Repository navigation
Commit baa0f76
fix(build-push-docker-manifest): idempotent manifest + cosign reruns (RANE-4683) (#1577)
* fix(build-push-docker-manifest): idempotent manifest + cosign reruns (RANE-4683)
- Skip imagetools create when the tag already references the expected
platform digests; fail if the tag exists with different digests
- Skip cosign sign when verify already succeeds (idempotent rerun)
- Retry cosign verify after sign for Sigstore propagation flakes
Together these changes make build-publish manifest jobs safe to rerun without
digest drift or redundant signing, while still failing loudly on real conflicts.
* fix(build-push-docker-manifest): address PR review feedback (RANE-4683)
- Ensure jq is installed before digest comparison
- Validate docker-image-name-digests is non-empty
- Only skip cosign sign when OIDC identity constraints verify
- Fail fast on unexpected imagetools inspect errors (not just missing tag)
* chore(build-push-docker-manifest): address additional Copilot nits
Keep MANIFEST_CREATE_SKIPPED expression on one line and only sleep between
cosign verify retries, not after the final failed attempt.
* chore(build-push-docker-manifest): address latest Copilot nits
- Fail fast when jq is missing and apt-get/sudo are unavailable
- Shorten step/output ids so summary env expressions stay on one line
under Prettier (avoids split ${{ }} expressions)
* fix(build-push-docker-manifest): de-duplicate platform digests for idempotency
Treat digest lists as sets: sort -u in normalization and existing-manifest
inspection, and reuse normalized digests when building imagetools create args.
* fix(build-push-docker-manifest): address follow-up Copilot nits
- Only sleep between manifest digest inspect retries, not after the final fail
- Fail fast when an existing tag has no extractable platform digests instead
of falling through to imagetools create (digest drift on rerun)
* fix(build-push-docker-manifest): validate sha256 digest format early
Reject non-sha256 tokens in normalize_digest_csv so bad
docker-image-name-digests input fails fast with a clear error instead
of deferring to imagetools create.
* chore(build-push-docker-manifest): replace jq install with availability guard
jq is preinstalled on GitHub-hosted ubuntu-24.04 runners; fail fast with
a clear error when missing instead of apt-get/sudo install logic.
* fix(build-push-docker-manifest): ECR propagation guard + move verify to workflow
Retry manifest inspect until platform digests match expected inputs (ECR tag
propagation lag). Move the cosign verify gate with 5×10s retry from the
composite action into reusable-docker-build-publish; keep idempotent create,
sign-skip internal verify, and sign in the action (RANE-4683).
* fix(build-push-docker-manifest): read additional tags from action input in summary
The step summary referenced a manifest-additional-tags output that
inspect-docker-manifest never sets; use the manifest-additional-tags input
instead so additional tags display correctly.
* refactor(build-push-docker-manifest): verify signature in its own job (RANE-4683)
Per review (Erik/Chad): move cosign signature verification out of the
build-push-docker-manifest action into a standalone verify-manifest-signature
job in reusable-docker-build-publish, so a Sigstore propagation-lag flake can be
retried in isolation without re-running manifest create/sign. That rerun was the
root cause of index digest drift stranding the tag on an unsigned wrapper
(hit again on v2.55.0-rc.0 GA).
- reusable-docker-build-publish: new verify-manifest-signature job (needs
docker-manifest); expose docker-manifest name-with-digest output; remove the
inline verify step.
- build-push-docker-manifest: always cosign sign (safe now that verify is
decoupled and imagetools create is idempotent); drop sign-skip verification
shell; drop the jq availability guard (preinstalled on ubuntu-24.04); tidy
summary.
- regenerate synced .github/workflows copy; update changeset.
* refactor(verify): extract cosign verify+retry into verify-docker-signature action
Address "too much bash in the job" (Chad): move the standalone verify job's
inline cosign install + retry loop into a dedicated composite action
`verify-docker-signature`, with the retry logic in scripts/verify-with-retry.sh.
The verify-manifest-signature job in reusable-docker-build-publish is now
declarative (aws login -> ecr login -> uses: verify-docker-signature).
- new action actions/verify-docker-signature (action.yml, scripts, README,
package.json, project.json); cosign verify with configurable retry for
Sigstore propagation lag.
- reusable-docker-build-publish: verify job uses the new action (pinned @main
pending first release; TODO to pin to /v1).
- changeset + regenerated .github/workflows copy.
* refactor(verify): keep verification inline in the workflow job
Revert the verify-docker-signature composite action / external script; per
follow-up review we keep the logic directly in the workflow (matching the
existing inline style in reusable-docker-build-publish). Verification stays in
its own verify-manifest-signature job so a Sigstore propagation flake retries
without re-running create/sign, but the cosign install + retry loop live inline.
* refactor(verify): single isolated verify step, no in-step retry loop
Per review (Chad: the retry loop isn't good; Erik: keep verify as its own
isolated step): drop the 5x10s hand-rolled retry loop and verify once. The
verify-manifest-signature job is already isolated and independently re-runnable,
so it is the retry unit for the Sigstore propagation-lag case — re-running it
never touches manifest create/sign, so no index digest drift (RANE-4683).
* feat(verify): intelligent verify retry — exponential backoff, 10 min cap
Per Chad: replace the fixed retry with an exponential-backoff retry (10s, 20s,
40s ... capped at 120s/wait) bounded to 10 minutes total, in the isolated
verify-manifest-signature job. Absorbs Sigstore propagation lag without ever
re-running manifest create/sign (RANE-4683).
* fix(verify): bump verify-manifest-signature timeout to 12m
Job timeout was 5m while the in-step retry budget is 600s, so GitHub
could kill the job before Sigstore propagation retries finished.
* docs(action): comment idempotent manifest create for reviewers
Explain why we compare platform digests (not index digests), skip vs
fail-hard paths, and how create idempotency relates to the isolated
verify job (RANE-4683).
* fix(verify): include last cosign verify output on timeout
Makes auth/identity mismatches distinguishable from Sigstore
propagation lag when the 10-minute retry budget is exhausted.
* fix(action): require platform os+arch in digest jq filter
Descriptors without .platform (e.g. SBOMs/attachments) no longer pass
the idempotency/propagation digest comparison.
* Debloat: reduce to a minimal idempotency guard (RANE-4683)
- Skip imagetools create when the tag already exists (lightweight sanity
check that it references the digests being published)
- Revert inspect step to original retry loop
- Move cosign verify back inline with a small backoff retry; drop the
separate verify-manifest-signature job (redundant once create is
idempotent; it also hardcoded the OIDC issuer/identity)
- Delete normalize_digest_csv / get_existing_platform_digests /
wait_for_manifest_tag_propagation helpers
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* fix(build-push-docker-manifest): repair idempotency guard
The autofix rewrote the create-step guard into Python heredocs that
produced invalid YAML (unindented heredoc body terminated the run block
scalar) and captured inspect stderr into the JSON payload (2>&1).
Restore a plain-bash guard that:
- validates/normalizes docker-image-name-digests up front (fail fast on
empty/invalid input, before both the idempotency check and create)
- captures inspect stdout and stderr separately (no warnings in payload)
- distinguishes 'tag missing' from real inspect errors (no silent
fall-through to create on transient/auth failures)
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>1 parent 1f49f1a commit baa0f76
2 files changed
Lines changed: 121 additions & 12 deletions
File tree
- .changeset
- actions/build-push-docker-manifest
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
317 | 322 | | |
318 | | - | |
| 323 | + | |
319 | 324 | | |
320 | 325 | | |
321 | 326 | | |
| |||
327 | 332 | | |
328 | 333 | | |
329 | 334 | | |
| 335 | + | |
| 336 | + | |
330 | 337 | | |
331 | | - | |
332 | | - | |
333 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
334 | 396 | | |
335 | | - | |
| 397 | + | |
336 | 398 | | |
337 | 399 | | |
338 | 400 | | |
| |||
422 | 484 | | |
423 | 485 | | |
424 | 486 | | |
425 | | - | |
| 487 | + | |
426 | 488 | | |
427 | 489 | | |
428 | 490 | | |
| |||
432 | 494 | | |
433 | 495 | | |
434 | 496 | | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
439 | 537 | | |
440 | 538 | | |
441 | 539 | | |
442 | 540 | | |
443 | 541 | | |
444 | 542 | | |
445 | | - | |
446 | | - | |
| 543 | + | |
447 | 544 | | |
448 | 545 | | |
449 | 546 | | |
| |||
456 | 553 | | |
457 | 554 | | |
458 | 555 | | |
| 556 | + | |
459 | 557 | | |
460 | 558 | | |
461 | 559 | | |
| |||
467 | 565 | | |
468 | 566 | | |
469 | 567 | | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
470 | 571 | | |
471 | 572 | | |
472 | 573 | | |
| |||
0 commit comments