Skip to content

feat(gitlab): search commits and read merge requests with their discussion and diff - #10533

Merged
waleedlatif1 merged 3 commits into
stagingfrom
feat/gitlab-commits-mr-read
Dec 1, 2026
Merged

waleedlatif1 merged 3 commits into
stagingfrom
feat/gitlab-commits-mr-read

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • GitLab live search gets a commits kind. Commit search needs advanced search; on instances without it (detected from application settings, or from GitLab rejecting the scope) a project-scoped commit search lists recent commits and matches their messages, and a group search moves on to its projects. Date filters list commits by author date; oldest-first is refused
  • Commits are opt-in: a search without a kind still covers issues, merge requests and code (and a source's wiki), as before
  • A source limited to one branch keeps commit search and listing on that branch (explicit ref option on searchGitLab, replacing the URL-sniffing client wrapper), and verifies a commit is on that branch before serving it
  • Commits are served by sources that include code, except where code is limited to a path or file types; their ACL is the repository audience (commit: maps to the repository feature in one shared prefix table)
  • Reading a merge request returns its discussion (diff comments with file and line, resolved state) and its diff; issues return their discussion; commits return their diff. Internal and system notes are left out. Diffs GitLab withholds (too large, collapsed, generated) are named, the diff shares the discussion page and text budget, and instances without the paginated MR diffs endpoint fall back to /changes
  • Reads skip the project lookup they no longer need and fetch item, discussion and diff in parallel
  • GitLab /-/commit/<sha> links resolve to commits; one shared commit-SHA check serves GitLab, GitHub and link parsing

Type of Change

  • New feature

Testing

  • bun run --cwd apps/sim test lib/sim-search connectors/gitlab: 53 files, 620 tests pass
  • New unit tests each shown red by reverting their guard: internal-note filter, withheld diffs, diff text cap, legacy /changes fallback, advanced-search fallback, scope-rejection fallback, group refusal status, oldest-first refusal, SHA validation, commit ACL prefix, branch refs check, branch ref passing, path-limited sources excluding commits, opt-in default kinds, commit link parsing
  • gitlab-federated.integration.ts extended with commits search/read and a merge request read (discussion, diff, no internal notes) against the disposable self-hosted GitLab fixture; that suite only runs when the fixture is provided
  • bun run lint, bun run generate (no drift), check:comment-hygiene, check:test-patterns, check:utils, check:explicit-any (baseline shrunk), check:api-validation:strict; full type-check and audits left to CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Dec 1, 2026 5:04am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no new blocking issues were found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new blocking issues were found.

Summary

Adds opt-in GitLab commit search and richer document reads.

  • GitLab searches can find commits when callers ask for them.
  • GitLab reads now include discussions and code changes.
  • GitLab commit links can open matching commit records.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Commit search] --> B{Advanced search available?}
  B -->|Yes| C[Search commit messages]
  B -->|No| D[List and match recent commits]
  C --> E[Check source scope and reader access]
  D --> E
  E --> F[Return allowed results and coverage status]
  F --> G[Read commit and diff]
Loading

Reviews (3) · Last reviewed commit: "fix(gitlab): report a commit listing tha..." · Reviewed by Greptile

Comment thread apps/sim/lib/sim-search/live/gitlab.ts Resolved

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 14 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/sim-search/live/gitlab.ts Resolved
Comment thread apps/sim/lib/sim-search/live/gitlab.ts Resolved
…ngs without gaps, refuse dot-segment projects
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 15 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/sim-search/live/gitlab.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 15 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/sim-search/live/gitlab.ts Resolved
Comment thread apps/sim/lib/sim-search/live/gitlab.ts Resolved
@waleedlatif1
waleedlatif1 merged commit 0c4ac4a into staging Dec 1, 2026
87 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/gitlab-commits-mr-read branch December 1, 2026 07:17

This branch was previously deployed

1 inactive deployment
Preview — 6cc67d65 Deployed Dec 1, 2026 by vercel[bot]
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.

1 participant