test: end-to-end partial-batch failure recovers on re-run (#61) - #62
Conversation
… on re-run Drive process_submodule_list over real git fixtures with one submodule's remote transiently offline, so it fails while the others succeed. The re-run, with the remote restored, completes the previously-failed submodule and leaves the already-synced ones untouched (no new commit). Closes cppalliance#61.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a Bats end-to-end test that simulates one failed submodule during a batch, verifies successful processing of the others, then confirms recovery and idempotency on a second run. ChangesPartial batch recovery test
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai, full review |
|
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/test_partial_batch_recovery.bats`:
- Around line 82-85: Before restoring the json remote and starting Run 2 in the
partial-batch recovery test, assert that the remote repository’s current
revision still matches json_start. Add the check immediately after the failed
Run 1 and before moving json.git.offline back to json.git, using the existing
fixture and revision-validation helpers.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 62b90373-c92f-4e71-9643-42756c030c19
📒 Files selected for processing (1)
tests/test_partial_batch_recovery.bats
Before Run 2, verify the restored json remote still points at json_start, confirming the failed push committed locally but never reached the remote.
wpak-ai
left a comment
There was a problem hiding this comment.
tests/test_partial_batch_recovery.bats:82-99, tests/test_partial_batch_recovery.bats:27-33, .github/workflows/assets/translation.sh:17-27, .github/workflows/assets/translation.sh:112-120: delete and re-clone each submodule's destination directory from its bare remote after the remote is restored and before the second batch, mirroring the per-run fresh clone sync_one_submodule performs, so the recovering submodule is proven to re-commit and push against an unchanged remote rather than merely pushing run 1's leftover local commit (the re-run recovery invariant is held jointly by sync_repo_master's commit-before-push ordering and by the caller's workspace lifecycle, and production's caller clones the destination fresh into a mktemp -d workspace trapped for deletion, so the pending-commit state that makes run 2 pass in this fixture never exists in a real re-run)
Done. Run 2 now re-clones each destination fresh from its bare remote before the second batch, matching sync_one_submodule's per-run mktemp -d workspace. It first asserts json's remote is still at json_start, then recovery re-commits and pushes against that unchanged remote; algorithm/system re-clone and produce no new commit. |
Match sync_one_submodule's per-run mktemp workspace: delete and re-clone each destination from its bare remote before run 2. This proves the recovering submodule re-commits and pushes against the unchanged remote rather than pushing run 1's leftover local commit.
Closes #61.
process_submodule_listalready continues past a failed submodule (#32) andsync_repo_masteris already idempotent, but nothing proved end to end that a re-run after a partial failure recovers the failed submodule without re-touching the others. This adds that guard.Test
Drives
process_submodule_listover three real git-fixture submodules:Test-only, no source changes.
make testpasses 131/131 andmake lintis clean.Summary by CodeRabbit