Skip to content

feat(artifacts): Emit granular installable app error codes (EME-883)#603

Merged
runningcode merged 4 commits intomainfrom
no/eme-883-distribution-error-enum-values
Apr 24, 2026
Merged

feat(artifacts): Emit granular installable app error codes (EME-883)#603
runningcode merged 4 commits intomainfrom
no/eme-883-distribution-error-enum-values

Conversation

@runningcode
Copy link
Copy Markdown
Contributor

@runningcode runningcode commented Apr 23, 2026

Mirror the new granular InstallableAppErrorCode values added in getsentry/sentry#113440, and emit them directly from _do_distribution instead of packing the reason into the free-form error_message string.

Before, when distribution was skipped for one of these reasons we sent error_code=SKIPPED (or PROCESSING_ERROR) plus a short-code string in error_message and the Sentry frontend had to pattern-match on those strings. After Sentry gained dedicated enum values for each case, launchpad emits the specific code paired with a human-readable sentence that the Sentry install page renders verbatim as the description:

Case Before After
iOS signature invalid SKIPPED + "invalid_signature" INVALID_CODE_SIGNATURE + "The build's code signature could not be verified."
iOS simulator build SKIPPED + "simulator" SIMULATOR_BUILD + "Simulator builds cannot be distributed."
Unrecognised artifact type PROCESSING_ERROR + "unsupported artifact type" UNSUPPORTED_ARTIFACT_TYPE + "This artifact type is not supported for distribution."

Cleanup

  • Drop the error_message tag from the distribution.processing.error statsd metric. error_code is the pivot dimension; error_message is 1:1 with the code today and interpolating a variable into it later would silently explode metric cardinality. The log line and PUT body still carry the message.
  • Correct the class-name references in the enum sync comments (InstallableApp.ErrorCodePreprodArtifact.InstallableAppErrorCode) and spell out why the invariant matters — drift will 400 on Sentry's pydantic validation.

Refs EME-883

Sentry's InstallableAppErrorCode enum was extended with granular values
for the specific distribution-failure reasons launchpad produces
(INVALID_CODE_SIGNATURE, SIMULATOR_BUILD, UNSUPPORTED_ARTIFACT_TYPE).

Mirror those values in the launchpad-side enum and emit them directly
from _do_distribution instead of packing the reason into the free-form
error_message string on top of SKIPPED / PROCESSING_ERROR.

Depends on getsentry/sentry#113440 — that PR must be deployed first so
Sentry's PUT endpoint accepts the new codes.
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Apr 23, 2026

@sentry
Copy link
Copy Markdown
Contributor

sentry Bot commented Apr 23, 2026

📲 Install Builds

Android

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

⚙️ launchpad-test-android Build Distribution Settings

Replace empty error_message strings with a human-readable sentence at
each emission site. Sentry renders these verbatim on the install page
as the description under the error title (which is derived from
error_code). Keeps copy next to the condition it describes rather
than centralising it in Sentry and losing per-site context.
Copy link
Copy Markdown

@cursor cursor Bot left a comment

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.

Reviewed by Cursor Bugbot for commit a96cba5. Configure here.

Comment thread src/launchpad/artifact_processor.py
error_code already covers the dimension you'd pivot on in dashboards,
and error_message is currently 1:1 mapped to error_code so the tag
only duplicates information. Keeping it sets a trap: the day someone
interpolates a variable (artifact ID, version, path) into a message,
metric cardinality explodes silently. The log line and PUT body still
carry the message for human context.

Also drop two stale comments on the enum classes pointing at Sentry —
the pointer was vague ("Django model") or used an old class name.
"distribution.processing.error",
tags=[
f"error_code:{error_code.value}",
f"error_message:{error_message}",
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.

I removed this since the error codes now map 1:1 with error messages.

Earlier I dropped these comments because the class names they pointed
at were stale. The comments' load-bearing purpose — flagging that
these enums mirror Sentry and a drift will fail pydantic validation
on the distribution PUT — was worth keeping. Restore them with
accurate references.
Copy link
Copy Markdown
Contributor

@chromy chromy left a comment

Choose a reason for hiding this comment

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

lgtm

@runningcode runningcode merged commit 7aa9227 into main Apr 24, 2026
22 checks passed
@runningcode runningcode deleted the no/eme-883-distribution-error-enum-values branch April 24, 2026 14:03
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.

2 participants