fix(capgo): give every OTA upload a unique bundle version - #2708
Open
innolope-dev wants to merge 2 commits into
Open
fix(capgo): give every OTA upload a unique bundle version#2708innolope-dev wants to merge 2 commits into
innolope-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.
|
Contributor
|
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 |
Contributor
Code-analysis diffPainscore total: 7159.84 → 7159.84 (0) |
Contributor
🧪 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.
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.
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.