Skip to content

Commit 9b43399

Browse files
## Changes - Ticket: [sc-73085-add-support-for-discussionforumurl-in-demo](https://app.shortcut.com/xanaduai/story/73085/add-support-for-discussionforumurl-in-demo-metadata-files) - Added support for `discussionForumUrl` field in `metadata.json` files for demos - This can be used to link a specific discussion forum thread to a demo - Bumped schema version to `0.1.2` ## Testing - `"discussionForumUrl": "https://discuss.pennylane.ai/c/pennylane-help/5"` - Passes ✅ - [Action Run](https://github.com/PennyLaneAI/qml/actions/runs/10943682894/job/30383786592) - `"discussionForumUrl": "https://pennylane.ai/c/pennylane-help/5"` - Fails ❌ - [Action Run](https://github.com/PennyLaneAI/qml/actions/runs/10943718222/job/30383899155) --------- Co-authored-by: Paul Finlay <50180049+doctorperceptron@users.noreply.github.com>
1 parent c74fab7 commit 9b43399

File tree

2 files changed

+136
-1
lines changed

2 files changed

+136
-1
lines changed

.github/workflows/validate-demo-metadata.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
METADATA_FILE_LIST: ${{ needs.generate-metadata-file-list.outputs.metadata_files }}
102102
run: |
103103
cd metadata_schemas
104-
${{ steps.poetry.outputs.bin }} run check-jsonschema -v --traceback-mode full --schemafile demo.metadata.schema.0.1.1.json $METADATA_FILE_LIST
104+
${{ steps.poetry.outputs.bin }} run check-jsonschema -v --traceback-mode full --schemafile demo.metadata.schema.0.1.2.json $METADATA_FILE_LIST
105105
106106
validate-metadata-preview-images:
107107
runs-on: ubuntu-latest
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "demo.metadata.schema.0.1.2.json",
4+
"title": "Demo Metadata",
5+
"description": "A QML demo's metadata",
6+
"type": "object",
7+
"properties": {
8+
"title": {
9+
"description": "The title of the demo.",
10+
"type": "string",
11+
"minLength": 2
12+
},
13+
"authors": {
14+
"description": "The author(s) of the demo. This array must contain at least one item.",
15+
"type": "array",
16+
"items": {
17+
"oneOf": [
18+
{
19+
"$ref": "file:./objects/author.schema.0.1.0.json"
20+
},
21+
{
22+
"$ref": "file:./objects/author.schema.0.2.0.json"
23+
}
24+
]
25+
},
26+
"minItems": 1
27+
},
28+
"dateOfPublication": {
29+
"description": "The date on which the demo was first published, in the form YYYY-MM-DDTHH:MM:SS+00:00.",
30+
"type": "string",
31+
"format": "date-time",
32+
"minLength": 25,
33+
"maxLength": 25
34+
},
35+
"dateOfLastModification": {
36+
"description": "The date on which the demo was last modified, in the form YYYY-MM-DDTHH:MM:SS+00:00.",
37+
"type": "string",
38+
"format": "date-time",
39+
"minLength": 25,
40+
"maxLength": 25
41+
},
42+
"categories": {
43+
"description": "An array of the categories that this demo is in.",
44+
"type": "array",
45+
"items": {
46+
"enum": [
47+
"Algorithms",
48+
"Getting Started",
49+
"Optimization",
50+
"Quantum Machine Learning",
51+
"Quantum Chemistry",
52+
"Devices and Performance",
53+
"Quantum Computing",
54+
"Quantum Hardware",
55+
"How-to"
56+
]
57+
},
58+
"minItems": 0
59+
},
60+
"tags": {
61+
"description": "An array of the tags that the demo has. An empty array is allowed.",
62+
"type": "array",
63+
"items": {
64+
"type": "string"
65+
}
66+
},
67+
"previewImages": {
68+
"description": "An array of the different images that can be used as previews for this demo - e.g., thumbnails, social media cards (perhaps of different aspect ratios).",
69+
"type": "array",
70+
"items": {
71+
"$ref": "file:./objects/preview.image.schema.0.1.0.json"
72+
},
73+
"minItems": 1
74+
},
75+
"seoDescription": {
76+
"description": "A description of the demo suitable for SEO purposes. Ideally this should be less than 150 characters, but this is not a strict limit. It should be a full, grammatically-correct sentence ending in a full stop.",
77+
"type": "string",
78+
"minLength": 2
79+
},
80+
"doi": {
81+
"description": "The DOI for the demo.",
82+
"type": "string",
83+
"pattern": "^$|^10[.]"
84+
},
85+
"canonicalURL": {
86+
"description": "The canonical URL for the demo. Sometimes there might be more than one URL that points to a given page on a website. The canonical URL defines which of these should be thought of as the primary or main one.",
87+
"type": "string",
88+
"pattern": "(^https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6})?\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)"
89+
},
90+
"references": {
91+
"description": "An array of the references used for the demo.",
92+
"type": "array",
93+
"items": {
94+
"$ref": "file:./objects/reference.schema.0.1.0.json"
95+
}
96+
},
97+
"basedOnPapers": {
98+
"description": "An array of the DOIs for the papers the demo is based on. An empty array is allowed.",
99+
"type": "array",
100+
"items": {
101+
"type": "string"
102+
}
103+
},
104+
"referencedByPapers": {
105+
"description": "An array of the DOIs of any papers that reference the demo. An empty array is allowed.",
106+
"type": "array",
107+
"items": {
108+
"type": "string"
109+
}
110+
},
111+
"relatedContent": {
112+
"description": "An array of objects describing the content related to the demo. An empty array is allowed.",
113+
"type": "array",
114+
"items": {
115+
"$ref": "file:./objects/related.content.schema.0.1.0.json"
116+
}
117+
},
118+
"hardware": {
119+
"description": "An array of objects representing third-party vendors who can run the demo on their hardware. An empty array is allowed.",
120+
"type": "array",
121+
"items": {
122+
"$ref": "file:./objects/hardware.schema.0.1.0.json"
123+
}
124+
},
125+
"discussionForumUrl": {
126+
"description": "Link to dedicated discussion forum thread on https://discuss.pennylane.ai/ for this demo",
127+
"type": "string",
128+
"format": "uri",
129+
"pattern": "(^https?:\/\/(www.)?discuss.pennylane.ai(?:\/.*)?$)"
130+
}
131+
},
132+
"required": [
133+
"title", "authors", "dateOfPublication", "dateOfLastModification", "categories", "tags", "previewImages", "seoDescription", "doi", "canonicalURL", "references", "basedOnPapers", "referencedByPapers", "relatedContent"
134+
]
135+
}

0 commit comments

Comments
 (0)