MarshallOfSound

#51881: build: profile-pure PGO collection retries + automatic state-file update PRs

Merged
Created: Jun 4, 2026, 2:41:35 PM
Merged: Jun 4, 2026, 11:33:43 PM
3 comments
Target: main

Two improvements to the PGO generation pipeline, prompted by run 26933006860 where a jetstream2 startability failure on win-x86 could never be retried and blocked publishing.

Profile-pure collection retries

The in-app retry from #51866 left the failed attempt's counters in the profile (continuous-mode counters are app-lifetime cumulative and cannot be excised). Replaced with wipe-and-relaunch retries in collect-profile.js:

  • up to --attempts (default 5) full relaunches, each starting from an empty profraw dir and fresh processes, so a published profile only ever contains counters from one fully-successful run
  • non-final attempts abort on the first workload failure (PGO_ABORT_ON_FAILURE); the final attempt runs to completion so a persistent failure still uploads a maximal partial profile
  • retries stop launching past --retry-deadline-minutes (default 240) so the in-flight attempt finishes and flushes counters before the step timeout (a hard kill loses the exit-time profraw write); step timeout raised 150 → 330 to match
  • jetstream2 fails in seconds instead of polling its 300s startability window when the driver flags a load error (startFailExpr on allIsGood), which is exactly the failure from the run above

Publish gate + automatic state-file PR

  • upload-profiles now requires every build/collect/merge job to be green (skipped platforms via the skip-* inputs remain allowed) - a partial profile set never reaches the CDN or the state files
  • after the Azure upload, the job exchanges its OIDC token for an electron-pgo-updater app token via electron/secret-service-action (electron/secret-service#69) and opens a PR updating build/pgo_profiles/*.pgo.txt to the freshly uploaded profiles
  • the app token is restricted to single_file: write on the nine state files and cannot create refs, so GITHUB_TOKEN creates the pgo/update/* branch and the app token commits each state file via the contents API (verified against the live installation)

Notes: none

Backports

42-x-y
Merged
PR Number
#51888
Merged At
Jun 5, 2026, 12:42:54 PM
Released In
Not yet
Release Date
Not yet
43-x-y
Merged
PR Number
#51889
Merged At
Jun 5, 2026, 12:42:59 PM
Released In
Not yet
Release Date
Not yet

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron