Skip to content

ci: regenerate Baseline Profiles before each release - #1064

Open
kikoso wants to merge 1 commit into
feat/baseline-profilesfrom
ci/regenerate-baseline-profiles
Open

kikoso wants to merge 1 commit into
feat/baseline-profilesfrom
ci/regenerate-baseline-profiles

Conversation

@kikoso

@kikoso kikoso commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Stack

Summary

Baseline Profiles go stale as the code changes, and nobody will remember to regenerate them by hand. This adds a Regenerate Baseline Profiles workflow that runs the generator from #1063 on an emulator and opens a pull request when the profiles changed, so we can merge it before the release pull request.

  • Trigger. release-please.yml calls it (workflow_call) when release-please creates or updates the release pull request. It can also be run by hand (workflow_dispatch, with a force input).
  • Only when needed. prs_created is true every time the release pull request is updated, so after almost every merge. To not burn 20 minutes of emulator each time, the workflow first checks whether any library src/main changed since the last commit that touched the profiles, and skips everything else if not.
  • Generation. Same API 36 google_apis image and pinned actions as the demo smoke test, with the key from ACTIONS_API_KEY. It fails right away if the secret is not there.
  • Sanity check. .github/scripts/compare_baseline_profiles.py compares the regenerated profiles with the committed ones. It fails if a module keeps less than half of its rules or comes out empty, which is what happens with a placeholder key or demos that close themselves (it happened to me locally in maps-utils, and the generation still "succeeds"). It also ignores small differences: two runs never record exactly the same methods, so the pull request is only opened when more than 5% of the rules changed.
  • Pull request. Opened (or updated, if one is already open) from the chore/regenerate-baseline-profiles branch with a chore: title so it does not bump the version, and a table with the rules before and after per module plus the classes added and removed. The profiles and test reports are also uploaded as an artifact.
  • release-please.yml now sets permissions per job instead of at the workflow level, so the new job only gets contents: read (zizmor flagged the workflow-level contents: write and pull-requests: write).

Open questions

  • Token. The pull request is opened with SYNCED_GITHUB_TOKEN_REPO, the token release-please already uses, because pull requests opened with GITHUB_TOKEN do not trigger the checks. @dkhawk, is it fine to use it here, or would you prefer another bot token?
  • CLA. The commit is authored by github-actions[bot]. If cla/google does not accept it we can switch to the identity release-please commits with.

Testing

  • actionlint passes on both workflows, and zizmor reports no medium or high findings (only the low self-repository hint for ./.github/...).
  • The comparison script was tested locally with identical profiles, small noise (not significant), a big change (significant) and a near-empty regeneration (fails with an error per module).
  • The staleness check was tested on a temporary worktree: up to date on this branch, stale after a change in maps-compose/src/main, up to date after a change only in maps-app.
  • The workflow itself can only run once this is on main; I will trigger it by hand with force after merging.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Coverage (unit tests)

Compared against 174f0fd on feat/baseline-profiles (#1060).

Module Line % Change Branch % Change
maps-compose 15.28% no change 3.76% no change
maps-compose-utils 6.09% no change 4.47% no change
maps-compose-widgets 10.88% no change 11.11% no change
TOTAL 12.99% no change 4.12% no change

Line and branch coverage from unit test reports. History is recorded on the coverage-history branch after each merge to feat/baseline-profiles.

Add a workflow that regenerates the library Baseline Profiles on an emulator
and opens a pull request when they changed. release-please.yml calls it when
the release pull request is created or updated; it skips the emulator run when
the library sources did not change since the last profiles, and fails if a
module comes out nearly empty. It can also be run by hand.

release-please.yml now sets its permissions per job.
@kikoso
kikoso force-pushed the feat/baseline-profiles branch from 68d7a25 to 066ee0e Compare November 3, 2026 03:32
@kikoso
kikoso force-pushed the ci/regenerate-baseline-profiles branch from 6de02f3 to fdf9e49 Compare November 3, 2026 03:32
@kikoso
kikoso marked this pull request as ready for review November 3, 2026 03:33
@kikoso
kikoso requested a review from a team as a code owner November 3, 2026 03:33
@googlemaps-bot

Copy link
Copy Markdown
Contributor

Coverage (instrumentation tests)

Overall Project 43.69% 🍏

There is no coverage information present for the Files changed

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