Skip to content

feat(preprod): Add snapshot details to admin info endpoint#112482

Merged
NicoHinderling merged 3 commits intomasterfrom
add-snapshots-details-into-admin-info-endpoint
Apr 8, 2026
Merged

feat(preprod): Add snapshot details to admin info endpoint#112482
NicoHinderling merged 3 commits intomasterfrom
add-snapshots-details-into-admin-info-endpoint

Conversation

@NicoHinderling
Copy link
Copy Markdown
Contributor

Add snapshot metrics, comparison, and approval data to the preprod artifact
admin info endpoint. This gives better debugging visibility into the snapshot
pipeline state for a given artifact — metrics ingestion, comparison results,
and approval status — all in one place.

Queries are only executed when snapshot metrics exist for the artifact,
avoiding unnecessary DB hits.

Add snapshot metrics, comparison, and approval data to the preprod
artifact admin info endpoint for debugging visibility.
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 8, 2026
@NicoHinderling NicoHinderling marked this pull request as ready for review April 8, 2026 16:50
@NicoHinderling NicoHinderling requested a review from a team as a code owner April 8, 2026 16:50
Comment thread src/sentry/preprod/api/endpoints/preprod_artifact_admin_info.py
Comment thread src/sentry/preprod/api/endpoints/preprod_artifact_admin_info.py Outdated
Comment thread src/sentry/preprod/api/endpoints/preprod_artifact_admin_info.py Outdated
…admin info endpoint

Add order_by("-date_added") to snapshot comparison and approval queries
to ensure deterministic results with .first(). Add missing date_updated
field to snapshot_approval serialization for consistency.
Comment thread src/sentry/preprod/api/endpoints/preprod_artifact_admin_info.py
Comment thread src/sentry/preprod/api/endpoints/preprod_artifact_admin_info.py Outdated
Comment thread src/sentry/preprod/api/endpoints/preprod_artifact_admin_info.py
…ify serialization

Query snapshot_approval independently of snapshot_metrics since
approvals are linked to preprod_artifact_id, not metrics. Use
.values() queries for snapshot_comparison and snapshot_approval to
return dicts directly, letting DRF handle datetime serialization.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
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 2 potential issues.

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 ec0c211. Configure here.

Comment thread src/sentry/preprod/api/endpoints/preprod_artifact_admin_info.py
Comment thread src/sentry/preprod/api/endpoints/preprod_artifact_admin_info.py
@NicoHinderling NicoHinderling merged commit eef6ced into master Apr 8, 2026
55 checks passed
@NicoHinderling NicoHinderling deleted the add-snapshots-details-into-admin-info-endpoint branch April 8, 2026 18:25
george-sentry pushed a commit that referenced this pull request Apr 9, 2026
Add snapshot metrics, comparison, and approval data to the preprod
artifact
admin info endpoint. This gives better debugging visibility into the
snapshot
pipeline state for a given artifact — metrics ingestion, comparison
results,
and approval status — all in one place.

Queries are only executed when snapshot metrics exist for the artifact,
avoiding unnecessary DB hits.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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