Repository navigation
ci(release): sign Android helpers in a job that runs only workflow-commit code - #5410
Conversation
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 6 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
fc71e22 to
b492465
Compare
This comment has been minimized.
This comment has been minimized.
|
Two problems in the new signing split at b492465 need a fix before the signing key can be trusted to this design. A second independent pass found that the unsigned artifact from the compile job is extracted after the signing checkout and before the keystore is loaded (release.yml:155, keystore at lines 170–190). If that artifact is a ZIP with a nested path that resolves outside the extraction directory, the pinned download action can overwrite the checked-out signing files, so a later signing step can run compiler-controlled code with the key in reach. The same sequence exists in the stable asset call and standalone dispatch (release-android-snapshot-helper.yml:94–145). The APK validator runs only after extraction, and the numeric ID picks the archive without limiting its entries. The pinned bundle passes the archive to unzip-stream's Extract, which joins and opens each destination without a containment check (extract call, path join). The PR dry run uses the same downloader, so it can lose the signed-output guarantee even with its disposable key. The rule to satisfy: no step that holds or precedes the keystore may extract compiler-controlled archive entries without a path-containment check. Both signer downloads enumerate the sites. Replace them with a pinned downloader whose bundled extractor checks containment before any write, or download without automatic decompression and write only the exact expected regular APK entries into a fresh temporary directory. A second independent pass also found that delayed approvals and retries now break (release.yml:119). Approve a nightly or stable signing job two days after compilation. The approval is still inside GitHub's 30-day window, but the one-day compile artifact has expired, so the ID download at lines 154–159 fails. The stable asset call and standalone dispatch have the same expiry (release-android-snapshot-helper.yml:72–87). Separately, if signing succeeds and a later build or publish job fails, rerunning only failed jobs after two days (as CONTRIBUTING.md:126 says) keeps the old signer result, whose artifact has expired (release.yml:193–200, release-android-snapshot-helper.yml:148–155), so the retry fails before packaging. The old build and publish jobs compiled and signed inside the retried job, so they had no such window (base 813f53a). Keep the unsigned and signed helper artifacts in both release files for the 30-day approval and retry window, within the repository retention limit. See GitHub's docs on deployment approval and re-running jobs. Not blocking, and these can be taken or left: the invariant test at release-workflow.test.ts:122 reads only release.yml, so the keystore-holding job in release-android-snapshot-helper.yml is not asserted (one test over a table of file, signer and unkeyed jobs would enumerate every signer); the signer job and the release certificate literal exist in several copies (release-android-snapshot-helper.yml:141, release.yml:186), so one owner such as a reusable job or a default pin in scripts/sign-android-helpers.sh would remove the "Keep it equal" comment; and CI runs only the disposable-key branch of sign-android-helpers.sh:67, so the keystore branch and the pin match and mismatch have no automated test unless the first post-merge nightly is accepted as the proof. The two open inline threads on the test regex and the dropped setup-node step still stand, both as non-blocking notes. The only failing check is Body rules, which checks the PR body and not the code: it needs a "## Summary" section and fewer than 250 words (the body has 422). That failure is likely unrelated to the diff. The release dry-run split, rehearsal and package jobs, repo guards and smoke tests passed at this head. Before merge, the two problems above need a fix and the body needs a rewrite. Not verified here: the stable-tag or dispatch snapshot path and the release-environment keystore path, which PR CI does not run; the author's local pin and keystore validation; and the environment deployment policy and branch ruleset, which are admin settings. The first nightly (no build-job secret, helper certificate 734335…39e1) and the next stable tag are the proof for those paths. |
b492465 to
6aecb64
Compare
|
Replies to the review in 6aecb64:
|
8f3a026 to
2596025
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 3 new findings on 2596025. The verdict and the full list are in the summary comment.
- 🟡 Minor · Release certificate pin duplicated in two workflows that must stay equal ·
.github/workflows/release-android-snapshot-helper.yml:149 - 🟡 Minor · Consumer cert check compares the APK against the signer's own output, not the pin ·
.github/workflows/release-android-snapshot-helper.yml:196 - 🟡 Minor · Rehearsal signer is no longer checked as workflow-commit code ·
test/ci/release-workflow.test.ts:95
…the rehearsal signer
This comment has been minimized.
This comment has been minimized.
|
The earlier review (b492465, #5410 (comment)) findings are mostly addressed at 7db0714, but the change adds one new problem that stops the Release workflow from starting. The test guard now inspects parsed step fields, Node is set up before metadata resolution, the pin has a single default in the signing script, and the rehearsal case is in the test table. The delta adds The whole Release workflow then fails for every event: PR dry runs, the nightly schedule, dispatch and stable tags. Nothing publishes. This is a regression against the base, where release.yml starts. PR checks do not show it because a startup failure creates no check run. Every other listed check is green. The rule is that every job that calls a reusable workflow must grant at least the union of the permissions its nested jobs request. Please add A second independent pass reached the same finding from the stable-tag and dispatch-retry path, where the caller grants Not verified here: the exact startup_failure message, because the CLI does not expose it. The attribution rests on the GitHub rule, the caller's contents-only permissions, and the failure starting exactly at the head that added Before merge, a Release workflow dry run at the fixed head must start and pass compile-helpers, sign-helpers (packed fetch plus in-script extraction with the disposable key) and build. A non-startup_failure run of release.yml for the new head SHA shows this. Of the earlier inline threads, the test guard thread (#5410 (comment)), the Node 24.13 setup thread (#5410 (comment)), the pin default thread (#5410 (comment)) and the rehearsal test-table thread (#5410 (comment)) are fixed at this head and can be resolved. The pin thread at #5410 (comment) does not apply: the trusted signer enforces the pin before upload (sign-android-helpers.sh lines 99 and 121), and the consumer runs planned-source code, so a pin there adds no guarantee. No other threads still apply. No conflicts were reported. Before merge, add |
This comment has been minimized.
This comment has been minimized.
|
The change at 7f78198 looks good, and the startup failure from the earlier review (#5410 (comment)) is now fixed. All 35 checks pass, and the Release pull_request run at this head (47535069445) succeeds through compile, sign and build. No conflicts are known. Nothing else blocks merge. Not verified here: the dry run skips the Android helper assets reusable-workflow jobs. The release-environment keystore path, the packed artifact fetch with Of the other open threads, these no longer apply and can be resolved: the step-field guard (#5410 (comment)), the Node.js 24.13 setup order (#5410 (comment)), the single pin default (#5410 (comment)), the consumer-side pin (#5410 (comment), the signer enforces the pin before upload and the author withdrew it), and the rehearsal signer test case (#5410 (comment)). |
| - name: Setup Android SDK | ||
| uses: ./.github/actions/setup-android-sdk | ||
|
|
||
| - name: Compile unsigned helpers |
| - name: Compile unsigned helpers | ||
| env: | ||
| VERSION: ${{ needs.plan.outputs.version }} | ||
| AGENT_DEVICE_ANDROID_HELPER_UNSIGNED: '1' | ||
| run: | | ||
| set -euo pipefail | ||
| for helper in snapshot ime; do | ||
| sh scripts/build-android-helper.sh "$helper" "$VERSION" "$RUNNER_TEMP/unsigned-helpers" | ||
| done | ||
|
|
||
| - name: Upload unsigned helpers |
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
|
The code at 5fa19a1 looks correct, and the cache-poisoning route from the earlier review (7f78198, #5410 (comment)) is now closed. The compile job runs with The only failing check is the CodeQL aggregate, and it comes from the two cache-poisoning alerts on compile-helpers. The rule matches the checkout plus execution and does not model job-level The two inline alert threads do not apply at this head and can be resolved: #5410 (comment) and #5410 (comment). A maintainer needs to dismiss both alerts in code scanning as false positives so the CodeQL check goes green. Nothing in the code blocks merge, and no conflicts are known. |
Summary
Stacked on #5409. Planned-source code no longer runs in a job that holds the Android helper keystore.
releaseenvironment; disposable key in dry runs): a sparse checkout ofworkflow_shawith no install and no cache. It fetches the compiler artifact packed, through the REST API by ID, and checks that it comes from this run.actions/download-artifactextracts without a containment check, so it is not used here.scripts/sign-android-helpers.shunpacks only the exact expected APK names, as regular files, into a fresh directory. It checks ZIP structure and identity, signs, verifies v1+v2 and a single signer, and pins the release cert734335…39e1.mainand0.22.release-android-snapshot-helper.ymland the rehearsal use the same signer. Helper artifacts are kept for 30 days to cover approvals and reruns.Validation
../paths and a symlink entry are all rejected. The packaged bytes match the signed bytes.734335…39e1.