-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add the ability to cancel a pending task. The celery task is not actually cancelled yet. - Track cancel reason, datetime cancelled, and add a new cancelled status. * Add drp revoke request to postman collection. * Add drp revoke docs. * Update down_rev after rebase. * Fix incorrect check. * Restore new canceled state. * Check that the privacy request is not canceled right before starting execution. This is really our last chance to check before we start executing the graph in dask. The use case here might be it was canceled shortly after it was approved. * Attempt to revoke a queued celery task if we cancel it before it starts executing. * Prettier. * Changelog updated. * Add a few unit tests around how triggering the run_privacy_request_task with a cancelled task id doesn't do anything and how you can't approve a canceled privacy request. * Fix SQLAlchemy logging to console - logging in migration propagates to the rest of the application. * Refresh session instead of creating a new one. * Add 200 character limit. * Add some assertions that db.refresh is doing what we think it's doing.
- Loading branch information
Showing
19 changed files
with
299 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/fidesops/migrations/versions/ed1b00ff963d_cancel_privacy_request.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
"""cancel privacy request | ||
Revision ID: ed1b00ff963d | ||
Revises: 55d61eb8ed12 | ||
Create Date: 2022-06-03 15:45:14.584540 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "ed1b00ff963d" | ||
down_revision = "55d61eb8ed12" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.add_column( | ||
"privacyrequest", sa.Column("cancel_reason", sa.String(200), nullable=True) | ||
) | ||
op.add_column( | ||
"privacyrequest", | ||
sa.Column("canceled_at", sa.DateTime(timezone=True), nullable=True), | ||
) | ||
op.execute("alter type privacyrequeststatus add value 'canceled'") | ||
|
||
|
||
def downgrade(): | ||
op.drop_column("privacyrequest", "canceled_at") | ||
op.drop_column("privacyrequest", "cancel_reason") | ||
|
||
op.execute("delete from privacyrequest where status in ('canceled')") | ||
|
||
op.execute("alter type privacyrequeststatus rename to privacyrequeststatus_old") | ||
op.execute( | ||
"create type privacyrequeststatus as enum('in_processing', 'complete', 'pending', 'error', 'paused', 'approved', 'denied')" | ||
) | ||
op.execute( | ||
( | ||
"alter table privacyrequest alter column status type privacyrequeststatus using " | ||
"status::text::privacyrequeststatus" | ||
) | ||
) | ||
op.execute("drop type privacyrequeststatus_old") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.