Skip to content

fix(ci): authenticate nix github flake fetches to stop 429 rate-limiting - #239

Merged
thedavidmeister merged 1 commit into
mainfrom
fix/nix-access-tokens-429
Jun 28, 2026
Merged

thedavidmeister merged 1 commit into
mainfrom
fix/nix-access-tokens-429

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

Problem

Every rainix reusable workflow runs nix develop github:rainlanguage/rainix#<shell>, which resolves the flake HEAD via an unauthenticated GitHub API call (github.com/ghapi/repos/rainlanguage/rainix/commits/HEAD), capped at 60 req/hour/IP. Under CI bursts — concurrent runs, the st0x V4 deploy rollout, the issue→PR cron — the cap blows and the run dies early with:

error: unable to download 'https://github.com/ghapi/repos/rainlanguage/rainix/commits/HEAD': HTTP error 429

This is the recurring transient red papered over with empty "429 retrigger" commits across the org.

Fix

Add access-tokens = github.com=\${{ github.token }} to the nix_conf of the shared nix-cachix-setup composite, so nix authenticates its GitHub API calls with the run token — raising the limit from 60/hr to ~1000/hr and eliminating the 429.

github.token is the automatic per-run GITHUB_TOKEN, not a secret, so it is present in every run (including cross-org reusable calls from consumers like S01-Issuer) with no secrets: plumbing, and only needs public-repo read to fetch the public rainix flake. Single-sourced in the preamble, so it fixes the 429 for every reusable in one place. Low risk: worst case it is a no-op.

🤖 Generated with Claude Code

Every rainix reusable runs `nix develop github:rainlanguage/rainix#...`, which
resolves the flake HEAD via an UNAUTHENTICATED GitHub API call capped at 60
req/hour/IP. Under CI bursts (concurrent runs, deploy rollouts) the cap blows
and the run dies with HTTP 429 before doing any work -- the recurring "429
retrigger" churn across rain repos and the st0x V4 deploy rollout.

Add access-tokens = github.com=${{ github.token }} to the shared
nix-cachix-setup preamble so nix authenticates those calls with the run token
(~1000/hour limit). github.token is the automatic per-run token (not a secret),
so it is present in every run including cross-org reusable calls and needs only
public-repo read to fetch the rainix flake. Single-sourced here, applies to
every reusable using this preamble.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this Jun 28, 2026
@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@thedavidmeister, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 59 minutes and 30 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ff933d84-e30c-47d6-8e0d-73d3fe1b0286

📥 Commits

Reviewing files that changed from the base of the PR and between 51e62ff and 1cafc09.

📒 Files selected for processing (1)
  • .github/actions/nix-cachix-setup/action.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/nix-access-tokens-429

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thedavidmeister

Copy link
Copy Markdown
Contributor Author

Reviewed 1cafc09: one-line CI fix — adds access-tokens = github.com=${{ github.token }} to the shared nix-cachix-setup nix_conf. Correct nix.conf syntax; authenticates nix's flake-resolution GitHub API calls so they use the run-token limit (~1000/hr) instead of the unauthenticated 60/hr/IP cap that's been 429ing CI. github.token is the automatic per-run token (not a secret), so cross-org consumers need no plumbing and it only needs public-repo read. Substance CI (sol-artifacts, slither, tests, fmt, reuse) green. Low risk — worst case a no-op. Approve.

@thedavidmeister
thedavidmeister merged commit 6147dbf into main Jun 28, 2026
13 checks passed
@github-actions

Copy link
Copy Markdown

@coderabbitai assess this PR size classification for the totality of the PR with the following criterias and report it in your comment:

S/M/L PR Classification Guidelines:

This guide helps classify merged pull requests by effort and complexity rather than just line count. The goal is to assess the difficulty and scope of changes after they have been completed.

Small (S)

Characteristics:

  • Simple bug fixes, typos, or minor refactoring
  • Single-purpose changes affecting 1-2 files
  • Documentation updates
  • Configuration tweaks
  • Changes that require minimal context to review

Review Effort: Would have taken 5-10 minutes

Examples:

  • Fix typo in variable name
  • Update README with new instructions
  • Adjust configuration values
  • Simple one-line bug fixes
  • Import statement cleanup

Medium (M)

Characteristics:

  • Feature additions or enhancements
  • Refactoring that touches multiple files but maintains existing behavior
  • Breaking changes with backward compatibility
  • Changes requiring some domain knowledge to review

Review Effort: Would have taken 15-30 minutes

Examples:

  • Add new feature or component
  • Refactor common utility functions
  • Update dependencies with minor breaking changes
  • Add new component with tests
  • Performance optimizations
  • More complex bug fixes

Large (L)

Characteristics:

  • Major feature implementations
  • Breaking changes or API redesigns
  • Complex refactoring across multiple modules
  • New architectural patterns or significant design changes
  • Changes requiring deep context and multiple review rounds

Review Effort: Would have taken 45+ minutes

Examples:

  • Complete new feature with frontend/backend changes
  • Protocol upgrades or breaking changes
  • Major architectural refactoring
  • Framework or technology upgrades

Additional Factors to Consider

When deciding between sizes, also consider:

  • Test coverage impact: More comprehensive test changes lean toward larger classification
  • Risk level: Changes to critical systems bump up a size category
  • Team familiarity: Novel patterns or technologies increase complexity

Notes:

  • the assessment must be for the totality of the PR, that means comparing the base branch to the last commit of the PR
  • the assessment output must be exactly one of: S, M or L (single-line comment) in format of: SIZE={S/M/L}
  • do not include any additional text, only the size classification
  • your assessment comment must not include tips or additional sections
  • do NOT tag me or anyone else on your comment

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