Skip to content

Commit

Permalink
Skip Koji build if dependencies are not satisfied within a sidetag
Browse files Browse the repository at this point in the history
Signed-off-by: Nikola Forró <[email protected]>
  • Loading branch information
nforro committed Jul 11, 2024
1 parent 7b26d1d commit 7230345
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packit_service/worker/handlers/distgit.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,19 @@ def run(self) -> TaskResults:
else:
sidetag = None

# skip submitting build for a branch if dependencies
# are not satisfied within a sidetag
if sidetag and self.job_config.dependencies:
builds = self.koji_helper.get_builds_in_tag(sidetag.koji_name)
tagged_packages = {b["package_name"] for b in builds}
if set(self.job_config.dependencies) <= tagged_packages:
missing = set(self.job_config.dependencies) - tagged_packages
logger.debug(
f"Skipping downstream Koji build for branch {branch}, "
f"missing dependencies: {missing}"
)
continue

stdout = self.packit_api.build(
dist_git_branch=koji_build_model.target,
scratch=self.job_config.scratch,
Expand Down

0 comments on commit 7230345

Please sign in to comment.