Skip to content

Commit df20ac6

Browse files
authored
Merge pull request #24 from sivasubramanian95/fix/gitlab-empty-stages
fix(gitlab-ci): prevent empty stages when kubernetes disabled
2 parents fe67283 + 09f7e20 commit df20ac6

2 files changed

Lines changed: 2 additions & 12 deletions

File tree

cli/scaffold_gitlab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def _global_section(args):
9393
stages.append("build")
9494
if args.type in ("test", "complete"):
9595
stages.append("test")
96-
if args.type in ("deploy", "complete") and args.kubernetes:
96+
if args.type == "deploy" or (args.type == "complete" and args.kubernetes):
9797
stages.append("deploy")
9898

9999
return {

tests/test_comprehensive.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -614,17 +614,7 @@ def test_build_job_docker_services(self):
614614
# Build job uses docker-in-docker services
615615
assert "services" in data["build"]
616616

617-
# BUG-1: deploy pipeline with no kubernetes produces empty stages list
618-
@pytest.mark.xfail(
619-
strict=True,
620-
reason=(
621-
"BUG-1: When type='deploy' and kubernetes=False, _global_section() "
622-
"produces an empty stages list because the 'deploy' stage is only "
623-
"appended when args.kubernetes is True. A deploy-only pipeline "
624-
"without Kubernetes has no valid stages, making it an invalid "
625-
"GitLab CI pipeline."
626-
),
627-
)
617+
# BUG-1 regression: deploy pipeline with no kubernetes must still have stages
628618
def test_deploy_pipeline_no_kubernetes_empty_stages(self):
629619
"""
630620
BUG-1: When type='deploy' and kubernetes=False, the generated

0 commit comments

Comments
 (0)