Skip to content

Conversation

@chromy
Copy link
Contributor

@chromy chromy commented Jan 30, 2026

No description provided.

Remove should_run_size and should_run_distribution logic from the
assemble_preprod_artifact task. The task now always requests all
features, and the actual determination of which features can run
is now handled by the artifact update endpoint.

When size analysis cannot run due to quota limits or project filters
the artifact update endpoint now updates the PreprodArtifactSizeMetrics
record with NOT_RAN state and appropriate error code (NO_QUOTA or SKIPPED)
and message.
@chromy chromy requested a review from a team as a code owner January 30, 2026 16:07
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 30, 2026
@chromy chromy changed the base branch from master to chromy/2026-01-30-add-requested-to-update January 30, 2026 16:09
Copy link
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.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

"error_code": error_code,
"error_message": error_message,
},
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Size metrics record can be overwritten after completion

Medium Severity

The update_or_create call unconditionally overwrites the PreprodArtifactSizeMetrics record when can_run_size is False. If size analysis has already completed successfully (state is COMPLETED), and the update endpoint is called again when quota is exhausted or filters don't match, the COMPLETED record gets overwritten with NOT_RAN, causing data loss of the successful analysis results. The old code in assemble_preprod_artifact used get_or_create which wouldn't overwrite existing records. The logic needs to check the current state before updating.

Fix in Cursor Fix in Web

Copy link
Member

Choose a reason for hiding this comment

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

hmm if re-running then it should probably respect the quota instead of showing stale results, but re-running is a rare occurrence

requested_features=[
PreprodFeature.SIZE_ANALYSIS,
PreprodFeature.BUILD_DISTRIBUTION,
],
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe mark this with a deprecated comment or something , just something to indicate these aren't actually used anymore?

"error_code": error_code,
"error_message": error_message,
},
)
Copy link
Member

Choose a reason for hiding this comment

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

hmm if re-running then it should probably respect the quota instead of showing stale results, but re-running is a rare occurrence

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

4 participants