From 9403b7acdfa4405c271b3bbf7d46d82fc582c30d Mon Sep 17 00:00:00 2001 From: Maja Massarini Date: Wed, 27 Nov 2024 16:15:53 +0100 Subject: [PATCH 1/2] Add identifier to tests target overrides created in copr end handler --- packit_service/worker/handlers/copr.py | 11 ++++++----- packit_service/worker/handlers/mixin.py | 3 +-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packit_service/worker/handlers/copr.py b/packit_service/worker/handlers/copr.py index e128792bb..3a0dc0dd6 100644 --- a/packit_service/worker/handlers/copr.py +++ b/packit_service/worker/handlers/copr.py @@ -8,13 +8,13 @@ from celery import Task, signature from ogr.services.github import GithubProject from ogr.services.gitlab import GitlabProject + from packit.config import ( JobConfig, JobConfigTriggerType, JobType, ) from packit.config.package_config import PackageConfig - from packit_service import sentry_integration from packit_service.constants import ( COPR_API_SUCC_STATE, @@ -479,12 +479,13 @@ def handle_testing_farm(self): and self.copr_event.chroot in self.copr_build_helper.build_targets_for_test_job(job_config) ): - event_dict["tests_targets_override"] = list( - self.copr_build_helper.build_target2test_targets_for_test_job( + event_dict["tests_targets_override"] = [ + (target, job_config.identifier or "") + for target in self.copr_build_helper.build_target2test_targets_for_test_job( self.copr_event.chroot, job_config, - ), - ) + ) + ] signature( TaskName.testing_farm.value, kwargs={ diff --git a/packit_service/worker/handlers/mixin.py b/packit_service/worker/handlers/mixin.py index 67c7ac3bd..5d3cce427 100644 --- a/packit_service/worker/handlers/mixin.py +++ b/packit_service/worker/handlers/mixin.py @@ -11,7 +11,6 @@ from packit.exceptions import PackitException from packit.utils.koji_helper import KojiHelper from packit.vm_image_build import ImageBuilder - from packit_service.config import ProjectToSync from packit_service.constants import COPR_SRPM_CHROOT, KojiBuildState from packit_service.models import ( @@ -432,7 +431,7 @@ def copr_build_helper(self) -> CoprBuildJobHelper: # when reporting state of SRPM build built in Copr build_targets_override = ( { - (build.target, build.identifier) + (build.target, build.identifier or "") for build in CoprBuildTargetModel.get_all_by_build_id( str(self.copr_event.build_id), ) From 03c0f11324cae991cc765de68d3b9c1d28cac4d7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:22:23 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- packit_service/worker/handlers/copr.py | 2 +- packit_service/worker/handlers/mixin.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packit_service/worker/handlers/copr.py b/packit_service/worker/handlers/copr.py index 3a0dc0dd6..bc724ccf6 100644 --- a/packit_service/worker/handlers/copr.py +++ b/packit_service/worker/handlers/copr.py @@ -8,13 +8,13 @@ from celery import Task, signature from ogr.services.github import GithubProject from ogr.services.gitlab import GitlabProject - from packit.config import ( JobConfig, JobConfigTriggerType, JobType, ) from packit.config.package_config import PackageConfig + from packit_service import sentry_integration from packit_service.constants import ( COPR_API_SUCC_STATE, diff --git a/packit_service/worker/handlers/mixin.py b/packit_service/worker/handlers/mixin.py index 5d3cce427..88629e4bb 100644 --- a/packit_service/worker/handlers/mixin.py +++ b/packit_service/worker/handlers/mixin.py @@ -11,6 +11,7 @@ from packit.exceptions import PackitException from packit.utils.koji_helper import KojiHelper from packit.vm_image_build import ImageBuilder + from packit_service.config import ProjectToSync from packit_service.constants import COPR_SRPM_CHROOT, KojiBuildState from packit_service.models import (