Skip to content

Commit

Permalink
Merge branch 'master' into 2.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jmfernandez committed Aug 10, 2023
2 parents 143da24 + b000936 commit 2af4054
Show file tree
Hide file tree
Showing 9 changed files with 2,074 additions and 256 deletions.
41 changes: 27 additions & 14 deletions .github/workflows/validate-and-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,41 @@ jobs:
schema-version: [ "0.4.x", "1.0.x", "2.0.x" ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 100
- uses: ts-graphviz/setup-graphviz@v1
- uses: actions/setup-python@v4
with:
python-version: "3.8"
cache: 'pip'
architecture: x64
cache-dependency-path: 'dev-requirements.txt'
- run: |
- name: Install chart generator dependencies (development)
run: |
pip install --upgrade pip wheel
pip install -r dev-requirements.txt
- name: Changes at ${{ matrix.schema-version }} schemas
id: changed
uses: tj-actions/changed-files@v32
with:
files: |
json-schemas/${{ matrix.schema-version }}/**
run: |
dotfile="json-schemas/openebench-bdm-${{ matrix.schema-version }}.dot"
if [ -f "$dotfile" ] ; then
at="$(git --no-pager log -p -1 "--format=tformat:%at" --no-patch -- "$dotfile")"
dat="$at"
for schema in json-schemas/"${{ matrix.schema-version }}"/*.json ; do
dat="$(git --no-pager log -p -1 "--format=tformat:%at" --no-patch -- "$schema")"
if [ "$at" -lt "$dat" ] ; then
break
fi
done
if [ "$at" -lt "$dat" ] ; then
echo "any_changed=true" >> "$GITHUB_OUTPUT"
else
echo "any_changed=false" >> "$GITHUB_OUTPUT"
fi
else
echo "any_changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Generated ${{ matrix.schema-version }} schema
id: generate-if-changed
if: steps.changed.outputs.any_changed == 'true'
Expand Down Expand Up @@ -74,22 +93,16 @@ jobs:
skip=false
fi
echo "skip=$skip" >> "$GITHUB_OUTPUT"
# - uses: EndBug/add-and-commit@v9
# if: steps.move.outputs.skip == 'false'
# with:
# add: json-schemas/*
# message: Automatically commit updated charts
# default_author: github_actions

- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v5
if: steps.move.outputs.skip == 'false'
with:
title: Updated documentation (triggered by ${{ github.sha }})
title: Updated schemas documentation (triggered by ${{ github.sha }})
branch: create-pull-request/patch-schema-docs
delete-branch: true
signoff: true
commit-message: "[create-pull-request] Automatically commit updated contents (generated documentation)"
commit-message: "[create-pull-request] Automatically commit updated contents (generated schemas documentation)"
- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
pass_filenames: false
args: [ "json-schemas/0.4.x" ]
- repo: https://github.com/jmfernandez/pre-commit_mirrors-actionlint.git
rev: v1.6.25
rev: v1.6.25-r1
hooks:
- id: actionlint
args:
Expand Down
4 changes: 2 additions & 2 deletions json-schemas/1.0.x/_shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
"title": "The original id of the entry",
"description": "The field is filled in on server side, and it contains the original id in '_id' used on data submission, used by the community",
"readOnly": true,
"pattern": "^(?!(?i)OEB).+$",
"pattern": "^(?![Oo][Ee][Bb]).+$",
"type": "string",
"minLength": 1
},
"OriginalIdOnSub": {
"pattern": "^(?!(?i)OEB).+$",
"pattern": "^(?![Oo][Ee][Bb]).+$",
"description": "Identifiers used on submission must not begin with OEB. Client tools must use always this pattern to validate",
"writeOnly": true
}
Expand Down
2 changes: 1 addition & 1 deletion json-schemas/1.0.x/community.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"status": {
"title": "_id(s) of the current community status(es)",
"type": "string",
"enum": [ "abandoned","active","unknown" ]
"enum": [ "abandoned","active","archived","incubating","unknown" ]
},
"description": {
"title": "Long community name or description",
Expand Down
20 changes: 17 additions & 3 deletions json-schemas/1.0.x/dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@
"type": "string",
"format": "uri"
},
"schema_uri": {
"title": "The optional URI to the JSON Schema which validates the remote data, in case it is either JSON or YAML",
"type": "string",
"format": "uri"
},
"attrs": {
"title": "Attributes describing the datalink: whether it is inline (i.e. a data URI); a CURIE; whether it is compressed, or an archive (tar, zip, rar), a metalink (RFC 5854, RFC 6249, https://en.wikipedia.org/wiki/Metalink) or a standard sums (MD5, SHA1) file",
"type": "array",
Expand All @@ -170,9 +175,18 @@
"format": "date-time"
},
"status": {
"title": "Last validation status (unreachable content, missing content(404), interrupted while validating, corrupted (checksums, not all the contents available, etc...), ok)",
"type": "string",
"enum": [ "unreachable", "missing", "interrupted", "corrupted", "ok" ]
"title": "Last validation status (unreachable content, missing content(404), interrupted while validating, corrupted (checksums, not all the contents available, etc...), ok) or the HTTP code (numerical)",
"oneOf": [
{
"type": "string",
"enum": [ "unreachable", "missing", "interrupted", "corrupted", "ok" ]
},
{
"type": "integer",
"minimum": 100,
"exclusiveMaximum": 600
}
]
}
},
"additionalProperties": false,
Expand Down
Loading

0 comments on commit 2af4054

Please sign in to comment.