fix(capgo): give every OTA upload a unique bundle version - #2708
fix(capgo): give every OTA upload a unique bundle version#2708innolope-dev wants to merge 2 commits into
Conversation
package.json's version only moves on a native release, so every OTA upload after the first reused bundle version 1.0.8. Capgo failed those uploads until --version-exists-ok turned them into silent no-ops: green check, nothing shipped. Derive the version per commit instead — <major>.<minor> from package.json plus the git commit count — so each upload is real. The patch cannot be a prerelease (1.0.8-<sha>): Capgo's disable_auto_update_under_native rule makes devices on the 1.0.8 binary reject anything that sorts below it. --version-exists-ok now only covers a re-run of the same commit, and a new step asserts the channel actually serves the version the run built, so a no-op that ships nothing is red again. Closes #2638
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Code-analysis diffPainscore total: 7159.84 → 7159.84 (0) |
🧪 UI test report — ✅ all greenSuites
📊 Coverage (unit)
⏱ 10 slowest test cases
|
The unit job checks the repo out shallow, so asserting the derived version against the checkout's history failed in CI. Only the CAPGO_BUNDLE_VERSION cases still use the checkout — that path never reads git.
|
Verified this against today's live OTA failure and it does fix it — but there's a latent gap in the floor check worth closing before it bites. It fixes the current outage. Devices are on binary The gap. That drift is structural, not accidental: It holds as long as releases only bump the patch. It breaks the first time one bumps the minor:
Suggestion: compare against the real shipped version rather than Not a blocker for landing — this is strictly better than the status quo and unblocks the live outage. Filing it so the trap is written down. Context: #2735 deliberately keeps |
Closes #2638
Problem
package.json's version only moves on a native release, so every OTA upload after the first reused bundle version1.0.8. Capgo failed those uploads loudly until #2636 added--version-exists-ok, which turned them into silent no-ops: green check, nothing shipped.One correction to the issue's suggestion
1.0.8-<short-sha>would have made it worse. Capgo's update endpoint rejects any bundle that semver-sorts below the device's native version (disable_auto_update_under_native, on by default — update.ts), and a prerelease sorts under plain1.0.8. Uploads would succeed, the dashboard would show new bundles, and every device on the 1.0.8 binary would refuse them. The commit-count variant the issue also proposes is what this PR uses.Changes
scripts/capgo-bundle-version.mjs— prints<major>.<minor>frompackage.json+ the git commit count (today:1.0.9798). Anchoring major/minor topackage.jsonkeeps the version above the native floor when a native release bumps it; the commit count makes it unique per commit. It refuses a shallow clone (would emit1.0.1), a prerelease override, and anyCAPGO_BUNDLE_VERSIONoverride below the native version.fetch-depth: 0, a "Resolve bundle version" step,--bundle <version>on the upload, and a post-upload assertion thatchannel currentBundleactually serves the version the run just built.--version-exists-okstays, but now only covers a re-run of the same commit; any other no-op leaves the channel stale and turns the job red. That check is the issue's "verify when fixed" criterion, enforced in CI.capgo:upload:dev|stagingpackage scripts get the same derived version — they had the identical collision.Verification
scripts/__tests__/capgo-bundle-version.test.js), including a real shallow-clone repo.bash -efor match / stale-channel / CLI-error; it is green only on a real match.prettier --checkclean on the touched files; both workflows parse.Before the first release
Check on the Capgo dashboard that the channels' update policy is not
patch— that setting blocks any patch-differing bundle, i.e. all OTA, regardless of the version scheme. Also note a native release that overridesversionNamewithout bumpingpackage.jsonwould strand OTA bundles under the shipped binary.