Skip to content

Commit c4b46fd

Browse files
mnaserclaude
andauthored
Add missing attributes and nodeset entry to Zuul schema (SchemaStore#5225)
* Add group-vars attribute to Zuul job schema Add support for the group-vars job attribute which allows setting Ansible variables for groups of nodes. This mirrors the existing host-vars attribute but applies to inventory groups instead. Reference: https://zuul-ci.org/docs/zuul/latest/config/job.html#attr-job.group-vars 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]> Signed-off-by: Mohammed Naser <[email protected]> * Add merge-mode attribute to Zuul project schema Add support for the merge-mode project attribute which specifies the merge strategy used by Git. Valid values are: merge, merge-resolve, merge-recursive, merge-ort, cherry-pick, squash-merge, and rebase. Reference: https://zuul-ci.org/docs/zuul/latest/config/project.html#attr-project.merge-mode 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]> Signed-off-by: Mohammed Naser <[email protected]> * Add nodeset entry type to Zuul schema Add support for top-level nodeset definitions in Zuul configuration files. A nodeset defines a collection of nodes and groups for use by jobs. The schema supports: - nodes: List of node definitions with name and label - groups: List of group definitions for organizing nodes - alternatives: List of fallback nodesets to try in sequence Reference: https://zuul-ci.org/docs/zuul/latest/config/nodeset.html 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]> Signed-off-by: Mohammed Naser <[email protected]> --------- Signed-off-by: Mohammed Naser <[email protected]> Co-authored-by: Claude Opus 4.5 <[email protected]>
1 parent bd2b6d6 commit c4b46fd

File tree

2 files changed

+154
-0
lines changed

2 files changed

+154
-0
lines changed

src/schemas/json/zuul.json

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@
8989
"title": "Final",
9090
"type": "boolean"
9191
},
92+
"group-vars": {
93+
"additionalProperties": {
94+
"type": "object"
95+
},
96+
"title": "Group-Vars",
97+
"type": "object"
98+
},
9299
"host-vars": {
93100
"additionalProperties": {
94101
"type": "object"
@@ -344,6 +351,102 @@
344351
"title": "JobSemaphoreModel",
345352
"type": "object"
346353
},
354+
"NodesetEntry": {
355+
"additionalProperties": false,
356+
"properties": {
357+
"nodeset": {
358+
"$ref": "#/definitions/NodesetModel"
359+
}
360+
},
361+
"required": ["nodeset"],
362+
"title": "NodesetEntry",
363+
"type": "object"
364+
},
365+
"NodesetModel": {
366+
"additionalProperties": false,
367+
"properties": {
368+
"name": {
369+
"title": "Name",
370+
"type": "string"
371+
},
372+
"nodes": {
373+
"items": {
374+
"$ref": "#/definitions/NodesetNodeModel"
375+
},
376+
"title": "Nodes",
377+
"type": "array"
378+
},
379+
"groups": {
380+
"items": {
381+
"$ref": "#/definitions/NodesetGroupModel"
382+
},
383+
"title": "Groups",
384+
"type": "array"
385+
},
386+
"alternatives": {
387+
"items": {
388+
"anyOf": [
389+
{
390+
"type": "string"
391+
},
392+
{
393+
"$ref": "#/definitions/NodesetModel"
394+
}
395+
]
396+
},
397+
"title": "Alternatives",
398+
"type": "array"
399+
}
400+
},
401+
"required": ["name"],
402+
"title": "NodesetModel",
403+
"type": "object"
404+
},
405+
"NodesetNodeModel": {
406+
"additionalProperties": false,
407+
"properties": {
408+
"name": {
409+
"anyOf": [
410+
{
411+
"type": "string"
412+
},
413+
{
414+
"items": {
415+
"type": "string"
416+
},
417+
"type": "array"
418+
}
419+
],
420+
"title": "Name"
421+
},
422+
"label": {
423+
"title": "Label",
424+
"type": "string"
425+
}
426+
},
427+
"required": ["name", "label"],
428+
"title": "NodesetNodeModel",
429+
"type": "object"
430+
},
431+
"NodesetGroupModel": {
432+
"additionalProperties": false,
433+
"properties": {
434+
"name": {
435+
"title": "Name",
436+
"type": "string"
437+
},
438+
"nodes": {
439+
"items": {
440+
"type": "string"
441+
},
442+
"title": "Nodes",
443+
"type": "array"
444+
}
445+
},
446+
"required": ["name", "nodes"],
447+
"title": "NodesetGroupModel",
448+
"type": "object"
449+
},
347450
"PipelineModel": {
348451
"additionalProperties": false,
349452
"properties": {
@@ -392,6 +495,19 @@
392495
"gate": {
393496
"$ref": "#/definitions/PipelineModel"
394497
},
498+
"merge-mode": {
499+
"title": "Merge-Mode",
500+
"enum": [
501+
"merge",
502+
"merge-resolve",
503+
"merge-recursive",
504+
"merge-ort",
505+
"cherry-pick",
506+
"squash-merge",
507+
"rebase"
508+
],
509+
"type": "string"
510+
},
395511
"name": {
396512
"title": "Name",
397513
"type": "string"
@@ -551,6 +667,9 @@
551667
{
552668
"$ref": "#/definitions/JobEntry"
553669
},
670+
{
671+
"$ref": "#/definitions/NodesetEntry"
672+
},
554673
{
555674
"$ref": "#/definitions/ProjectEntry"
556675
},

src/test/zuul/jobs.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
attempts: 1
2121
voting: true
2222
ansible-version: 2.8
23+
group-vars:
24+
all:
25+
ansible_python_interpreter: /usr/bin/python3
2326
host-vars:
2427
primary:
2528
ansible_user: root
@@ -151,6 +154,7 @@
151154
name: Sample project
152155
queue: test
153156
default-branch: main
157+
merge-mode: squash-merge
154158
description: Description
155159
templates:
156160
- sample-template
@@ -173,3 +177,34 @@
173177
name: foo
174178
data:
175179
foo: bar
180+
181+
# https://zuul-ci.org/docs/zuul/latest/config/nodeset.html
182+
# nodeset minimal
183+
- nodeset:
184+
name: single-node
185+
nodes:
186+
- name: controller
187+
label: ubuntu-jammy
188+
189+
# nodeset with groups
190+
- nodeset:
191+
name: multi-node
192+
nodes:
193+
- name: controller
194+
label: ubuntu-jammy
195+
- name:
196+
- worker1
197+
- worker2
198+
label: ubuntu-jammy
199+
groups:
200+
- name: workers
201+
nodes:
202+
- worker1
203+
- worker2
204+
205+
# nodeset with alternatives
206+
- nodeset:
207+
name: fallback-nodeset
208+
alternatives:
209+
- single-node
210+
- multi-node

0 commit comments

Comments
 (0)