Skip to content

Fix fetch policy in pipeline editor branch switcher

Mireya Andres requested to merge fix-branch-switcher-fetch-policy into master

What does this MR do?

Fix for #331105 (closed)

For the pipeline editor, we've already decided to use the network-only fetch policy when fetching the file content of the CI file. This prevents the content from getting out out of sync, and it's not likely that the user will switch between branches often enough that the query results need to be cached.

This also fixes several caching bugs as described below in the testing section.

There was a typo in the code however, so we did not end up using the correct fetch policy. This MR should fix it 😅

Local Testing

Go to CI/CD > Editor. The following bugs should be fixed:

  • Committed changes should persist when switching back and forth between branches
  • When switching branches, the branch in the commit form should be updated to use the current branch

Screenshots

Fixes bug where the branch in the commit form is not updated when user switches between branches

Before After
Update Branch in Commit Form - Before Update Branch in Commit Form - After

Fixes bug where committed changes do not persist when user switches between branches

Before After
Persist Committed Changes - Before Persist Committed Changes - After

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Mireya Andres

Merge request reports