Skip to content

Comments created with LinePositionOptions do not show line range in Gitlab

When creating a merge request discussion, client-go only allows specifying the LineCode and Type for a comment position. When these LinePositionOptions are used in gitlab.nvim (a Neovim plugin for managing Gitlab reviews) to create a comment, the line range of the comment is not correctly shown in Gitlab, leading to this issue in gitlab.nvim/Gitlab.

The Gitlab API in contrast seems to also support specifying old_line and new_line in the line range position data. Interestingly, when I create a ranged comment in Gitlab, in the developer tools of my browser, I can see that Gitlab uses the notes endpoint, rather than the discussions endpoint to create the comment image even if the documentation for merge request notes states that "Notes are not attached to specific lines".

Would it be possible to extend LinePositionOptions in client-go to also support the OldLine and NewLine parameters if that would fix the problem with missing line information in Gitlab?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information