Conversation
Implemented automatic server URL detection to support self-hosted GitHub instances, matching the jest-coverage-comment implementation exactly. - serverUrl is automatically calculated from context.serverUrl - Falls back to 'https://github.com' for standard GitHub - Updated repoUrl construction to use serverUrl for file links - Added logging to show which GitHub URL is being used This allows users running GitHub Enterprise Server or other self-hosted GitHub instances to have coverage report links point to the correct server automatically, without requiring any additional configuration.
WalkthroughThe change modifies Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Pull Request Overview
This PR implements automatic server URL detection to support self-hosted GitHub instances (like GitHub Enterprise Server). The change ensures that coverage report file links point to the correct GitHub server without requiring additional configuration.
- Introduced automatic detection of GitHub server URL via
context.serverUrl - Updated repository URL construction to use the detected server URL
- Added informational logging to show which GitHub URL is being used
Reviewed Changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/index.js | Added serverUrl extraction from context with fallback to standard GitHub, updated repoUrl construction, and added logging |
| dist/index.js | Compiled version of the source file changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/index.js (1)
203-203: Fix branding inconsistency.The log message uses "Github" but the correct branding is "GitHub" (with capital H).
Apply this diff:
- core.info(`Uses Github URL: ${serverUrl}`); + core.info(`Uses GitHub URL: ${serverUrl}`);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
dist/index.jsis excluded by!**/dist/**
📒 Files selected for processing (1)
src/index.js(2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
src/**/*.js
📄 CodeRabbit inference engine (CLAUDE.md)
Run ESLint on all JavaScript source files under src
Files:
src/index.js
src/{utils,index}.js
📄 CodeRabbit inference engine (CLAUDE.md)
Enforce GitHub comment maximum length of 65,536 characters when creating/updating PR comments
Files:
src/index.js
src/index.js
📄 CodeRabbit inference engine (CLAUDE.md)
src/index.js: Support filtering to show only changed files in the current commit when generating reports/comments
Use comment watermarking to update an existing PR comment instead of creating duplicates
Generate an HTML coverage report with repository file links for inclusion in the PR comment
Files:
src/index.js
🧠 Learnings (3)
📚 Learning: 2025-08-30T12:36:01.248Z
Learnt from: CR
Repo: MishaKav/pytest-coverage-comment PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-08-30T12:36:01.248Z
Learning: Applies to src/index.js : Generate an HTML coverage report with repository file links for inclusion in the PR comment
Applied to files:
src/index.js
📚 Learning: 2025-08-30T12:36:01.248Z
Learnt from: CR
Repo: MishaKav/pytest-coverage-comment PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-08-30T12:36:01.248Z
Learning: Applies to src/index.js : Use comment watermarking to update an existing PR comment instead of creating duplicates
Applied to files:
src/index.js
📚 Learning: 2025-08-30T12:36:01.248Z
Learnt from: CR
Repo: MishaKav/pytest-coverage-comment PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-08-30T12:36:01.248Z
Learning: Applies to src/{utils,index}.js : Enforce GitHub comment maximum length of 65,536 characters when creating/updating PR comments
Applied to files:
src/index.js
🔇 Additional comments (1)
src/index.js (1)
235-235: Verification complete—no issues found.The dynamic serverUrl construction at line 235 correctly propagates through the codebase. The parse functions in
src/parse.js(lines 299, 331) properly use theoptions.repoUrlparameter passed fromsrc/index.js, ensuring self-hosted instance support is maintained. The hardcoded URL at line 106 is documentation text in a help message, which is appropriate. No functional hardcoded GitHub URLs remain in the coverage report generation logic.
Implemented automatic server URL detection to support self-hosted GitHub instances
This allows users running GitHub Enterprise Server or other self-hosted GitHub instances to have coverage report links point to the correct server automatically, without requiring any additional configuration.