Skip to content

Improve in-stackrox-repo check, remove TODO#226

Merged
mclasmeier merged 6 commits into
mainfrom
mc/stackrox-repo-check
Jul 6, 2026
Merged

Improve in-stackrox-repo check, remove TODO#226
mclasmeier merged 6 commits into
mainfrom
mc/stackrox-repo-check

Conversation

@mclasmeier

@mclasmeier mclasmeier commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

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 .git suffix. Fixes #91.

Summary by CodeRabbit

  • Bug Fixes
    • Improved repository detection so the app recognizes StackRox GitHub remotes in more common URL formats.
    • Support now includes both SSH and HTTPS remote URLs, with or without a .git suffix, reducing false negatives.

@mclasmeier mclasmeier requested a review from porridge June 30, 2026 09:23
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@mclasmeier, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Enterprise

Run ID: ede9fcb4-85e3-4720-ac9d-62df63261072

📥 Commits

Reviewing files that changed from the base of the PR and between acc9fee and 411c386.

📒 Files selected for processing (2)
  • internal/env/env.go
  • internal/helpers/tag.go
📝 Walkthrough
📝 Walkthrough
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the main change to stackrox repo detection.
Linked Issues check ✅ Passed The PR addresses #91 by removing the TODO and updating repository detection as requested.
Out of Scope Changes check ✅ Passed The changes stay focused on repo detection logic and tests, with no unrelated additions.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mc/stackrox-repo-check

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
internal/env/env.go (1)

330-334: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Matching 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 using ssh://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

📥 Commits

Reviewing files that changed from the base of the PR and between 189e745 and 51412bd.

📒 Files selected for processing (1)
  • internal/env/env.go

@mclasmeier mclasmeier force-pushed the mc/stackrox-repo-check branch from 51412bd to efb31a0 Compare June 30, 2026 09:36
Comment thread internal/env/env.go Outdated
@mclasmeier mclasmeier force-pushed the mc/stackrox-repo-check branch from 629ec20 to 9de8b01 Compare July 2, 2026 07:03

@porridge porridge left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo a few comments.

Comment thread internal/env/env.go
Comment thread internal/env/env.go Outdated
Comment thread internal/helpers/tag.go Outdated
mclasmeier and others added 2 commits July 6, 2026 12:08
Co-authored-by: Marcin Owsiany <porridge@redhat.com>
Co-authored-by: Marcin Owsiany <porridge@redhat.com>
@mclasmeier mclasmeier merged commit 9e28369 into main Jul 6, 2026
20 of 21 checks passed
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.

Address review of AI-generated code

2 participants