From: Jessica Wagantall Date: Tue, 30 Jul 2019 01:05:00 +0000 (-0700) Subject: Update lf-info-yaml-verify X-Git-Tag: v0.40.0~2^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F70%2F16370%2F5;p=releng%2Fglobal-jjb.git Update lf-info-yaml-verify Move info-schema to schema/info-schema.yaml to keep schemas consistency. Download only needed files for lf-info-yaml-verify rather than cloning the entire repo. Issue: RELENG-2242 Change-Id: Ie135c761d1401957be33c98634467967cc085ce2 Signed-off-by: Jessica Wagantall --- diff --git a/docs/jjb/lf-ci-jobs.rst b/docs/jjb/lf-ci-jobs.rst index bd477b90..987f88fa 100644 --- a/docs/jjb/lf-ci-jobs.rst +++ b/docs/jjb/lf-ci-jobs.rst @@ -536,7 +536,7 @@ Info YAML Verify Info YAML Verify job validates that INFO.yaml file changes are kept isolated from other file changes. Verifies INFO.yaml files follow the schema defined in -`global-jjb/info-schema`. +`lfit/releng-global-jjb/schema/info-schema.yaml`. :Template Names: - {project-name}-info-yaml-verify diff --git a/info-schema b/info-schema deleted file mode 100644 index bb596c22..00000000 --- a/info-schema +++ /dev/null @@ -1,70 +0,0 @@ -# SPDX-License-Identifier: EPL-1.0 -############################################################################## -# Copyright (c) 2018 The Linux Foundation and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -############################################################################## ---- -$schema: 'http://json-schema.org/schema#' -$id: 'https://github.com/lfit/releng-global-jjb/blob/master/info-schema' - -required: - - 'project' - - 'project_creation_date' - - 'project_category' - - 'lifecycle_state' - - 'project_lead' - - 'primary_contact' - - 'issue_tracking' - - 'mailing_list' - - 'realtime_discussion' - - 'repositories' - - 'committers' - - 'tsc' - -properties: - project: - type: 'string' - version: - type: 'string' - project_creation_date: - type: 'string' - project_category: - type: 'string' - lifecycle_state: - type: 'string' - enum: ['Incubation', 'Proposal', 'Mature', 'Core', 'Top Level', 'Archived', 'Null', 'Integration'] - project_lead: &user_object - type: 'object' - properties: - name: - type: 'string' - email: - type: 'string' - format: 'email' - id: - type: 'string' - company: - type: 'string' - timezone: - type: 'string' - pattern: '([A-Z][a-z]*\s*)+\/([A-Za-z_-])+' - additionalProperties: false - primary_contact: *user_object - issue_tracking: - type: 'object' - properties: - type: - type: 'string' - url: - type: 'string' - format: 'uri' - key: - type: 'string' - required: ['type', 'url'] - committers: - type: 'array' - items: *user_object diff --git a/releasenotes/notes/update-info-schema-eb973b5477c7a7a2.yaml b/releasenotes/notes/update-info-schema-eb973b5477c7a7a2.yaml new file mode 100644 index 00000000..39f613aa --- /dev/null +++ b/releasenotes/notes/update-info-schema-eb973b5477c7a7a2.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + Move info-schema to schema/info-schema.yaml to keep schemas + consistency. + - | + Download only needed files for lf-info-yaml-verify + rather than cloning the entire repo. diff --git a/schema/info-schema.yaml b/schema/info-schema.yaml new file mode 100644 index 00000000..55f99b58 --- /dev/null +++ b/schema/info-schema.yaml @@ -0,0 +1,80 @@ +# SPDX-License-Identifier: EPL-1.0 +############################################################################## +# Copyright (c) 2018 The Linux Foundation and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +############################################################################## +--- +$schema: "http://json-schema.org/schema#" +$id: "https://github.com/lfit/releng-global-jjb/blob/master/schema/info-schema.yaml" + +required: + - "project" + - "project_creation_date" + - "project_category" + - "lifecycle_state" + - "project_lead" + - "primary_contact" + - "issue_tracking" + - "mailing_list" + - "realtime_discussion" + - "repositories" + - "committers" + - "tsc" + +properties: + project: + type: "string" + version: + type: "string" + project_creation_date: + type: "string" + project_category: + type: "string" + lifecycle_state: + type: "string" + enum: + [ + "Incubation", + "Proposal", + "Mature", + "Core", + "Top Level", + "Archived", + "Null", + "Integration", + ] + project_lead: &user_object + type: "object" + properties: + name: + type: "string" + email: + type: "string" + format: "email" + id: + type: "string" + company: + type: "string" + timezone: + type: "string" + pattern: '([A-Z][a-z]*\s*)+\/([A-Za-z_-])+' + additionalProperties: false + primary_contact: *user_object + issue_tracking: + type: "object" + properties: + type: + type: "string" + url: + type: "string" + format: "uri" + key: + type: "string" + required: ["type", "url"] + committers: + type: "array" + items: *user_object diff --git a/shell/info-file-validate.sh b/shell/info-file-validate.sh index 13c27dfb..f0c47cbb 100755 --- a/shell/info-file-validate.sh +++ b/shell/info-file-validate.sh @@ -17,13 +17,12 @@ virtualenv --quiet "/tmp/v/info" source "/tmp/v/info/bin/activate" pip install PyYAML jsonschema rfc3987 yamllint -# Cloning global-jjb to get access to needed scripts -git clone https://github.com/lfit/releng-global-jjb.git +# Download info-schema.yaml and yaml-verfy-schema.py +wget -q https://raw.githubusercontent.com/lfit/releng-global-jjb/master/schema/info-schema.yaml \ +https://raw.githubusercontent.com/lfit/releng-global-jjb/master/yaml-verify-schema.py yamllint INFO.yaml -python releng-global-jjb/yaml-verify-schema.py \ - -s releng-global-jjb/info-schema \ +python yaml-verify-schema.py \ + -s info-schema.yaml \ -y INFO.yaml - -rm -rf releng-global-jjb