Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion migrations_lockfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ nodestore: 0001_squashed_0002_nodestore_no_dictfield

notifications: 0003_notification_thread_models

preprod: 0026_add_initial_snapshot_models
preprod: 0027_add_distribution_state_fields

prevent: 0004_delete_prevent_ai_configuration_table

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 5.2.8

from django.db import migrations, models

import sentry.db.models.fields.bounded
from sentry.new_migrations.migrations import CheckedMigration


class Migration(CheckedMigration):
is_post_deployment = False

dependencies = [
("preprod", "0026_add_initial_snapshot_models"),
]

operations = [
migrations.AddField(
model_name="preprodartifact",
name="installable_app_error_code",
field=sentry.db.models.fields.bounded.BoundedPositiveIntegerField(null=True),
),
migrations.AddField(
model_name="preprodartifact",
name="installable_app_error_message",
field=models.TextField(null=True),
),
]
20 changes: 20 additions & 0 deletions src/sentry/preprod/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,21 @@ def as_choices(cls) -> tuple[tuple[int, str], ...]:
(cls.ARTIFACT_PROCESSING_ERROR, "artifact_processing_error"),
)

class InstallableAppErrorCode(IntEnum):
UNKNOWN = 0
NO_QUOTA = 1
"""No quota available for distribution."""
SKIPPED = 2
"""Distribution was not requested on this build."""

@classmethod
def as_choices(cls) -> tuple[tuple[int, str], ...]:
return (
(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)

)

__relocation_scope__ = RelocationScope.Excluded
objects: ClassVar[PreprodArtifactModelManager] = PreprodArtifactModelManager()

Expand Down Expand Up @@ -201,6 +216,11 @@ def as_choices(cls) -> tuple[tuple[int, str], ...]:
# An identifier for the main binary
main_binary_identifier = models.CharField(max_length=255, db_index=True, null=True)

installable_app_error_code = BoundedPositiveIntegerField(
choices=InstallableAppErrorCode.as_choices(), null=True
)
installable_app_error_message = models.TextField(null=True)

def get_sibling_artifacts_for_commit(self) -> list[PreprodArtifact]:
"""
Get sibling artifacts for the same commit, deduplicated by (app_id, artifact_type, build_configuration_id).
Expand Down
Loading