-
Notifications
You must be signed in to change notification settings - Fork 6
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
Remove pulls trigger #450
Merged
Merged
Remove pulls trigger #450
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7644366
remove pulls trigger
nora-codecov f064855
add test
nora-codecov 37420c5
put cleanup method into cron job
nora-codecov 7da62b4
fix migration conflict
nora-codecov 1190957
remove the changes to should_write_to_storage
nora-codecov 9da9d82
make repository non-required for ArchiveService, add bulk delete to A…
nora-codecov 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
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
21 changes: 21 additions & 0 deletions
21
shared/django_apps/legacy_migrations/migrations/0008_delete_pull_update_trigger.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,21 @@ | ||
# Generated by Django 4.2.16 on 2024-12-06 00:15 | ||
|
||
from django.db import migrations | ||
|
||
from shared.django_apps.migration_utils import RiskyRunSQL | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("legacy_migrations", "0007_delete_repo_trigger_stats"), | ||
] | ||
|
||
operations = [ | ||
RiskyRunSQL( | ||
""" | ||
DROP TRIGGER IF EXISTS pulls_before_update_drop_flare ON pulls; | ||
DROP FUNCTION IF EXISTS pulls_drop_flare(); | ||
""", | ||
reverse_sql=migrations.RunSQL.noop, | ||
) | ||
] |
2 changes: 0 additions & 2 deletions
2
shared/django_apps/legacy_migrations/migrations/legacy_sql/main/triggers/main.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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
from .commits import run_sql as commits_run_sql | ||
from .owners import run_sql as owners_run_sql | ||
from .pulls import run_sql as pulls_run_sql | ||
from .repos import run_sql as repos_run_sql | ||
|
||
|
||
def run_sql(schema_editor): | ||
commits_run_sql(schema_editor) | ||
owners_run_sql(schema_editor) | ||
repos_run_sql(schema_editor) | ||
pulls_run_sql(schema_editor) |
17 changes: 0 additions & 17 deletions
17
shared/django_apps/legacy_migrations/migrations/legacy_sql/main/triggers/pulls.py
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
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 |
---|---|---|
|
@@ -147,7 +147,7 @@ def delete_file(self, bucket_name, path): | |
except ClientError: | ||
raise | ||
|
||
def delete_files(self, bucket_name, paths=[]): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This default value is dangerous and unnecessary. fixed the occurrences I found across the project. |
||
def delete_files(self, bucket_name: str, paths: list[str]) -> list[bool]: | ||
"""Batch deletes a list of files from a given bucket | ||
|
||
Note: | ||
|
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.
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.
Making ArchiveService dependent on a repository was complicating my flare cleanup task.
It seems like repository is only needed to make the hash for reading and writing to the archive - you don't need it to delete.
To make my flare cleanup task much lighter, I removed the requirement for a repository in order to use ArchiveService. I added checks to the ArchiveStorage functions where the hash is used, so that you can't do something like write to storage without a hash.