From 50dd589966a77090339466ca378d0d92223cbf73 Mon Sep 17 00:00:00 2001 From: Johannes Carlsson Date: Mon, 18 Nov 2024 13:39:31 +0100 Subject: [PATCH] Fix "abort-builds" for WorkflowMultiBranchProject "abort-builds" must be present in job_contents_keys in order for it to properly work. Also add a multibranch test for the yamlparser that will verify that this works properly. Change-Id: Ide9cd0f89a19002977cdcc2dfb9cd873e7d16945 --- jenkins_jobs/defaults.py | 1 + .../job_fixtures/multi_scm_full.xml | 54 +++++++++++++++++++ .../job_fixtures/multi_scm_full.yaml | 13 +++++ 3 files changed, 68 insertions(+) create mode 100644 tests/yamlparser/job_fixtures/multi_scm_full.xml create mode 100644 tests/yamlparser/job_fixtures/multi_scm_full.yaml diff --git a/jenkins_jobs/defaults.py b/jenkins_jobs/defaults.py index 913fbc0d7..227f20ae5 100644 --- a/jenkins_jobs/defaults.py +++ b/jenkins_jobs/defaults.py @@ -79,6 +79,7 @@ job_contents_keys = { "prune-dead-branches", "days-to-keep", "number-to-keep", + "abort-builds", "periodic-folder-trigger", # Pipeline. "dsl", diff --git a/tests/yamlparser/job_fixtures/multi_scm_full.xml b/tests/yamlparser/job_fixtures/multi_scm_full.xml new file mode 100644 index 000000000..bef1e8498 --- /dev/null +++ b/tests/yamlparser/job_fixtures/multi_scm_full.xml @@ -0,0 +1,54 @@ + + + + + + All + false + false + + + + + + + + + + + false + + + + + + + true + 10 + 10 + true + + + + H H * * * + 86400000 + + + + + + + + + some.Jenkinsfile + + + Workflow demo<!-- Managed by Jenkins Job Builder --> + false + false + false + false + true + + + diff --git a/tests/yamlparser/job_fixtures/multi_scm_full.yaml b/tests/yamlparser/job_fixtures/multi_scm_full.yaml new file mode 100644 index 000000000..e4ddeff41 --- /dev/null +++ b/tests/yamlparser/job_fixtures/multi_scm_full.yaml @@ -0,0 +1,13 @@ +- job: + name: 'demo-multibranch-multi-scm-full' + description: 'Workflow demo' + + project-type: multibranch + + periodic-folder-trigger: 1d + prune-dead-branches: True + number-to-keep: '10' + days-to-keep: '10' + abort-builds: True + script-path: 'some.Jenkinsfile' + scm: []