Fix non-default MR version review in file-by-file mode
What does this MR do and why?
For #408712 (closed)
When we get the endpoint for an individual file from the Rails page, it doesn't include any of the page context (like whitespace settings, diff ID, version information, etc.).
So this change extracts what we can from the URL and mixes those into the actual fetch call, to be appended to the "bare" URL.
This enables the MR controls like the version selector and toggling whitespace.
Screenshots or screen recordings
Before | After |
---|---|
How to set up and validate locally
Please see the reproduction discussion in the associated issue.
Summary:
- Create an MR with at least one commit
- Amend a commit and push it to create a new version
- Repeat above step a couple more times to have multiple versions
- With "View files one at a time" (file-by-file) enabled, try to view a version combination that is not base => head (e.g. of 5 versions, view version 2 => version 4)
- Note: with fix - the range is respected, without fix - you are always viewing the full changeset between base and head.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Thomas Randolph