Allow users to work on non-default branch in pipeline editor
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_nameURL parameter to set thecurrentBranchof the pipeline editor. This value replaces thedefaultBranchvariable. -
currentBranchis 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)
On a non-default branch (using branch_name param)
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
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers - [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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

