Skip to content

feat: adds reusable actions#296

Open
baywet wants to merge 37 commits intoOAI:mainfrom
baywet:feat/action-templates
Open

feat: adds reusable actions#296
baywet wants to merge 37 commits intoOAI:mainfrom
baywet:feat/action-templates

Conversation

@baywet
Copy link
Copy Markdown
Member

@baywet baywet commented Feb 18, 2026

This pull request adds action templates.

fixes #33
fixes #136
fixes #270

closes #238

This is another attempt to solve a scale limitation in the current specification. Action templates are better than the previous parameters proposal because:

  • They do not introduce a matrix projection, people may use the template multiple times.
  • They do not require "declaring" which environment variables to read in advance.
  • They limit the string literal replacement to the templates, which does not impact how actions currently work.
  • The template reference mechanism works like OpenAPI references.
  • The template resolution mechanism can be isolated as a pre-processing step, and the resolved actions can then be fed to the existing code processing actions.
  • It introduces a string literal replacement syntax which can be expanded upon for other sources or used at other places in the future.

The pull request is incomplete as it is, it's a draft, I want to collect feedback on the approach before making any further investments.

@baywet baywet added this to the Release 1.2 milestone Feb 18, 2026
@baywet baywet requested review from handrews, karenetheridge, lornajane, mikekistler, mkistler and ralfhandl and removed request for mkistler February 18, 2026 18:37
@ralfhandl
Copy link
Copy Markdown
Contributor

I like the general direction.

@baywet
Copy link
Copy Markdown
Member Author

baywet commented Feb 24, 2026

Feedback from the meeting from both @lornajane and @ralfhandl :

  • add a peer block to parameters for the environment variables, this allows to set defaults and "declare" which variables are used. But this declaration is optional.
  • add a peer "actions" in the components, that's defined as everything except for the target. So people can specify the target on reference. Reusable actions may use action templates in turns.

Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
@baywet baywet force-pushed the feat/action-templates branch from e709bde to 06a21c9 Compare February 25, 2026 15:19
@baywet baywet changed the title feat: adds action templates feat: adds action templates and reusable actions Feb 25, 2026
Copy link
Copy Markdown
Contributor

@ralfhandl ralfhandl left a comment

Choose a reason for hiding this comment

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

Mostly wording and capitalization

baywet and others added 3 commits February 25, 2026 11:37
Co-authored-by: Ralf Handl <ralf.handl@gmail.com>
Co-authored-by: Ralf Handl <ralf.handl@gmail.com>
Co-authored-by: Ralf Handl <ralf.handl@gmail.com>
@baywet baywet requested a review from ralfhandl February 25, 2026 18:56
baywet added 3 commits March 3, 2026 08:33
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
…rlay-Specification into feat/action-templates

Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
@baywet
Copy link
Copy Markdown
Member Author

baywet commented Mar 3, 2026

@ralfhandl @lornajane I pushed another update a couple of minutes ago. I wasn't happy about the whole reusable actions vs action templates kind of thing. After chatting with @mikekistler internally I realized we could simply define a an action template reference object as "you can override anything from the resolved template in the reference" like JSON schema does to some extent. And keep things extra simple.

Let me know what you think!

baywet added 8 commits March 31, 2026 14:22
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
chore: refactors unevaluated json to avoid duplication

Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
…get everywhere

Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
…e actions

Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
@baywet baywet changed the title feat: adds action templates and reusable actions feat: adds reusable actions Mar 31, 2026
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
@baywet baywet requested a review from mikekistler March 31, 2026 19:30
@baywet baywet marked this pull request as ready for review March 31, 2026 19:30
@baywet baywet requested a review from a team as a code owner March 31, 2026 19:30
@baywet baywet requested a review from handrews March 31, 2026 19:30
@baywet
Copy link
Copy Markdown
Member Author

baywet commented Mar 31, 2026

Update, I've had some more time to spend on this. I believe I've addressed all the feedback and got this to a place much closer to a finalized version/ready for a formal vote.
I suggest we go through another round of review/update before we move to a formal vote.

Noteable changes:

  • updated the terminology to "reusable actions"
  • moved to a single concept (no more template vs component actions divide)
  • stuck with local references only for now, we can always open this up in a subsequent release, as per other authors' feedback
  • added the schema changes
  • added the schema tests
  • triple checked the examples
  • updated additional wording based on @mikekistler excellent suggestions

Let me know if you have any additional comments or questions.

baywet added 4 commits March 31, 2026 15:43
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
…r versions of the specification

Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
@baywet
Copy link
Copy Markdown
Member Author

baywet commented Mar 31, 2026

Note: I've just added a lot of tests to improve the coverage. This is going to temporarily make the review more difficult. I've extracted the tests for the current schema (not the changes in this pull request) in #317 in the hope that we merge that one first, making the diff here smaller.

Signed-off-by: Vincent Biret <vincentbiret@hotmail.com>
| Field Name | Type | Description |
| ---- | :----: | ---- |
| <a name="reusable-action-parameter-name"></a>name | `string` | **REQUIRED** The name of the parameter, MUST match the key for the string literal replacement expression. |
| <a name="reusable-action-parameter-default>default | Any | A default value for the parameter to use when no value is provided by the reference. Optional. |
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

collecting notes from my implementation work: it might be better to restrain this to string instead of any json value. Having any json value poses a couple of issues:

  • string interpolation is not "just string interpolation" anymore (you need to consider the object tree), and that brings a higher chance of ending up with an invalid resolved value in the end
  • environment variables would never be able to support that.

So both in the name of simplicity and uniformity I suggest we change this, and the parameter value field to string types instead of json values.


| Field Name | Type | Description |
| ---- | :----: | ---- |
| <a name="reusable-action-reference-ref"></a>$ref | `string` | **REQUIRED** A [same-document](https://www.rfc-editor.org/rfc/rfc3986.html#section-4.4) (or fragment-only) relative URI reference, per RFC3986 §4.4, and that the fragment syntax is JSON Pointer, with the pointer prefix restricted to `/components/actions/`. |
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@handrews I think that also effectively means that any reusable action (entries under components/actions) MUST have / and ~ encoded according to the JSON pointer semantics. I think we should call this out explicitly in the components section, what do you think?

| ---- | :----: | ---- |
| <a name="reusable-action-parameters"></a>parameters | [[Reusable action parameter object](#reusable-action-parameter-object)] | A list of parameters to be used during string literal replacement. Optional. |
| <a name="reusable-action-environment-variables"></a>environmentVariables | [[Reusable action parameter object](#reusable-action-parameter-object)] | A list of environment variables to be used during string literal replacement. Optional. |
| <a name="reusable-action-action-fields"></a>Any field defined in the [action object](#action-object) | mixed | The [string literal replacement syntax](#string-literal-replacement-syntax) MAY be used for any of the fields, and the replacements MUST be evaluated as the reusable action reference is being resolved. |
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Here we need to restrict the interpolation syntax to apply only to string fields (Target, Copy, Description), because for others (Remove) it breaks the JSON schema validation of the document).

And for Update, it poses a lot of additional questions (env vs params, what happens if the resulting JSON doesn't match the structure we expect (requirement for this field), etc...

@baywet
Copy link
Copy Markdown
Member Author

baywet commented Apr 2, 2026

Finalized the implementation of the current version of the spec over here BinkyLabs/openapi-overlays-dotnet#276

(some LLMs were hurt in the process)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unsupported use case for dynamic node creation String Interpolation for Update Values Environment Variables in definition

5 participants