Revert "Preserve variables when switching branches on run pipeline page"

What does this MR do and why?

This MR reverts Preserve variables when switching branches on r... (!213718 - merged). It turned out the issue for preserving pipeline variables was not refined well enough, and this change disrupted our customers' workflow. We need to revert it temporarily until we design a proper UX.

References

Screenshots or screen recordings

Screen_Recording_2025-12-11_at_11.41.25

How to set up and validate locally

Prerequisites

  1. Create a project with a .gitlab-ci.yml configuration on main branch:
variables:
  TEXT:
    value: "MAIN-VAR"
    description: "desc"

test_job:
  script:
    - echo "test"
  1. Create a feature branch with a different .gitlab-ci.yml:
variables:
  TEXT:
    value: "FEATURE-VAR"
    description: "desc"

test_job:
  script:
    - echo "test"
  1. Create a no-variables branch with a .gitlab-ci.yml that has no variables:
test_job:
  script:
    - echo "test"

Test Steps

  1. Navigate to Build → Pipelines → New pipeline
  2. Verify the variables are changing for each ref
  3. Try creating a new variable on the UI, switch to another ref, and verify the variable was not preserved

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #486983 (closed)

Edited by Anna Vovchenko

Merge request reports

Loading