From 27463f202b58a6da8bfc3966e253e1f3a150ae8b Mon Sep 17 00:00:00 2001 From: Maja Massarini Date: Fri, 20 Sep 2024 14:33:09 +0200 Subject: [PATCH] Remove sync_default_files from method signatures synced_files has been removed. files_to_sync is always initialized with the default files path. If default files have not to be synchronized then they have to be removed from files_to_sync list. --- packit_service/worker/handlers/distgit.py | 1 - packit_service/worker/jobs.py | 12 +++--------- tests/integration/test_new_hotness_update.py | 2 -- tests/integration/test_pr_comment.py | 2 -- tests/integration/test_release_event.py | 6 ------ tests/unit/test_steve.py | 1 - 6 files changed, 3 insertions(+), 21 deletions(-) diff --git a/packit_service/worker/handlers/distgit.py b/packit_service/worker/handlers/distgit.py index e957fe361..78b02eaf6 100644 --- a/packit_service/worker/handlers/distgit.py +++ b/packit_service/worker/handlers/distgit.py @@ -266,7 +266,6 @@ def sync_branch( "create_pr": True, "local_pr_branch_suffix": branch_suffix, "use_downstream_specfile": is_pull_from_upstream_job, - "sync_default_files": not is_pull_from_upstream_job, "add_pr_instructions": True, "resolved_bugs": self.get_resolved_bugs(), "release_monitoring_project_id": self.data.event_dict.get( diff --git a/packit_service/worker/jobs.py b/packit_service/worker/jobs.py index e3398aeac..79a6a72cb 100644 --- a/packit_service/worker/jobs.py +++ b/packit_service/worker/jobs.py @@ -13,15 +13,12 @@ import celery from ogr.exceptions import GithubAppNotInstalledError + from packit.config import JobConfig, JobConfigTriggerType, JobConfigView, JobType -from packit.config.job_config import DEPRECATED_JOB_TYPES from packit.utils import nested_get - from packit_service.config import PackageConfig, PackageConfigGetter, ServiceConfig from packit_service.constants import ( - TASK_ACCEPTED, COMMENT_REACTION, - DOCS_CONFIGURATION_URL, PACKIT_VERIFY_FAS_COMMAND, TASK_ACCEPTED, ) @@ -641,7 +638,7 @@ def should_task_be_created_for_job_config_and_handler( ) return False - if not handler_kls.pre_check( + return handler_kls.pre_check( package_config=( self.event.packages_config.get_package_config_for(job_config) if self.event.packages_config @@ -649,10 +646,7 @@ def should_task_be_created_for_job_config_and_handler( ), job_config=job_config, event=self.event.get_dict(), - ): - return False - - return True + ) def is_project_public_or_enabled_private(self) -> bool: """ diff --git a/tests/integration/test_new_hotness_update.py b/tests/integration/test_new_hotness_update.py index 21941041e..572a2be04 100644 --- a/tests/integration/test_new_hotness_update.py +++ b/tests/integration/test_new_hotness_update.py @@ -215,7 +215,6 @@ def test_new_hotness_update(new_hotness_update, sync_release_model): create_pr=True, local_pr_branch_suffix="update-pull_from_upstream", use_downstream_specfile=True, - sync_default_files=False, add_pr_instructions=True, resolved_bugs=["rhbz#2106196"], release_monitoring_project_id=4181, @@ -391,7 +390,6 @@ def test_new_hotness_update_non_git(new_hotness_update, sync_release_model_non_g create_pr=True, local_pr_branch_suffix="update-pull_from_upstream", use_downstream_specfile=True, - sync_default_files=False, add_pr_instructions=True, resolved_bugs=["rhbz#2106196"], release_monitoring_project_id=4181, diff --git a/tests/integration/test_pr_comment.py b/tests/integration/test_pr_comment.py index 5cf02e6e3..3a626dd88 100644 --- a/tests/integration/test_pr_comment.py +++ b/tests/integration/test_pr_comment.py @@ -2727,7 +2727,6 @@ def _get_project(url, *_, **__): create_pr=True, local_pr_branch_suffix="update-pull_from_upstream", use_downstream_specfile=True, - sync_default_files=False, add_pr_instructions=True, resolved_bugs=["rhbz#123", "rhbz#124"], release_monitoring_project_id=None, @@ -2894,7 +2893,6 @@ def _get_project(url, *_, **__): create_pr=True, local_pr_branch_suffix="update-pull_from_upstream", use_downstream_specfile=True, - sync_default_files=False, add_pr_instructions=True, resolved_bugs=["rhbz#123", "rhbz#124"], release_monitoring_project_id=None, diff --git a/tests/integration/test_release_event.py b/tests/integration/test_release_event.py index de7da0f8d..48795d533 100644 --- a/tests/integration/test_release_event.py +++ b/tests/integration/test_release_event.py @@ -215,7 +215,6 @@ def test_dist_git_push_release_handle( create_pr=True, local_pr_branch_suffix="update-propose_downstream", use_downstream_specfile=False, - sync_default_files=True, add_pr_instructions=True, resolved_bugs=[], release_monitoring_project_id=None, @@ -357,7 +356,6 @@ def test_dist_git_push_release_handle_multiple_branches( create_pr=True, local_pr_branch_suffix="update-propose_downstream", use_downstream_specfile=False, - sync_default_files=True, add_pr_instructions=True, resolved_bugs=[], release_monitoring_project_id=None, @@ -507,7 +505,6 @@ def test_dist_git_push_release_handle_one_failed( create_pr=True, local_pr_branch_suffix="update-propose_downstream", use_downstream_specfile=False, - sync_default_files=True, add_pr_instructions=True, resolved_bugs=[], release_monitoring_project_id=None, @@ -532,7 +529,6 @@ def test_dist_git_push_release_handle_one_failed( create_pr=True, local_pr_branch_suffix="update-propose_downstream", use_downstream_specfile=False, - sync_default_files=True, add_pr_instructions=True, resolved_bugs=[], release_monitoring_project_id=None, @@ -785,7 +781,6 @@ def test_retry_propose_downstream_task( create_pr=True, local_pr_branch_suffix="update-propose_downstream", use_downstream_specfile=False, - sync_default_files=True, add_pr_instructions=True, resolved_bugs=[], release_monitoring_project_id=None, @@ -901,7 +896,6 @@ def test_dont_retry_propose_downstream_task( create_pr=True, local_pr_branch_suffix="update-propose_downstream", use_downstream_specfile=False, - sync_default_files=True, add_pr_instructions=True, resolved_bugs=[], release_monitoring_project_id=None, diff --git a/tests/unit/test_steve.py b/tests/unit/test_steve.py index afefcf534..88ca8e6de 100644 --- a/tests/unit/test_steve.py +++ b/tests/unit/test_steve.py @@ -186,7 +186,6 @@ def test_process_message(event, private, enabled_private_namespaces, success): create_pr=True, local_pr_branch_suffix="update-propose_downstream", use_downstream_specfile=False, - sync_default_files=True, add_pr_instructions=True, resolved_bugs=[], release_monitoring_project_id=None,