Repository navigation
ci: fix py-combine-coverage on unit-only PR runs - #34835
Conversation
Since #34740 skips Python integration tests on PRs, py-combine-coverage downloads only coverage-unit. download-artifact extracts a single matched artifact directly into the target path rather than a per-artifact subdirectory, so the prepare step never found the .coverage file and coverage combine failed with "No data to combine".
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved🟡 Medium risk · Adjusting coverage artifact lookup may leave unit coverage uncombined, causing incomplete Sonar coverage reporting. Fixes OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Follow-up to #34740. Python integration tests no longer run on PRs, so
py-combine-coveragenow downloads only one artifact (coverage-unit). The pinnedactions/download-artifact(v7) has a special case for a single matched artifact: it extracts the files straight intopathinstead ofpath/<artifact-name>/. You can see this in the log:Starting download of artifact to: .../ingestion/coverage-data.The "Prepare coverage files" step only looked in
coverage-data/coverage-unit/.coverage, so on these runs it found nothing andcoverage combineexited withNo data to combine. Failing example: https://github.com/open-metadata/OpenMetadata/actions/runs/37597613451/job/112739564448 (PR #34785). Because the job iscontinue-on-error,py-testsstill reports success, but the Sonar coverage upload is skipped.The fix makes the step check both locations, so it handles unit-only PR runs as well as merge-queue runs, where all shards are downloaded into their own subdirectories.
Testing
bash -e -o pipefail,nullglob) against both layouts. Both produce.coverage.unit, and neither aborts on the missing-file branch.coverage-unitartifact from the failing run and rancoverage combine(7.16.2) on it:Combined 1 file.Type of change:
Checklist: