Skip to content

Commit 138789b

Browse files
authored
Filter job for auto_inject repo so system-tests specific jobs are excluded (#7284)
1 parent 56f5f7c commit 138789b

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

utils/scripts/ci_orchestrators/external_gitlab_pipeline.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,22 @@ def main(language: str | None = None) -> None:
7070
# Ensure 'variables' section exists and update with new values
7171
data.setdefault("variables", {}).update(new_variables)
7272

73-
if language and language in LANG_STAGES:
74-
data = filter_yaml(data, language)
73+
data = filter_yaml(data, language)
7574

7675
handle_parallelism(data)
7776

7877
# Print the modified YAML
7978
print(yaml.dump(data, default_flow_style=False, sort_keys=False))
8079

8180

82-
def is_allowed_stage(stage: str | None, language: str) -> bool:
81+
def is_allowed_stage(stage: str | None, language: str | None) -> bool:
8382
"""Check if a stage is allowed based on the language."""
83+
if not language or language not in LANG_STAGES:
84+
return stage in LANG_STAGES or stage in {"configure", "pipeline-status"}
8485
return stage in {language, "configure", "pipeline-status"}
8586

8687

87-
def filter_yaml(yaml_data: dict, language: str) -> dict:
88+
def filter_yaml(yaml_data: dict, language: str | None) -> dict:
8889
"""Filter the pipeline to run only the jobs for the specified language"""
8990

9091
# Find all jobs where stage == language

0 commit comments

Comments
 (0)