Skip to content

ci: install the Android SDK through one setup-android-sdk action - #4400

Merged
thymikee merged 2 commits into
mainfrom
claude/audit-findings-remediation-62d6ky-android-sdk-action
Nov 11, 2026
Merged

thymikee merged 2 commits into
mainfrom
claude/audit-findings-remediation-62d6ky-android-sdk-action

Conversation

@thymikee

@thymikee thymikee commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Summary

TOOL2-5 (refs #4368). The sdkmanager install existed in six copies. They handled the yes SIGPIPE three different ways, and one of them (|| true) hid real licence failures. The build-tools version 36.0.0, which decides the helper APK bytes, was written nine times.

A new composite action, .github/actions/setup-android-sdk, now owns the version through its build-tools input. It exports AGENT_DEVICE_ANDROID_BUILD_TOOLS, outputs build-tools-dir, and installs only when a build-tools binary a caller runs (aapt aapt2 d8 zipalign apksigner) or the platform jar is missing. All six sites call it.

The fixture APK scripts read the exported version. A local repack outside CI uses the newest installed build-tools, and it refuses to run without the version when CI=true.

A repo guard keeps the version and sdkmanager inside the action. 12 files.

Validation

  • Tested SHA 819d1dd.
  • check:quick and check:fallow --base origin/main pass, and so do the new guard and test:fixture-cache (16/16, including build-tools version ordering and a missing SDK).
  • At 2295200: check:affected stopped at the 2 known container-only smoke-daemon-clean failures, and every remaining gate passed when run on its own. 819d1dd touches only the action's readiness check, the repack script and its test.
  • actionlint is clean on the changed files.
  • CI obligations: green runs of android.yml, size.yml and test-app-build-cache.yml (Android leg).
  • release.yml and release-android-snapshot-helper.yml run only after merge, so the next release run is their first proof.
  • Risk: a workflow_dispatch of the snapshot-helper workflow with a checkout_ref older than this action fails, because the action does not exist at that ref.

Generated by Claude Code


<a href="https://backend.blacksmith.sh/track/enable-autofix?expires=1796966815&installation_model_id=447842&pr_number=4400&ref=codesmith_pr_footer&repository=callstack%2Fagent-device&return_to=https%3A%2F%2Fgithub.com%2Fcallstack%2Fagent-device%2Fpull%2F4400&signature=3c7dbb95da9da01e1adcc23d3c07df48dac44735b450e18e918d560c4e67f04f"&gt;&lt;picture&gt;&lt;source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"&gt;&lt;source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"&gt;&lt;img alt="Autofix with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png" width="190" height="28"&gt;
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

&lt;source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"&gt;&lt;source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"&gt;&lt;img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"&gt; <a href="https://www.cubic.dev/action/auto-fix/pr/callstack/agent-device/4400?returnTo=https%3A%2F%2Fgithub.com%2Fcallstack%2Fagent-device%2Fpull%2F4400&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true">&lt;source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"&gt;&lt;source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"&gt;&lt;img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"&gt;


Generated by Claude Code

Six copies of the sdkmanager install handled the `yes` SIGPIPE three ways
(one hid real licence failures with `|| true`) and the build-tools version
was written nine times. The new composite action owns the version (input
`build-tools`), exports AGENT_DEVICE_ANDROID_BUILD_TOOLS, and outputs
`build-tools-dir`. The fixture APK scripts read the exported version; a
local repack outside CI takes the newest installed build tools. A repo
guard keeps the version and sdkmanager inside the action.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.21 MB 6.21 MB +175 B
Package (unpacked) 6.20 MB 6.20 MB +175 B
Package (download) 1.88 MB 1.88 MB +17 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 26.4 ms 26.9 ms +0.5 ms
CLI --help 66.9 ms 53.1 ms -13.8 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 12 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

setup-android-sdk skipped sdkmanager when aapt and apksigner existed, but
the helper build also runs aapt2, d8, and zipalign. The repack script's
newest-version lookup exited silently under pipefail when the build-tools
directory was missing; it now reaches its own diagnostic. The repack test
covers version ordering (9.0.0, 35.0.1, 36.0.0) and a missing directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel

Verdict: approve

No findings.

1 finding below minor not shown (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (a97f7948c4f7).

Feedback goes in the review comment threads, as a reply under the inline comment of a finding:

Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.

Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.

Comment @apex-sentinel-staging review on this conversation to run a full review.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready: I found no problems in the code at 819d1dd, and all 28 checks are passing. There are no conflicts, and it can merge on a maintainer decision. Not blocking, and fine to take or leave: the new fallback to the newest installed build-tools directory in repack-android-apk.sh was not requested (a local repack could require AGENT_DEVICE_ANDROID_BUILD_TOOLS, or keep the old 36.0.0 default, and drop the sort -V test case), and the licence-failure guard in android-sdk-setup-action.test.ts matches source text, so it could run the install step against a stub sdkmanager that exits non-zero. I did not run the CI jobs or the local tests, so the nested local action use and the env-based key after GITHUB_ENV are inferred from the green checks.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 11, 2026
@thymikee
thymikee merged commit fac75a7 into main Nov 11, 2026
28 checks passed
@thymikee
thymikee deleted the claude/audit-findings-remediation-62d6ky-android-sdk-action branch November 11, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants