Skip to content

fix(workflow): use $sourceDescriptions for workflow references#2867

Open
harshit078 wants to merge 13 commits into
Redocly:mainfrom
harshit078:fix-respect-workflow-reference
Open

fix(workflow): use $sourceDescriptions for workflow references#2867
harshit078 wants to merge 13 commits into
Redocly:mainfrom
harshit078:fix-respect-workflow-reference

Conversation

@harshit078

@harshit078 harshit078 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

What/Why/How?

  • Added support for the Arazzo workflow reference form $sourceDescriptions.<name>.<workflowId>.
  • The previous $sourceDescriptions.<name>.workflows.<workflowId> form is still maintained.

Reference

#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

Low Risk
Localized change to context expression parsing in respect-core; backward compatible and covered by expanded tests.

Overview
Respect now resolves external workflow references using the Arazzo-compliant path $sourceDescriptions.<name>.<workflowId> (without a workflows segment). The older $sourceDescriptions.<name>.workflows.<workflowId> form still works.

In get-value-from-context.ts, resolveValue distinguishes the spec form (3 path segments) from the legacy form (4 segments with workflows). For the spec form it looks up a matching workflowId in the source description’s workflows array; if none match, it falls back to a property on the source description (e.g. $sourceDescriptions.test.url). Legacy references only resolve via the workflows list and otherwise return undefined.

Tests and flow-runner examples were updated to the spec form, with added cases for legacy compatibility, field fallback, and missing workflows.

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

@changeset-bot

changeset-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 34791a3

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

@harshit078 harshit078 changed the title respect workflow references must use $sourceDescriptions fix(workflow): use $sourceDescriptions for workflow references Jun 15, 2026
@harshit078 harshit078 marked this pull request as ready for review June 15, 2026 10:07
@harshit078 harshit078 requested review from a team as code owners June 15, 2026 10:07
@harshit078

Copy link
Copy Markdown
Contributor Author

Hi @DmitryAnansky , Can you review the PR and check it ? Thanks !

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Performance Benchmark (Lower is Faster)

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

if (workflow) {
return workflow;
}
}

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.

Probably we need to handle case with

    if (isLegacyForm) {
      return undefined;
    }

Comment thread packages/respect-core/src/modules/context-parser/get-value-from-context.ts Outdated
@DmitryAnansky

Copy link
Copy Markdown
Contributor

Could you please update existing tests to use correct and not legacy format?

@harshit078 harshit078 requested a review from DmitryAnansky June 23, 2026 08:03

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

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2658393. Configure here.

@harshit078

Copy link
Copy Markdown
Contributor Author

Hi @DmitryAnansky, I have addressed the comments left by you and resolved cursor bot comments. Can you review the changes again ? thanks !

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.

2 participants