Skip to content

ci: move coverage history off main and retry pushes - #1815

Open
kikoso wants to merge 2 commits into
mainfrom
ci/coverage-history-branch
Open

kikoso wants to merge 2 commits into
mainfrom
ci/coverage-history-branch

Conversation

@kikoso

@kikoso kikoso commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Today #1812 and #1814 merged 16 seconds apart and the second coverage run failed (https://github.com/googlemaps/android-maps-utils/actions/runs/37806329462). Each run checked out its own triggering commit, so the second one started from a stale coverage/history.csv. Both appended rows at the end of the same files, and git pull --rebase origin main conflicted. Separately, every bot commit on main marks all open pull requests out of date under strict branch protection.

This mirrors googlemaps/android-maps-compose#1006. The history now lives on a coverage-history branch, checked out into coverage-data/ after the concurrency wait, and main is never written to. The new .github/scripts/push_coverage_history.sh handles a rejected push by resetting to the branch tip, re-applying our rows with a new coverage_history.py merge subcommand (keyed on commit, suite and module), re-rendering COVERAGE.md and pushing again, up to 3 attempts. The CSV columns are unchanged.

First run: the coverage-history branch does not exist yet, so the workflow checks out main with full history, finds the last version of coverage/history.csv and coverage/COVERAGE.md (the parent of this PR's merge commit, since this PR removes coverage/ from main), and creates the branch as an orphan seeded with those files plus a short README. It then appends the row for the triggering commit and pushes the branch. Every later run checks out the existing branch. No manual step is needed, and the existing 21 commits of history carry over.

Only the unit suite (Kover) is recorded, as before. There is no coverage badge in this repo, so none is added. The self-trigger guard for chore: update coverage history is gone, since nothing lands on main anymore; the release-please guard stays. AGENTS.md now points at the branch.

Tested locally against a copy of the current history.csv: the seed step picked up all 126 existing rows from git history after coverage/ was deleted, the first push created the branch, and two simulated runs appending different commits from the same tip both landed (the second push was rejected, merged and retried). YAML parses, and bash -n and shellcheck pass on the script and on every run: block.

Recording coverage on main raced when two merges landed close together:
each run checked out its own triggering commit, both appended to the end of
coverage/history.csv, and git pull --rebase conflicted. Every bot commit on
main also marked all open pull requests out of date under strict branch
protection.

The history now lives on the coverage-history branch, checked out after the
concurrency wait. push_coverage_history.sh retries a rejected push by
resetting to the branch tip, re-applying our rows with a new merge
subcommand and re-rendering COVERAGE.md. The first run creates the branch,
seeded from the last version of coverage/ in main's history, so coverage/
is removed from main here.

Mirrors googlemaps/android-maps-compose#1006. Only unit coverage is recorded.
@googlemaps-bot

googlemaps-bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage

Overall Project 60.59% 🍏

There is no coverage information present for the Files changed

@kikoso
kikoso marked this pull request as ready for review October 12, 2026 04:37
@kikoso
kikoso requested a review from a team as a code owner October 12, 2026 04:37
…ranch

# Conflicts:
#	coverage/COVERAGE.md
#	coverage/history.csv

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants