fix: pass workflow inputs to success and failure actions#2796
fix: pass workflow inputs to success and failure actions#2796harshit078 wants to merge 14 commits into
Conversation
🦋 Changeset detectedLatest commit: ffd8f5a The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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.
| import type { Arazzo1Rule } from '../../visitors.js'; | ||
| import type { UserContext } from '../../walk.js'; | ||
|
|
||
| const IN_REQUIRED_MESSAGE = |
There was a problem hiding this comment.
You can use report messages directly
There was a problem hiding this comment.
yep I agree ! Made changes.
|
Thanks @harshit078 for contribution! Please, fix the issue reported by bugbot. I left comment as well. Additionally, please add docs for a new rule. |
|
Hey @AlbinaBlazhko17 , I have pushed a fix addressing both cursor and your comment along with addition of docs for |
|
|
||
| export const SpecParametersInByContext: Arazzo1Rule = () => { | ||
| return { | ||
| Step: { |
There was a problem hiding this comment.
Please, add to this rule Workflowvisitor, because you miss, that Workflow also accepts parameters per arazzo.ts:179.
| "@redocly/cli": minor | ||
| --- | ||
|
|
||
| Added the `spec-parameters-in-by-context` Arazzo rule, which validates that a parameter's `in` field is specified when the parent step, success action, or failure action does not reference a `workflowId`. Extended success and failure action objects to accept a `parameters` property that maps to workflow inputs. |
There was a problem hiding this comment.
I think, we need to add Note, that lint can produce errors after this rule release as we add this rule to the recommended ruleset with error setting.
There was a problem hiding this comment.
agree, I have added a note !
| } | ||
|
|
||
| function checkParameters( | ||
| parameters: any, |
There was a problem hiding this comment.
Please, avoid using any, because we provide proper types
| ```yaml | ||
| rules: | ||
| spec-parameters-in-by-context: error | ||
| ```## Examples |
There was a problem hiding this comment.
Please, add line break
|
|
||
| ## Resources | ||
|
|
||
| - [Rule source](https://github.com/Redocly/redocly-cli/blob/main/packages/core/src/rules/arazzo/spec-parameters-in-by-context.ts) No newline at end of file |
There was a problem hiding this comment.
Let's add a new line at the end, the issue with code-quality should disappear.

What/Why/How?
spec-parameters-in-by-contextArazzo ruleparametersproperty in interface of workflow for success and failure action objects.Reference
#2735
Testing
Screenshots (optional)
Check yourself
Security
Note
Medium Risk
Adds a new built-in Arazzo lint rule and enables it in stricter/default rulesets, which can introduce new lint errors for existing Arazzo files. Also expands the Arazzo schema/types to accept
parameterson success/failure actions, affecting validation and downstream consumers.Overview
Adds the new Arazzo rule
spec-parameters-in-by-contextto enforce context-dependent validation of parameterin: required for workflow/operation-backed parameters and forbidden when a step/action references aworkflowId(parameters map to workflow inputs), and it errors if success/failure actions defineparameterswithout aworkflowId.Updates built-in rule registrations and default rulesets (including
spec,recommended,recommended-strict,all) so the rule is active by default atwarn/error, and extends Arazzo success/failure action schemas/types (core + respect) to support an action-levelparametersfield; includes new docs and a comprehensive test suite for the rule.Reviewed by Cursor Bugbot for commit ffd8f5a. Bugbot is set up for automated code reviews on this repo. Configure here.