Skip to content

MM-70042: Improve project handling in the GitLab integration - #690

Merged
edgarbellot merged 2 commits into
masterfrom
fix/MM-70042
Aug 3, 2026
Merged

MM-70042: Improve project handling in the GitLab integration#690
edgarbellot merged 2 commits into
masterfrom
fix/MM-70042

Conversation

@edgarbellot

@edgarbellot edgarbellot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

See MM-70045 for more details.

Fixed an issue with project handling in the GitLab integration.

Change Impact: 🟡 Medium

Reasoning: The change adds extra namespace/group gating to GitLab project retrieval and permalink preview generation, which directly affects user-facing project access and code preview behavior across multiple components. Existing automated tests cover the primary in-group/out-of-group/unconfigured scenarios, but there’s still moderate risk of blocking or altering edge-case namespaces.

Regression Risk: Moderate—behavior changes occur in core GitLab integration logic (project fetching and permalink processing), and failures in the new validation could impact previews even when the initial fetch succeeds.

QA Recommendation: Perform focused manual QA for in-group vs out-of-group vs unconfigured GitlabGroup permutations, especially around permalink preview expansion. Skipping manual QA is not recommended due to the user-facing behavioral change, though automated tests should catch many regressions.

Generated by CodeRabbitAI

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@edgarbellot
edgarbellot requested a review from a team as a code owner July 30, 2026 14:46
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

GitLab project retrieval now validates configured group membership. Permalink preview generation applies the same namespace gate, and tests cover blocked, allowed, and unrestricted configurations.

Changes

Namespace gating

Layer / File(s) Summary
Project retrieval group validation
server/gitlab/api.go, server/mcp_test.go
GetProject checks the retrieved project namespace against the configured group and returns errors for disallowed projects; tests cover all group configurations.
Permalink preview group validation
server/permalinks.go, server/permalinks_test.go
processReplacement skips previews for disallowed namespaces while preserving expansion for allowed and unrestricted configurations.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: 2: Dev Review, 3: Security Review

Poem

I’m a bunny guarding paths with care,
Keeping previews out of forbidden lairs.
In-group hops make tokens glow,
No group? Anywhere may go.
GitLab gates now guide the show!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main GitLab project-handling changes and is concise.

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.

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 `@server/mcp_test.go`:
- Around line 408-414: Run gofmt on server/mcp_test.go, including the test block
containing the JSON encoder response, and preserve the resulting formatting
changes so the lint check passes.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ad563221-ddc6-4905-8ad1-9632244a2406

📥 Commits

Reviewing files that changed from the base of the PR and between 6673c91 and e274840.

📒 Files selected for processing (4)
  • server/gitlab/api.go
  • server/mcp_test.go
  • server/permalinks.go
  • server/permalinks_test.go

Comment thread server/mcp_test.go Outdated
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@edgarbellot edgarbellot added the 2: Dev Review Requires review by a core committer label Jul 30, 2026

@nang2049 nang2049 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!

@edgarbellot
edgarbellot merged commit 83b9f5a into master Aug 3, 2026
17 checks passed
@edgarbellot
edgarbellot deleted the fix/MM-70042 branch August 3, 2026 09:21
@edgarbellot edgarbellot added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core committer labels Aug 3, 2026

@cursor cursor 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.

🤖 Automation starting cherry-pick for the following target branches:

  • release-1.12
  • release-1.13

Results will be posted here once all branches are complete.
cc. @edgarbellot

Open in Web View Automation 

@avasconcelos114

avasconcelos114 commented Aug 7, 2026

Copy link
Copy Markdown
Member

(Sorry for the noise, testing a cherry-pick packport automation)

@cursor cursor 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.

🤖 Cherry-pick automation complete for #690.

  • ✅ release-1.12: #696
  • ✅ release-1.13: #697

⚠️ Needs human input: Both cherry-pick PRs were opened, but the Open Pull Request tool could not set base branch, reviewers, or labels.

  • #696: retarget base from masterrelease-1.12; add reviewers edgarbellot, amyblais; add labels Changelog/Not Needed, Docs/Not Needed, Do Not Merge/Awaiting Next Release, AI/Babysit
  • #697: retarget base from masterrelease-1.13; add the same reviewers and labels

cc. @edgarbellot

View PR

Open in Web View Automation 

@cursor cursor 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.

🤖 Automation starting cherry-pick for the following target branches:

  • release-1.12
  • release-1.13

Results will be posted here once all branches are complete.

Open in Web View Automation 

Sent by Cursor Automation: Plugin Cherry-pick Automation

@cursor cursor 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.

🤖 Cannot open backport PRs: the automation's GitHub token is not write-capable.
No branches were cherry-picked.

Open in Web View Automation 

Sent by Cursor Automation: Plugin Cherry-pick Automation

@avasconcelos114

Copy link
Copy Markdown
Member

🤖 Starting cherry-pick of #690 onto the following branches:

  • release-1.12
  • release-1.13

Results will be posted here when complete.

@avasconcelos114

Copy link
Copy Markdown
Member

🤖 Cherry-pick of #690 complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4: Reviews Complete All reviewers have approved the pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants