Skip to content

feat(preprod): Upgrade admin panel's "rerun analysis" action to support batch (up to 100)#112481

Merged
NicoHinderling merged 3 commits intomasterfrom
feat/batch-rerun-analysis
Apr 8, 2026
Merged

feat(preprod): Upgrade admin panel's "rerun analysis" action to support batch (up to 100)#112481
NicoHinderling merged 3 commits intomasterfrom
feat/batch-rerun-analysis

Conversation

@NicoHinderling
Copy link
Copy Markdown
Contributor

@NicoHinderling NicoHinderling commented Apr 8, 2026

Closes EME-926

Add PreprodArtifactAdminBatchRerunAnalysisEndpoint at /internal/preprod-artifact/batch-rerun-analysis/ so the admin launchpad can rerun analysis for multiple artifacts in a single request instead of one at a time.

The endpoint accepts {"artifact_ids": [1, 2, 3]}, deduplicates IDs, enforces a 100-item batch limit (matching the batch delete endpoint), and returns per-artifact results with success/failure status and cleanup stats. On dispatch failure, the response includes a detail message noting that cleanup completed but dispatch failed.

The admin UI card is updated from "Rerun Analysis" (single ID) to "Batch Rerun Analyses" (comma-separated IDs) and now surfaces partial failures with per-artifact error toasts.

Add PreprodArtifactAdminBatchRerunAnalysisEndpoint at
/internal/preprod-artifact/batch-rerun-analysis/ that accepts multiple
artifact IDs in a single request. Includes deduplication, a 100-item
batch limit, per-artifact success/failure reporting, and partial failure
detail messages.

Update the admin launchpad UI to use the new batch endpoint with
comma-separated ID input and surface per-artifact dispatch failures.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Apr 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

@NicoHinderling NicoHinderling marked this pull request as ready for review April 8, 2026 16:38
@NicoHinderling NicoHinderling requested review from a team as code owners April 8, 2026 16:38
@NicoHinderling NicoHinderling changed the title feat(preprod): Add batch rerun analysis admin endpoint feat(preprod): Upgrade admin panel's "rerun analysis" action to support batch (up to 100) Apr 8, 2026
Comment thread src/sentry/preprod/api/endpoints/preprod_artifact_rerun_analysis.py
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 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 1922b17. Configure here.

Comment thread src/sentry/preprod/api/endpoints/preprod_artifact_rerun_analysis.py
… rerun

When dispatch_taskbroker() fails, it updates the artifact state to FAILED
via QuerySet.update(), but the in-memory object still holds UPLOADED from
reset_artifact_data(). This caused the API response to return a stale
new_state. refresh_from_db() ensures the response reflects the actual DB
state.
@linear-code
Copy link
Copy Markdown

linear-code bot commented Apr 8, 2026

@NicoHinderling NicoHinderling merged commit a04cd9f into master Apr 8, 2026
60 checks passed
@NicoHinderling NicoHinderling deleted the feat/batch-rerun-analysis branch April 8, 2026 17:31
george-sentry pushed a commit that referenced this pull request Apr 9, 2026
…rt batch (up to 100) (#112481)

Closes EME-926

Add `PreprodArtifactAdminBatchRerunAnalysisEndpoint` at
`/internal/preprod-artifact/batch-rerun-analysis/` so the admin
launchpad can rerun analysis for multiple artifacts in a single request
instead of one at a time.

The endpoint accepts `{"artifact_ids": [1, 2, 3]}`, deduplicates IDs,
enforces a 100-item batch limit (matching the batch delete endpoint),
and returns per-artifact results with success/failure status and cleanup
stats. On dispatch failure, the response includes a detail message
noting that cleanup completed but dispatch failed.

The admin UI card is updated from "Rerun Analysis" (single ID) to "Batch
Rerun Analyses" (comma-separated IDs) and now surfaces partial failures
with per-artifact error toasts.

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.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 Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants