test(probe): make triage tests fork-tolerant - #1346
Conversation
Two tests hardcoded the upstream owner 'debpalash', so they failed on any fork (the fork's git origin resolves to its own owner). test_detect_repo_from_origin now asserts the repo name (stable across upstream and forks) instead of a hardcoded owner; test_triage_builds_github_url pins detect_repo via monkeypatch so its URL assertion is deterministic on every fork. Behavior unchanged (triage still routes bug-report URLs to the git origin). On a fork: 2 failed before, 7 passed after.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe repository detection tests now avoid hardcoded owner values. The GitHub URL test patches ChangesRepository test portability
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 8 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (8 passed)
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 |
|
| Filename | Overview |
|---|---|
| tests/probe/test_triage.py | The test-only changes remove fork-owner coupling without changing production behavior or introducing a concrete merge-blocking defect. |
Reviews (1): Last reviewed commit: "test(probe): make triage tests fork-tole..." | Re-trigger Greptile
What
Two tests in
tests/probe/test_triage.pyhardcoded the upstream ownerdebpalash, so they failed on any fork (the fork'sgit originresolves to its own owner, notdebpalash). This kept the fork's CI red on every push and masked real failures.test_detect_repo_from_originasserteddetect_repo() == ("debpalash", "OmniVoice-Studio").detect_repo()parses the real git origin, so on a fork it returns the fork owner.test_triage_builds_github_urlasserted the triaged URL's owner== "debpalash", same reason.Fix
test_detect_repo_from_origin: assert the shape and the repo name (OmniVoice-Studio, stable across upstream and forks), not a hardcoded owner.test_triage_builds_github_url: pindetect_repoviamonkeypatchto("debpalash", "OmniVoice-Studio")so the URL assertion is deterministic on every fork. The test exercises URL construction, not the git origin.Behavior unchanged
The triage still routes bug-report URLs to whatever
git originresolves to (route-to-origin). Only the tests stop assuming the upstream owner.Verification
On a fork: 2 failed before, 7 passed after (full
tests/probe/test_triage.py).The triage tests now support repository forks by avoiding hardcoded owners and mocking
detect_repo()for deterministic URL checks. This prevents fork-specific test failures while preserving production behavior. No production-code risk was introduced.