Skip to content

Prefetch flake inputs with retries in CI - #2567

Open
MarcusSorealheis wants to merge 3 commits into
TraceMachina:mainfrom
MarcusSorealheis:ci/retry-flake-input-fetch
Open

Prefetch flake inputs with retries in CI#2567
MarcusSorealheis wants to merge 3 commits into
TraceMachina:mainfrom
MarcusSorealheis:ci/retry-flake-input-fetch

Conversation

@MarcusSorealheis

@MarcusSorealheis MarcusSorealheis commented Jul 17, 2026

Copy link
Copy Markdown
Member

Problem

CI jobs have been failing intermittently with HTTP 503s from GitHub's tarball API while Nix fetches flake inputs (e.g. hercules-ci/flake-parts), before the actual build starts:

error: unable to download 'https://api.github.com/repos/hercules-ci/flake-parts/tarball/5792860...': HTTP error 503

Nix's own retry gives up within seconds, so a brief GitHub blip fails the whole job. The requests are already authenticated (nix-installer-action auto-configures access-tokens from GITHUB_TOKEN), so this is server-side flakiness, not rate limiting.

Fix

Add a nix flake archive prefetch step to the shared prepare-nix action, wrapped in the same nick-fields/retry action (5 attempts, 30s apart) the attic setup already uses. All flake inputs land in the store before any nix develop/nix build step runs, so transient 503s are ridden out instead of failing the run.

The step deliberately fails (rather than skips) if GitHub is hard-down for the full retry window — a build job that can't fetch its inputs can't do anything meaningful, and skipping would report green without building.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FoVmjH7WSaK69bYy8xhVW7


This change is Reviewable

GitHub's tarball API intermittently returns 503s, which fails any job
during flake input fetching before the build even starts. Prefetch all
inputs with nix flake archive inside the same retry wrapper the attic
setup already uses, so transient GitHub outages are absorbed instead of
failing the run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FoVmjH7WSaK69bYy8xhVW7
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nativelink Ready Ready Preview, Comment Jul 23, 2026 2:14pm
nativelink-aidm Ready Ready Preview, Comment Jul 23, 2026 2:14pm

Request Review

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.

2 participants