Skip to content

fix(respect): workflow references format - #2969

Open
DmitryAnansky wants to merge 6 commits into
mainfrom
fix/workflow-reference-in-respect
Open

fix(respect): workflow references format#2969
DmitryAnansky wants to merge 6 commits into
mainfrom
fix/workflow-reference-in-respect

Conversation

@DmitryAnansky

@DmitryAnansky DmitryAnansky commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

What/Why/How?

Added support for the Arazzo spec-compliant workflow reference form $sourceDescriptions.<name>.<workflowId> in dependsOn, step workflowId, and success/failure action workflowId. Unresolvable workflow references now fail the affected workflow with a clear error message instead of aborting the whole run or being silently ignored.

Reference

Closes: #2826

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

Note

Medium Risk
Touches core Respect workflow resolution and run orchestration (dependsOn, call steps, goto actions), so regressions could affect multi-workflow Arazzo runs; legacy reference form is preserved and coverage is extensive.

Overview
Respect now accepts the Arazzo spec workflow reference shape $sourceDescriptions.<name>.<workflowId> (without a .workflows. segment) for dependsOn, step workflowId, and success/failure action workflowId, while keeping the legacy $sourceDescriptions.<name>.workflows.<workflowId> form.

Workflow lookup is centralized in resolveWorkflowReference, and runtime expression resolution for $sourceDescriptions.* paths throws clearer errors (with available names/workflows) instead of returning undefined silently. For the spec form, non-workflow segments can still resolve to source-description fields (e.g. url, type) when appropriate.

Unresolvable workflow references no longer abort the entire Respect run: a bad dependsOn entry fails only that workflow via a synthetic dependsOn step, and bad step/action workflowId values add failed checks and register the step in results. JSON log export tolerates those synthetic steps when no declared workflow step exists.

Reviewed by Cursor Bugbot for commit 7983562. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7983562

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

This PR includes changesets to release 3 packages
Name Type
@redocly/respect-core Patch
@redocly/cli Patch
@redocly/openapi-core Patch

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 Jul 27, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 72.33% (🎯 69%) 8769 / 12123
🔵 Statements 72% (🎯 69%) 9120 / 12665
🔵 Functions 77.04% (🎯 73%) 1732 / 2248
🔵 Branches 63.96% (🎯 61%) 5928 / 9268
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/cli/src/commands/respect/json-logs.ts 79.31% 61.11% 100% 78.57% 74, 111, 116, 125-130
packages/respect-core/src/modules/context-parser/get-value-from-context.ts 90.17% 81.66% 96.77% 91.78% 29, 42, 72, 97, 118-119, 127, 145, 157, 164, 175, 194, 220, 264, 295, 310, 394, 399, 421, 451, 470, 480
packages/respect-core/src/modules/context-parser/resolve-workflow-reference.ts 100% 95.65% 100% 100%
packages/respect-core/src/modules/flow-runner/run-step.ts 90.27% 80.76% 100% 90.07% 177, 185-187, 197-203, 345-346, 384-392, 396, 421, 424, 448
packages/respect-core/src/modules/flow-runner/runner.ts 89.52% 83.33% 93.33% 90.19% 176-182, 197, 217-227, 238, 264-266, 307, 414
Generated in workflow #10892 for commit 7983562 by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Performance Benchmark (Lower is Faster)

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

@DmitryAnansky DmitryAnansky added the snapshot Create experimental release PR label Jul 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 A new experimental 🧪 version v0.0.0-snapshot.1785167039 of Redocly CLI has been published for testing.

Install with NPM:

npm install @redocly/cli@0.0.0-snapshot.1785167039

⚠️ Note: This is a development build and may contain unstable features.

@DmitryAnansky
DmitryAnansky marked this pull request as ready for review July 27, 2026 16:28
@DmitryAnansky
DmitryAnansky requested review from a team as code owners July 27, 2026 16:28
Comment thread packages/respect-core/src/modules/flow-runner/run-step.ts
Comment thread packages/respect-core/src/modules/flow-runner/runner.ts
@DmitryAnansky DmitryAnansky removed the snapshot Create experimental release PR label Jul 27, 2026

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4284624. Configure here.

step.checks.push(failedCall);
// register the step so the failed check is displayed and counted in the totals
ctx.executedSteps.push(step);
printUnknownStep(step, ctx.options.logger);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unresolved call does not end workflow

Medium Severity

When a step workflowId cannot be resolved, the failed check is recorded but the function returns without shouldEnd, so later steps in the same workflow keep running. The parallel goto-action path for the same kind of broken reference returns shouldEnd: true, and a found-but-failed child workflow with no failure actions also ends the workflow.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4284624. Configure here.

}

// Extra segments after the workflowId are tolerated for backward compatibility.
if (parts.length >= 4 && parts[2] === 'workflows' && parts[1] && parts[3]) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Correct me if I'm wrong but parts.length >= 4 && parts[2] === 'workflows' means $sourceDescriptions.a.workflows.b.c.d would resolve to workflow b and will drop the tail right ? The trailing "c" and "d" are ignored.

Comment thread .changeset/spec-form-workflow-references.md Outdated
Comment on lines +130 to +132
endTime: performance.now(),
totalTimeMs: performance.now() - startTime,
executedSteps: [failedStep],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, arent we calling the clock twice as we are doing endTime: performance.now() and totalTimeMs: performance.now() - startTime , so totalTimeMs !== endTime - startTime. So shouldnt we Take endTime once and then use it ?

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.

Respect workflow references must use $sourceDescriptions.<name>.<workflowId>

3 participants