Skip to content

Commit 71268ee

Browse files
authored
Fix recent static quality gate windows flake due to artifact leak (#37374)
1 parent 1cc63d8 commit 71268ee

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

tasks/quality_gates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def exception_threshold_bump(ctx):
299299
:param ctx:
300300
:return:
301301
"""
302-
current_branch_name = get_current_branch()
302+
current_branch_name = get_current_branch(ctx)
303303
ancestor_commit = get_common_ancestor(ctx, "HEAD")
304304
repo = get_gitlab_repo()
305305
with tempfile.TemporaryDirectory() as extract_dir, ctx.cd(extract_dir):

tasks/static_quality_gates/lib/gates_lib.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ def find_package_path(flavor, package_os, arch, extension=None):
8484
separator = '_' if package_os == 'debian' else '-'
8585
if not extension:
8686
extension = "deb" if package_os == 'debian' else "rpm"
87-
glob_pattern = f'{package_dir}/{flavor}{separator}7*{arch}.{extension}'
87+
pipeline_match = ""
88+
if package_os == "windows": # Windows builds are subject to artifacts leak and need their pipeline to match the msi
89+
pipeline_match = f"{os.environ['CI_PIPELINE_ID']}-1-"
90+
glob_pattern = f'{package_dir}/{flavor}{separator}7*{pipeline_match}{arch}.{extension}'
8891
package_paths = glob.glob(glob_pattern)
8992
if len(package_paths) > 1:
9093
raise Exit(code=1, message=color_message(f"Too many files matching {glob_pattern}: {package_paths}", "red"))

0 commit comments

Comments
 (0)