Skip to content

Update session history when switching branches in pipeline editor

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

What does this MR do?

For #322485 (closed)

When the user switches branches in the pipeline editor, the branch_name param in the URL is updated and pushed to the session history. This allows the user to retain the same branch they are working on when they refresh the page.

Note: If the user initially loads the page and they are in the default branch, there is no branch_name param in the URL.

Branch Switcher

The breakdown of the implementation for the whole branch switcher feature is as follows:

Link Status Progress
!57562 (merged) Add dropdown UI to the pipeline editor
!57941 (merged) When clicking on a branch, switch to that branch and load the correct data
!60465 (merged) Add branch switcher to empty state
!59217 (merged) WIP Fetch and search available branches in pipeline editor
you are here 👉 Retain the same branch on refresh

Local Testing

The feature is under the :pipeline_editor_branch_switcher feature flag, so please enable it first when testing.

  • Go to CI/CD > Editor to view the pipeline editor.
  • Switch branches around and confirm that the URL changes.
  • Branch should be the same when reloading the page.

Note that the branch switcher is currently using a client resolver. Make sure to test with a branch included in the resolver, or add your own test branch in pipeline_editor/graphql/resolvers.js.

Screenshots

Screen_Recording_2021-05-05_at_17.12.49

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

Merge request reports