Skip to content

fix(gitlab): keep merge request diffs within a source's code scope and search project commits on basic search - #10551

Merged
waleedlatif1 merged 4 commits into
stagingfrom
fix/gitlab-audit-followups
Dec 1, 2026
Merged

waleedlatif1 merged 4 commits into
stagingfrom
fix/gitlab-audit-followups

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Follow-ups to #10533 from an independent review, each validated against the code first:

  • Merge request reads now respect the source's code scope. A source without code shows no diff and no diff-line threads; a source limited to a path or file types shows only diffs (and diff threads) whose every path is in scope, so a rename out of a hidden path is not shown; a source limited to a ref shows diffs only for merge requests into that ref. A short line says when changes are left out
  • Project-scoped commit search runs under basic search; only group-wide commit search needs advanced search. Undated project searches search first and keep the 400/422 listing fallback; dated searches list, since the search API filters neither by date nor oldest first. The messages no longer claim Premium is required for a project
  • Commits are dated by commit date, the date GitLab's since/until filter on, so rebased or cherry-picked commits are not dropped by the date post-filter; the guide text says commit date
  • Ref-pinned sources: commits a ref-scoped search or listing returned carry that ref as evidence and skip the merge-base check; any other commit is checked once per session, recorded under both its short and full SHA, so a read's second verification does not spend another request
  • Diff paging stops when a page adds no file already listed, for instances that ignore page/per_page
  • Nits: one helper decides whether a commit search lists (no && project double check), the kind is narrowed once in verification, and the source project lookup uses gitLabProjectPath

Type of Change

  • Bug fix

Testing

  • bun run --cwd apps/sim test lib/sim-search connectors/gitlab: 53 files, 628 tests pass
  • New tests, each shown red by reverting its fix: project commit search without consulting advanced search; dated listing window and commit-date dating; diff and diff-thread scoping by path (incl. renames), no-code sources (no diff request), and ref-pinned sources (no diff request); repeated diff page stops; ref-scoped evidence skips merge-base and short/full SHA share one check; no-code sources read with a null code scope; listed commits carry ref evidence
  • bun run lint, bun run generate (no drift), check:comment-hygiene, check:test-patterns, check:utils, check:explicit-any, check:api-validation:strict, check:boundaries; 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 8:49am 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 blocking issue remains.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issue remains.

Summary

The PR keeps GitLab merge request diffs and diff threads within the source’s code scope. It also enables project commit search under basic search and uses commit dates for date filters.

  • Merge request reads only show diffs inside a source’s code scope.
  • Project commit searches work without advanced search.
  • Diff reads stop when a page repeats the same files.
  • Ref-scoped commit results can skip repeat history checks.

Reviews (4) · Last reviewed commit: "test(gitlab): read through the real read..." · Reviewed by Greptile

Comment thread apps/sim/lib/sim-search/live/gitlab.ts Resolved
Comment thread apps/sim/lib/sim-search/live/gitlab.ts Resolved
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 5 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
Comment thread apps/sim/lib/sim-search/live/gitlab.ts Resolved
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 5 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.

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

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

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit e0ae4c4 into staging Dec 1, 2026
84 checks passed

This branch was previously deployed

1 inactive deployment
Preview — 77cc0d2d 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