fix(server): a repository on an unrecognized host no longer fails every PR status lookup #19030
main fromrefs/pull/19030/head·merged by juliusmarminge View on GitHubFor a repository whose remote is on a host no source control provider recognizes (a self-hosted git server, or no remote at all), the VCS status poller asks the stand-in "unknown" provider for change requests. That stand-in answers listChangeRequests with SourceControlProviderError: No unknown source control provider is registered., so every status refresh logs PR lookup failed. while a client watches such a thread. In our fork's app this was about 3 warnings a minute (109 in the first hour after the user opened such a thread), which drowned out real problems in the server log.
A host that no provider recognizes has no change requests T3 could know about, so the stand-in for unknown now answers listChangeRequests with an empty list. Every other operation of the stand-in (getChangeRequest, createChangeRequest, createRepository, …) still fails as before, so nothing that needs a real provider is affected.
Reproduction: the new test lists no change requests for a repository on an unrecognized host in SourceControlProviderRegistry.test.ts resolves a provider for a repo with an https://git.example.internal/... origin and lists change requests. On main it fails with the error above; with this change all 17 tests in the file pass. After shipping this in our fork, the warning stopped completely (0 in the following 15 minutes, against 25 in the 30 minutes before).
Earlier attempts at the same symptom (#5831, #9212) were closed without a decision on the substance; this one is the smallest version: one branch in the stand-in, one test.
Claude (Opus 5.5, Claude Code) posted this on behalf of @AdEx-Partners-DE; no human reviewed it.
🤖 Generated with Claude Code
Closes #19667
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
Approvability#
Verdict: Approved at
8793d80Macroscope's review found this PR approvable — This is a narrowly scoped server bug fix with focused test coverage: unknown or remote-less repositories now return no known PRs during polling while supported providers and other operations are unchanged. It introduces no schema, infrastructure, security-sensitive, product-default, or static-analysis changes.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
3cf3aeec-06d1-49b8-880b-b8632cb4881e
📥 Commits
-
Reviewing files that changed from the base of the PR and between 6524a8d43795dc543f7cfb572388cdea3662ad48 and 8793d804a19767b9134fe3a7d6da51793bda7bed.
📒 Files selected for processing (2)
-
apps/server/src/sourceControl/SourceControlProviderRegistry.test.tsapps/server/src/sourceControl/SourceControlProviderRegistry.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
📝 Walkthrough
-
The unknown source control provider now returns an empty change-request list. A test verifies this result for a repository with an unrecognized remote host.
Changes: Unknown Provider Handling
Layer / File(s) Summary Unknown provider result
apps/server/src/sourceControl/SourceControlProviderRegistry.ts,apps/server/src/sourceControl/SourceControlProviderRegistry.test.tsThe unknown provider returns an empty change-request list. Other unsupported provider kinds still return an unregistered-provider error. A test covers the unrecognized-host case. Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge
### Architecture SummaryMerge Risk: ⚪ Minimal · up to
8793d-
Unknown-provider lookups now return a normal no-match result; no concrete merge-blocking risk remains.
Architecture risk: 🔵 Low · up to
8793dThe change affects 1 system.
Changed systems:
apps/serverArchitecture concerns No architecture-level concerns identified.
Review details
-
Systems and components
- observed — apps/server (service) was modified; 2 changed files map to changed impact.
Before / after behavior
- observed — Modified behavior in apps/server/src/sourceControl/SourceControlProviderRegistry.test.ts: Adds a test for an unrecognized-host remote, asserting that resolution yields the
unknownprovider and listing change requests formasterin theallstate returns an empty array. - observed — Modified behavior in apps/server/src/sourceControl/SourceControlProviderRegistry.ts:
unsupportedProvidernow succeeds with an empty change-request list for the"unknown"provider; other provider kinds still produce the existing unregistered-provider error.
Pre-merge checks:
4-
Passed checks: 4 passed-
Check name Status Explanation Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Title check The title clearly and concisely describes the primary change: preventing repeated PR status lookup failures for repositories on unrecognized hosts. Description check The description covers the problem, expected behavior, implementation, scope, reproduction, focused test results, observed production effect, issue references, and agent disclosure. It does not use th…
-
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
juliusmarminge merged thise0de586
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes