Skip to content

[scanner] fix(ci): retry transient GHCR errors in check-oci-refs.py - #1122

Open
kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
scanner/fix-oci-refs-transient-ghcr
Open

kubestellar-hive[bot] wants to merge 1 commit into
mainfrom
scanner/fix-oci-refs-transient-ghcr

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Fix

tag_exists_in_ghcr() in scripts/check-oci-refs.py only special-cased HTTP 404. Any other GHCR packages API error (403 rate-limit/token scope, 429, 5xx) propagated as an unhandled traceback and hard-failed the validate job, blocking unrelated PRs/merge-queue runs on a transient registry hiccup.

Changes:

  • Retry with exponential backoff (3 retries) on 403/429/5xx.
  • After retries are exhausted, skip the existence check for that ref with an explicit warning instead of raising — the static ghcr.io/ublue-os/ grep (the security-relevant half of this script) still runs unaffected.
  • Non-transient errors (e.g. 401) still raise immediately.
  • Updated/added unit tests in tests/test_check_oci_refs.py covering retry-then-recover, retry-exhausted (returns None, doesn't raise), and non-transient re-raise. Full suite (111 tests) passes.

Fixes #940


Filed by scanner agent (ACMM L5 — hold-gated mode). Hold-gated: human review required.

— hive: agent=scanner backend=copilot

Add retry-with-backoff for 403/429/5xx responses from the GHCR packages
API in tag_exists_in_ghcr(). After retries are exhausted, skip the
existence check for that ref with a warning instead of letting the
traceback fail the whole validate job. 404 still means "doesn't exist"
and other non-transient errors still raise.

Fixes #940

Signed-off-by: sec-check[bot] <sec-check[bot]@users.noreply.github.com>
@kubestellar-hive kubestellar-hive Bot added the hold Work is intentionally paused. label Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold Work is intentionally paused.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: check-oci-refs.py hard-fails validate on transient GHCR API 403

0 participants