Add sha to CiConfig graphql query
What does this MR do?
For #332845 (closed).
This fixes a bug where the merged yaml content in the pipeline editor doesn't show the proper include configs for non-default branches. By passing the commit sha to the query, the backend will be able to use that as a reference and return the correct merged yaml for the current branch.
This also reverts the changes in !65972 (merged), which was a workaround fix that hides the merged yaml tab for non-default branches while the fix is not yet live.
How To Test
You can follow the steps to reproduce in the original issue. Create your .gitlab-ci.yml
file and add the included config.
main-branch-job:
script:
- echo
include:
- local: 'include-file.yml'
In two separate branches, make sure to add different contents for the include-file.yml
:
Branch 1:
included-job:
script:
- echo "This job was added with include"
Branch 2:
included-job-2:
script:
- echo "This job was added with include in my branch, not master"
Finally, you can go to the pipeline editor (CI/CD > Editor) and switch branches. Check the Merged YAML tab and verify that the content changes in the included config.
Screenshots
Screen_Recording_2021-07-13_at_15.08.46
Before | After |
---|---|
Does this MR meet the acceptance criteria?
Conformity
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) - [-] I have added/updated documentation, or it's not needed. (Is documentation required?)
-
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. -
This change is backwards compatible across updates, or this does not apply.
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.)