fix: use null-safe github.event.inputs.dry_run in orchestrate deploy passthrough - #193
Merged
Merged
Conversation
…passthrough Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The orchestrate generator passed the dry-run flag to a supports_dry_run deploy callback as
dry_run: ${{ inputs.dry_run }}. orchestrate.yaml is triggered by push, schedule, and workflow_run, none of which populate theinputscontext, so the bare expression renders an empty string. The deploy callback declaresdry_runastype: boolean, and passing an empty string into a boolean reusable-workflow input fails the dispatch with no visible job. Finalize then sees the deploy as failed and on_failure aborts. Only repos with a supports_dry_run deploy callback hit this; the four-environment example was the trigger.Fix
internal/generate/generator.gonow emitsdry_run: ${{ github.event.inputs.dry_run }}, the same null-safe accessor already used everywhere else in the generator (promote and release deploy passthroughs, every dry_run guard). On push/schedule/workflow_run it renders null so the callback boolean falls back to its default; on dispatch it forwards the operator value.A test in
internal/generate/dry_run_test.gohad locked in the broken bare form, contradicting the corrected assertions elsewhere in the same file. Both assertions now expect the null-safe accessor.Verification