Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Support editing of certain workflow fields on a provisioned workflow #749

Closed
ohltyler opened this issue Jun 20, 2024 · 7 comments · Fixed by #757
Closed

[FEATURE] Support editing of certain workflow fields on a provisioned workflow #749

ohltyler opened this issue Jun 20, 2024 · 7 comments · Fixed by #757
Assignees
Labels
enhancement New feature or request v2.16.0 Issues targeting release v2.16.0

Comments

@ohltyler
Copy link
Member

ohltyler commented Jun 20, 2024

Currently, the update API will not execute on a workflow that is not in NOT_STARTED state (has been provisioned, failed during provision, is currently provisioning, etc.). This prevents losing track of created resources, and enforcing deprovision will work as expected.

The current logic is simplified, and blanket denies any proposed update, even for trivial fields like name or ui_metadata. This prevents users from updating these things on a provisioned workflow, even if their goal is to not change the critical parts of the workflow template.

Additionally, on the frontend, a desired capability is updating a frontend configuration (which may be incomplete or in-progress) on some provisioned workflow, as a "lightweight" save. All of the frontend configuration is stored under ui_metadata. This may be done manually by the users, and/or in a scheduled way, such as autosaving. These save scenarios we want to be able to do at any point, without disrupting what may be currently deployed. Only when users want to run actual functionalities against the workflow (ingest/search/export) do we want to update the underlying template and perform the deeper deprovision/reprovision.

One proposal is allowing specific fields in the workflow schema to be allowed to be updated, at the REST level of the update API. I could see a few options for how the interface may look:

Option 1. Using the existing update API and passing in the entire workflow configuration, and letting the backend perform a diff and determine that based on the changed fields and the state of the workflow, if the update is allowed or not

PUT /_plugins/_flow_framework/workflow/my-workflow-id
{
    "name": "my-new-name",
    "description": "my existing description",
    "workflows": {
        "provision": { <some-unchanged-provision-flows> }
    },
    ...,
}

Option 2. Allowing users to only specify the fields they want to update in the API body, something like:

PUT /_plugins/_flow_framework/workflow/my-workflow-id
{
    "name": "my-new-name"
}
@ohltyler ohltyler added enhancement New feature or request v2.16.0 Issues targeting release v2.16.0 labels Jun 20, 2024
@dbwiddis
Copy link
Member

The Update Document API easily allows key-by-key replacement. Or we can just upsert the whole document after parsing it ourselves as I did in #631.

@dbwiddis
Copy link
Member

dbwiddis commented Jul 8, 2024

PR #757 adds these fields:

/** Fields which may be updated in the template even if provisioned */
private static final Set<String> UPDATE_FIELD_ALLOWLIST = Set.of(
    NAME_FIELD,
    DESCRIPTION_FIELD,
    USE_CASE_FIELD,
    VERSION_FIELD,
    UI_METADATA_FIELD
);

This is essentially the whole Template except for the Workflow field and the auto-generated timestamps, and none of these fields impact the provisioning.

@minalsha
Copy link
Collaborator

minalsha commented Jul 8, 2024

@dbwiddis can you please share doc issue created for this feature?

@ohltyler
Copy link
Member Author

ohltyler commented Jul 8, 2024

It is linked in the linked PR #757 : opensearch-project/documentation-website#7632

@minalsha
Copy link
Collaborator

minalsha commented Jul 8, 2024

ahh my bad. thank you

@minalsha
Copy link
Collaborator

minalsha commented Jul 8, 2024

we need to first create a doc issue for the same and link it to it. That's how doc team track. Just FYI

@dbwiddis
Copy link
Member

dbwiddis commented Jul 8, 2024

Ah, haven't done that for any of the earlier features, will take care of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v2.16.0 Issues targeting release v2.16.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants