Repository navigation
fix(mobile): publish the Android APK's size and checksum with the release - #24037
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe Android release workflow now requires exactly one release APK. It records the APK’s size and SHA-256 digest, creates a Priority: ➖ Normal Architecture SummaryArchitecture risk: 🔵 Low · up to The changed surface does not map to a changed system, dependency edge, entrypoint, or external dependency. Changed systems: None identified. Architecture concerns Review detailsBefore / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: f8f481ad-f602-4231-bed5-f37a4901a547
📒 Files selected for processing (4)
.github/workflows/mobile-android-release.ymlmobile/app.jsonmobile/plugins/android-apk-v1-signature.jsmobile/src/mobile-release/android-apk-v1-signature-plugin.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
|
There was a problem hiding this comment.
ℹ️ No critical issues — two minor suggestions inline.
Reviewed changes
- v1 APK signature restored — new
mobile/plugins/android-apk-v1-signature.jsconfig plugin addsenableV1Signing true/enableV2Signing trueto thesigningConfigs.debugblock duringexpo prebuild, registered inmobile/app.json. Anchored on thekeyPassword 'android'line, throws on template drift, idempotent. - Size and SHA-256 published —
.github/workflows/mobile-android-release.ymladds aChecksum the APKstep (asserts one APK, writesapp-release.apk.sha256, emits outputs), uploads the digest as an artifact, attaches it to both release paths, and appends a### Verify your downloadblock after the body truncation. - Plugin unit tests — new
mobile/src/mobile-release/android-apk-v1-signature-plugin.test.tscovering flag insertion, idempotency, and the loud-failure anchor.
I verified the load-bearing AGP claim against AGP source (DefaultSigningConfig, SigningConfigImpl, SigningConfigVersionsWriterTask → signflinger): the flags are writable ApkSigningConfig properties, an explicit true overrides the minSdk >= 24 default, and the debug config's flags govern a release build type that references it — so the mechanism is sound. Test collection, mobile test scoping, and the allowJs typecheck path all check out, and the existing shell-switch workflow test is unaffected.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…ease An APK that fails to install with a missing certificate or a package-parse error is usually a download that died near the end: the signature block sits in the last ~100 KB of a 133 MB file, so a truncated APK looks complete and carries no signature at all. The release published neither a size nor a digest, so there was no way to tell that apart from a bad build without deriving both from the asset by hand — which is why the reports have stayed unfalsifiable. The release now uploads app-release.apk.sha256 next to the APK in `sha256sum -c` format, and puts the exact byte size and digest in the release body. The body line is appended after the existing truncation so the character cap cannot eat it.
a0066d5 to
7c8cef3
Compare
Review catches on the checksum step: `gh release upload --clobber` replaced the APK and its checksum file but left the release body alone, so a rerun left a digest describing a file nobody could download any more — worse than publishing none, because a reader comparing against it would reject a good APK. The existing-release path now rewrites the body from the current outputs, dropping any previous verification section and keeping the generated notes. Both paths share one function that emits it. The checksum file now uses the ` *` binary marker: Git Bash's sha256sum treats text mode as a licence to translate line endings while hashing, which would fail on a valid APK. The body also names `shasum -a 256 -c`, since a reader on macOS has no sha256sum.
|
Addressed the review catches in 13e4e75. All three were real:
Verified by extracting the step's script from the YAML and running it against a stubbed The remaining P2 — that nothing verifies the built APK's signature schemes before publishing — no longer applies: the v1 signing plugin is out of this PR (see the Why section), so it now changes no signing behaviour at all. Worth doing as part of #21808, where the signing config is actually in play. |
|
Verified commit
Replied to and resolved the two Pullfrog threads and the greptile P2 thread. Working tree clean; nothing to push. Task list (5/5 completed)
|
|
Thanks — these changes address the previously reported issues. The existing-release path now replaces the verification section after clobbering the assets, so the release body stays synchronized with the current APK; the |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 8a391783-34b4-4e84-9d20-8711dc5decb4
📒 Files selected for processing (1)
.github/workflows/mobile-android-release.yml
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Checksum uses the binary
*marker —Checksum the APKnow writesprintf '%s *%s\n', so Windows Git Bash's text-mode line-ending translation can't produce a spurioussha256sum -cmismatch on a valid APK. - Verification block names the macOS tool — the appended release-notes block is now the
verification_sectionprintfhelper and names bothsha256sum -c app-release.apk.sha256andshasum -a 256 -c(macOS). - Reruns refresh the published digest — a new
drop_verification_sectionhelper (sed '/^### Verify your download\r*$/,$d') strips the previous section, and the existing-release path rewrites the body after--clobberuploads the new APK + checksum viagh release edit --notes-file, so the published size and digest can no longer describe a replaced asset.
I traced the new shell logic: the verification_section/drop_verification_section functions are defined before both branches, the body-rewrite pipeline sits under set -euo pipefail so a failed gh release view fails the step rather than truncating the notes, and the sed pattern behaves correctly for both LF and CRLF bodies under GNU sed (verified locally). The create path's truncateReleaseBody cap is 120000, leaving headroom under the 125000 API limit for the appended section; the rerun edit operates on an already-capped body and is net-neutral.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
ast-grep outline .github/workflows/mobile-android-release.yml || true
nl -ba .github/workflows/mobile-android-release.yml | sed -n '1,320p'
gh pr diff 24037 --repo stablyai/orcaLength of output: 17378
I checked
I withdraw the remaining P2 signature-scheme finding. This PR does not change signing behavior. Signature-scheme verification belongs with the signing configuration work in This was code inspection only; I did not rerun your manual checks. ✏️ Learnings added
If you found this review helpful, would you consider giving us a shout-out on X? Thank you for using CodeRabbit! You are interacting with an AI system. |
… cap Appending the section after the truncation meant a near-limit body could push the release past GitHub's character limit, failing `gh release create` — or, on the upload path, failing `gh release edit` after --clobber had already replaced the assets, leaving new files described by a stale digest. Both paths now build the notes, truncate with the section's own length reserved out of the cap, then append it, so the section always survives and the body always fits. MAX_RELEASE_BODY_LENGTH is exported from the desktop release script rather than restated here, so the reserve is computed against one source of truth.
|
Addressed the body-cap catch in 077425f (@coderabbitai). It was real on both paths, not just the upload one: appending the section after Both paths now build the notes, truncate with the section's own length reserved out of the cap, then append it — so the section always survives and the body always fits. Verified against the real truncation module with a 119,900-character existing body carrying a stale section: result is 119,998 characters, stale section replaced, generated notes preserved, fresh digest intact. Re-ran the short-body edit and fresh-create paths unchanged, plus |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The delta since the prior pullfrog review is one commit (077425f):
- Verification section reserved out of the body cap — new
write_notes_with_verification()subtracts the section's byte length (verification_section | wc -c) fromMAX_RELEASE_BODY_LENGTHbefore truncating, then appends the section, so the final body can never exceed the cap. - The same helper now governs the existing-release path — that path previously stripped and re-appended the section without truncating; it now truncates to the reserved cap too, so a stored body near the API limit cannot push the
gh release editcall over the line after--clobberhas already replaced the assets. MAX_RELEASE_BODY_LENGTHexported — changed from a module-localconsttoexport constso the workflow's inline node snippet can import it;truncateReleaseBody's signature is unchanged (its second arg already existed).
I replayed the new shell + node logic against a fixture body at the old cap: the reserve computes to 332 bytes, the truncated body lands at exactly 120,000 with a single ### Verify your download section, and the previously appended section is stripped before the rewrite. The create path's if [ ! -s "$notes_file" ] fallback is preserved ahead of the helper, and set -euo pipefail still fails the step on a failed gh release view rather than writing an empty body. No new issues.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
ast-grep outline .github/workflows/mobile-android-release.yml || true
ast-grep outline config/scripts/create-draft-release.mjs --match 'MAX_RELEASE_BODY_LENGTH|truncateReleaseBody' || true
git show 077425f -- .github/workflows/mobile-android-release.yml config/scripts/create-draft-release.mjs
rg -n -C 12 'MAX_RELEASE_BODY_LENGTH|truncateReleaseBody|verification|wc -c|gh release (create|edit)' .github/workflows/mobile-android-release.yml config/scripts/create-draft-release.mjsLength of output: 25420
This was code inspection only. I did not rerun your reported 80 tests. ✏️ Learnings added
You are interacting with an AI system. |

ELI5
When someone says the Android app won't install, we currently have no way to check whether the file they downloaded is actually intact. This publishes the APK's exact file size and a fingerprint alongside it, so a broken download can be identified in one command instead of guessed at.
What Changed
Before: the Android release published
app-release.apkand nothing else. No size, no checksum.After: it also publishes
app-release.apk.sha256(insha256sum -cformat), and the release body carries the exact byte count and digest.The mechanism is a new
Checksum the APKstep in.github/workflows/mobile-android-release.yml. It asserts the build produced exactly one APK, computes size and SHA-256, writes the sibling checksum file, and exposes all three as step outputs. Both release paths —gh release createand thegh release upload --clobberpath for an existing tag — now upload the checksum file too. The body text is appended after the existing truncation logic, so the 125k character cap can't eat it.printfrather than a heredoc because YAML block indentation would otherwise leak into the Markdown.Why
An install that fails with a missing certificate or "There was a problem parsing the package" is usually a download that died near the end. The APK's signature block sits in the last ~100 KB of a 133 MB file, so a truncated download produces a file that looks complete, is only slightly short, and carries no signature at all. Android then reports
INSTALL_PARSE_FAILED_NO_CERTIFICATES— which reads to a user like the build is broken.Because we published neither a size nor a digest, every such report has been unfalsifiable: nobody could separate "your download is short" from "the build is bad" without fetching the asset and deriving both by hand. That's a large part of why #24011, #12248 and #11444 have all stayed open. Fifteen lines makes every future report self-diagnosing, and gives a user a concrete recovery check rather than "try again".
Alternatives considered:
Deliberately not in this PR:
expo-template-bare-minimumdebug keystore, which is the genuinely serious issue. It needs a generated keystore plus repo secrets, and rotating the key breaks in-place updates for every existing install — a product decision, not a reviewable diff. No key changes here.Linked Issue
Refs #24011, #12248, #11444.
Intentionally not
Fixes— this does not resolve the root cause of any of them. It is the missing evidence that lets us pick which root cause applies.Visual Proof
N/A— no UI or interaction change. The only user-visible surface is the Android release body, whose new section renders as:(Values above are the real ones for the current
mobile-android-v0.0.50asset.)Testing
Platform: macOS, though nothing here is platform-dependent — the step runs only on the
ubuntu-latestrelease runner.Checksum the APKscript against a fixture APK in a temp tree: it asserts the single-APK invariant, emitschecksum/bytes/sha256to$GITHUB_OUTPUT, and the file it writes passesshasum -a 256 -c.printfto confirm the Markdown, including that the appended block survives the truncation step above it.steps.apk.outputs.*is referenced only after the step that defines it. Asset globs still match*.apkand do not pick up*.apk.sha256.No automated tests added: this is workflow YAML with no test harness in the repo, and its logic was verified by replaying the script directly (2 and 3 above). The existing
mobile/src/mobile-release/tests cover the release script, which this doesn't touch.Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
sha256sumover a 133 MB file on the runner. No app code changes, so no iOS impact.