From 4b5b74683767bad514ec53eb2236b57e4a088bd4 Mon Sep 17 00:00:00 2001 From: Justin Pierce Date: Thu, 6 Oct 2022 17:39:42 -0400 Subject: [PATCH] Imagestream fixes (#665) Only open one reconcilation PR at a time if component is using fallback branch Prior to this change, a component that only has a 'master' branch, for example, would have that branch used as a fallback for all active releases. This made imagestreams open a PR against the master branch for reconciliation. In these cases, we should only open a reconciliation PR against master when the current group matches what release CI is tracking for master branches. --- doozerlib/cli/images_streams.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doozerlib/cli/images_streams.py b/doozerlib/cli/images_streams.py index 5f1fb503e..5a6ce8f95 100644 --- a/doozerlib/cli/images_streams.py +++ b/doozerlib/cli/images_streams.py @@ -728,6 +728,14 @@ def check_if_upstream_image_exists(upstream_image): if not public_branch: public_branch = source_repo_branch + if (public_branch == 'master' or public_branch == 'main') and not prs_in_master: + # If a component is not using 'release-4.x' / 'openshift-4.x' branching mechanics, + # ART will be falling back to use master/main branch for the content of ALL + # releases. In this case, only open a reconciliation PR for when the current + # group matches what release CI is tracking in master. + logger.info(f'Skipping PR for {runtime.group} : {dgk} / {public_repo_url} since associated public branch is {public_branch} but CI is tracking {master_major}.{master_minor} in that branch.') + continue + # There are two standard upstream branching styles: # release-4.x : CI fast-forwards from default branch (master or main) when appropriate # openshift-4.x : Upstream team manages completely.