Skip to content

Add sha to CiConfig graphql query

Mireya Andres requested to merge pipeline-editor/add-sha-to-lint into master

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
Before_-_New_Branch After_-_New_Branch

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Mireya Andres

Merge request reports

Loading