Skip to content

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

Loading