Skip to content

fix(shared): improve config validation error message for local git connections#1047

Closed
shobhitsahani wants to merge 1 commit intosourcebot-dev:mainfrom
shobhitsahani:fix/improve-local-git-error-message
Closed

fix(shared): improve config validation error message for local git connections#1047
shobhitsahani wants to merge 1 commit intosourcebot-dev:mainfrom
shobhitsahani:fix/improve-local-git-error-message

Conversation

@shobhitsahani
Copy link
Copy Markdown

@shobhitsahani shobhitsahani commented Mar 26, 2026

When a user configures a local git connection with a file:// URL but forgets to mount the repo into the Docker container, the error thrown is raw AJV output which is hard to understand.

This PR appends a plain-English hint to the error when a file:// URL is detected, telling the user to mount the repo and use the container-internal path.

Fixes #1044

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced configuration validation error messages. When configuration validation fails and local file connections are detected, the system now provides additional guidance about mounting local repositories into Docker containers and using the correct container-internal file paths.

…nnections

When a file:// URL is detected in a failing connection, append a hint
to the error message explaining that the repository must be mounted
into the Docker container and the URL must reflect the container-internal
path, not the host machine path.

Fixes sourcebot-dev#1044
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6d46d171-f0b1-4b1f-9396-898c61ee2aa4

📥 Commits

Reviewing files that changed from the base of the PR and between abcb180 and b680faa.

📒 Files selected for processing (1)
  • packages/shared/src/env.server.ts

Walkthrough

The change enhances error handling in loadConfig by detecting when configuration validation fails due to file:// URL connections and appending a contextual hint message. This hint guides users to mount local repositories into Docker containers and use container-internal paths.

Changes

Cohort / File(s) Summary
Error Message Enhancement
packages/shared/src/env.server.ts
Detects file:// protocol URLs in connection configurations when validation fails, appends helpful hint to error message about Docker container path mounting and configuration best practices.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: improving the config validation error message for local git connections with file:// URLs.
Linked Issues check ✅ Passed The PR adds a plain-English hint to validation errors when file:// URLs are detected, directly addressing issue #1044's objective of providing clearer guidance for local git connections.
Out of Scope Changes check ✅ Passed The changes are limited to improving error messaging in env.server.ts when file:// connections are present, which is directly within the scope of issue #1044.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@msukkari
Copy link
Copy Markdown
Contributor

msukkari commented Mar 26, 2026

This is logging a hint when we're validating the schema of the config and not when we actually try to pull the local github repo.

@msukkari msukkari closed this Mar 26, 2026
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.

Not able to read local repo

2 participants