From 56dd3fd3491ee1eb5243f1ff451aafa311e8d8cd Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Fri, 26 Feb 2021 13:58:08 +0000 Subject: [PATCH] More missing zuul schema properties --- examples/zuul.d/jobs.yaml | 8 ++++++++ f/zuul.json | 33 +++++++++++++++++++++++++++++++++ src/ansibleschemas/zuul.py | 4 ++++ 3 files changed, 45 insertions(+) diff --git a/examples/zuul.d/jobs.yaml b/examples/zuul.d/jobs.yaml index 8c771178..dee3c602 100644 --- a/examples/zuul.d/jobs.yaml +++ b/examples/zuul.d/jobs.yaml @@ -36,6 +36,10 @@ files: 'pattern' # or list of patterns override-checkout: master success-url: docs/ + tags: all-platforms + required-projects: + - foo + - bar - project-template: name: sample-template @@ -60,9 +64,13 @@ - sample-template vars: var_for_all_jobs: value + # common pipeline names (sadly at same level as properties) check: jobs: - job1 - job2: vars: var_for_all_jobs: override + gate: {} + promote: {} + periodic-weekly: {} diff --git a/f/zuul.json b/f/zuul.json index 65d807f7..2708f45a 100644 --- a/f/zuul.json +++ b/f/zuul.json @@ -124,6 +124,13 @@ ], "title": "Pre-Run" }, + "required-projects": { + "items": { + "type": "string" + }, + "title": "Required-Projects", + "type": "array" + }, "run": { "title": "Run", "type": "string" @@ -132,6 +139,20 @@ "title": "Success-Url", "type": "string" }, + "tags": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + } + ], + "title": "Tags" + }, "timeout": { "title": "Timeout", "type": "integer" @@ -194,9 +215,15 @@ "title": "Name", "type": "string" }, + "periodic-weekly": { + "$ref": "#/definitions/PipelineModel" + }, "post": { "$ref": "#/definitions/PipelineModel" }, + "promote": { + "$ref": "#/definitions/PipelineModel" + }, "release": { "$ref": "#/definitions/PipelineModel" }, @@ -245,9 +272,15 @@ "title": "Name", "type": "string" }, + "periodic-weekly": { + "$ref": "#/definitions/PipelineModel" + }, "post": { "$ref": "#/definitions/PipelineModel" }, + "promote": { + "$ref": "#/definitions/PipelineModel" + }, "release": { "$ref": "#/definitions/PipelineModel" }, diff --git a/src/ansibleschemas/zuul.py b/src/ansibleschemas/zuul.py index a5be0385..bc461618 100644 --- a/src/ansibleschemas/zuul.py +++ b/src/ansibleschemas/zuul.py @@ -29,6 +29,8 @@ class ProjectBaseModel(BaseModel): release: Optional[PipelineModel] check: Optional[PipelineModel] gate: Optional[PipelineModel] + promote: Optional[PipelineModel] + periodic_weekly: Optional[PipelineModel] = Field(alias="periodic-weekly") class ProjectTemplateModel(ProjectBaseModel): @@ -66,6 +68,8 @@ class JobModel(BaseModel): Union[float, Literal["2.7", "2.8", "2.9", "2.10", "2.11"]] ] = Field(alias="ansible-version") host_vars: Optional[Mapping[str, Mapping[str, Any]]] = Field(alias="host-vars") + tags: Optional[Union[str, List[str]]] + required_projects: Optional[List[str]] = Field(alias="required-projects") class Config: extra = Extra.forbid