Add job.nodeset parameter to supercede job.nodes
We intended to have Nodesets be convenience methods for the 'nodes'
attribute of jobs, but be identical. When nodesets grew groups,
however, job.nodes did not. Because of the additional structure
that nodesets contain (to support groups, and likely vars in the
future), we can't simply extend the existing nodes parameter.
Add a new parameter, nodeset, which expects either a string or
an embedded nodeset definition. We're using the name 'nodeset'
here because 'nodes: nodes:' is difficult to understand.
Job.nodes will be removed soon.
(Re-proposed from I714887625c41bd1220ff05cd7356fbac589389c9)
Change-Id: I6c1c1e864704ac659efae9b28b140d9b37cef9d2
diff --git a/tests/fixtures/config/ansible/git/common-config/zuul.yaml b/tests/fixtures/config/ansible/git/common-config/zuul.yaml
index d34d5c4..67d1c70 100644
--- a/tests/fixtures/config/ansible/git/common-config/zuul.yaml
+++ b/tests/fixtures/config/ansible/git/common-config/zuul.yaml
@@ -98,9 +98,10 @@
- job:
parent: python27
name: check-vars
- nodes:
- - name: ubuntu-xenial
- label: ubuntu-xenial
+ nodeset:
+ nodes:
+ - name: ubuntu-xenial
+ label: ubuntu-xenial
vars:
vartest_job: vartest_job
vartest_secret: vartest_job
@@ -112,9 +113,10 @@
- job:
parent: python27
name: check-secret-names
- nodes:
- - name: ubuntu-xenial
- label: ubuntu-xenial
+ nodeset:
+ nodes:
+ - name: ubuntu-xenial
+ label: ubuntu-xenial
secrets:
- secret: vartest_secret
name: renamed_secret
diff --git a/tests/fixtures/config/inventory/git/common-config/zuul.yaml b/tests/fixtures/config/inventory/git/common-config/zuul.yaml
index 7809c5d..e5727a2 100644
--- a/tests/fixtures/config/inventory/git/common-config/zuul.yaml
+++ b/tests/fixtures/config/inventory/git/common-config/zuul.yaml
@@ -37,10 +37,11 @@
- job:
name: single-inventory
- nodes:
- - name: ubuntu-xenial
- label: ubuntu-xenial
+ nodeset:
+ nodes:
+ - name: ubuntu-xenial
+ label: ubuntu-xenial
- job:
name: group-inventory
- nodes: nodeset1
+ nodeset: nodeset1
diff --git a/tests/fixtures/config/multi-tenant/git/common-config/zuul.yaml b/tests/fixtures/config/multi-tenant/git/common-config/zuul.yaml
index 27f2fd5..273469c 100644
--- a/tests/fixtures/config/multi-tenant/git/common-config/zuul.yaml
+++ b/tests/fixtures/config/multi-tenant/git/common-config/zuul.yaml
@@ -17,6 +17,7 @@
- job:
name: python27
- nodes:
- - name: controller
- label: ubuntu-trusty
+ nodeset:
+ nodes:
+ - name: controller
+ label: ubuntu-trusty
diff --git a/tests/fixtures/config/openstack/git/project-config/zuul.yaml b/tests/fixtures/config/openstack/git/project-config/zuul.yaml
index 2506db0..de6321d 100644
--- a/tests/fixtures/config/openstack/git/project-config/zuul.yaml
+++ b/tests/fixtures/config/openstack/git/project-config/zuul.yaml
@@ -37,9 +37,10 @@
name: base
parent: null
timeout: 30
- nodes:
- - name: controller
- label: ubuntu-xenial
+ nodeset:
+ nodes:
+ - name: controller
+ label: ubuntu-xenial
- job:
name: python27
@@ -49,9 +50,10 @@
name: python27
parent: base
branches: stable/mitaka
- nodes:
- - name: controller
- label: ubuntu-trusty
+ nodeset:
+ nodes:
+ - name: controller
+ label: ubuntu-trusty
- job:
name: python35
diff --git a/tests/fixtures/config/single-tenant/git/common-config/zuul.yaml b/tests/fixtures/config/single-tenant/git/common-config/zuul.yaml
index 9796fe2..14f43f4 100644
--- a/tests/fixtures/config/single-tenant/git/common-config/zuul.yaml
+++ b/tests/fixtures/config/single-tenant/git/common-config/zuul.yaml
@@ -47,41 +47,47 @@
- job:
name: project-merge
hold-following-changes: true
- nodes:
- - name: controller
- label: label1
+ nodeset:
+ nodes:
+ - name: controller
+ label: label1
- job:
name: project-test1
attempts: 4
- nodes:
- - name: controller
- label: label1
+ nodeset:
+ nodes:
+ - name: controller
+ label: label1
- job:
name: project-test1
branches: stable
- nodes:
- - name: controller
- label: label2
+ nodeset:
+ nodes:
+ - name: controller
+ label: label2
- job:
name: project-post
- nodes:
- - name: static
- label: ubuntu-xenial
+ nodeset:
+ nodes:
+ - name: static
+ label: ubuntu-xenial
- job:
name: project-test2
- nodes:
- - name: controller
- label: label1
+ nodeset:
+ nodes:
+ - name: controller
+ label: label1
- job:
name: project1-project2-integration
- nodes:
- - name: controller
- label: label1
+ nodeset:
+ nodes:
+ - name: controller
+ label: label1
- job:
name: project-testfile
diff --git a/tests/fixtures/layouts/autohold.yaml b/tests/fixtures/layouts/autohold.yaml
index 515f79d..578f886 100644
--- a/tests/fixtures/layouts/autohold.yaml
+++ b/tests/fixtures/layouts/autohold.yaml
@@ -17,9 +17,10 @@
- job:
name: project-test2
- nodes:
- - name: controller
- label: label1
+ nodeset:
+ nodes:
+ - name: controller
+ label: label1
- project:
name: org/project
diff --git a/tests/fixtures/layouts/disable_at.yaml b/tests/fixtures/layouts/disable_at.yaml
index 7b1b8c8..8c24c1b 100644
--- a/tests/fixtures/layouts/disable_at.yaml
+++ b/tests/fixtures/layouts/disable_at.yaml
@@ -21,9 +21,10 @@
- job:
name: project-test1
- nodes:
- - name: controller
- label: label1
+ nodeset:
+ nodes:
+ - name: controller
+ label: label1
- project:
name: org/project
diff --git a/tests/fixtures/layouts/dont-ignore-ref-deletes.yaml b/tests/fixtures/layouts/dont-ignore-ref-deletes.yaml
index 6a92deb..bb98b57 100644
--- a/tests/fixtures/layouts/dont-ignore-ref-deletes.yaml
+++ b/tests/fixtures/layouts/dont-ignore-ref-deletes.yaml
@@ -13,9 +13,10 @@
- job:
name: project-post
- nodes:
- - name: static
- label: ubuntu-xenial
+ nodeset:
+ nodes:
+ - name: static
+ label: ubuntu-xenial
- project:
name: org/project
diff --git a/tests/fixtures/layouts/idle.yaml b/tests/fixtures/layouts/idle.yaml
index ec31408..4cc07ae 100644
--- a/tests/fixtures/layouts/idle.yaml
+++ b/tests/fixtures/layouts/idle.yaml
@@ -11,9 +11,10 @@
- job:
name: project-bitrot
- nodes:
- - name: static
- label: ubuntu-xenial
+ nodeset:
+ nodes:
+ - name: static
+ label: ubuntu-xenial
- project:
name: org/project
diff --git a/tests/fixtures/layouts/no-timer.yaml b/tests/fixtures/layouts/no-timer.yaml
index 3790ea7..7aaa1ed 100644
--- a/tests/fixtures/layouts/no-timer.yaml
+++ b/tests/fixtures/layouts/no-timer.yaml
@@ -29,9 +29,10 @@
- job:
name: project-bitrot
- nodes:
- - name: static
- label: ubuntu-xenial
+ nodeset:
+ nodes:
+ - name: static
+ label: ubuntu-xenial
- project:
name: org/project
diff --git a/tests/fixtures/layouts/repo-deleted.yaml b/tests/fixtures/layouts/repo-deleted.yaml
index 6e6c301..3a7f6b3 100644
--- a/tests/fixtures/layouts/repo-deleted.yaml
+++ b/tests/fixtures/layouts/repo-deleted.yaml
@@ -42,16 +42,18 @@
- job:
name: project-test1
- nodes:
- - name: controller
- label: label1
+ nodeset:
+ nodes:
+ - name: controller
+ label: label1
- job:
name: project-test1
branches: stable
- nodes:
- - name: controller
- label: label2
+ nodeset:
+ nodes:
+ - name: controller
+ label: label2
- job:
name: project-test2
diff --git a/tests/fixtures/layouts/smtp.yaml b/tests/fixtures/layouts/smtp.yaml
index 5ea75ce..0654448 100644
--- a/tests/fixtures/layouts/smtp.yaml
+++ b/tests/fixtures/layouts/smtp.yaml
@@ -48,16 +48,18 @@
- job:
name: project-test1
- nodes:
- - name: controller
- label: label1
+ nodeset:
+ nodes:
+ - name: controller
+ label: label1
- job:
name: project-test1
branches: stable
- nodes:
- - name: controller
- label: label2
+ nodeset:
+ nodes:
+ - name: controller
+ label: label2
- job:
name: project-test2
diff --git a/tests/fixtures/layouts/timer.yaml b/tests/fixtures/layouts/timer.yaml
index e1c4e77..8c0cc2b 100644
--- a/tests/fixtures/layouts/timer.yaml
+++ b/tests/fixtures/layouts/timer.yaml
@@ -30,9 +30,10 @@
- job:
name: project-bitrot
- nodes:
- - name: static
- label: ubuntu-xenial
+ nodeset:
+ nodes:
+ - name: static
+ label: ubuntu-xenial
- project:
name: org/project