Preserve variables when switching branches on run pipelines page

What does this MR do and why?

Preserve variables when switching branches on run pipelines page

References

Fixes: #486983 (closed)

Screenshots or screen recordings

Before After
Screen Recording 2025-11-21 at 23.14.39.mov Screen Recording 2025-11-21 at 23.15.35.mov

How to set up and validate locally

  1. Checkout this branch gitlab-community/gitlab-org/gitlab:fix/preserve-pipelines-variables-on-branch-change
  2. Run gdk locally gdk start
  3. Open any project
  4. Go to Pipelines page Build > Pipelines
  5. Click New pipeline button
  6. Enter few variables
  7. Try changing the branch from branch selector
  8. Notice the variables will persist now

Merge request reports

Loading