Repository navigation
ci(codecov): use one coverage upload per build like autoware_universe - #1563
Merged
Merged
Conversation
Codecov posted 22 statuses on each main commit and 22 checks on each PR, one project and one patch status for each flag. With target auto and no threshold, a coverage drop of 0.01 % failed a status, and one failure turned the commit red. The PR upload also ran gcov again and sent extra reports and system header files. Use the setup that autoware_universe uses: - Upload coverage only from the jazzy job without above and agnocast: flag full-suite on push to main, flag daily on the nightly build, and no flag on PRs. - Carry forward only full-suite. A flagless PR upload keeps the full-suite baseline and merges on top of it. - Use codecov-action v6 with disable_search and only the pycoverage plugin on every upload. - Make the default project and patch statuses informational and remove the per-flag statuses. Signed-off-by: Mete Fatih Cırıt <mfc@autoware.org>
|
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
The pycoverage plugin does nothing in the Autoware images, because they have no coverage command. colcon-test already makes the coverage files, so no plugin is needed. noop is the documented value to turn off all plugins, and the main build used it before. Signed-off-by: Mete Fatih Cırıt <mfc@autoware.org>
…branch Point the PR build at autowarefoundation/autoware-github-actions branch fix/colcon-test-coveragepy-xml and touch autoware_interface_spec_lint, so that this PR uploads a coverage.py XML report to Codecov. Revert this commit before the merge. Signed-off-by: Mete Fatih Cırıt <mfc@autoware.org>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1563 +/- ##
==========================================
+ Coverage 71.83% 79.62% +7.78%
==========================================
Files 518 6 -512
Lines 28732 481 -28251
Branches 13306 115 -13191
==========================================
- Hits 20640 383 -20257
+ Misses 6912 69 -6843
+ Partials 1180 29 -1151
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…test PR branch" This reverts commit b6d67bd. The test upload is done. Signed-off-by: Mete Fatih Cırıt <mfc@autoware.org>
xmfcx
marked this pull request as ready for review
November 23, 2026 22:04
This was referenced Nov 23, 2026
Merged
Codecov carries a flag forward when the commit has no upload with that flag. An upload with another flag does not stop it. So the reason to upload PR coverage without a flag is that a PR upload with the full-suite flag would replace the carried-forward baseline. Signed-off-by: Mete Fatih Cırıt <mfc@autoware.org>
setup.py of an ament_python package runs only at build time, so Python coverage reports it with 0 hits. Leave it out of the coverage numbers, as the test folders already are. Signed-off-by: Mete Fatih Cırıt <mfc@autoware.org>
interimadd
approved these changes
Nov 24, 2026
mitsudome-r
approved these changes
Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Codecov turns most commits on
mainand many PRs red, so a real CI failure is hard to see. 24 of the last 40 commits onmainand 5 of the 8 newest PRs with Codecov checks have at least one failed Codecov status. The PR coverage numbers also jump, for exampledifferential-jazzy 28.80% (-26.86%).This PR copies the Codecov setup of
autoware_universe:maintotal-humble,total-jazzy,total-humble-agnocast,total-jazzy-agnocastfull-suitedaily-humble,daily-jazzydailydifferential-humble,differential-jazzytwice (with and without agnocast)totalanddifferentialflags that no workflow uploadsfull-suiteonlymain, v4 on PRs (gcov runs again, the workspace search sends extra files)disable_search,plugins: noopmain, 22 checks on PRs,target: autowith no thresholdcodecov/projectandcodecov/patch, informationalWhy each part:
full-suiteflag would replace that baseline with partial data. A flagless PR upload merges on top of it.total_coverage.info.nofilt(the report before filtering),coverage_base.info, and.gcovfiles for headers in/usr/includeand/opt/ros.plugins: noopturns off all uploader plugins, as the push build onmainalready does.colcon-testmakes the coverage files, so no plugin is needed.target: autowith no threshold fails on a drop of0.01%, and coverage moves by that much between runs without code changes. Informational statuses report the numbers and never fail. To make Codecov block a PR later, removeinformational: truefromprojectand add athreshold.What changes for readers:
full-suitenumbers, about 82 % instead of today's 71.83 %, because the stale flags leave the report. Python files change this number again when they arrive.colcon-testoutputs the raw.coveragefile, which Codecov does not read. A separate PR makescolcon-testoutput an XML report. After its release, the upload in this PR sends that report with no further change:pull_requestrun uses the merge commit. Codecov readscodecov.yamlfrom the PR head, so the old status rules stay until the PR is updated frommain, and a red Codecov check is possible until then. PR baselines are correct after the first push build onmainuploadsfull-suite.setup.pyis added to theignorelist. It runs only at build time, so Python coverage would report it with 0 hits.full-suitebaseline plus the PR upload. A PR that removes a test does not show the drop until it is merged. Patch coverage is not affected.History
The
coverage.statusandflag_managementblocks came from sync-file-templates in 2022 and did not change after that. In 2025, a PR removedcodecov.yamlfrom the sync list, and a later PR introduced the per-distro flag names:autoware_universereached its setup in these PRs:Two differences:
autoware_universekeeps the per-flag statuses withtarget: 0%andthreshold: 100%. This PR removes them and usesinformational: true, which gives the same result with fewer statuses.autoware_universeusesplugins: pycoverageto turn off the gcov plugin. Thepycoverageplugin needs acoveragecommand, which the images do not have, so it does nothing. This PR usesplugins: noop, the documented value to turn off all plugins.Tracking issue:
AI usage
AI usage: Written with Claude Code. It collected the Codecov statuses on
mainand on recent PRs, read the upload logs, copied theautoware_universesetup into the core workflows, and wrote this description.Self-review: A reviewer with a clean context read the diff, the five workflows,
codecov.yaml, the Codecov and codecov-action documentation, theautoware_universesetup, the cited CI logs and the public Codecov API. Two review rounds ran. The first round found three wrong statements in the description, and these are fixed. The second round found no defect in the workflow logic and two open points,plugins: noopas the documented off switch and the sentence about open PRs, and these are fixed. A third review round checked the commit that adds**/setup.pytoignoreagainst the Codecov validator and the Codecov report of the test upload, and it found no defect.Verification: The Codecov validator accepts the new
codecov.yaml, and pre-commit and actionlint pass on the changed files. A temporary test commit uploaded Python coverage through the PR 440 branch, and Codecov posted only the two informational checks. The full-suite baseline shows only after the merge.Status history
gh api repos/autowarefoundation/autoware_core/commits/<sha>/statusfor the last 40 commits onmain, up to15ab4587: 24 commits have at least one Codecov status in thefailurestate. No other commit status failed. I did not count the GitHub Actions check runs of these commits.15ab4587has 23 statuses: 22 from Codecov andpre-commit.ci - push. Onlycodecov/project/project-total-jazzyfailed, with82.34% (-0.01%) compared to c93d7de.gh api .../commits/<sha>/check-runson the heads of the 8 newest PRs with Codecov checks: each has 22 Codecov checks. These 5 have at least one failed check:autoware_universemain: 24 commits have 4 Codecov statuses, 6 have none, and 0 statuses are in a state other thansuccess.mainafter the merge shows them.Upload logs before this PR
build-and-test-diff-jazzyof run 45230998214 (codecov-action@v4): the uploader ran theGcovPluginon 10.gcnofiles and sentcoverage_base.info,total_coverage.info.nofiltand.gcovfiles for/usr/includeand/opt/rosheaders, besideslcov/total_coverage.info.coverage.py is not installed or can't be found.for thePycoverageplugin.build-and-test-diff-jazzy-agnocast:do-upload -f lcov/total_coverage.info -F differential-jazzy, the same flag as the job without agnocast.mainpush jobbuild-and-test-jazzyof run 45238075211 (codecov-action@v5,plugins: noop):Found 2 coverage files to report,lcov/total_coverage.infoandcoveragepy/.coverage.autoware_universeget head reports with the same setup.Test upload on this PR
A temporary commit,
b6d67bda, pointedcolcon-testin the PR build at the branch of autowarefoundation/autoware-github-actions#440 and touchedautoware_interface_spec_lint. A revert commit removed it, and the tree is the same as before the test.build-and-test-diff-jazzyof run 45272414449:modified-packages: autoware_interface_spec_lint,Wrote XML report to coveragepy/coverage.xml, thenupload-coverage ... --disable-search --file coveragepy/coverage.xml --plugin noopwith no flag,Found 1 coverage files to reportandstatus_code=200..pyfiles undercommon/autoware_interface_spec_lint/, for examplechecks.pywith 264 hits and 21 partials of 317 lines. The test files are left out byignore. One of the 6 files issetup.pywith 0 hits, which this PR now adds toignore.codecov/patch(success,Coverage not affected when comparing 15ab458...b6d67bd) andcodecov/project(success,79.62% (+7.78%) compared to 15ab458).mainhas nofull-suiteupload yet. The+7.78%compares 6 Python files with the old flags ofmain. Not checked: a PR report with a carried-forwardfull-suitesession. That needs the first push build after the merge.Static checks
curl --data-binary @codecov.yaml https://codecov.io/validateprintedValid!.pre-commit run --files codecov.yaml .github/workflows/*.yaml:check yaml,prettierandyamllintpassed.actionlint -shellcheck=on the five changed workflows: no findings. With shellcheck on, it reportsSC2086andSC2044notes inrun:scripts that this PR does not change.gh api repos/autowarefoundation/autoware_core/rules/branches/main: no required status check starts withcodecov.