Skip to content

Allow users to work on non-default branch in pipeline editor

Mireya Andres requested to merge pipeline-editor-branch-param into master

What does this MR do?

For issue #321652 (closed)

Users can set the branch_name URL parameter to set the branch where the pipeline editor will pull the CI config file from. Changes to the config file will be committed to this branch by default. In the absence of this parameter, the pipeline editor will use the default branch (currently master).

This is an iterative step for creating the branch selector UI on the pipeline editor, which will be addressed in future merge requests.

Dev Notes

  • Adds branch_name URL parameter to set the currentBranch of the pipeline editor. This value replaces the defaultBranch variable.
  • currentBranch is saved in apollo cache since it can be updated by a client mutation later on when we implement the branch switcher. It's also part of the global state of the app, so storing it here makes data retrieval easier.

Screenshots

On the default branch (no query params)

Default Branch

On a non-default branch (using branch_name param)

Non-Default Branch

Test Recording

Committing from a non-default branch

This shows that the CI config from the non-default branch is loaded, and that changes will be committed to that same branch. Committing from a non-default branch

Creating a new merge request from non-default branch Creating a new merge request from non-default branch

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 Mireya Andres

Merge request reports