Repository navigation
Serve every Android download link from one permanent latest-APK release - #25312
brennanb2025 wants to merge 3 commits into
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 📝 WalkthroughWalkthroughThe change adds a workflow that selects the newest versioned Android release with an APK and maintains a permanent prerelease with that APK and an optional checksum. The Android release workflow runs it when a release is published. README files, mobile documentation, and renderer links now use the permanent APK URL. The release policy classifies the rolling release tag as a prerelease. Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: 🔵 Low · up to A failed update can temporarily break the permanent download link or leave the served APK without its verification file. Both paths warrant correction, though a later successful run can restore them. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation
Full details: Docstring CoverageExplanation Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 6 files. (1 skipped: 1 unsupported.)
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:
565e9219-2dfa-4bd1-aff5-55135b218dd2
📒 Files selected for processing (12)
.github/workflows/mobile-android-latest-apk.yml.github/workflows/mobile-android-release.ymlREADME.mddocs/readme/README.es.mddocs/readme/README.fr.mddocs/readme/README.ja.mddocs/readme/README.ko.mddocs/readme/README.pt.mddocs/readme/README.zh-CN.mddocs/site/content/docs/mobile.mdxsrc/renderer/src/components/mobile/mobile-platform-copy.tssrc/renderer/src/components/settings/MobileSettingsPane.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
| # Why: upload under a temporary name, then swap, so the link is down only between the | ||
| # delete and the rename rather than for the whole upload, and a failed upload leaves the | ||
| # previous APK serving. | ||
| gh release upload "$LATEST_TAG" "$dir/$next" --repo "$REPO" | ||
| release_json="$(gh api "repos/$REPO/releases/tags/$LATEST_TAG")" | ||
| old_id="$(jq -r --arg n "$ASSET" '.assets[] | select(.name == $n) | .id' <<<"$release_json")" | ||
| next_id="$(jq -r --arg n "$next" '.assets[] | select(.name == $n) | .id' <<<"$release_json")" | ||
| if [ -n "$old_id" ]; then | ||
| gh api -X DELETE "repos/$REPO/releases/assets/$old_id" | ||
| fi | ||
| gh api -X PATCH "repos/$REPO/releases/assets/$next_id" -f name="$ASSET" >/dev/null | ||
| if [ -f "$dir/$checksum" ]; then | ||
| gh release upload "$LATEST_TAG" "$dir/$checksum" --repo "$REPO" | ||
| fi | ||
| gh release edit "$LATEST_TAG" --repo "$REPO" --notes "$notes" |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '1,110p' .github/workflows/mobile-android-latest-apk.ymlRepository: stablyai/orca
Length of output: 5055
🏁 Script executed:
#!/bin/bash
set -e
file=.github/workflows/mobile-android-latest-apk.yml
git diff --no-ext-diff --unified=5 0971479866f2dc625b5c32dbc260ca568d1460dc 1e894304d65a471ff9a1940f206338c1c0e8c3e6 -- "$file"
printf '\n--- workflow callers ---\n'
rg -n -C 4 'mobile-android-latest-apk|workflow_call' .github/workflows
printf '\n--- file with line numbers ---\n'
nl -ba "$file" | sed -n '68,108p'Repository: stablyai/orca
Length of output: 21246
🏁 Script executed:
#!/bin/bash
set -e
nl -ba .github/workflows/mobile-android-release.yml | sed -n '1,42p;220,252p'Repository: stablyai/orca
Length of output: 2923
Recover the orphaned APK before stale-asset cleanup.
If the rename PATCH returns nonzero after the DELETE succeeds, set -euo pipefail stops the step with no app-release.apk. The next run deletes app-release.next.apk instead of restoring it, so the permanent URL can remain unavailable until a later run succeeds or someone dispatches the workflow. Promote the orphan before cleanup and refresh release_json. A trap can attempt immediate recovery, but the same API failure can also defeat that attempt.
Suggested recovery
release_json="$(gh api "repos/$REPO/releases/tags/$LATEST_TAG")"
+ old_id="$(jq -r --arg n "$ASSET" '.assets[] | select(.name == $n) | .id' <<<"$release_json")"
+ next_id="$(jq -r --arg n "$next" '.assets[] | select(.name == $n) | .id' <<<"$release_json")"
+ if [ -z "$old_id" ] && [ -n "$next_id" ]; then
+ gh api -X PATCH "repos/$REPO/releases/assets/$next_id" -f name="$ASSET" >/dev/null
+ release_json="$(gh api "repos/$REPO/releases/tags/$LATEST_TAG")"
+ fi
if jq -e --arg asset "$ASSET" --arg src "Currently: $source_tag " \…al itself - Look up each candidate tag with releases/tags (published only) and skip a tag only on 404; any other error fails the run instead of serving an older APK. - Decide "already current" from the source and served asset digests (APK and checksum), so a re-published build of the same version reaches the link and a checksum sits beside the APK exactly when the source has one. All downloads happen before any write. - Run on push to main (creates the release on merge as the workflow bot) and daily, so a swap that died midway is repaired; concurrency moves to the job. - Register mobile-android-latest as a prerelease tag in the release policy.
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:
8e17cf21-8f53-4ec2-8b06-483b1f02863e
📒 Files selected for processing (5)
.github/workflows/mobile-android-latest-apk.ymlconfig/scripts/release-policy.mjsconfig/scripts/release-policy.test.mjsconfig/scripts/release-tag-pattern-census.test.mjsconfig/scripts/release-tag-patterns.mjs
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
A run whose final notes edit failed left the notes naming the previous version, and the digest-only no-op check never repaired them. The no-op path now rewrites the notes when they differ from the ones the current source would produce.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Keep the old checksum until the temporary APK upload… · mobile-android-latest-apk.yml:135-140
.github/workflows/mobile-android-latest-apk.yml:135-140
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winKeep the old checksum until the temporary APK upload succeeds.
If
gh release upload "$LATEST_TAG" "$dir/$next" --repo "$REPO"fails,set -estops the job after the stale-asset loop has deletedapp-release.apk.sha256. The oldapp-release.apkremains served, but users cannot run the documented checksum check against it. Delete the old checksum after the temporary upload succeeds but before replacing the permanent APK. Deleting it only after the APK swap can leave the old checksum beside the new APK if publishing the new checksum then fails.Suggested fix
- for stale in "$next" "$checksum"; do + for stale in "$next"; do stale_id="$(jq -r --arg n "$stale" '.assets[] | select(.name == $n) | .id' "$dir/latest.json")" if [ -n "$stale_id" ]; then gh api -X DELETE "repos/$REPO/releases/assets/$stale_id" @@ old_id="$(jq -r --arg n "$ASSET" '.assets[] | select(.name == $n) | .id' "$dir/latest.json")" next_id="$(jq -r --arg n "$next" '.assets[] | select(.name == $n) | .id' "$dir/latest.json")" + old_sum_id="$(jq -r --arg n "$checksum" '.assets[] | select(.name == $n) | .id' "$dir/latest.json")" + if [ -n "$old_sum_id" ]; then + gh api -X DELETE "repos/$REPO/releases/assets/$old_sum_id" + fi if [ -n "$old_id" ]; then gh api -X DELETE "repos/$REPO/releases/assets/$old_id" fi
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
625dfa7d-1b70-40bd-9c37-b7d5978995f9
📒 Files selected for processing (1)
.github/workflows/mobile-android-latest-apk.yml
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/mobile-android-latest-apk.yml
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed the newest commit — the only change since the prior review at 52623dfc99: the permanent-link workflow now re-derives its release notes when the served APK and checksum are already current but the notes still name an older version.
- Heal stale release notes in the already-current path —
mobile-android-latest-apk.yml:120-128compares the served release body against the freshly computed notes and callsgh release editonly when they differ, so a run that swapped the APK and checksum but died before writing the notes is repaired on the next run without re-uploading the APK.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
Review summary (head c5acc09)The problem. Every Android download link (the READMEs in seven languages, the docs site, the desktop pairing screen and Settings → Mobile) named one version, so each one had to be edited by hand after every Android release, and they kept going stale. Copies built into the desktop app stayed stale on every installed desktop until its next update (#7583). What changes for users. Every Android download link now points at one permanent URL, Rollout. No manual step is needed. When this PR merges, the workflow runs on Fixed during review (two new commits on top of the original, 52623df and c5acc09):
Deferred (not fixed here):
Verified:
Not verified:
|
|
Closing as superseded: a merged PR already covers this change. #28143 (5a77f06) moved every README, docs and in-app APK link to one stable URL (onorca.dev/download/android) with a bump on release, solving the same stale per-version links (Stale-PR cleanup 2026-10-20, approved by Brennan. Reopen if something here is still missing on main.) |

ELI5
Every "download the Android app" link (the READMEs in seven languages, the docs site, and two places in the desktop app) names one specific version, so each one has to be edited by hand after every Android release. They keep getting missed: the desktop app and the docs site were still sending people to 0.0.48 after 0.0.50 and 0.0.52 shipped. This gives Android one permanent download link that a workflow keeps pointing at the newest build, and moves every link to it, so nobody edits them again.
What Changed
.../releases/download/mobile-android-v0.0.52/app-release.apk(or older). Each Android release needed a follow-up edit to ~17 links, and the copies built into the desktop app stayed stale on every installed desktop until its next update.https://github.com/stablyai/orca/releases/download/mobile-android-latest/app-release.apk, which always serves the newest Android APK. Link text drops the version number, since the link no longer promises one.mobile-android-latest-apk.yml, copies the newest Android APK onto a dedicatedmobile-android-latestrelease. It runs after every Android release (the Android release workflow calls it), once when this PR merges (it creates the release then), once a day, and by hand.mobile-android-v*release that has an APK, not the build of the run that called it, so re-running an older release can never roll the link back. It looks each version up as a published release; it moves on to an older version only when GitHub says that version has no published release (HTTP 404, which also covers drafts). Any other error, such as a GitHub outage, fails the run and leaves the link as it was, instead of quietly serving an older APK.mobile-android-latestrelease is a pre-release created with--latest=false, so it never takes the desktop app's Latest badge. Its tag is never moved. The release policy now knows this tag: it is a pre-release that the workflow's built-in token publishes, so even a manual edit that marks it Latest is put back.Why
GitHub's built-in
releases/latest/download/...URL can't be used: in this repo "latest" is the desktop app. A dedicated release gives Android a URL of its own.Alternatives considered:
mobile-android-latesttag on each release. That needs CI to force-push a tag, for no benefit to a download link.Nothing that reads Android releases sees the new release: the desktop updater ignores tags that aren't version numbers, the phone's update check (#23755) and the Android release-notes lookup only match
mobile-android-v, and the release workflow only triggers onmobile-android-v*tags.This supersedes #22894, which proposed the same permanent link.
Linked Issue
Fixes #7583
Visual Proof
N/A: only the destination of existing download links changes, plus the version number dropped from their text.
Testing
ghthat keeps release state in local files and never calls GitHub. Cases: first run creates the release and serves 0.0.52; a second run writes nothing; a same-version re-publish with new bytes is swapped in; a 502 on the newest version fails the run with no writes; a version with no release (404) or only a draft is skipped; a release without a checksum removes the old checksum and uploads none; a failed checksum download fails before any write; a leftover temporary APK from a dead run is cleaned up; a failed rename, a failed checksum upload and a failed notes update are each repaired by the next run; a failed tag listing fails with no writes; files with no recorded digest are hashed and not re-swapped.sha256:68bd92…) and on the oldest one (0.0.14).mobile-android-latestto a pre-release when someone marks it Latest, and the shared tag patterns never classify it as a desktop or versioned mobile release.release-policy.test.mjs,release-tag-pattern-census.test.mjsand the workflow-reading tests pass.actionlintreports nothing on the new workflow;oxfmt --checkpasses on every changed file.src/for versioned Android APK links: none left.Rollout: no manual step. Merging runs the workflow, which creates
mobile-android-latestand uploads the 0.0.52 APK as the workflow bot (no maintainer token: the release policy deletes a non-version release a person creates). The README and docs links 404 for the minute or two that first run takes. The links in the desktop app only reach users with the next desktop release, by which time the release exists. If that first run fails, the daily run (or a manual run) creates it.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
CI-only workflow change, a release-policy tag registration, and link updates; no effect on SSH, remote, or app behavior beyond where the download links go.
Author X/Twitter: @BrennanKB5
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)