-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
|
@@ -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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
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. |
Now that the
Detector
andWorkflow
models have astatus
column we can make use of it. This PR sets the status toPENDING_DELETION
in the deletion endpoints, sets the status toDELETION_IN_PROGRESS
in the deletion tasks, and updates all gets and filters to filter toACTIVE
statuses.