Skip to content

Add launchpad diff command for build-to-build size comparison#642

Draft
trevor-e wants to merge 1 commit into
mainfrom
trevorelkins/eme-1224-build-something-cool-7b46
Draft

Add launchpad diff command for build-to-build size comparison#642
trevor-e wants to merge 1 commit into
mainfrom
trevorelkins/eme-1224-build-something-cool-7b46

Conversation

@trevor-e

@trevor-e trevor-e commented Jul 1, 2026

Copy link
Copy Markdown
Member

Adds a diff CLI command that analyzes two artifacts and reports the size delta between them — useful for catching size regressions between builds.

launchpad diff old.apk new.apk            # table (default)
launchpad diff old.xcarchive.zip new.xcarchive.zip --format json

It reports:

  • Summary: install/download size for base vs head, with signed deltas (green for shrink, red for growth)
  • Category changes: per-treemap-category size deltas
  • File changes: files added / removed / modified, matched by path (a file present in both builds is "modified" only when its content hash or size differs), sorted by largest absolute change. --limit caps rows in table output.

The core comparison lives in compute_diff (size/diff.py) operating on BaseAnalysisResults, so it's platform-agnostic and unit-tested independent of the CLI. Table rendering reuses the existing size command's byte formatting.

Testing

  • tests/unit/size/test_diff.py covers added/removed/modified/unchanged classification, category deltas, identical-build no-ops, and JSON serialization.
  • CLI help/registration tests in tests/unit/test_cli.py.
  • Verified end-to-end against fixture artifacts; make check passes (lint/format/types).

Adds a `diff` CLI command that analyzes two artifacts and reports the
size delta between them: total install/download size changes, per-category
deltas, and per-file added/removed/modified changes. Supports table and JSON
output. Useful for catching size regressions between builds.

Generated with [Linear](https://linear.app/getsentry/issue/EME-1224/build-something-cool#agent-session-6e6bd37b)

Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
@linear-code

linear-code Bot commented Jul 1, 2026

Copy link
Copy Markdown

EME-1224

@sentry

sentry Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

📲 Install Builds

iOS

🔗 App Name App ID Version Configuration
HackerNews com.emergetools.hackernews 3.8 (1) Release

Android

🔗 App Name App ID Version Configuration
Hacker News com.emergetools.hackernews 1.0.2 (13) Release

⚙️ launchpad-test-android Build Distribution Settings

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit bf5cc20. Configure here.

file_changes.append(FileChange(path=path, kind=ChangeKind.REMOVED, head_size=0, base_size=base_file.size))
elif base_file is not None and head_file is not None:
if base_file.hash == head_file.hash and base_file.size == head_file.size:
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty hash skips real changes

Medium Severity

For paths present in both builds, compute_diff skips reporting when hash and size both match. Android analysis sets hash to an empty string for merged entries (e.g. combined DEX or duplicate paths), so two builds can differ in content while still being treated as unchanged when merged sizes match.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bf5cc20. Configure here.

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.

1 participant