fix: always emit non-empty deploy_name in notify dispatch - #195
Merged
Merged
Conversation
A build-only satellite (builds + notify, zero deploys) generated a Notify Primary Repo step that omitted the deploy_name dispatch input, but the external-update consumer declares deploy_name as required: true. The dispatch was rejected with 422 Required input 'deploy_name' not provided. writeNotifyPrimaryStep now always emits a non-empty deploy_name: the first deploy name, falling back to the first build name for build-only artifact satellites, and to the runtime repo name when neither is present. Also fix a stray dot in the github-script accessor (context.jobs.['id'] -> context.jobs['id']) that would fail at runtime for satellites collecting deploy outputs. 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
A build-only satellite (manifest with
builds+ anotifyto a primary repo, but zerodeploys) generated a "Notify Primary Repo" step whose dispatch to the primary'sexternal-update.yamlomitted thedeploy_nameinput. The consumer declaresdeploy_nameasrequired: true, so GitHub rejected the dispatch with422 Required input 'deploy_name' not provided(observed live on cascade-example-artifact-a and artifact-b).Root cause:
writeNotifyPrimaryStepemitteddeploy_nameonlyif len(g.config.Deploys) > 0.A latent typo in the same step shared the same root cause: the github-script accessor was written as
context.jobs.['id']with a stray dot before the bracket (invalid JavaScript). It only renders for satellites that collect deploy outputs, so it was dormant for zero-deploy manifests but would break a notify+deploys satellite.Fix
deploy_nameis now always emitted and non-empty. Fallback chain: first deploy name, then first build name (the build-only artifact case), then the satellite's own repo name from the runtime context (context.repo.repo). The chosen value identifies the satellite's artifact and matches the--deploy-namerequired flag oncascade external update.context.jobs.['id']->context.jobs['id'].Verification
internal/generate/external_test.go: a build-onlybuilds+notifymanifest asserts the Notify step emits a non-emptydeploy_name; a notify+deploys manifest asserts the accessor has no stray dot.go build ./...,go test ./...(1395 pass),golangci-lint run ./...all green.