Allow users to work off the non-default branch in the pipeline editor
Problem to solve
As an iterative step towards &5393 (closed) we should add the ability to edit pipeline configs on the non-default branch. There will be no UI to take us here for this step so we'll need to use the URL to identify which branch we're editing.
Proposal
In the single file editor the URI is:
https://[instance].com/[group]/[project]/-/blob/[branch-name]/[filename]
Using that format, we may be able to use the following URI
https://[instance].com/[group]/[project]/-/ci/blob/[branch-name]/editor
However, rails is weird and URIs are weirder so maybe it's easier to use a query string for now.
https://[instance].com/[group]/[project]/-/ci/editor?branch_name=[branch-name]
Whichever approach we take, we should use that branch name to populate the editor with the CI config on that particular branch.
We'll also need to update the target branch in the commit form to be the branch we're currently on.
Further details
On it's own, this feature isn't all that useful. However, as a first step on the linked epic, it opens a lot of doors.
Documentation
As this feature isn't discoverable, and is simply a first step, I don't see this needing Documentation at this stage.
Availability & Testing
What does success look like, and how can we measure that?
We should be able to:
- Load the CI config for a branch by entering the right URL.
- Edit the config on that branch with all the features of the editor working correctly.
- Commit the changes to that same branch
- Commit the changes to a new branch and open an MR with the target branch as the base.