Skip to content

feat: add support parameters on success failure actions - #3160

Draft
DmitryAnansky wants to merge 13 commits into
mainfrom
feat/support-parameters-on-success-failure-actions
Draft

DmitryAnansky wants to merge 13 commits into
mainfrom
feat/support-parameters-on-success-failure-actions

Conversation

@DmitryAnansky

@DmitryAnansky DmitryAnansky commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

What/Why/How?

Added support for the Arazzo 1.1.0 parameters field of success and failure actions to the respect command.
When an action references a workflow with workflowId, its parameters are passed to that workflow as inputs.

Reference

Closes: #2735

Testing

Screenshots (optional)

Check yourself

  • This PR follows the contributing guide
  • All new/updated code is covered by tests
  • Core code changed? - Tested with other Redocly products (internal contributions only)
  • New package installed? - Tested in different environments (browser/node)
  • Documentation update has been considered

Security

  • The security impact of the change has been considered
  • Code follows company security practices and guidelines

@changeset-bot

changeset-bot Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1f2cbd7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@redocly/openapi-core Minor
@redocly/cli Minor
@redocly/respect-core Minor
@redocly/client-generator Patch
@redocly/recheck Minor
@redocly/reunite-integration Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Performance Benchmark (Lower is Faster)

CLI Version Bundle Lint Check Config
cli-latest ▓ 1.00x (Fastest) ▓ 1.00x (Fastest) ▓ 1.00x (Fastest)
cli-next ▓ 1.01x ± 0.01 ▓ 1.00x ± 0.01 ▓ 1.00x ± 0.01

@DmitryAnansky
DmitryAnansky requested a balanced review from Copilot September 29, 2026 12:19
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 83.46% (🎯 79%) 20111 / 24095
🔵 Statements 83.08% (🎯 78%) 21730 / 26153
🔵 Functions 85.22% (🎯 82%) 3825 / 4488
🔵 Branches 75.59% (🎯 71%) 14611 / 19327
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/core/src/rules/arazzo/parameters-unique.ts 88.88% 87.5% 100% 100% 17, 33
packages/core/src/types/arazzo1_1.ts 95.23% 88.46% 100% 95.23% 25, 159
packages/respect-core/src/arazzo-schema.ts 0% 100% 100% 0% 1-451
packages/respect-core/src/modules/context-parser/resolve-reusable-component.ts 100% 100% 100% 100%
packages/respect-core/src/modules/context-parser/resolve-reusable-object-reference.ts 100% 100% 100% 100%
packages/respect-core/src/modules/flow-runner/prepare-request.ts 89.47% 81.7% 100% 89.18% 81, 132, 194-199, 203-205, 265, 268
packages/respect-core/src/modules/flow-runner/run-step.ts 92.77% 83.8% 100% 92.63% 155, 163-165, 175-181, 310-311, 436-438, 466, 469-471, 501
packages/respect-core/src/modules/flow-runner/runner.ts 89.47% 83.87% 94.11% 90.09% 100, 204, 214-215, 230-240, 251, 277-279, 326, 440
Generated in workflow #12202 for commit 1f2cbd7 by the Vitest Coverage Report Action

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Invalid parameters can be silently dropped, and exhausted retries can mutate workflow inputs without invoking the target workflow.

Review effort: Balanced
Findings: 3 Medium severity · 2 Low severity

Open (5)
What changed in this PR

Adds Arazzo 1.1 success and failure action parameters to Respect workflow execution.

Changes:

  • Maps action parameters to referenced workflow inputs.
  • Extends the Arazzo schema and documentation.
  • Adds unit and end-to-end failure-action coverage.
File Description
.changeset/​respect-action-parameters.md Records the feature release.
docs/​@v2/​commands/​respect.md Notes partial Arazzo 1.1 support.
packages/​respect-core/​src/​arazzo-schema.ts Adds action parameter fields.
packages/​respect-core/​src/​modules/​flow-runner/​run-step.ts Passes parameters into target workflows.
packages/​respect-core/​src/​modules/​__tests__/​flow-runner/​run-step.test.ts Tests failure-action inputs.
tests/​e2e/​respect/​action-parameters-passed-to-target-workflow/​action-parameters-passed-to-target-workflow.arazzo.yaml Defines action parameter fixtures.
tests/​e2e/​respect/​action-parameters-passed-to-target-workflow/​action-parameters-passed-to-target-workflow.test.ts Executes the new fixture.
tests/​e2e/​respect/​action-parameters-passed-to-target-workflow/​__snapshots__/​action-parameters-passed-to-target-workflow.test.ts.snap Captures execution output.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/respect-core/src/modules/flow-runner/run-step.ts Outdated
Comment thread packages/respect-core/src/modules/flow-runner/run-step.ts Outdated
Comment thread packages/respect-core/src/modules/flow-runner/run-step.ts Outdated
Comment thread docs/@v2/commands/respect.md
Comment thread packages/respect-core/src/arazzo-schema.ts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Some valid reusable values are mishandled, forbidden querystring locations bypass validation, and support documentation is incomplete.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
Resolved since last review (5)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Honor falsy reusable parameter value overrides

packages/​respect-core/​src/​modules/​flow-runner/​run-step.ts:331

Reusable action parameters do not honor valid falsy value overrides. This newly resolves each reusable parameter through resolveReusableComponentItem, but resolve-reusable-object-reference.ts:37 applies an override only when valueOverride is truthy; { reference: ..., value: 0 } and value: false therefore pass the component's original value to the workflow. Update that resolver to distinguish an omitted value from a falsy value and cover both scalar cases.

Comment thread packages/respect-core/src/modules/flow-runner/run-step.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Reusable action parameters silently discard valid falsy value overrides.

Review effort: Balanced
Findings: None

Resolved since last review (1)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Falsy reusable action parameter overrides are ignored

packages/​respect-core/​src/​modules/​flow-runner/​run-step.ts:328

Reusable action parameters with a valid falsy override (value: 0, false, or '') lose that override here. resolveReusableObjectReference only applies overrides when valueOverride is truthy, so the component's original value is passed to the target workflow instead. Check for presence of the value field rather than truthiness, and cover a falsy override.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Invalid action parameters can be silently ignored, and falsy reusable-parameter overrides resolve incorrectly.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)

Comment thread packages/respect-core/src/modules/flow-runner/run-step.ts
Comment thread packages/respect-core/src/modules/flow-runner/run-step.ts
@DmitryAnansky
DmitryAnansky force-pushed the feat/support-parameters-on-success-failure-actions branch from 7bf0a8d to db5da12 Compare September 30, 2026 16:29
@DmitryAnansky
DmitryAnansky requested a balanced review from Copilot September 30, 2026 16:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Structural validation accepts action parameter forms that the runtime ignores or rejects, and the documentation is incomplete.

Review effort: Balanced
Findings: 4 Medium severity

Open (4)

Comment thread packages/core/src/types/arazzo1_1.ts Outdated
Comment thread packages/core/src/types/arazzo1_1.ts
@DmitryAnansky
DmitryAnansky force-pushed the feat/support-parameters-on-success-failure-actions branch from db5da12 to fdb7b65 Compare October 2, 2026 13:46
@DmitryAnansky
DmitryAnansky requested a balanced review from Copilot October 2, 2026 13:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Reusable action parameters can reference action components and then be silently omitted from workflow inputs.

Review effort: Balanced
Findings: 1 High severity

Open (1)
Resolved since last review (4)

Comment on lines +326 to +328
const actionParameters = action.parameters.map((parameter) =>
resolveReusableComponentItem(parameter, ctx)
);

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Parameterized retries fail when retryLimit is omitted, duplicate resolved inputs are silently overwritten, and the feature documentation is incomplete.

Review effort: Balanced
Findings: 1 High severity · 2 Medium severity

Open (3)

Comment thread packages/respect-core/src/modules/flow-runner/run-step.ts
Comment thread packages/respect-core/src/modules/flow-runner/run-step.ts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Concurrent runs can corrupt scoped inputs, and exhausted retries skip subsequent failure actions.

Review effort: Balanced
Findings: 2 High severity · 1 Medium severity · 1 Low severity

Open (4)
Resolved since last review (2)

Comment on lines +177 to +179
const inputsBeforeRun = inputs ? ctx.$workflows[workflow.workflowId].inputs : undefined;
if (inputs) {
ctx.$workflows[workflow.workflowId].inputs = { ...inputsBeforeRun, ...inputs };
Comment on lines +397 to +398
// the spec retries a step once when the action has no `retryLimit`
const { retryAfter, retryLimit = 1 } = action;
Comment on lines +37 to +40
message:
resolvedParameter?.name === undefined
? 'The parameter `reference` must be unique amongst listed parameters.'
: 'The parameter `name` must be unique amongst listed parameters.',
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.

Pass workflow inputs to success and failure actions

2 participants