Skip to content

test(probe): make triage tests fork-tolerant - #1346

Open
paoloantinori wants to merge 1 commit into
debpalash:mainfrom
paoloantinori:fix/probe-triage-fork-tolerant
Open

test(probe): make triage tests fork-tolerant#1346
paoloantinori wants to merge 1 commit into
debpalash:mainfrom
paoloantinori:fix/probe-triage-fork-tolerant

Conversation

@paoloantinori

@paoloantinori paoloantinori commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

What

Two tests in tests/probe/test_triage.py hardcoded the upstream owner debpalash, so they failed on any fork (the fork's git origin resolves to its own owner, not debpalash). This kept the fork's CI red on every push and masked real failures.

  • test_detect_repo_from_origin asserted detect_repo() == ("debpalash", "OmniVoice-Studio"). detect_repo() parses the real git origin, so on a fork it returns the fork owner.
  • test_triage_builds_github_url asserted 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: pin detect_repo via monkeypatch to ("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 origin resolves 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.

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.
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 981dcadb-18d5-4ff8-b733-5931faaa12e5

📥 Commits

Reviewing files that changed from the base of the PR and between 5f39f9f and 6fe1634.

📒 Files selected for processing (1)
  • tests/probe/test_triage.py

📝 Walkthrough

Walkthrough

The repository detection tests now avoid hardcoded owner values. The GitHub URL test patches detect_repo with a fixed repository tuple before building the URL.

Changes

Repository test portability

Layer / File(s) Summary
Controlled repository detection tests
tests/probe/test_triage.py
The detection test accepts any nonempty owner and checks the stable repository name. The URL test patches detect_repo for deterministic URL construction.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 8 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title uses the required Conventional Commit format with scope, but it does not include an issue reference in the title or description. Add the issue reference to the title or pull request description.
✅ Passed checks (8 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the problem, fix, unchanged behavior, and verification, but it omits the template's Type and Checklist sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cross-Platform Default Parity ✅ Passed The PR diff changes only tests/probe/test_triage.py; production triage.py is unchanged, so no default-mode behavior changes across macOS, Windows, or Linux.
I18n Completeness (21 Locales) ✅ Passed The PR changes only tests/probe/test_triage.py; it adds no frontend t(...) keys or frontend user-facing strings requiring locale checks.
Local-First Guarantee ✅ Passed The commit changes only tests; added code uses local monkeypatching and URL parsing. Existing triage drafts a GitHub Issues URL without submission, credentials, telemetry, or required cloud access.
Backward Compatibility ✅ Passed The patch changes only tests/probe/test_triage.py; it adds no runtime, database schema, migration, engine, or model-weight changes.

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.

@greptile-apps

greptile-apps Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Updates probe triage tests to tolerate fork owners while keeping GitHub URL construction deterministic.

  • Validates the detected repository tuple without hardcoding its owner.
  • Mocks repository detection in the URL-construction test.

Important Files Changed

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

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