Skip to content

review(gitlab): preserve finding IDs across shifted discussion lines #2111

Open

Description

@csoceanu

Problem

Stable finding-ID mapping from stamped review threads is currently enabled only for GitHub.

GitLab discussions could not be used safely because fetch-review-threads always returned an unknown is_outdated state, making it impossible to tell whether a reported line still belonged to the current MR diff.

fullsend-ai/fullsend#9695 and PR fullsend-ai/fullsend#9698 add this information. GitLab discussions now return:

  • is_outdated: false with a trusted current line when their diff refs match the current MR;
  • is_outdated: true with no current line when they belong to an older diff;
  • is_outdated: null with no current line when their state cannot be verified.

The Agents review flow still needs to consume this information. Without that follow-up, a GitLab finding may receive a new ID after its line moves even when GitLab successfully traced the existing discussion to the new line.

Requested change

Extend the existing stamped-thread finding-ID mapping to GitLab:

  1. Collect stamped GitLab discussions through fetch-review-threads.
  2. Trust only discussions with is_outdated == false.
  3. Verify that the finding-ID stamp was posted by the authenticated review bot.
  4. Reuse an ID only for a unique current path-and-line match.
  5. Fail closed for outdated, unknown, ambiguous or truncated results.
  6. Preserve the existing GitHub behavior.
  7. Do not reconstruct diffs or attempt to map stale GitLab positions locally.

Acceptance criteria

  • A stamped GitLab discussion traced to a shifted current line preserves its finding ID.
  • An outdated discussion does not preserve its ID.
  • A discussion with is_outdated: null does not preserve its ID.
  • Missing, malformed, human-authored or ambiguous stamps are ignored.
  • Truncated thread or comment results fail closed.
  • Tests cover shifted lines, outdated and unknown positions, bot verification, duplicate mappings and unchanged GitHub behavior.

Dependency

Depends on fullsend-ai/fullsend#9698.

Related:

Activity

  1. self-assigned this
    on Nov 19, 2026
  2. fullsend-ai-triage commented on Nov 19, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 11:47 AM UTC · Completed 11:49 AM UTC

    Commit: f6907db · View workflow run →

    Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.15

  3. fullsend-ai-triage commented on Nov 19, 2026

    @fullsend-ai-triage

    The requested change is clear and well scoped, but it cannot be implemented yet. It depends on the fullsend change that makes fetch-review-threads report is_outdated for GitLab discussions. That change is still open and unmerged, so GitLab results currently always carry an unknown outdated state. Until it lands, extending stamped-thread finding-ID mapping to GitLab would have nothing trustworthy to consume, and failing closed would make it a no-op.

    Once the dependency merges, this issue can be re-triaged. At that point the work would be to extend the existing GitHub-only stamped-thread mapping to GitLab. It would trust only is_outdated == false discussions, verify the stamp was posted by the review bot, reuse an ID only for a unique path-and-line match, and fail closed on outdated, unknown, ambiguous or truncated results. Existing GitHub behavior would stay unchanged.

    Blocked by:

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions