diff --git a/.ci/scripts/extra_linting.sh b/.ci/scripts/extra_linting.sh new file mode 100755 index 0000000000..ef0c3ce288 --- /dev/null +++ b/.ci/scripts/extra_linting.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +EXIT_CODE=0 +if (git grep "orphan_protection_time=0" ./galaxy_ng);then + echo "Setting 'orphan_protection_time' to 0 can lead to a race condition.\n"; + EXIT_CODE=1 +fi +exit $EXIT_CODE \ No newline at end of file diff --git a/.github/template_gitref b/.github/template_gitref index 1b8061f348..7446ef6e14 100644 --- a/.github/template_gitref +++ b/.github/template_gitref @@ -1 +1 @@ -2021.08.26-65-g3505809 +2021.08.26-85-ga3934fa diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d72b24e4ac..8485f907e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,6 +63,9 @@ jobs: - name: Run flake8 run: flake8 --config flake8.cfg + - name: Run extra lint checks + run: "[ -x .ci/scripts/extra_linting.sh ] && .ci/scripts/extra_linting.sh" + # check for any files unintentionally left out of MANIFEST.in - name: Check manifest run: check-manifest diff --git a/CHANGES/1384.bugfix b/CHANGES/1384.bugfix new file mode 100644 index 0000000000..a1bc3f98d4 --- /dev/null +++ b/CHANGES/1384.bugfix @@ -0,0 +1 @@ +Make sure orphan_protection_time is not set to zero \ No newline at end of file diff --git a/galaxy_ng/app/tasks/deletion.py b/galaxy_ng/app/tasks/deletion.py index 4a11b060ff..4387a298bd 100644 --- a/galaxy_ng/app/tasks/deletion.py +++ b/galaxy_ng/app/tasks/deletion.py @@ -36,7 +36,7 @@ def delete_collection_version(collection_version_pk): _remove_collection_version_from_repos(collection_version) log.info("Running orphan_cleanup to delete CollectionVersion object and artifact") - orphan_cleanup(content_pks=None, orphan_protection_time=0) + orphan_cleanup(content_pks=None, orphan_protection_time=10) if not collection.versions.all(): log.info("Collection has no more versions, deleting collection {}".format(collection)) @@ -57,7 +57,7 @@ def delete_collection(collection_pk): _remove_collection_version_from_repos(version) log.info("Running orphan_cleanup to delete CollectionVersion objects and artifacts") - orphan_cleanup(content_pks=None, orphan_protection_time=0) + orphan_cleanup(content_pks=None, orphan_protection_time=10) log.info("Deleting collection {}".format(collection)) collection.delete() @@ -70,7 +70,7 @@ def delete_container_distribution(instance_ids): pulp_container_tasks.general_multi_delete(instance_ids=instance_ids) log.info("Running orphan_cleanup to delete Container objects and artifacts") - orphan_cleanup(content_pks=None, orphan_protection_time=0) + orphan_cleanup(content_pks=None, orphan_protection_time=10) def delete_container_image_manifest(repository_pk, content_unit_pks):