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

Add documentation for parameter substitution when provisioning workflows #6547

Merged
merged 12 commits into from
Mar 25, 2024

Conversation

dbwiddis
Copy link
Member

Description

opensearch-project/flow-framework#525 added the ability to substitute expressions with API parameters during workflow provisioning.

This PR updates the documentation for this new feature.

This will be part of the 2.13 release.

Checklist

  • By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and subject to the Developers Certificate of Origin.
    For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@hdhalter
Copy link
Contributor

hdhalter commented Mar 1, 2024

Thanks, @dbwiddis! Is this ready for doc review?

@dbwiddis
Copy link
Member Author

dbwiddis commented Mar 1, 2024

Yes, but there will be other 2.13 features. Would you prefer to wait and have all at once?

@dbwiddis dbwiddis marked this pull request as draft March 4, 2024 20:24
@dbwiddis
Copy link
Member Author

dbwiddis commented Mar 4, 2024

Flipping this to draft as we may be implementing a different feature which will slightly change this.

@amitgalitz
Copy link
Member

Hey @hdhalter since this feature has expanded a little more I will have a good amount more added to this PR for the issue we have here: opensearch-project/flow-framework#496.

We talked offline about this but I might only have more of the edits later in tonight (11:00PM PST) as I am merging a bug fix for the RC at 4pm. Is it okay to be adding extra documentation to here by then? Should I make a new PR?

@hdhalter
Copy link
Contributor

Hey @hdhalter since this feature has expanded a little more I will have a good amount more added to this PR for the issue we have here: opensearch-project/flow-framework#496.

We talked offline about this but I might only have more of the edits later in tonight (11:00PM PST) as I am merging a bug fix for the RC at 4pm. Is it okay to be adding extra documentation to here by then? Should I make a new PR?

No problem, @amitgalitz. Feel free to add to this PR, and we'll review it when it's ready. Thanks!

@dbwiddis
Copy link
Member Author

@hdhalter I understand @amitgalitz will be submitting a separate PR, so this one should be good to review/merge as-is.

@hdhalter
Copy link
Contributor

@hdhalter I understand @amitgalitz will be submitting a separate PR, so this one should be good to review/merge as-is.

Yes, he submitted one yesterday. I'll put this forward for doc review. Thanks, @dbwiddis !

@hdhalter hdhalter added 4 - Doc review PR: Doc review in progress and removed 2 - In progress Issue/PR: The issue or PR is in progress. labels Mar 22, 2024
@kolchfa-aws
Copy link
Collaborator

Thank you, @dbwiddis! This PR is my queue for review.

Copy link
Collaborator

@kolchfa-aws kolchfa-aws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for providing this documentation, @dbwiddis! A couple of style suggestions. Please review, and then we'll be ready to move the PR to editorial review. Thanks!

_automating-configurations/api/create-workflow.md Outdated Show resolved Hide resolved

| Parameter | Data type | Description |
| :--- | :--- | :--- |
| `provision` | Boolean | Whether to provision the workflow as part of the request. Default is `false`. |
| `validation` | String | Whether to validate the workflow. Valid values are `all` (validate the template) and `none` (do not validate the template). Default is `all`. |
| User-provided | String | Parameters matching substitutions in the template. Optional. |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of "user-provided", can we say something like "User-provided parameters that vary depending on the step type" or something like that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of that is in the description field (and it only varies based on the user template, not step type). I made an attempt in a918a6b that I hope works.

We also may wish to link to the provision-workflow.md file "Query Paremeters" section, which should probably include the identical text here.... just added that as fda9311

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dbwiddis Done. Please take a look.

_automating-configurations/api/provision-workflow.md Outdated Show resolved Hide resolved
_automating-configurations/api/provision-workflow.md Outdated Show resolved Hide resolved
_automating-configurations/api/provision-workflow.md Outdated Show resolved Hide resolved
_automating-configurations/api/provision-workflow.md Outdated Show resolved Hide resolved

| Parameter | Data type | Description |
| :--- | :--- | :--- |
| User-provided | String | Parameters that match substitutions in the template. Optional. |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| User-provided | String | Parameters that match substitutions in the template. Optional. |
| User-provided substitution expressions | String | Parameters that match substitutions in the template. Optional. |

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was already making a similar edit in fda9311 :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wording that you chose is perfect, thank you 😄 Let me add links

Copy link
Collaborator

@natebower natebower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dbwiddis @kolchfa-aws Just one minor comment. Thanks!

#### Example request
## Query parameters

If you have included a substitution expression in the template, you may pass it as a query parameter or as a string value of a request body field. For example, if you specified a credential field in a template as `openAI_key: '${{ openai_key }}'`, then you can include the `openai_key` parameter as a query parameter or body field so it can be substituted during provisioning.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this end in a colon?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an intro sentence to the example.

@dbwiddis
Copy link
Member Author

Anything else needed on this? Looks like all comments have been addressed.

@kolchfa-aws
Copy link
Collaborator

@dbwiddis If you're OK with this commit c594fa1, we're ready to merge.

@dbwiddis
Copy link
Member Author

@dbwiddis If you're OK with this commit c594fa1, we're ready to merge.

That change looks good!

@kolchfa-aws kolchfa-aws merged commit b191690 into opensearch-project:main Mar 25, 2024
3 checks passed
@hdhalter hdhalter added 3 - Done Issue is done/complete release-notes PR: Include this PR in the automated release notes and removed 4 - Doc review PR: Doc review in progress labels Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Done Issue is done/complete release-notes PR: Include this PR in the automated release notes v2.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants