Fix redeploy button behavior

What does this MR do and why?

Describe in detail what your merge request does and why.

This MR fixes the redeploy button not starting a deployment job

As it turned out, the initial guess mentioned in #361616 (closed) that the problem was related to incorrect event listener turned out to be wrong. While investigating the issue, I realised the event was triggered properly. However, the mutation that was triggering the POST request to the API to re-trigger the deploy job was lacking some parameters (specifically retryUrl parameter). AXIOS simply ignores the request, if the url is null or undefined, so no errors were caught here, but also no request was fired. It turned out, that retryUrl is not a part of environment object that we work with, so it has to be added manually, which I did in environment_rollback.vue component. Once that has been added, the whole functionality worked.

I agree that it is not super straightforward, so I plan to create a follow-up issue, to refactor this part, to be less reliant on passing the parameters from component to component manually. That is however blocked by #23036 (closed) as the component is shared between these two pages.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

No UI changes were made.

Here's how the page looks like: Screenshot_2022-11-02_at_17.17.38

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Go to a Project with set-up deployments
  2. Go to Environments page
  3. Click on a dropdown button and select Re-deploy to environment
  4. Expand the environment details. At some point the deployment ID should be updated

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Andrei Zubov

Merge request reports

Loading