Skip to content

docs: complete the preview APK recipe and print versionCode (#26) - #289

Open
saurabhbhoir456 wants to merge 1 commit into
DojoCodingLabs:mainfrom
saurabhbhoir456:fix/preview-apk-version-recipe-26
Open

saurabhbhoir456 wants to merge 1 commit into
DojoCodingLabs:mainfrom
saurabhbhoir456:fix/preview-apk-version-recipe-26

Conversation

@saurabhbhoir456

Copy link
Copy Markdown
Contributor

What and why

For #26, step 1 only; this does not close #26.

Makes the recipe complete and the rebuild inputs public: docs/devices.md ("Or build it yourself") now carries the same step .github/workflows/release-apk.yml runs before building, writing the tag's version and a versionCode into apps/mobile/app.json, and the workflow prints that run's versionCode in the release notes next to the APK's SHA-256, so a rebuild from the tag can use the same two numbers. Steps 2 to 4 of #26 stay open: building twice from one tag and comparing the APKs apart from the signature needs a JDK 17 and Android SDK/NDK toolchain, which is being installed on the machine doing this work; what the comparison finds will be listed on #26, fixed where possible, and only then claimed as reproducible.

Vision fit

ROADMAP "Now": preview APKs anyone can install and check. A rebuild that can use the published version and versionCode is the first half of trusting that the APK is the code on the tag.

Non-negotiables

  • This keeps every non-negotiable in AGENTS.md as it is.
  • Or it changes one, and this is the accepted RFC: n/a

Checklist

  • It closes one issue, linked above, or it's a small fix (a typo, a broken link, a wrong comment). A feature has an accepted proposal. For Make the preview APK reproducible from its tag #26 step 1, linked above; Make the preview APK reproducible from its tag #26 itself stays open for steps 2 to 4.
  • I wrote the failing test first. It fails without this change and passes with it. n/a: docs and a release-notes line; no code or test behavior changes. The recipe snippet itself was run against apps/mobile/app.json in a scratch copy of the step (it sets version and android.versionCode exactly as the workflow does; the file was restored unchanged).
  • These pass: pnpm check:privacy, pnpm typecheck, pnpm lint, pnpm test and node scripts/guard/check.mjs --patterns scripts/guard/patterns.txt. Run locally: the PR guard (ok, 2 changed files) and a YAML parse of the workflow (ok). No app code changes; CI runs the full gates.
  • No new network call, telemetry, analytics, ads or crash reporting. (A new request in an app adapter is explained below, with its host, skill and risk.)
  • No new dependency, or the reason for each one is below.
  • Every UI string is in packages/copy, in es-419 and en, with matching keys and placeholders, and no em or en dashes. n/a: documentation and release notes only, no UI string changed, no em or en dashes in the changed lines.
  • Tests, fixtures and screenshots use made-up data only. n/a: no tests, fixtures or screenshots in this change; the example version numbers in the recipe are labeled examples.

Model path

  • This doesn't touch the model path: packages/model, agent, skills or eval, the prompt, the router, tool descriptions, normalizers, examples or the model file.
  • It does. The eval numbers from before and after are below, run as docs/evals.md says. No held-out case was tuned on.

Screenshots

  • No UI change.
  • UI change. Each changed screen is below, in both themes and both languages, with made-up data.
Light Deep sea
es-419
en

New dependencies and network calls

None in the repository. (Installing JDK 17 on the machine doing the follow-up comparison builds is local tooling only, not a repository dependency. Build-time downloads stay pinned as the workflow already pins them.)

AI agents

  • No AI agent wrote any part of this.
  • An AI agent helped. Which one, and what it did: Tinsel Alpha, an AI coding agent running in OpenCode, drafted the recipe step and the release-notes line and ran the snippet, YAML and guard checks above, in a session directed by the author.
  • I read and ran everything in this pull request, and I can explain it.

@juancguerrerodev

Copy link
Copy Markdown
Contributor

Thanks! Two small fixes: in docs/devices.md (around line 59 of the new text) the sentence "It signs with the key you name…" is stuck to the closing code fence, which breaks the Markdown; put it on its own line. And this covers step 1 of #26 only, so please change "Closes #26" to "Refs #26" so the issue stays open. 🦀

@saurabhbhoir456 saurabhbhoir456 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — blocked on one docs-formatting bug

Verdict: request changes (posted as a comment review, since GitHub doesn't allow a formal request-changes review on your own PR).

The workflow logic is correct and this is a clean step 1 of #26 (no reproducibility overclaim, #26 stays open). One thing must be fixed first:

🔴 Blocking: the new code fence in docs/devices.md:59 never closes

'
``` It signs with the key you name when Gradle runs, in the environment or as Gradle
properties …

The closing fence shares a line with the following sentence. A closing fence can't carry trailing text, so GitHub's GFM parser doesn't recognise it as a close — verified by rendering the file through GitHub's markdown API. Everything from line 59 through line 88 (the signing-key paragraph, the environment/Gradle-property table, and the whole "Run it on an iPhone" section up to its code block) renders as single shell code block. No CI check catches this, since it's purely rendering.

Fix — fence on its own line:

'
```

It signs with the key you name when Gradle runs, in the environment or as Gradle
properties (for example in `~/.gradle/gradle.properties`), never in a file in the repository:

Worth eyeballing the rendered PR diff after the fix.

✅ Verified correct

  • Notes versionCode matches the build. release-apk.yml:193 sets CODE: ${{ github.run_number }}, the same expression the version-stamping step uses at line 102 — so the printed number is the one baked into that build, including on workflow_dispatch rebuilds (both steps re-evaluate in the same run, and the notes are overwritten together).
  • Notes formatting preserved. The \n\n blank-line terminator moves from the certificate line to the new versionCode line (lines 201–202).
  • Recipe snippet matches the workflow byte-for-byte (same node -e body as lines 104–111), and apps/mobile/app.json has expo.android, so the assignment works as relied on in production.
  • Scope is right. No code, dependency, network, or UI-string changes; steps 2–4 of #26 explicitly left open.
  • Checks: PR guard ✅, Privacy/types/lint/tests ✅, mergeable.

🟡 Minor (non-blocking)

  1. The recipe permanently dirties app.json for a local builder, with no hint to revert it. A git checkout -- apps/mobile/app.json after building would prevent an accidental commit of a stamped version.
  2. Releases published before this merges have no versionCode in their notes, so "the number printed in that release's notes" only holds going forward. Qualifying that would stop readers of older releases hunting for a number that isn't there.

With the fence fixed (ideally plus the two nits), good to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the preview APK reproducible from its tag

2 participants