Skip to content

feat(preprod): Add distribution state fields to PreprodArtifact (EME-842)#109075

Merged
runningcode merged 2 commits intomasterfrom
no/eme-842-distribution-state-model
Feb 24, 2026
Merged

feat(preprod): Add distribution state fields to PreprodArtifact (EME-842)#109075
runningcode merged 2 commits intomasterfrom
no/eme-842-distribution-state-model

Conversation

@runningcode
Copy link
Contributor

@runningcode runningcode commented Feb 23, 2026

Summary

  • Add installable_app_error_code and installable_app_error_message columns to PreprodArtifact
  • Add InstallableAppErrorCode enum (UNKNOWN, NO_QUOTA, SKIPPED) following the existing ErrorCode pattern on PreprodArtifact
  • Migration: 0027_add_distribution_state_fields

Uses an error-code model instead of a state field so that installable_app_file_id implicitly encodes success, avoiding ambiguous state combinations:

  • file_id set + no error → success
  • no file_id + error code set → skipped/failed
  • no file_id + no error → pending / not yet determined

Split out from #109062 to land the schema change independently.

EME-842

…842)

Add distribution_state and distribution_skip_reason columns to
PreprodArtifact so we can record when build distribution is skipped
(and why), matching the existing NOT_RAN pattern for size analysis.
@runningcode runningcode requested a review from a team as a code owner February 23, 2026 15:41
@linear
Copy link

linear bot commented Feb 23, 2026

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 23, 2026
Copy link
Contributor

@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.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 23, 2026

This PR has a migration; here is the generated SQL for src/sentry/preprod/migrations/0027_add_distribution_state_fields.py

for 0027_add_distribution_state_fields in preprod

--
-- Add field installable_app_error_code to preprodartifact
--
ALTER TABLE "sentry_preprodartifact" ADD COLUMN "installable_app_error_code" integer NULL CHECK ("installable_app_error_code" >= 0);
--
-- Add field installable_app_error_message to preprodartifact
--
ALTER TABLE "sentry_preprodartifact" ADD COLUMN "installable_app_error_message" text NULL;

…(EME-842)

Per code review feedback, replace the distribution_state/distribution_skip_reason
fields with installable_app_error_code/installable_app_error_message following
the existing ErrorCode pattern on PreprodArtifact. This eliminates ambiguous
state combinations between distribution_state and installable_app_file_id:

- file_id set + no error_code → success ("available")
- no file_id + error_code set → skipped/failed ("not_ran")
- no file_id + no error_code → pending / not yet determined
(cls.NOT_RAN, "not_ran"),
(cls.UNKNOWN, "unknown"),
(cls.NO_QUOTA, "no_quota"),
(cls.SKIPPED, "skipped"),
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: and PROCESSING_ERROR or something for the launchpad case

Copy link
Contributor

Choose a reason for hiding this comment

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

(but we can add when it's used)

Copy link
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 thanks!

@runningcode runningcode merged commit ace795e into master Feb 24, 2026
103 checks passed
@runningcode runningcode deleted the no/eme-842-distribution-state-model branch February 24, 2026 13:47
mchen-sentry pushed a commit that referenced this pull request Feb 24, 2026
…842) (#109075)

## Summary

- Add `installable_app_error_code` and `installable_app_error_message`
columns to `PreprodArtifact`
- Add `InstallableAppErrorCode` enum (UNKNOWN, NO_QUOTA, SKIPPED)
following the existing `ErrorCode` pattern on `PreprodArtifact`
- Migration: `0027_add_distribution_state_fields`

Uses an error-code model instead of a state field so that
`installable_app_file_id` implicitly encodes success, avoiding ambiguous
state combinations:

- `file_id` set + no error → success
- no `file_id` + error code set → skipped/failed
- no `file_id` + no error → pending / not yet determined

Split out from #109062 to land the schema change independently.

EME-842
wedamija pushed a commit that referenced this pull request Feb 24, 2026
…842) (#109075)

## Summary

- Add `installable_app_error_code` and `installable_app_error_message`
columns to `PreprodArtifact`
- Add `InstallableAppErrorCode` enum (UNKNOWN, NO_QUOTA, SKIPPED)
following the existing `ErrorCode` pattern on `PreprodArtifact`
- Migration: `0027_add_distribution_state_fields`

Uses an error-code model instead of a state field so that
`installable_app_file_id` implicitly encodes success, avoiding ambiguous
state combinations:

- `file_id` set + no error → success
- no `file_id` + error code set → skipped/failed
- no `file_id` + no error → pending / not yet determined

Split out from #109062 to land the schema change independently.

EME-842
@github-actions github-actions bot locked and limited conversation to collaborators Mar 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

claude-code-assisted Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants