Unable to clear artifacts:reports:coverage_report in inherited job
Summary
An external job defines artifacts:reports:junit and artifacts:reports:coverage_report. I overwrite the job locally, but I am not able to remove the artifacts:reports:coverage_report definition while keeping artifacts:reports:junit. The attempts either remove both artifacts, keep both of them, or make the pipeline crash with a very generic message.
Probably related to #383079 (closed).
Steps to reproduce
External job:
# .gitlab-ci.import.yml
test-included-artifacts:
stage: test
script:
- touch report.xml
artifacts:
paths:
- report.xml
reports:
junit: report.xml
coverage_report:
coverage_format: cobertura
path: report.xml
All configs below are in .gitlab-ci.yml and start with include:local: .gitlab-ci.import.yml.
1. Following configs collect `paths`, `junit` and `cobertura_report`:
a.
test-included-artifacts:
artifacts:
paths:
- report.xml
b.
test-included-artifacts:
artifacts:
reports:
junit: report.xml
c.
test-included-artifacts:
artifacts:
paths:
- report.xml
reports:
junit: report.xml
d.
test-included-artifacts:
artifacts: null
artifacts:
paths:
- report.xml
reports:
junit: report.xml
e.
test-included-artifacts:
artifacts:
reports: null
artifacts:
paths:
- report.xml
reports:
junit: report.xml
f.
test-included-artifacts:
artifacts:
reports: null
artifacts:
paths:
- report.xml
2. Following config collects `paths` only:
test-included-artifacts:
artifacts:
paths:
- report.xml
reports: null
3. Following config collects `junit` and `coverage_report`:
test-included-artifacts:
artifacts:
paths:
- report.xml
reports: null
artifacts:
reports:
junit: report.xml
4. Following config collects `report.xml` for `junit` and `report2.xml` for `coverage_format`. Note that `paths` are not collected!
test-included-artifacts:
after_script:
- touch report2.xml
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: report2.xml
5. Following config collects nothing:
test-included-artifacts:
artifacts:
paths:
- report.xml
artifacts:
reports: null
6. [for completeness] Following config crashes, see #383079 (closed):
test-included-artifacts:
artifacts:
reports:
coverage_report: null
Example Project
What is the current bug behavior?
None of the provided configurations can disable coverage_report and at the same time enable (explicitly redefined) junit. It feels to me that at least one of them should.
What is the expected correct behavior?
A configuration that disables a predefined artifacts:reports:coverage_report and enables a (predefined/redefined/newly-defined) artifacts:reports:coverage_report.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
GitLab Enterprise Edition 15.4.2-ee
Results of GitLab application Check
Possible fixes
Possibly related to #383079 (closed).