The submodule fixture commits as somebody, and a failed git says what git said - #154
Conversation
… git said Two tests have been failing on main since #143's run, in every job that runs the suite -- coverage, pre-commit, prek and scan engine -- and passing on every contributor's machine. `with_a_submodule` gives an identity to the source repository it builds and then adds that repository as a submodule. The tests commit into `root/sub`, which is the CLONE `git submodule add` made, and a clone carries none of the source's local config. So the commit borrowed whoever was configured globally: a developer machine has somebody, and CI has nobody. The clone is handed the same identity the fixture gives everything else it builds. The second half is why this took a local repro to find. The `git` helper sent stderr to `Stdio::null()` and asserted `"git {args:?} failed"`, so eleven minutes of CI reported back the one fact the reader already had -- that the command failed -- and threw away the sentence naming the cause. It now prints what git said and which directory it said it in. Verified by running the whole suite with GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM pointed at /dev/null, which is the condition CI runs under: 807 passed, 0 failed. The same suite was 2 failed before this change. Claude-Session: https://claude.ai/code/session_01HertdiAvdNKGyjR91jvRUM
|
Warning Review limit reachedNext included review available in 17 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #154 +/- ##
==========================================
- Coverage 93.39% 93.26% -0.14%
==========================================
Files 38 38
Lines 14677 15276 +599
==========================================
+ Hits 13708 14247 +539
- Misses 969 1029 +60 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mainhas been red since run 34017238390. The same two tests fail in every job that runs the suite --coverage,pre-commit,prek,scan engine-- and pass on every contributor's machine.The cause
with_a_submodulebuilds a source repository, gives ituser.nameanduser.email, and adds it as a submodule. Both tests then commit intoroot/sub-- which is the clonegit submodule addmade, not the source. A clone carries none of the source repository's local config, so that commit borrowed whoever was configured globally.A developer machine has somebody configured globally. CI has nobody. The clone is now handed the same identity the fixture gives every other repository it builds.
Why it took a local repro to find
The fixture's
githelper sent stderr toStdio::null()and asserted"git {args:?} failed". Six minutes of CI reported back the one fact the reader already had -- that the command failed -- and discarded the sentence naming the cause, which wasPlease tell me who you are. It now prints what git said and which directory it said it in.Verification
Run the whole suite with
GIT_CONFIG_GLOBALandGIT_CONFIG_SYSTEMpointed at/dev/null, which is the condition CI runs under:Before this change, that command reproduces CI exactly -- the same two tests, the same line.
cargo fmt --check,cargo clippy --all-targets -- -D warningsandcargo run -- scanare clean, and the suite is 807/0 with a normal git config too.https://claude.ai/code/session_01HertdiAvdNKGyjR91jvRUM