Fix fetch policy in pipeline editor branch switcher
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
-
I have included a changelog entry, or it's not needed. (Does this MR need a changelog?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.)