Skip to content

fix: always emit non-empty deploy_name in notify dispatch - #195

Merged
joshua-temple merged 1 commit into
mainfrom
fix/notify-deploy-name
Jun 16, 2026
Merged

joshua-temple merged 1 commit into
mainfrom
fix/notify-deploy-name

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Problem

A build-only satellite (manifest with builds + a notify to a primary repo, but zero deploys) generated a "Notify Primary Repo" step whose dispatch to the primary's external-update.yaml omitted the deploy_name input. The consumer declares deploy_name as required: true, so GitHub rejected the dispatch with 422 Required input 'deploy_name' not provided (observed live on cascade-example-artifact-a and artifact-b).

Root cause: writeNotifyPrimaryStep emitted deploy_name only if 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_name is 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-name required flag on cascade external update.
  • Stray dot removed: context.jobs.['id'] -> context.jobs['id'].

Verification

  • Failing-first tests added in internal/generate/external_test.go: a build-only builds+notify manifest asserts the Notify step emits a non-empty deploy_name; a notify+deploys manifest asserts the accessor has no stray dot.
  • go build ./..., go test ./... (1395 pass), golangci-lint run ./... all green.
  • Dogfood regen produces zero workflow drift (cascade's own manifest has no notify block).

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>
@joshua-temple
joshua-temple merged commit 2582c52 into main Jun 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant