Skip to content

feat(preprod): Add analytics for status check rule CRUD#109116

Closed
mtopo27 wants to merge 1 commit intomasterfrom
max/preprod-status-check-analytics
Closed

feat(preprod): Add analytics for status check rule CRUD#109116
mtopo27 wants to merge 1 commit intomasterfrom
max/preprod-status-check-analytics

Conversation

@mtopo27
Copy link
Contributor

@mtopo27 mtopo27 commented Feb 23, 2026

Add Amplitude analytics events for status check rule create, update, and
delete actions in the project settings UI. This lets us track adoption and
usage patterns for the status checks feature.

Three new events are defined in preprodBuildAnalyticsEvents.tsx and fired
from statusCheckRules.tsx:

  • preprod.settings.status_check_rule_created — on rule creation
  • preprod.settings.status_check_rule_updated — on rule save, includes metric/measurement/artifact_type/value
  • preprod.settings.status_check_rule_deleted — on rule deletion

Track create, update, and delete actions for status check rules in
the project settings UI to understand feature usage in Amplitude.

Co-Authored-By: Claude <noreply@anthropic.com>

Agent transcript: http://localhost:5173/share/opxnFrSR20ag5gH3jd5zERc1cotkhr3_xH6R1-roiHo
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Feb 23, 2026
@mtopo27 mtopo27 marked this pull request as ready for review February 23, 2026 19:36
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 2 potential issues.

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

trackAnalytics('preprod.settings.status_check_rule_created', {
organization,
project_slug: project.slug,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Analytics track failed operations as successes

High Severity

Analytics events for rule create, update, and delete fire before their async operations complete. When addRule, updateRule, or deleteRule fail due to network errors or validation issues, the analytics still record successful operations, inflating metrics and misrepresenting actual adoption/usage. The tracking calls happen synchronously while the underlying saveRules mutation in useStatusCheckRules is asynchronous.

Additional Locations (2)

Fix in Cursor Fix in Web

project_slug: project.slug,
metric: updated.metric,
measurement: updated.measurement,
artifact_type: updated.artifactType ?? 'all_artifacts',
Copy link
Contributor

Choose a reason for hiding this comment

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

Inconsistent artifact_type default in analytics fallback

Low Severity

The fallback value for artifact_type uses 'all_artifacts', but the rule parsing logic in useStatusCheckRules.ts defaults to 'main_artifact' (via DEFAULT_ARTIFACT_TYPE). While the form should always provide an artifactType value making this fallback unused in practice, the inconsistency could cause confusion or incorrect analytics if the fallback is ever triggered.

Fix in Cursor Fix in Web

@mtopo27 mtopo27 closed this Feb 23, 2026
@mtopo27 mtopo27 deleted the max/preprod-status-check-analytics branch February 23, 2026 19:49
@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant