Skip to content

feat(ACI): Use status column on Detector and Workflow #91994

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ceorourke
Copy link
Member

Now that the Detector and Workflow models have a status column we can make use of it. This PR sets the status to PENDING_DELETION in the deletion endpoints, sets the status to DELETION_IN_PROGRESS in the deletion tasks, and updates all gets and filters to filter to ACTIVE statuses.

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

codecov bot commented May 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

⚠️ 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:157236 in /home/runner/work/sentry/sentry/.artifacts/pytest.junit.xml
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #91994       +/-   ##
===========================================
+ Coverage   36.78%   85.47%   +48.69%     
===========================================
  Files        9659    10356      +697     
  Lines      540724   587564    +46840     
  Branches    22602    22602               
===========================================
+ Hits       198928   502247   +303319     
+ Misses     341375    84708   -256667     
- Partials      421      609      +188     

@@ -107,6 +108,7 @@ def delete(self, request: Request, organization: Organization, workflow: Workflo
Delete a workflow
"""
RegionScheduledDeletion.schedule(workflow, days=0, actor=request.user)
workflow.update(status=ObjectStatus.PENDING_DELETION)
Copy link
Member Author

Choose a reason for hiding this comment

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

Setting it to pending deletion in the delete endpoint after it's been scheduled for deletion

@@ -169,6 +172,7 @@ def delete(self, request: Request, organization: Organization, detector: Detecto
return Response(status=403)

RegionScheduledDeletion.schedule(detector, days=0, actor=request.user)
detector.update(status=ObjectStatus.PENDING_DELETION)
Copy link
Member Author

Choose a reason for hiding this comment

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

Setting it to pending deletion in the delete endpoint after it's been scheduled for deletion

for instance in instance_list:
status = getattr(instance, "status", None)
if status not in (ObjectStatus.DELETION_IN_PROGRESS, None):
instance.update(status=ObjectStatus.DELETION_IN_PROGRESS)
Copy link
Member Author

Choose a reason for hiding this comment

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

Setting it to deletion in progress

for instance in instance_list:
status = getattr(instance, "status", None)
if status not in (ObjectStatus.DELETION_IN_PROGRESS, None):
instance.update(status=ObjectStatus.DELETION_IN_PROGRESS)
Copy link
Member Author

Choose a reason for hiding this comment

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

Setting it to deletion in progress

@ceorourke
Copy link
Member Author

I know it's a lot of files touched but it's the same change across most except those that I called out in the comments.

@ceorourke ceorourke marked this pull request as ready for review May 21, 2025 17:23
@ceorourke ceorourke requested review from a team as code owners May 21, 2025 17:23
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.

1 participant