Skip to content

fix(server): clarify undetected source control provider errors - #19716

Closed
Guria wants to merge 1 commit into
pingdotgg:mainfrom
Guria:fix/19667-undetected-source-control-error
Closed

Guria wants to merge 1 commit into
pingdotgg:mainfrom
Guria:fix/19667-undetected-source-control-error

Conversation

@Guria

@Guria Guria commented Oct 15, 2026

Copy link
Copy Markdown

Problem

When T3 cannot detect a project's source-control provider, explicit provider operations report No unknown source control provider is registered. This treats an undetected provider as a named provider with a missing registration instead of explaining the detection failure.

Resolve the provider for a repository with no remotes, then call getChangeRequest with reference #42. The error changes from:

Source control provider unknown failed in getChangeRequest: No unknown source control provider is registered.

to:

Source control operation getChangeRequest failed: Could not detect the source control provider for this project.

Change

Choose the fallback error detail once based on whether the provider is undetected or named but unregistered. Apply it to all seven fallback operations. The shared contract formatter omits unknown from the user-facing provider name while preserving the failed operation and the structured provider, cwd, repository, and reference fields.

The contract change is needed because the old formatter would otherwise still prefix the corrected detail with Source control provider unknown. Named-provider messages stay unchanged. Tests cover both fallback cases and error encoding/decoding used across clients.

Scope and approval

Fixes #19667. Maintainer confirmation and invitation to submit this wording fix.

This PR changes only error wording. It does not change provider detection, lookup results, or warning frequency. #19030 handles the empty-list fallback for unknown-host change-request lookups separately; the remaining explicit operations still need this message correction.

No client-specific UI or documentation change is needed. The error schema fields are unchanged.

Verification

Checked on Linux x86_64 with Node.js v24.21.0, based on current upstream main.

vp test run apps/server/src/sourceControl/SourceControlProviderRegistry.test.ts packages/contracts/src/sourceControl.test.ts apps/server/src/sourceControl/SourceControlRepositoryService.test.ts

All 36 tests across 3 files pass. The registry regression resolves a repository with no remotes and exercises all seven fallback operations, checking the detection explanation and failed operation. A named, unregistered provider retains its registration explanation. The contract tests verify the exact unknown and GitHub message formats before and after schema encoding/decoding, with request context preserved. Existing repository-service tests also pass.

vp run --filter @t3tools/contracts --filter t3 --concurrency-limit 2 typecheck

Both package type checks pass.

vp lint apps/server/src/sourceControl/SourceControlProviderRegistry.ts apps/server/src/sourceControl/SourceControlProviderRegistry.test.ts packages/contracts/src/sourceControl.ts packages/contracts/src/sourceControl.test.ts --report-unused-disable-directives
vp fmt --check apps/server/src/sourceControl/SourceControlProviderRegistry.ts apps/server/src/sourceControl/SourceControlProviderRegistry.test.ts packages/contracts/src/sourceControl.ts packages/contracts/src/sourceControl.test.ts
git diff --check

Lint exits successfully with one pre-existing empty-import warning at SourceControlProviderRegistry.ts:12. Formatting and whitespace checks pass.

No browser, desktop, mobile, remote-connection, or live hosting-service verification was run. This is a backend/shared-contract wording change; the focused tests use mocked external dependencies. No repo-wide checks were run.

Model: codex/gpt-6.1-sol, xhigh reasoning effort. Harness: Codex in T3 Code.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T02:32:25.657819Z b2dcdae PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Oct 15, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at b2dcdae

Macroscope's review found this PR approvable — This is a focused error-message correction that preserves provider detection, operation behavior, structured fields, and named-provider output. The added tests cover all fallback operations and transport formatting, with no production defaults or static-analysis configuration changes.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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: 514b057a-d220-482a-947f-b9489b7ad255
📥 Commits

Reviewing files that changed from the base of the PR and between ec1313c and b2dcdae.

📒 Files selected for processing: 4
  • apps/server/src/sourceControl/SourceControlProviderRegistry.test.ts
  • apps/server/src/sourceControl/SourceControlProviderRegistry.ts
  • packages/contracts/src/sourceControl.test.ts
  • packages/contracts/src/sourceControl.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

Errors for an undetected source-control provider now explain that the provider could not be detected. Errors for other unavailable providers retain their registration detail. Tests cover seven unsupported operations and error transport round trips.

Changes: Source-control provider errors

Layer / File(s) Summary
Provider error details and messages
packages/contracts/src/sourceControl.ts, apps/server/src/sourceControl/SourceControlProviderRegistry.ts, apps/server/src/sourceControl/SourceControlProviderRegistry.test.ts, packages/contracts/src/sourceControl.test.ts
Unknown-provider errors use generic source-control failure wording and a detail that states the provider could not be detected. Other provider kinds retain the registered-provider detail and message format. Tests cover seven unsupported operations and transport encoding and decoding.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to b2dcd

The tests protect the clearer provider errors, and no actionable merge-blocking issue remains after normal checks.

Pre-merge checks: Passed 4
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: clarifying errors for undetected source-control providers.
Description check Passed The description covers the problem, change, scope and approval, and verification. It includes the linked issue, maintainer approval, focused test results, type checks, lint and formatting results, and…
Linked Issues check Passed Direct issue #19667 requires a clear error for an undetected provider, a distinction from a named unregistered provider, and the failed operation. unsupportedProvider selects the detection detail fo…
Out of Scope Changes check Passed The changes stay within issue #19667. Production changes only select fallback error wording and format the shared error message. Registry and contract tests directly verify the required wording, opera…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@maria-rcks

Copy link
Copy Markdown
Collaborator

Note

Written by claude-opus-5-5 on behalf of Maria

Thanks for this. I'm closing it as part of PR triage. Right now we're only taking focused bug fixes from outside contributors (see Read this first), and this PR is not one.

From the review: This only changes the wording of undetected source control provider errors; provider detection and operation behavior stay the same. Copy changes need prior maintainer agreement.

If you think this was a mistake, message me on Twitter at @maria_rcks and I'll take another look.

@maria-rcks maria-rcks closed this Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Undetected source-control provider produces misleading "unknown provider" error

2 participants