fix(probe): reject scheme-less endpoint URLs#56
Conversation
📝 WalkthroughWalkthroughThis PR validates OTLP endpoint URLs by rejecting scheme-less addresses. The ChangesEndpoint URL scheme validation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/probe.test.ts`:
- Around line 35-36: Remove the redundant assertion
`expect(result.error).toBeDefined()` in tests/probe.test.ts; the existing
`expect(result.error).toContain("invalid endpoint URL")` already implies
`result.error` is defined, so delete the `expect(result.error).toBeDefined()`
line to avoid duplication.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f154f78f-6b68-4947-967b-1e572adf01c2
📒 Files selected for processing (3)
README.mdsrc/probe.tstests/probe.test.ts
| expect(result.error).toContain("invalid endpoint URL") | ||
| expect(result.error).toBeDefined() |
There was a problem hiding this comment.
Remove redundant assertion.
Line 36 checking result.error is defined is redundant because line 35 already validates that result.error contains the string "invalid endpoint URL", which implicitly confirms it is defined.
🧹 Proposed fix to remove redundant assertion
expect(result.error).toContain("invalid endpoint URL")
- expect(result.error).toBeDefined()📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| expect(result.error).toContain("invalid endpoint URL") | |
| expect(result.error).toBeDefined() | |
| expect(result.error).toContain("invalid endpoint URL") |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/probe.test.ts` around lines 35 - 36, Remove the redundant assertion
`expect(result.error).toBeDefined()` in tests/probe.test.ts; the existing
`expect(result.error).toContain("invalid endpoint URL")` already implies
`result.error` is defined, so delete the `expect(result.error).toBeDefined()`
line to avoid duplication.
Summary
OPENCODE_OTLP_ENDPOINTmust include a schemeTesting
Fixes #45
Summary by CodeRabbit
Release Notes
Documentation
OPENCODE_OTLP_ENDPOINTrequires full URLs with schemes (e.g.,http://localhost:4317). Scheme-less values likelocalhost:4317are no longer accepted.Bug Fixes