Skip to content

chore(aci milestone 3): backfill resolution action filters #91402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 19, 2025

Conversation

mifu67
Copy link
Contributor

@mifu67 mifu67 commented May 9, 2025

Backfill migrated metric alerts with resolution action filter data conditions. See #89832 for an explanation of what these are.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label May 9, 2025
Copy link
Contributor

github-actions bot commented May 9, 2025

This PR has a migration; here is the generated SQL for src/sentry/workflow_engine/migrations/0060_backfill_metric_alert_resolution_action_filters.py

for 0060_backfill_metric_alert_resolution_action_filters in workflow_engine

--
-- Raw Python operation
--
-- THIS OPERATION CANNOT BE WRITTEN AS SQL

Copy link

codecov bot commented May 10, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 38 lines in your changes missing coverage. Please review.

⚠️ Parser warning

The parser emitted a warning. Please review your JUnit XML file:

Warning while parsing testcase attributes: Limit of string is 1000 chars, for name, we got 2083 at 1:157002 in /home/runner/work/sentry/sentry/.artifacts/pytest.junit.xml
Files with missing lines Patch % Lines
...backfill_metric_alert_resolution_action_filters.py 38.09% 26 Missing ⚠️
...backfill_metric_alert_resolution_action_filters.py 64.70% 12 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #91402       +/-   ##
===========================================
+ Coverage   42.03%   87.68%   +45.64%     
===========================================
  Files       10325    10332        +7     
  Lines      585571   586721     +1150     
  Branches    22574    22596       +22     
===========================================
+ Hits       246153   514450   +268297     
+ Misses     338973    71843   -267130     
+ Partials      445      428       -17     

@mifu67
Copy link
Contributor Author

mifu67 commented May 16, 2025

The migration tests will pass after #90898 is merged (made a change to the data condition comparison)

@mifu67 mifu67 marked this pull request as ready for review May 16, 2025 19:03
@mifu67 mifu67 requested review from a team as code owners May 16, 2025 19:03
@mifu67 mifu67 requested a review from ceorourke May 16, 2025 19:03
Copy link
Contributor

This PR has a migration; here is the generated SQL for src/sentry/workflow_engine/migrations/0061_backfill_metric_alert_resolution_action_filters.py

for 0061_backfill_metric_alert_resolution_action_filters in workflow_engine

--
-- Raw Python operation
--
-- THIS OPERATION CANNOT BE WRITTEN AS SQL

Copy link
Member

@ceorourke ceorourke left a comment

Choose a reason for hiding this comment

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

looks good, just gotta fix the failing tests and skip the migration tests that are timing out :(


workflow_ids = AlertRuleWorkflow.objects.filter(
alert_rule_id__in=alert_rule_ids
).values_list("workflow__id", flat=True)
Copy link
Member

Choose a reason for hiding this comment

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

nit: You can also just use workflow_id here to avoid the join. Not a huge deal, jfyi


for workflow_id in workflow_ids:
workflow_dcgs = DataConditionGroup.objects.filter(
workflowdataconditiongroup__workflow__id=workflow_id
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Can use workflowdataconditiongroup__workflow_id here too

@mifu67 mifu67 merged commit c2c0da4 into master May 19, 2025
60 checks passed
@mifu67 mifu67 deleted the mifu67/aci/resolution-backfill-migration branch May 19, 2025 17:07
andrewshie-sentry pushed a commit that referenced this pull request May 20, 2025
Backfill migrated metric alerts with resolution action filter data
conditions. See #89832 for an
explanation of what these are.

---------

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants