Remove duplicate querystring parameters from the batch diffs endpoint
What does this MR do?
For #215952 (closed)
The above issue seems to only happen in production, so while I believe this MR is the fix, I don't have any way to replicate it.
In any case, this MR updates the fetch for batched diff files to use mergeUrlParams
like the similar, non-batched request above it. Even if this doesn't fix the bug, it's a nice improvement to consistency.
This MR also adds two tests that check to see if the action is calling the appropriate endpoints WITHOUT duplicate parameters (one for split diff feature flag and one without). In theory, duplicate query parameters is the source of the bug in the issue, and this should be the fix.
Finally, the MR updates some existing tests to also use mergeUrlParams
. The MockAdapter is very particular about how it's set up, so onGet( endpoint, { params: { x: "y" } } )
fails when the call is actually endpoint?x=y
. Similarly, mergeUrlParams
assigns the parameters to the resulting URL in insert order, so we have to place page
last in a few cases, since it's inserted last in the actual action.
Screenshots
N/A, all ~backstage
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers - [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team