Improve in-stackrox-repo check, remove TODO#226
Conversation
|
Warning Review limit reached
Next review available in: 58 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 Walkthrough📝 Walkthrough🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
internal/env/env.go (1)
330-334: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueMatching is limited to two exact URL forms.
The helper only matches the scp-style SSH form (
git@github.com:stackrox/stackrox) and the plain HTTPS form. Remotes usingssh://git@github.com/stackrox/stackrox, a trailing slash, or differing host case would not match and fall through to the default tag path. If those forms are realistic in your environments, consider normalizing further; otherwise this is fine as-is.🤖 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 `@internal/env/env.go` around lines 330 - 334, The repository remote check in isStackRoxRepositoryRemote is too strict and only matches two exact URL forms. Update this helper to normalize additional realistic remote variants, such as ssh://git@github.com/stackrox/stackrox, an optional trailing slash, and host/path case differences, before comparing so valid StackRox remotes don’t fall through to the default tag path.
🤖 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.
Nitpick comments:
In `@internal/env/env.go`:
- Around line 330-334: The repository remote check in isStackRoxRepositoryRemote
is too strict and only matches two exact URL forms. Update this helper to
normalize additional realistic remote variants, such as
ssh://git@github.com/stackrox/stackrox, an optional trailing slash, and
host/path case differences, before comparing so valid StackRox remotes don’t
fall through to the default tag path.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Enterprise
Run ID: b2a0b774-222a-4ac2-a905-079f705c8b37
📒 Files selected for processing (1)
internal/env/env.go
51412bd to
efb31a0
Compare
629ec20 to
9de8b01
Compare
porridge
left a comment
There was a problem hiding this comment.
LGTM modulo a few comments.
Co-authored-by: Marcin Owsiany <porridge@redhat.com>
Co-authored-by: Marcin Owsiany <porridge@redhat.com>
Fix stackrox repository detection for forks and HTTPS clones
Check all remotes instead of only
origin, and match both SSH and HTTPS URL variants with and without.gitsuffix. Fixes #91.Summary by CodeRabbit
.gitsuffix, reducing false negatives.