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
3 changes: 2 additions & 1 deletion src/sentry/preprod/api/endpoints/builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def on_results(artifacts: list[PreprodArtifact]) -> list[dict[str, Any]]:
results.append(transform_preprod_artifact_to_build_details(artifact).dict())
except Exception:
logger.exception(
"preprod.builds.transform_failed", extra={"artifact_id": artifact.id}
"preprod.builds.transform_failed",
extra={"preprod_artifact_id": artifact.id},
)
return results

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def get(self, request: Request, head_artifact_id: str) -> Response:
logger.info(
"preprod_artifact.admin_get_info",
extra={
"artifact_id": head_artifact_id,
"preprod_artifact_id": head_artifact_id,
"user_id": request.user.id,
"organization_id": preprod_artifact.project.organization_id,
"project_id": preprod_artifact.project.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def post(
logger.info(
"preprod_artifact.rerun_analysis",
extra={
"artifact_id": head_artifact_id,
"preprod_artifact_id": head_artifact_id,
"user_id": request.user.id,
"organization_id": organization.id,
"project_id": head_artifact.project.id,
Expand Down Expand Up @@ -159,7 +159,7 @@ def post(self, request: Request) -> Response:
logger.info(
"preprod_artifact.admin_rerun_analysis",
extra={
"artifact_id": preprod_artifact_id,
"preprod_artifact_id": preprod_artifact_id,
"user_id": request.user.id,
"organization_id": preprod_artifact.project.organization_id,
"project_id": preprod_artifact.project.id,
Expand Down Expand Up @@ -258,7 +258,7 @@ def post(self, request: Request) -> Response:
logger.info(
"preprod_artifact.admin_batch_rerun_analysis",
extra={
"artifact_id": artifact_id,
"preprod_artifact_id": artifact_id,
"user_id": request.user.id,
"organization_id": organization.id,
"project_id": artifact.project.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def post(
logger.exception(
"preprod_artifact.rerun_status_checks.task_error",
extra={
"artifact_id": head_artifact.id,
"preprod_artifact_id": head_artifact.id,
"user_id": request.user.id,
"organization_id": head_artifact.project.organization_id,
"project_id": head_artifact.project.id,
Expand All @@ -131,7 +131,7 @@ def post(
logger.info(
"preprod_artifact.rerun_status_checks",
extra={
"artifact_id": head_artifact.id,
"preprod_artifact_id": head_artifact.id,
"user_id": request.user.id,
"organization_id": head_artifact.project.organization_id,
"project_id": head_artifact.project.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def delete(self, request: Request, organization: Organization, snapshot_id: str)
except Exception:
logger.exception(
"preprod_snapshot.delete_failed",
extra={"artifact_id": artifact.id},
extra={"preprod_artifact_id": artifact.id},
)
return Response(
{"detail": "Internal error deleting snapshot."},
Expand All @@ -175,7 +175,7 @@ def delete(self, request: Request, organization: Organization, snapshot_id: str)
logger.info(
"preprod_snapshot.deleted",
extra={
"artifact_id": artifact.id,
"preprod_artifact_id": artifact.id,
"user_id": request.user.id if request.user else None,
"files_deleted": result.files_deleted,
"size_metrics_deleted": result.size_metrics_deleted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def delete(
except Exception:
logger.exception(
"preprod_artifact.delete_failed",
extra={"artifact_id": int(head_artifact_id), "user_id": request.user.id},
extra={"preprod_artifact_id": int(head_artifact_id), "user_id": request.user.id},
)
return Response(
{
Expand All @@ -61,7 +61,7 @@ def delete(
logger.info(
"preprod_artifact.deleted",
extra={
"artifact_id": int(head_artifact_id),
"preprod_artifact_id": int(head_artifact_id),
"user_id": request.user.id,
"files_deleted": result.files_deleted,
"size_metrics_deleted": result.size_metrics_deleted,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def get(
sentry_sdk.capture_message(
"preprod.public_api.size_analysis.invalid_state",
level="warning",
extra={"artifact_id": head_artifact.id, "state": main_metric.state},
extra={"preprod_artifact_id": head_artifact.id, "state": main_metric.state},
)
return Response(
{"detail": "There was an error retrieving size analysis results"}, status=500
Expand Down Expand Up @@ -199,7 +199,7 @@ def _build_completed_response(
sentry_sdk.capture_message(
"preprod.public_api.size_analysis.no_file_id",
level="warning",
extra={"artifact_id": head_artifact.id, "size_metric_id": main_metric.id},
extra={"preprod_artifact_id": head_artifact.id, "size_metric_id": main_metric.id},
)
return Response(
{"detail": "There was an error retrieving size analysis results"}, status=500
Expand All @@ -211,7 +211,10 @@ def _build_completed_response(
sentry_sdk.capture_message(
"preprod.public_api.size_analysis.file_not_found",
level="warning",
extra={"artifact_id": head_artifact.id, "analysis_file_id": analysis_file_id},
extra={
"preprod_artifact_id": head_artifact.id,
"analysis_file_id": analysis_file_id,
},
)
return Response({"detail": "Analysis file not found"}, status=404)

Expand All @@ -223,7 +226,10 @@ def _build_completed_response(
except Exception:
logger.exception(
"preprod.public_api.size_analysis.parse_error",
extra={"artifact_id": head_artifact.id, "analysis_file_id": analysis_file_id},
extra={
"preprod_artifact_id": head_artifact.id,
"analysis_file_id": analysis_file_id,
},
)
return Response(
{"detail": "There was an error retrieving size analysis results"}, status=500
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def _parse_success_check(raw_size: dict[str, Any], artifact_id: int) -> StatusCh
logger.warning(
"preprod.build_details.invalid_check_id",
extra={
"artifact_id": artifact_id,
"preprod_artifact_id": artifact_id,
"check_id_type": type(check_id).__name__,
},
)
Expand All @@ -463,7 +463,7 @@ def _parse_failure_check(raw_size: dict[str, Any], artifact_id: int) -> StatusCh
logger.warning(
"preprod.build_details.invalid_error_type",
extra={
"artifact_id": artifact_id,
"preprod_artifact_id": artifact_id,
"error_type": error_type_str,
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def build_build_distribution_summary(
logger.warning(
"preprod.build_distribution.summary.both_file_and_error",
extra={
"artifact_id": artifact.id,
"preprod_artifact_id": artifact.id,
"error_code": error_code_value,
},
)
Expand Down
8 changes: 4 additions & 4 deletions src/sentry/preprod/build_distribution_webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def build_webhook_payload(
except PreprodArtifact.DoesNotExist:
logger.warning(
"preprod.build_distribution.webhook.artifact_not_found",
extra={"artifact_id": artifact.id},
extra={"preprod_artifact_id": artifact.id},
)
return None

Expand All @@ -49,7 +49,7 @@ def build_webhook_payload(
except BuildDistributionSummaryBuildError:
logger.exception(
"preprod.build_distribution.webhook.build_error",
extra={"artifact_id": artifact.id},
extra={"preprod_artifact_id": artifact.id},
)
return None

Expand All @@ -69,7 +69,7 @@ def send_build_distribution_webhook(
if payload is None:
logger.info(
"preprod.build_distribution.webhook.no_payload",
extra={"artifact_id": artifact.id},
extra={"preprod_artifact_id": artifact.id},
)
return

Expand All @@ -83,7 +83,7 @@ def send_build_distribution_webhook(
logger.exception(
"preprod.build_distribution.webhook.failed",
extra={
"artifact_id": artifact.id,
"preprod_artifact_id": artifact.id,
"organization_id": organization_id,
},
)
2 changes: 1 addition & 1 deletion src/sentry/preprod/size_analysis/grouptype.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _artifact_to_tags(artifact: PreprodArtifact) -> dict[str, str]:
if artifact.artifact_type is not None:
tags["artifact_type"] = PreprodArtifactModel.ArtifactType(artifact.artifact_type).to_str()

tags["artifact_id"] = str(artifact.id)
tags["preprod_artifact_id"] = str(artifact.id)
Comment thread
cursor[bot] marked this conversation as resolved.

return tags

Expand Down
12 changes: 6 additions & 6 deletions src/sentry/preprod/size_analysis/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def compare_preprod_artifact_size_analysis(
) -> None:
logger.info(
"preprod.size_analysis.compare.start",
extra={"artifact_id": artifact_id},
extra={"preprod_artifact_id": artifact_id},
)

try:
Expand All @@ -71,7 +71,7 @@ def compare_preprod_artifact_size_analysis(
logger.exception(
"preprod.size_analysis.compare.artifact_not_found",
extra={
"artifact_id": artifact_id,
"preprod_artifact_id": artifact_id,
},
)
return
Expand Down Expand Up @@ -281,7 +281,7 @@ def compare_preprod_artifact_size_analysis(
else:
logger.info(
"preprod.size_analysis.compare.artifact_no_commit_comparison",
extra={"artifact_id": artifact_id},
extra={"preprod_artifact_id": artifact_id},
)
finally:
send_size_analysis_webhook(artifact=artifact, organization_id=org_id)
Expand Down Expand Up @@ -612,7 +612,7 @@ def _maybe_emit_issues_from_diff_size_results(
if not head_metrics:
logger.info(
"preprod.size_analysis.diff_results.no_head_metrics",
extra={"artifact_id": artifact.id},
extra={"preprod_artifact_id": artifact.id},
)
return

Expand Down Expand Up @@ -672,7 +672,7 @@ def _maybe_emit_issues_from_diff_size_results(
if base_artifact is None:
logger.info(
"preprod.size_analysis.diff_results.no_base",
extra={"detector_id": detector.id, "artifact_id": artifact.id},
extra={"detector_id": detector.id, "preprod_artifact_id": artifact.id},
)
continue

Expand Down Expand Up @@ -707,7 +707,7 @@ def _maybe_emit_issues_from_diff_size_results(
"preprod.size_analysis.diff_results.evaluating",
extra={
"detector_id": detector.id,
"artifact_id": artifact.id,
"preprod_artifact_id": artifact.id,
"base_artifact_id": base_artifact.id,
},
)
Expand Down
8 changes: 4 additions & 4 deletions src/sentry/preprod/size_analysis/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def build_webhook_payload(
except PreprodArtifact.DoesNotExist:
logger.warning(
"preprod.size_analysis.webhook.artifact_not_found",
extra={"artifact_id": artifact.id},
extra={"preprod_artifact_id": artifact.id},
)
return None

Expand All @@ -55,7 +55,7 @@ def build_webhook_payload(
except SizeAnalysisSummaryBuildError:
logger.exception(
"preprod.size_analysis.webhook.build_error",
extra={"artifact_id": artifact.id},
extra={"preprod_artifact_id": artifact.id},
)
return None

Expand All @@ -75,7 +75,7 @@ def send_size_analysis_webhook(
if payload is None:
logger.info(
"preprod.size_analysis.webhook.no_payload",
extra={"artifact_id": artifact.id},
extra={"preprod_artifact_id": artifact.id},
)
return

Expand All @@ -89,7 +89,7 @@ def send_size_analysis_webhook(
logger.exception(
"preprod.size_analysis.webhook.failed",
extra={
"artifact_id": artifact.id,
"preprod_artifact_id": artifact.id,
"organization_id": organization_id,
},
)
Expand Down
6 changes: 3 additions & 3 deletions src/sentry/preprod/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ def _assemble_preprod_artifact_installable_app(
logger.exception(
"PreprodArtifact not found during installable app assembly",
extra={
"artifact_id": artifact_id,
"preprod_artifact_id": artifact_id,
"project_id": project.id,
"organization_id": org_id,
},
Expand Down Expand Up @@ -888,7 +888,7 @@ def detect_expired_preprod_artifacts() -> None:
"PreprodArtifact expired",
level="error",
extras={
"artifact_id": artifact_id,
"preprod_artifact_id": artifact_id,
},
)
try:
Expand All @@ -898,7 +898,7 @@ def detect_expired_preprod_artifacts() -> None:
except Exception:
logger.exception(
"preprod.tasks.detect_expired_preprod_artifacts.failed_to_trigger_status_check",
extra={"artifact_id": artifact_id},
extra={"preprod_artifact_id": artifact_id},
)

# Find expired PreprodArtifactSizeMetrics (those in PROCESSING state for more than 30 minutes)
Expand Down
Loading
Loading