Skip to content

fix: pass workflow inputs to success and failure actions#2796

Open
harshit078 wants to merge 5 commits into
Redocly:mainfrom
harshit078:pass-workflow-input-to-actions
Open

fix: pass workflow inputs to success and failure actions#2796
harshit078 wants to merge 5 commits into
Redocly:mainfrom
harshit078:pass-workflow-input-to-actions

Conversation

@harshit078
Copy link
Copy Markdown
Contributor

@harshit078 harshit078 commented May 4, 2026

What/Why/How?

  • Added the spec-parameters-in-by-context Arazzo rule
  • Added parameters property in interface of workflow for success and failure action objects.

Reference

#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

Note

Medium Risk
Adds a new built-in Arazzo lint rule and extends the Arazzo schema/types, which can introduce new lint findings for existing specs and affect downstream consumers relying on the previous action object shape.

Overview
Introduces the new Arazzo rule spec-parameters-in-by-context to enforce context-sensitive parameter validation: require parameter.in when a step/action does not reference a workflowId, and forbid parameter.in when it does (treating parameters as workflow input mappings). It also errors if success/failure actions define parameters without a workflowId.

Extends onSuccess/onFailure action objects to accept a parameters array in the core type system and JSON schema, wires the rule into the built-in Arazzo ruleset, updates default config presets to include it, and adds targeted rule tests plus config snapshot updates.

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

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 4, 2026

🦋 Changeset detected

Latest commit: 6b7e963

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

This PR includes changesets to release 3 packages
Name Type
@redocly/openapi-core Minor
@redocly/respect-core Minor
@redocly/cli 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

@harshit078 harshit078 marked this pull request as ready for review May 8, 2026 10:20
@harshit078 harshit078 requested review from a team as code owners May 8, 2026 10:20
Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 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 6b7e963. Configure here.

location: ctx.location.child(['parameters']).key(),
});
}
checkParameters(action.parameters, hasWorkflowId, ['parameters'], ctx);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Contradictory double error for action parameters without workflowId

Medium Severity

When a success/failure action lacks a workflowId and its parameters omit the in field, the rule produces two contradictory errors: first ACTION_PARAMETERS_REQUIRE_WORKFLOW_ID (parameters shouldn't exist at all), then IN_REQUIRED_MESSAGE from checkParameters (asking the user to add in). The checkParameters call on line 63/77 runs unconditionally after the !hasWorkflowId report, but it needs to be skipped when parameters are already flagged as invalid for lacking a workflowId.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6b7e963. Configure here.

import type { Arazzo1Rule } from '../../visitors.js';
import type { UserContext } from '../../walk.js';

const IN_REQUIRED_MESSAGE =
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.

You can use report messages directly

@AlbinaBlazhko17
Copy link
Copy Markdown
Contributor

Thanks @harshit078 for contribution! Please, fix the issue reported by bugbot. I left comment as well. Additionally, please add docs for a new rule.

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