Skip to content

ci: isolate CARGO_HOME in preflight snapshot test#86

Merged
EffortlessSteven merged 1 commit into
mainfrom
release/preflight-snapshot-token-isolation
Apr 16, 2026
Merged

ci: isolate CARGO_HOME in preflight snapshot test#86
EffortlessSteven merged 1 commit into
mainfrom
release/preflight-snapshot-token-isolation

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

The preflight_allow_dirty_snapshot test passed on nextest / PR lanes but failed on the Coverage (llvm-cov) lane, flipping main red even after PR #82 merged.

Root cause is not the test harness — it's the test env setup:

  • Shipper's token resolution chain is CARGO_REGISTRY_TOKENCARGO_REGISTRIES_<NAME>_TOKEN$CARGO_HOME/credentials.toml.
  • The test removed the first two env vars but said nothing about CARGO_HOME.
  • On developer machines, ~/.cargo/credentials.toml exists and contains a real token, so the snapshot was recorded with Token Detected: ✓ / Auth Type: Token.
  • On CI runners, that file doesn't exist, so preflight reports Token Detected: ✗ / Auth Type: -. The diff flipped red.

Fix: set CARGO_HOME to the test's tempdir so the credentials.toml lookup can't find anything. Re-recorded the snapshot under the isolated env — now deterministic regardless of ambient credentials.

Verification

  • cargo test -p shipper-cli --test e2e_expanded preflight_allow_dirty_snapshot -- --exact — passes locally with the isolated env.
  • Snapshot now shows Token Detected: ✗ / Auth Type: -, matching what every clean CI runner produces.

Test plan

  • Coverage (llvm-cov) lane green on main after merge
  • Tests (nextest) still green on all three OSes

The snapshot passed on nextest/PR lanes but failed on the Coverage
(llvm-cov) lane because llvm-cov runs cargo test without the nextest
harness. Root cause is unrelated to the runner though: the test removed
CARGO_REGISTRY_TOKEN and CARGO_REGISTRIES_CRATES_IO_TOKEN but did nothing
about the third token source in Shipper's resolution chain:
$CARGO_HOME/credentials.toml.

On developer machines that file exists and contains a real token, so the
snapshot was recorded with `Token Detected: ✓` and `Auth Type: Token`.
On CI runners credentials.toml does not exist, so preflight reports
`Token Detected: ✗` and `Auth Type: -`. The diff flipped the lane red.

Fix: set CARGO_HOME to the test tempdir so the credentials.toml lookup
cannot find anything. Re-record the snapshot under the isolated env —
now deterministic on every runner regardless of ambient credentials.
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Apr 15, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 44 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 8 minutes and 44 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0cb32f23-3ed4-4232-827b-a741ba5dbafe

📥 Commits

Reviewing files that changed from the base of the PR and between ea75b53 and 1794bd8.

⛔ Files ignored due to path filters (1)
  • crates/shipper-cli/tests/snapshots/e2e_expanded__preflight_allow_dirty.snap is excluded by !**/*.snap
📒 Files selected for processing (1)
  • crates/shipper-cli/tests/e2e_expanded.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release/preflight-snapshot-token-isolation

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 and usage tips.

@codecov

codecov Bot commented Apr 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@EffortlessSteven EffortlessSteven merged commit 5beab9b into main Apr 16, 2026
19 checks passed
@EffortlessSteven EffortlessSteven deleted the release/preflight-snapshot-token-isolation branch April 16, 2026 00:04
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