Skip to content

Commit

Permalink
Solve broken monorepo test using get_job_views
Browse files Browse the repository at this point in the history
In this way we will not touch our handlers but we are forced to
handle one package at time.

If we need to deal with multiple packages at the same time
we need to create new handlers and a new way to get them
from a new call, something like the
package_config.get_grouped_job_views().
We will pass to the new handlers a list of ConfigJobView(s)
instead of a single [ConfigJob|ConfigJobView]
  • Loading branch information
majamassarini committed Feb 2, 2023
1 parent 1eca5e9 commit 10d012b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packit_service/worker/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ def check_explicit_matching(self) -> List[JobConfig]:
"""
matching_jobs = []
if isinstance(self.event, PullRequestCommentPagureEvent):
for job in self.event.package_config.jobs:
for job in self.event.package_config.get_job_views():
if (
job.type in [JobType.koji_build, JobType.bodhi_update]
and job.trigger == JobConfigTriggerType.commit
Expand All @@ -532,7 +532,7 @@ def check_explicit_matching(self) -> List[JobConfig]:
# can be re-triggered by a Pagure comment in a PR
matching_jobs.append(job)
elif isinstance(self.event, AbstractIssueCommentEvent):
for job in self.event.package_config.jobs:
for job in self.event.package_config.get_job_views():
if (
job.type in (JobType.koji_build, JobType.bodhi_update)
and job.trigger == JobConfigTriggerType.commit
Expand All @@ -552,7 +552,7 @@ def get_jobs_matching_event(self) -> List[JobConfig]:
Get list of non-duplicated all jobs that matches with event's trigger.
"""
jobs_matching_trigger = []
for job in self.event.package_config.jobs:
for job in self.event.package_config.get_job_views():
if (
job.trigger == self.event.job_config_trigger_type
and (
Expand Down

0 comments on commit 10d012b

Please sign in to comment.