Skip to content

ref(preprod): Add organization_slug to size analysis log#112194

Merged
NicoHinderling merged 2 commits intomasterfrom
nicohinderling/ref/add-org-slug-to-preprod-log
Apr 7, 2026
Merged

ref(preprod): Add organization_slug to size analysis log#112194
NicoHinderling merged 2 commits intomasterfrom
nicohinderling/ref/add-org-slug-to-preprod-log

Conversation

@NicoHinderling
Copy link
Copy Markdown
Contributor

Add organization_slug to the size analysis metrics log entry in preprod tasks for easier debugging and log correlation when investigating size analysis issues.

Include organization_slug in the size metrics log entry for easier
debugging and log correlation.

Co-Authored-By: Claude Opus 4.6 <noreply@example.com>
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 3, 2026
@NicoHinderling NicoHinderling marked this pull request as ready for review April 3, 2026 00:28
@NicoHinderling NicoHinderling requested a review from a team as a code owner April 3, 2026 00:28
Comment thread src/sentry/preprod/tasks.py Outdated
…rganization

Avoids a potential extra DB query since organization is already fetched.
Comment thread src/sentry/preprod/tasks.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 db9b16f. Configure here.

Comment thread src/sentry/preprod/tasks.py Outdated
metrics_committed_successfully = True
size_metrics_updated = metrics_in_transaction

organization = preprod_artifact.project.organization
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Moving DB query outside inner try changes error handling

Medium Severity

organization = preprod_artifact.project.organization was moved from inside the narrow inner try/except (for EAP operations) to before it. If this DB lookup fails, it's now caught by the outer except at the end of the function, causing all subsequent operations to be skipped — including maybe_emit_issues_from_absolute_size_results, the extras/duration update, and the size analysis comparison trigger. Previously the inner except would catch the failure and allow those operations to proceed. Since select_related on the preprod_artifact query doesn't include project__organization, this line triggers additional DB queries that could fail.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit db9b16f. Configure here.

@NicoHinderling NicoHinderling force-pushed the nicohinderling/ref/add-org-slug-to-preprod-log branch from db9b16f to d6d4a12 Compare April 7, 2026 20:26
@NicoHinderling NicoHinderling enabled auto-merge (squash) April 7, 2026 20:26
@NicoHinderling NicoHinderling merged commit 6af5951 into master Apr 7, 2026
107 checks passed
@NicoHinderling NicoHinderling deleted the nicohinderling/ref/add-org-slug-to-preprod-log branch April 7, 2026 20:38
george-sentry pushed a commit that referenced this pull request Apr 9, 2026
Add `organization_slug` to the size analysis metrics log entry in
preprod tasks for easier debugging and log correlation when
investigating size analysis issues.

---------

Co-authored-by: Claude Opus 4.6 <noreply@example.com>
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