Safe outputs: pre-validate dispatch_workflow required inputs and downgrade missing-input failures to non-fatal#41992
Safe outputs: pre-validate dispatch_workflow required inputs and downgrade missing-input failures to non-fatal#41992Copilot wants to merge 4 commits into
dispatch_workflow required inputs and downgrade missing-input failures to non-fatal#41992Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
dispatch_workflow required inputs and downgrade missing-input failures to non-fatal
There was a problem hiding this comment.
Pull request overview
This PR enhances the safe_outputs “dispatch_workflow” handler by capturing required workflow_dispatch.inputs at compile time and using that metadata at runtime to pre-validate dispatch messages, converting “missing required input” failures into report-only results so they don’t fail the entire safe_outputs job.
Changes:
- Compile-time: extract and persist per-workflow required
workflow_dispatchinputs into safe-outputs handler config (required_inputs). - Runtime: validate
dispatch_workflowmessages againstrequired_inputsbefore dispatch, and normalize certain 400/422 API errors into report-only validation failures. - Job semantics: extend report-only partitioning logic to honor an explicit
reportOnly: trueflag (in addition to type-based rules).
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/safe_outputs_handler_registry.go | Emits required_inputs into the generated safe-outputs handler config when present. |
| pkg/workflow/safe_outputs_dispatch.go | Extracts required workflow_dispatch inputs from target workflows during compilation. |
| pkg/workflow/dispatch_workflow.go | Extends DispatchWorkflowConfig with RequiredInputs for compile→runtime transfer. |
| pkg/workflow/dispatch_workflow_test.go | Verifies required inputs are captured and serialized into config. |
| actions/setup/js/safe_output_handler_manager.cjs | Updates report-only classification/partitioning to honor explicit reportOnly: true. |
| actions/setup/js/safe_output_handler_manager.test.cjs | Adds tests for explicit reportOnly classification and partitioning. |
| actions/setup/js/dispatch_workflow.cjs | Adds pre-dispatch required-input validation and API missing-input normalization to report-only failures. |
| actions/setup/js/dispatch_workflow.test.cjs | Adds tests for the new report-only missing-input behaviors (pre-dispatch and API-error normalization). |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 8/8 changed files
- Comments generated: 3
- Review effort level: Low
| function isReportOnlyFailureResult(result) { | ||
| return isFailedProcessingResult(result) && !!(result?.type && REPORT_ONLY_FAILURE_TYPES.has(result.type)); | ||
| return isFailedProcessingResult(result) && (result?.reportOnly === true || !!(result?.type && REPORT_ONLY_FAILURE_TYPES.has(result.type))); | ||
| } |
|
@copilot please run the
|
…age paths Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
PR Triage — Run §28315307719
Fixes safe_outputs CI failures caused by missing
|
safe_outputswas failing the entire job when adispatch_workflowmessage omitted a target workflow’s requiredworkflow_dispatchinput (e.g.messageforhaiku-printer), even when all other safe outputs succeeded. This change adds required-input awareness to dispatch handling and treats that specific validation failure as report-only.Compile-time: capture required dispatch inputs
DispatchWorkflowConfigwithrequired_inputs(workflow -> []requiredInputName).workflow_dispatch.inputsfrom target workflow definitions and persist them into handler config.Runtime: pre-dispatch validation in
dispatch_workflowhandlermessage.inputsagainst compile-timerequired_inputs.success: false,reportOnly: true) with actionable error text naming the missing input.Runtime: normalize API missing-input errors
Required input 'X' not provided, translate it to the same typed report-only validation error instead of surfacing raw REST failure text.Job outcome semantics: report-only failures
reportOnly: trueon results (in addition to existing type-based report-only rules), so a single malformed dispatch does not makesafe_outputsred.pr-sous-chef run 28311797805