Skip to content

Commit 79a8df2

Browse files
authored
feat: add validator for people/publication files (#2062)
* feat: add validator for people files Signed-off-by: Henry Schreiner <[email protected]> * feat: add validator for pub files (and fixes) Signed-off-by: Henry Schreiner <[email protected]> * chore: skip two failures for now Signed-off-by: Henry Schreiner <[email protected]> --------- Signed-off-by: Henry Schreiner <[email protected]>
1 parent 2569caf commit 79a8df2

File tree

7 files changed

+164
-4
lines changed

7 files changed

+164
-4
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy
33
on:
44
workflow_dispatch:
55
push:
6-
branches: master
6+
branches: [master]
77
schedule:
88
- cron: "0 0 * * *"
99

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@ repos:
1010
- id: check-symlinks
1111
- id: check-yaml
1212

13+
- repo: https://github.com/python-jsonschema/check-jsonschema
14+
rev: 0.27.0
15+
hooks:
16+
- id: check-github-workflows
17+
- id: check-dependabot
18+
- id: check-jsonschema
19+
name: Check people files
20+
args: [--schemafile, _scripts/people.schema.json]
21+
files: '^_data/people/.*\.yml$'
22+
exclude: "_data/people/efajardo.yml|_data/people/m-carothers.yml"
23+
- id: check-jsonschema
24+
name: Check publication files
25+
args: [--schemafile, _scripts/publication.schema.json]
26+
files: '^_data/publications/.*\.yml$'
27+
1328
- repo: https://github.com/pre-commit/mirrors-prettier
1429
rev: "v3.0.3"
1530
hooks:

_data/publications/fpga-aas.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
inspire-id: 1823735
22
related-work: false
33
date: 2020-10-16
4-
focus area: ia
4+
focus-area: ia
55
project:
66
- caloreco-mlaas

_data/publications/gpu-aas.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
inspire-id: 1816034
22
related-work: false
33
date: 2020-09-09
4-
focus area: ia
4+
focus-area: ia
55
project:
66
- caloreco-mlaas
77
comment: this publication failed to acknowledge IRIS-HEP support
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
inspire-id: 1851132
22
related-work: false
33
date: 2021-03-21
4-
focus area: ia
4+
focus-area: ia
55
project:
66
- accel-gnn-tracking

_scripts/people.schema.json

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"@id": "https://github.com/iris-hep/iris-hep.github.io/blob/master/_scripts/people.schema.json",
3+
"@schema": "http://json-schema.org/draft-07/schema#",
4+
"type": "object",
5+
"additionalProperties": false,
6+
"required": ["name", "shortname"],
7+
"properties": {
8+
"active": { "type": "boolean" },
9+
"e-mail": { "type": "string", "format": "email" },
10+
"focus-area": {
11+
"type": "array",
12+
"items": { "$ref": "#/definitions/focus_area" }
13+
},
14+
"inspire-id": { "type": "string" },
15+
"institution": { "type": "string" },
16+
"name": { "type": "string" },
17+
"photo": { "type": "string" },
18+
"shortname": { "type": "string" },
19+
"title": { "$ref": "#/definitions/empty_string" },
20+
"website": { "$ref": "#/definitions/empty_string" },
21+
"past_institution": {
22+
"type": "object",
23+
"additionalProperties": false,
24+
"required": ["institution", "end_date"],
25+
"properties": {
26+
"institution": { "type": "string" },
27+
"end_date": { "type": "string", "format": "date" }
28+
}
29+
},
30+
"about": { "type": "string" },
31+
"hidden": { "type": "boolean" },
32+
"role": { "type": "string" },
33+
"presentations": {
34+
"oneOf": [
35+
{ "type": "null" },
36+
{
37+
"type": "array",
38+
"items": { "$ref": "#/definitions/presentation" }
39+
}
40+
]
41+
}
42+
},
43+
"definitions": {
44+
"focus_area": {
45+
"enum": ["as", "ia", "ssc", "doma", "ssl", "osglhc", "core"]
46+
},
47+
"focus_areas": {
48+
"oneOf": [
49+
{ "type": "null" },
50+
{ "$ref": "#/definitions/focus_area" },
51+
{ "type": "array", "items": { "$ref": "#/definitions/focus_area" } }
52+
]
53+
},
54+
"presentation": {
55+
"type": "object",
56+
"additionalProperties": false,
57+
"required": ["title", "date", "url"],
58+
"properties": {
59+
"title": { "type": "string" },
60+
"date": { "type": "string", "format": "date" },
61+
"url": { "$ref": "#/definitions/empty_string" },
62+
"meeting": { "$ref": "#/definitions/empty_string" },
63+
"meetingurl": { "$ref": "#/definitions/empty_string" },
64+
"focus-area": { "$ref": "#/definitions/focus_areas" },
65+
"project": { "$ref": "#/definitions/string_or_array" },
66+
"location": { "$ref": "#/definitions/empty_string" },
67+
"comment": { "$ref": "#/definitions/empty_string" },
68+
"labels": { "$ref": "#/definitions/string_or_array" },
69+
"video": { "$ref": "#/definitions/string_or_array" },
70+
"recordingurl": { "$ref": "#/definitions/empty_string" }
71+
}
72+
},
73+
"string_or_array": {
74+
"oneOf": [
75+
{ "type": "null" },
76+
{ "type": "string" },
77+
{ "type": "array", "elements": { "type": "string" } }
78+
]
79+
},
80+
"empty_string": {
81+
"oneOf": [{ "type": "string" }, { "type": "null" }]
82+
}
83+
}
84+
}

_scripts/publication.schema.json

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"@id": "https://github.com/iris-hep/iris-hep.github.io/blob/master/_scripts/publication.schema.json",
3+
"@schema": "http://json-schema.org/draft-07/schema#",
4+
"type": "object",
5+
"additionalProperties": false,
6+
"oneOf": [
7+
{
8+
"required": ["inspire-id"]
9+
},
10+
{
11+
"required": ["title", "date", "citation"]
12+
}
13+
],
14+
"properties": {
15+
"inspire-id": { "type": "integer" },
16+
"project": {
17+
"$ref": "#/definitions/string_or_array"
18+
},
19+
"focus-area": {
20+
"$ref": "#/definitions/focus_areas"
21+
},
22+
"title": { "type": "string" },
23+
"date": { "type": "string", "format": "date" },
24+
"citation": { "type": "string" },
25+
"submitted-to": { "type": "string" },
26+
"link": { "type": "string" },
27+
"nsf-par-id": { "type": "integer" },
28+
"related-work": { "type": "boolean" },
29+
"comment": { "type": "string" },
30+
"needs-nsf-par": { "type": "boolean" }
31+
},
32+
"definitions": {
33+
"focus_area": {
34+
"enum": [
35+
"as",
36+
"ia",
37+
"ssc",
38+
"doma",
39+
"ssl",
40+
"osglhc",
41+
"core",
42+
"blueprint",
43+
"outreach"
44+
]
45+
},
46+
"focus_areas": {
47+
"oneOf": [
48+
{ "type": "null" },
49+
{ "$ref": "#/definitions/focus_area" },
50+
{ "type": "array", "items": { "$ref": "#/definitions/focus_area" } }
51+
]
52+
},
53+
"string_or_array": {
54+
"oneOf": [
55+
{ "type": "null" },
56+
{ "type": "string" },
57+
{ "type": "array", "elements": { "type": "string" } }
58+
]
59+
}
60+
}
61+
}

0 commit comments

Comments
 (0)