-
Notifications
You must be signed in to change notification settings - Fork 33
feat: adds reusable actions #296
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
Open
baywet
wants to merge
47
commits into
OAI:main
Choose a base branch
from
baywet:feat/action-templates
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
38198c9
feat: adds string literal replacement syntax
baywet 74f3a40
feat: adds high level definitions for templates and templates parameters
baywet 2f2fbcc
feat: adds the action template reference object
baywet 77d9e4f
docs: adds an example for the action templates
baywet 5633f57
feat: adds reusable actions to the components
baywet 06a21c9
feat: adds environment variables template
baywet 553fca8
chore: capitalization fixes
baywet 9329227
chore: typo fixes
baywet d01be1e
fix: case sensitive environment variable
baywet 0b71e07
feat: merges reusable actions
baywet beeeab0
Merge branch 'feat/action-templates' of https://github.com/baywet/Ove…
baywet e64846a
fix: updates wording for references definition
baywet e5be862
Merge branch 'main' into feat/action-templates
baywet 3a58335
fix: aligns wording for the action fields in template and template re…
baywet d332446
docs: minor fixes for samples mismatches
baywet b79ed3e
docs: aligns on reusable action terminology
baywet 3ab579e
docs: further alignments on the reusable action terminology
baywet 694f572
Merge branch 'main' into feat/action-templates
baywet f9802ec
docs: aligns the examples names on the reusable action terminology
baywet 789568c
docs: adds description to the new examples
baywet d205893
docs: adds important considerations for the reusable actions
baywet 79f81dd
docs: adds precisions in the reusable action object abstract
baywet edcf47a
docs: adds precision on how to reuse actions in the components section
baywet 35a1e94
feat: adds schema definition for reusable actions
baywet d692a77
fix: makes actions a oneOf with reusable action reference
baywet 357b742
fix: adds missing parameter values to the schema
baywet df5ca29
chore: refactors the action definition to avoid having a required tar…
baywet ef024cf
tests: adds a first set of fail tests for action parameters
baywet 357c782
fix: actions definitions should use the action object not the reusabl…
baywet 1879f2a
tests: adds another batch of pass/fail tests for reusable actions
baywet 1cb9539
tests: additional pass tests for extensions
baywet ccc453a
fix: pattern validation in the schema
baywet 2ba09b6
tests: adds missing tests for unescaped characters
baywet b05ab45
tests: increases coverage through additional fail tests
baywet f0d5536
tests: duplicates additional tests that would be beneficial to earlie…
baywet 6842b95
Merge branch 'main' into feat/action-templates
baywet f9f5ffa
Merge branch 'main' into feat/action-templates
baywet f57ce30
Apply suggestions from code review
baywet e03b60d
chore: feedback updates for a number of tests
baywet ad8f5e8
fix: allow underscores in parameter names
baywet 569cff0
fix: removes outdated note about optional fields
baywet c04856d
docs: better representation of the reusable action object
baywet caade0d
chore: Apply suggestions from code review
baywet fd729d5
tests: removes duplicate test definition
baywet 7d43013
fix: restrict parameters defaults and values to string
baywet 18ea3ee
fix: restrict the string interpolation syntax to string fields of obj…
baywet 11e4053
fix: adds encoding considerations for keys
baywet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
tests/v1.2-dev/fail/action-parameter-value-invalid-type.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Reusable action reference parameter values must be strings | ||
| version: 1.0.0 | ||
| components: | ||
| actions: | ||
| errorResponse: | ||
| target: "$.paths['%param.pathItem%'].%param.operation%.responses" | ||
| update: | ||
| '404': | ||
| description: Not Found | ||
| parameters: | ||
| - name: pathItem | ||
| - name: operation | ||
| default: get | ||
| actions: | ||
| - $ref: '#/components/actions/errorResponse' | ||
| parameterValues: | ||
| pathItem: /items | ||
| operation: 100 |
10 changes: 10 additions & 0 deletions
10
tests/v1.2-dev/fail/action-with-environment-variables-invalid.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Non-reusable action objects cannot have environment variables | ||
| version: 1.0.0 | ||
| actions: | ||
| - target: '$.info' | ||
| environmentVariables: | ||
| - name: stageName | ||
| update: | ||
| description: Example |
baywet marked this conversation as resolved.
Show resolved
Hide resolved
baywet marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Reusable action parameter missing name | ||
| version: 1.0.0 | ||
| actions: | ||
| - target: '$.info' | ||
| parameters: | ||
| - default: fallback | ||
| update: | ||
| description: Updated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Components actions must be an object | ||
| version: 1.0.0 | ||
| components: | ||
| actions: [] | ||
| actions: | ||
| - target: '$' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Components invalid property | ||
| version: 1.0.0 | ||
| components: | ||
| invalidProperty: true | ||
| actions: | ||
| setDescription: | ||
| target: '$.info' | ||
| update: | ||
| description: Updated | ||
| actions: | ||
| - target: '$.info' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Components must be an object | ||
| version: 1.0.0 | ||
| components: [] | ||
| actions: | ||
| - target: '$' |
9 changes: 9 additions & 0 deletions
9
tests/v1.2-dev/fail/components-reusable-action-invalid-type.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Components action must be an object | ||
| version: 1.0.0 | ||
| components: | ||
| actions: | ||
| brokenAction: not-an-object | ||
| actions: | ||
| - target: '$' |
15 changes: 15 additions & 0 deletions
15
...s/v1.2-dev/fail/reusable-action-environment-variable-default-invalid-type-components.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Reusable action environment variable default values must be strings in components | ||
| version: 1.0.0 | ||
| components: | ||
| actions: | ||
| setDescription: | ||
| target: '$.info' | ||
| environmentVariables: | ||
| - name: STAGE_NAME | ||
| default: false | ||
| update: | ||
| description: Updated | ||
| actions: | ||
| - target: '$' |
17 changes: 17 additions & 0 deletions
17
tests/v1.2-dev/fail/reusable-action-environment-variable-invalid-name-pattern.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Reusable action environment variable name must start with a letter and be alphanumeric | ||
| version: 1.0.0 | ||
| components: | ||
| actions: | ||
| setDescription: | ||
| target: '$.info' | ||
| environmentVariables: | ||
| - name: stage-name | ||
| default: dev | ||
| update: | ||
| description: Updated | ||
| actions: | ||
| - target: '$.info' | ||
| update: | ||
| description: Invalid reusable action environment variable name |
11 changes: 11 additions & 0 deletions
11
tests/v1.2-dev/fail/reusable-action-environment-variable-invalid-name.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Reusable action environment variable invalid name type | ||
| version: 1.0.0 | ||
| actions: | ||
| - target: '$.info' | ||
| environmentVariables: | ||
| - name: 123 | ||
| default: dev | ||
| update: | ||
| description: Updated |
14 changes: 14 additions & 0 deletions
14
tests/v1.2-dev/fail/reusable-action-environment-variables-invalid-type-components.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Reusable action environment variables must be an array in components | ||
| version: 1.0.0 | ||
| components: | ||
| actions: | ||
| setDescription: | ||
| target: '$.info' | ||
| environmentVariables: | ||
| name: stageName | ||
| update: | ||
| description: Example | ||
| actions: | ||
| - target: '$' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Reusable action invalid property | ||
| version: 1.0.0 | ||
| components: | ||
| actions: | ||
| setDescription: | ||
| target: '$.info' | ||
| invalidProperty: true | ||
| update: | ||
| description: Updated | ||
| actions: | ||
| - target: '$.info' |
15 changes: 15 additions & 0 deletions
15
tests/v1.2-dev/fail/reusable-action-parameter-default-invalid-type-components.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Reusable action parameter default values must be strings in components | ||
| version: 1.0.0 | ||
| components: | ||
| actions: | ||
| setTitle: | ||
| target: '$.info' | ||
| parameters: | ||
| - name: titleValue | ||
| default: 100 | ||
| update: | ||
| title: Example | ||
| actions: | ||
| - target: '$' |
16 changes: 16 additions & 0 deletions
16
tests/v1.2-dev/fail/reusable-action-parameter-invalid-name-pattern.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Reusable action parameter name must start with a letter and be alphanumeric | ||
| version: 1.0.0 | ||
| components: | ||
| actions: | ||
| setTitle: | ||
| target: '$.info' | ||
| parameters: | ||
| - name: 1titleValue | ||
| update: | ||
| title: Example | ||
| actions: | ||
| - target: '$.info' | ||
| update: | ||
| description: Invalid reusable action parameter name |
15 changes: 15 additions & 0 deletions
15
tests/v1.2-dev/fail/reusable-action-parameter-invalid-property.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Reusable action parameter invalid property | ||
| version: 1.0.0 | ||
| components: | ||
| actions: | ||
| setTitle: | ||
| target: '$.info' | ||
| parameters: | ||
| - name: titleValue | ||
| invalidProperty: true | ||
| update: | ||
| title: Example | ||
| actions: | ||
| - target: '$.info' |
14 changes: 14 additions & 0 deletions
14
tests/v1.2-dev/fail/reusable-action-parameter-item-invalid-type.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Reusable action parameter items must be objects | ||
| version: 1.0.0 | ||
| components: | ||
| actions: | ||
| setTitle: | ||
| target: '$.info' | ||
| parameters: | ||
| - invalid | ||
| update: | ||
| title: Example | ||
| actions: | ||
| - target: '$' |
14 changes: 14 additions & 0 deletions
14
tests/v1.2-dev/fail/reusable-action-parameter-missing-name-components.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Reusable action parameter items must include name in components | ||
| version: 1.0.0 | ||
| components: | ||
| actions: | ||
| setTitle: | ||
| target: '$.info' | ||
| parameters: | ||
| - default: fallback | ||
| update: | ||
| title: Example | ||
| actions: | ||
| - target: '$' |
14 changes: 14 additions & 0 deletions
14
tests/v1.2-dev/fail/reusable-action-parameter-name-invalid-type-components.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Reusable action parameter names must be strings in components | ||
| version: 1.0.0 | ||
| components: | ||
| actions: | ||
| setTitle: | ||
| target: '$.info' | ||
| parameters: | ||
| - name: 100 | ||
| update: | ||
| title: Example | ||
| actions: | ||
| - target: '$' |
14 changes: 14 additions & 0 deletions
14
tests/v1.2-dev/fail/reusable-action-parameter-values-not-allowed.yaml
baywet marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Parameter values are not allowed on reusable actions | ||
| version: 1.0.0 | ||
| components: | ||
| actions: | ||
| setTitle: | ||
| target: '$.info' | ||
| parameterValues: | ||
| titleValue: Example | ||
| update: | ||
| title: '%param.titleValue%' | ||
| actions: | ||
| - $ref: '#/components/actions/setTitle' |
14 changes: 14 additions & 0 deletions
14
tests/v1.2-dev/fail/reusable-action-parameters-invalid-type-components.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Reusable action parameters must be an array in components | ||
| version: 1.0.0 | ||
| components: | ||
| actions: | ||
| setTitle: | ||
| target: '$.info' | ||
| parameters: | ||
| name: titleValue | ||
| update: | ||
| title: Example | ||
| actions: | ||
| - target: '$' |
8 changes: 8 additions & 0 deletions
8
tests/v1.2-dev/fail/reusable-action-reference-environment-variables-not-allowed.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| overlay: 1.2.0 | ||
| info: | ||
| title: Environment variables are not allowed on reusable action references | ||
| version: 1.0.0 | ||
| actions: | ||
| - $ref: '#/components/actions/errorResponse' | ||
| environmentVariables: | ||
| - name: stageName |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.