Repository navigation
fix(android): stop release signing from blocking Debug test filters - #136273
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 10:45 AM ET / 14:45 UTC. ClawSweeper reviewWhat this changesThe PR moves Android signing and release-metadata validation from requested task-name parsing to selected release-variant pre-build hooks, including Wear, and avoids capturing the build-script object in license validation. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readinessThe PR remains necessary: current main still uses the task-name heuristic that can inspect Debug test filters. The selected-release-variant wiring is structurally the right repair and has no discrete code finding, but this maintainer-owned PR must resolve the current exact-head security check failure and complete its Android checks before merge. Priority: P2 Review scores
Verification
How this fits togetherAndroid Gradle configuration creates phone and Wear build variants before their task graphs run. The changed hooks decide when signed release graphs must validate credentials and reproducible build metadata, while Debug unit-test graphs proceed normally. flowchart LR
A[Gradle invocation] --> B[Android variant selection]
B --> C{Release variant selected?}
C -->|Yes| D[Signing and metadata checks]
C -->|No| E[Debug test task]
D --> F[Release build graph]
E --> G[JUnit execution]
Before merge
Agent review detailsSecurityNone. PR surfaceOther +1. Total +1 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the variant-lifecycle repair only after the exact head demonstrates the existing Debug-filter reproduction, all direct phone/Wear release guards, and a resolved or documented security-fast result. Do we have a high-confidence way to reproduce the issue? No independent high-confidence reproduction was run in this read-only checkout; the source shows the prior configuration-time heuristic, and the PR body supplies a claimed native before/after matrix. Is this the best way to solve the issue? Unclear: attaching checks to selected release variants is the maintainable owner boundary and covers phone and Wear in source, but the pinned AGP lifecycle implementation could not be independently inspected here. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bf898e2fce7c. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Attach signing and build metadata validation to release variants instead of parsing task arguments. Keep the existing license validation action independent of the build script for strict configuration caching.
eb4b3b2 to
d01147e
Compare
|
Merged via squash.
|
Attach signing and build metadata validation to release variants instead of parsing task arguments. Keep the existing license validation action independent of the build script for strict configuration caching.
What Problem This Solves
Fixes an issue where developers running a Debug test whose filter contains “Release” were asked for release-signing credentials before any test could run. It also ensures indirectly selected release builds cannot miss the signing guard.
Why This Change Was Made
Gradle's requested task names also include task arguments. The old substring/aggregate-name heuristic therefore confused test filters with release tasks. Validation now belongs to the selected AGP release variant's pre-build lifecycle, including task dependencies and abbreviations. Both phone flavors retain explicit build-metadata validation; standalone Wear retains its existing signing-only policy and shared phone signing configuration.
Strict configuration-cache validation exposed a nearby existing failure: the license validation action captured the build-script object. It now captures only the directory and diagnostic path during configuration; its inputs, checks, messages, and dependency remain unchanged. The new signing/metadata actions likewise capture task-local values.
User Impact
Debug tests no longer need unrelated release credentials. Real Play, ThirdParty, and Wear release graphs still reject missing signing properties; phone release graphs still reject missing build metadata. No new settings, credentials, dependencies, or release artifacts are introduced.
Current-head Verification
Current commit:
d01147edb246cb0db3b89b6c9ff7495d8ccc69fa, mechanically rebased ontoe29d55a6c058f48310abeb2509f903ed0b090401after the separate CI-budget fix #136307 landed. The upstream Compose dependency removal is preserved. Gradle remains 9.7.1 and AGP remains 9.4.0; there is no dependency upgrade in this PR.The exact clean commit repeated the original ordered 20-case native Gradle matrix: nine successful exits and eleven intentional release-guard rejections, with five fresh JUnit executions and no failures/errors/skips. Summed Gradle runtime was 307.045 seconds, including fresh flavor compilation. All 759 captured source facts, HEAD, original driver and alias fixtures remained unchanged. Strict cache storage/reuse and signing/metadata invalidation passed; release APK/AAB outputs did not change.
The initially absent dependency graph was provisioned once through the documented native-PR workflow using frozen repository-pinned pnpm 12.1; all 766 captured source/manifest facts and the lockfile remained unchanged. The fresh matrix used separate cache roots. The task-local Debug key was removed after verifying its exact recorded identity, without reading its contents or touching operator/release keys.
Direct inspection covered both complete build scripts and the pinned AGP lifecycle implementation/callers. The published AGP 9.4.0 API sources define
LifecycleTasks.registerPreBuild; the matching implementation sources store those dependencies and attach them to the actual variant pre-build task. Publisher checksums matched both downloaded archives. This directly addresses the dependency-contract gap in the latest ClawSweeper review. Fresh managed Codex P0–P2 review found no actionable findings.Exact-head CI, attempt 2 succeeded: nine successful jobs and 26 intentionally skipped jobs, including the required gate, both phone test flavors, Wear tests, phone/Wear builds, lint, and security-fast. Six successful jobs executed on the retry; three successes were retained from attempt 1. The hosted Play build completed in 18m46s. The previous candidate's hosted build timeout remains historical evidence, not a passing result; the separately landed budget fix is now in this branch.
The retained first-attempt security-fast failure occurred while pre-commit bootstrapped its public hook repository:
git fetchexited 128 before the private-key hook executed. It was not a detected committed key. After confirming there was no useful work executing, only failed/cancelled unfinished lanes were recovered. The current security job and all selected Android checks passed, satisfying the latest review's CI rank-up request. No validation, test, or scanner was disabled.Retained Before/After Evidence
Source:
eb4b3b201e18cb9146da68c6e1389afdcf892b7f. The native runs used the byte-identical candidate before commit; all 759 captured inputs remained unchanged during every run. Managed Codex P0 review found no actionable findings, with direct owner/caller/sibling and pinned dependency-source inspection.The original Debug selection
:app:testPlayDebugUnitTest --tests ai.openclaw.app.chat.ChatControllerOutboxTest.healthFlushRequestDuringActiveFlushIsDrainedAfterReleasefailed at configuration with missing signing properties and zero executed tests. The fixed Play and ThirdParty selections each executed the existing JUnit test successfully.The final native Gradle matrix matched 20/20 expected outcomes: nine successful runs and eleven intentional signing/metadata rejections. This is twenty real Gradle executions, not twenty unit tests. Five fresh JUnit executions passed without failures or skips. Coverage includes all three direct release graphs, aggregate app assembly, three root aliases (including the abbreviated
:phonePlP), both phone metadata guards, unchanged standalone-Wear metadata policy, strict Debug cache storage/reuse, guard cache storage/reuse, and invalidation when signing or metadata inputs change.The license-task cache failure was first observed on the initial candidate and then reproduced on unchanged baseline code using the existing
deleteRemovesQueuedRowtest. That JUnit test passed, but Gradle rejected configuration-cache storage. The final candidate stores and reuses the strict cache without suppressions. No release APK/AAB output changed. Aggregate assembly may build Debug outputs; any generated Debug signing material was confined to task-local Android preferences. No release keystore was read, release signing/upload/install performed, task action replaced, or validation skipped. Aggregate Debug prerequisites use only task-local generated Debug signing material, not release credentials.The contract checks used the pinned AGP 9.4 lifecycle implementation and Gradle's task-name API. The task-local capture fix follows Gradle's configuration-cache requirements.
Production +32/-31 (net +1); no test-source growth. Existing JUnit coverage plus real task-graph/cache runs provide the regression proof without adding source-text assertions. The two local license captures are required to detach the action from the nonserializable script owner; the obsolete task-name policy is deleted.
Follow-up boundary: this does not establish full release-artifact configuration-cache compatibility. The existing release-only DNS stripping action still uses Project-backed file operations and needs its own full release-cache audit. No claim is made that a complete signed release was built.
Release note: Android Debug test filters no longer trigger release signing checks; signing and metadata validation follow the actual selected release variants.