Skip to content

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

Availability and Testing

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
Edited by 🤖 GitLab Bot 🤖

Merge request reports