Skip to content
Snippets Groups Projects

Update GitLab domFunctions to use new interop

Created by: souldzin

Description

This upstream PR is the final step to fixing an issue with GitLab/Sourcegraph integration for MR diffs.

What's the issue?

GitLab has semi-recently changes it's HTML structure which quite broke the ability for Sourcegraph to parse what's going on.

What was the fix?

In this MR we are introducing much friendlier interoperability attributes. This PR updates domFunctions to use those attributes. It falls back to the legacy behavior so that the extension can work for older versions of self-hosted GitLab instances.

Screenshots

Here's some screenshots demoing that this fixes the MR diff integration:

Legacy <table> layout:

inline parallel (left) parallel (right)
legacy_inline legacy_parallel_lhs legacy_parallel_rhs

New CSS grid layout:

inline (old) inline (new) inline (no change) parallel (left) parallel (right)
unified_inline_old unified_inline_new unified_inline_no_change unified_parallel_lhs unified_parallel_rhs

TODO

  • Update the split.html and unified.html snapshot once the GitLab MR is merged and deployed. This PR's tests will fail because the new HTML fixtures do not yet include the interoperability attributes. This test failure actually "catches" the bug.

Merge request reports

Approval is optional

Merged by avatar (Nov 11, 2025 7:39am UTC)

Merge details

  • Changes merged into main with 6e68b35b.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Created by: souldzin

    @felixfbecker could you please review this PR which addresses a long-standing GitLab/Sourcegraph integration issue? Checkout the description for details :smile:

    Please note the TODO in the PR description and that it's expected some tests will fail.

  • Created by: felixfbecker

    Hi @souldzin, I requested review from the appropriate team :) Thanks for the PR!

  • Created by: souldzin

    Thanks for checking this out @tjkandala! Since this GitLab MR has been merged and deployed, I just finished this TODO in the PR description :point_down:

    • Update the split.html and unified.html snapshot once the GitLab MR is merged and deployed. This PR's tests will fail because the new HTML fixtures do not yet include the interoperability attributes. This test failure actually "catches" the bug.

    I would expect the PR checks to have all passed now? :thinking:

    @tjkandala I think this is ready to merge, but please let me know if there's anything I need to do. Thank you! :bow:

    side note: I also updated the description with some screenshots of testing this integration locally across old/new versions of GitLab.

  • Created by: tjkandala

    Hey @souldzin, thanks for the screenshots! I triggered a build and it looks like the following checks are failing:

    • yarn -s run eslint in client/browser (seems like a variable name length issue)
    • yarn test in client/browser (a couple snapshots are missing, generating them locally should fix the issue)

    After those are resolved, this should be good to merge!

  • Created by: souldzin

    After those are resolved, this should be good to merge!

    @tjkandala thanks so much! Resolved the lint issue and missing snapshots in the latest commit.

    Back to you! :soccer:

  • Created by: souldzin

    and the PR is ready to merge

    Thanks so much @tjkandala! Let me know if there's anything needed from my end :smile:

Please register or sign in to reply
Loading