test(reconcile): BDD scenario for Ambiguous → StillUnknown (#99 follow-on)#144
Conversation
… follow-on) Completes the third acceptance-criteria BDD scenario for #99. The existing suite already covered Published (registry confirms upload landed) and NotPublished (registry confirms upload didn't land); this adds the operator-actionable StillUnknown case where reconciliation itself can't reach a verdict because the registry is unhealthy. Setup drives every registry query on /api/v1/crates/demo/0.1.0 to 500, so version_exists bails with Err for non-200/404 statuses. reconcile_ambiguous_upload translates that Err into ReconciliationOutcome::StillUnknown. Asserts: - publish returns Err with "reconciliation inconclusive" message - package state is PackageState::Ambiguous (so resume's reconcile block will fire rather than a silent retry) - exactly one cargo invocation — StillUnknown must not blind-retry - PublishReconciling + PublishReconciled{ StillUnknown } events are persisted to events.jsonl for operator visibility Closes the last open AC on #99 acceptance list; reconciliation behavior itself was already implemented in PR #111 and PR #115.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
Summary by CodeRabbit
WalkthroughA new serialized reconciliation test Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Code Review
This pull request adds a new integration test, reconcile_bdd_ambiguous_resolves_to_still_unknown, to the shipper-core engine. The test verifies the system's behavior when a cargo publish fails ambiguously while the registry is unhealthy (returning 500 errors). It ensures that the package is correctly transitioned to an Ambiguous state, that the process halts with an error without blind retries, and that the appropriate reconciliation events are recorded in the event log. I have no feedback to provide.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
Ambiguous → StillUnknown. The existing suite coveredPublishedandNotPublished; this closes the gap.What the test exercises
version_existsbails →reconcile_ambiguous_uploadreturnsStillUnknown.Errwith"reconciliation inconclusive".PackageState::Ambiguousso a subsequentresumeenters the reconcile block, not a silent retry.PublishReconciling+PublishReconciled { outcome: StillUnknown }events for operator visibility.Test plan
cargo test -p shipper-core --lib reconcile_bdd_ambiguous_resolves_to_still_unknownpassesreconcile_bdd_*suite (4 tests) passescargo clippy -p shipper-core --all-targets --all-features -- -D warningscleancargo fmt -p shipper-core -- --checkclean