Skip to content

Harden CI sibling checkouts against force-pushes#21

Merged
avrabe merged 1 commit into
mainfrom
fix/ci-sibling-checkout-fragility
May 23, 2026
Merged

Harden CI sibling checkouts against force-pushes#21
avrabe merged 1 commit into
mainfrom
fix/ci-sibling-checkout-fragility

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented May 23, 2026

Summary

CI's rivet-validate job started failing on PRs that didn't touch artifacts (#18, #20) with fatal: could not read Username for 'https://github.com' from actions/checkout@v4. Root cause confirmed via the GitHub compare API: both relay and rivet siblings were force-pushed since the original #17 pins landed.

rivet  335bb84 vs main: behind_by=1 ahead_by=3 status=diverged
relay  4d42acf vs main: behind_by=5 ahead_by=4 status=diverged

The pinned SHAs are now orphaned in those repos' default-branch history. actions/checkout@v4's default shallow fetch can't find an orphaned SHA on a public repo and falls back to a cloning mode that asks for credentials — which the workflow's GITHUB_TOKEN doesn't have for cross-repo public checkouts. Hence the auth error on a public repo.

Fix — two parts

  1. Bump pins to current sibling main (acute fix):

    • RELAY_REF: 4d42acf → 178ffd47
    • RIVET_REF: 335bb84 → 78f001e2
  2. Add fetch-depth: 0 to every cross-repo checkout (durable fix): full clone, no shallow-fetch failure mode. Any SHA on a public repo resolves — orphaned or not. ~30s extra on cold cache; trades a bit of CI time for not having to chase every sibling force-push.

The fetch-depth: 0 is the durable fix; the pin bumps are maintenance that'll recur until the Renovate bot from #8 lands.

Unblocks

🤖 Generated with Claude Code

PR #18 (.bazelignore) and PR #20 (rules_rust bump) both failed their
CI rivet-validate job with `fatal: could not read Username for
'https://github.com'` from `actions/checkout@v4`. Same flake in PR #18
seemed transient (passed on rerun) but it recurred on PR #20, and the
GitHub compare API confirms why:

  - rivet pinned ref 335bb84 vs current main:
      behind_by=1 ahead_by=3 status=diverged
  - relay pinned ref 4d42acf vs current main:
      behind_by=5 ahead_by=4 status=diverged

Both sibling-repo main branches were force-pushed since the original
pins landed in #17. The pinned SHAs are now orphaned in those repos'
default branch history. actions/checkout@v4's default shallow fetch
(fetch-depth: 1) can't find an orphaned SHA on a public repo and
falls back to a cloning mode that asks for credentials, which the
GITHUB_TOKEN doesn't have for cross-repo public checkouts.

Two-part fix:

1. Bump pins to current sibling main:
     RELAY_REF: 4d42acf -> 178ffd47
     RIVET_REF: 335bb84 -> 78f001e2

2. Add `fetch-depth: 0` to every cross-repo checkout (5 total: 4 relay
   in lint/test/kani/fuzz, 1 rivet in rivet-validate). Full clone so
   any SHA on a public repo resolves — orphaned or not. ~30 extra
   seconds on the cold cache; trades CI speed for robustness against
   the architect's recurring force-pushes of sibling repos.

The fetch-depth: 0 hardening is the durable fix. The pin bumps are
maintenance — they'll need to happen again on the next force-push,
ideally via the Renovate bot tracked in #8.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@avrabe avrabe merged commit f274e3b into main May 23, 2026
5 checks passed
@avrabe avrabe deleted the fix/ci-sibling-checkout-fragility branch May 23, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant