-
Notifications
You must be signed in to change notification settings - Fork 687
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
Eliminate flag-for-reply process #5954
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
83 changes: 0 additions & 83 deletions
83
install_files/ansible-base/roles/app/tasks/configure_haveged.yml
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -17,5 +17,3 @@ | |
- include: install_and_harden_apache.yml | ||
|
||
- include: setup_cron.yml | ||
|
||
- include: configure_haveged.yml |
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 was deleted.
Oops, something went wrong.
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
70 changes: 70 additions & 0 deletions
70
securedrop/alembic/versions/b060f38c0c31_drop_source_flagged.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,70 @@ | ||
"""drop Source.flagged | ||
|
||
Revision ID: b060f38c0c31 | ||
Revises: 92fba0be98e9 | ||
Create Date: 2021-05-10 18:15:56.071880 | ||
|
||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "b060f38c0c31" | ||
down_revision = "92fba0be98e9" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
with op.batch_alter_table("sources", schema=None) as batch_op: | ||
batch_op.drop_column("flagged") | ||
|
||
|
||
def downgrade(): | ||
# You might be tempted to try Alembic's batch_ops for the | ||
# downgrade too. Don't. SQLite's unnamed check constraints require | ||
# kludges. | ||
|
||
conn = op.get_bind() | ||
conn.execute("PRAGMA legacy_alter_table=ON") | ||
|
||
op.rename_table("sources", "sources_tmp") | ||
|
||
conn.execute( | ||
sa.text( | ||
""" | ||
CREATE TABLE "sources" ( | ||
id INTEGER NOT NULL, | ||
uuid VARCHAR(36) NOT NULL, | ||
filesystem_id VARCHAR(96), | ||
journalist_designation VARCHAR(255) NOT NULL, | ||
last_updated DATETIME, | ||
pending BOOLEAN, | ||
interaction_count INTEGER NOT NULL, | ||
deleted_at DATETIME, | ||
flagged BOOLEAN, | ||
PRIMARY KEY (id), | ||
CHECK (pending IN (0, 1)), | ||
CHECK (flagged IN (0, 1)), | ||
UNIQUE (filesystem_id), | ||
UNIQUE (uuid) | ||
) | ||
""" | ||
) | ||
) | ||
|
||
conn.execute( | ||
""" | ||
INSERT INTO sources ( | ||
id, uuid, filesystem_id, journalist_designation, | ||
last_updated, pending, interaction_count, deleted_at | ||
) SELECT | ||
id, uuid, filesystem_id, journalist_designation, | ||
last_updated, pending, interaction_count, deleted_at | ||
FROM sources_tmp; | ||
""" | ||
) | ||
|
||
# Now delete the old table. | ||
op.drop_table("sources_tmp") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from threading import Thread | ||
|
||
|
||
def asynchronous(f): # type: ignore | ||
""" | ||
Wraps a | ||
""" | ||
def wrapper(*args, **kwargs): # type: ignore | ||
thread = Thread(target=f, args=args, kwargs=kwargs) | ||
thread.start() | ||
return wrapper |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It may be worth marking the endpoint explicitly as deprecated, to be removed in a future release.
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.
I guess we can mark it as deprecated in the documentation, then we don't have to update this PR.