Skip to content

Commit e1563e1

Browse files
committed
Extend release validation to support v1 API files
The API Server adds additional properties to the [Meta API], an which here is called Release (because it contains release metadata). This caused validation to fail for metadata fetched from api.pgxn.org. Extend the validation of Release metadata to optionally include these properties. Define a new v1 schema, `api-extras.schema.json`, and add it to `release.schema.json`. Like the existing schemas, it applies strict validation for the new properties. Since the new schemas validate file paths, copy `path.schema.json` from the v2 schemas and apply it to the other paths in the v1 schema. Increment to v0.6.0 and prep for release. [Meta API]: https://github.com/pgxn/pgxn-api/wiki/meta-api#api-server-structure
1 parent ff47d62 commit e1563e1

14 files changed

+595
-56
lines changed

.github/workflows/build-and-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
release:
1515
name: ${{ matrix.platform.emoji }} ${{ matrix.platform.os_name }} 🦀 ${{ matrix.toolchain }}
1616
runs-on: ${{ matrix.platform.os }}
17+
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
1718
strategy:
1819
fail-fast: false
1920
matrix:

CHANGELOG.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ All notable changes to this project will be documented in this file. It uses the
77
[Semantic Versioning]: https://semver.org/spec/v2.0.0.html
88
"Semantic Versioning 2.0.0"
99

10-
## [v0.6.0]Unreleased
10+
## [v0.6.0]2025-03-25
1111

1212
### ⬆️ Dependency Updates
1313

@@ -17,13 +17,23 @@ All notable changes to this project will be documented in this file. It uses the
1717

1818
* Added basic logging for schema validation, digest validation, and JWS
1919
validation.
20+
* Extended the v1 Release schema to include the properties added by the [API
21+
Server Meta API]. However, these properties are not currently available
22+
via accessors, as the v2 schema does not (yet) define equivalents.
23+
* Improved validation of v1 schema paths to ensure they always use Unix
24+
conventions and don't point to files outside a distribution.
2025

21-
### 📔 Notes
26+
### 🏗️ Build Setup
2227

23-
* Upgraded [Cross] and and the Binary build workers.
28+
* Upgraded [Cross] and and the binary build workers.
29+
* Dropped the Solaris build pending [support for Solaris 11].
2430

2531
[v0.6.0]: https://github.com/pgxn/meta/compare/v0.5.2...v0.6.0
2632
[Cross]: https://github.com/cross-rs/cross/
33+
"“Zero setup” cross compilation and “cross testing” of Rust crates
34+
[API Server Meta API]: https://github.com/pgxn/pgxn-api/wiki/meta-api#api-server-structure
35+
[support for Solaris 11]: https://github.com/cross-rs/cross/issues/1599
36+
"cross-rs/cross#1599: Support Solaris 11"
2737

2838
## [v0.5.2] — 2025-01-07
2939

schema/v1/api-extras.schema.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://pgxn.org/meta/v1/api-extras.schema.json",
4+
"title": "API Extras",
5+
"type": "object",
6+
"description": "Additional properties added to distribution metadata by the [API Server Meta API](https://github.com/pgxn/pgxn-api/wiki/meta-api#api-server-structure).",
7+
"properties": {
8+
"docs": { "$ref": "docs.schema.json" },
9+
"special_files": { "$ref": "special_files.schema.json" },
10+
"releases": { "$ref": "releases.schema.json" }
11+
}
12+
}

schema/v1/docs.schema.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://pgxn.org/meta/v1/docs.schema.json",
4+
"title": "Documentation",
5+
"type": "object",
6+
"description": "This property describes the documentation included a distribution. Only included in the [API Server Meta API](https://github.com/pgxn/pgxn-api/wiki/meta-api#api-server-structure).",
7+
"propertyNames": { "type": "string" },
8+
"minProperties": 1,
9+
"additionalProperties": {
10+
"type": "object",
11+
"properties": {
12+
"title": { "type": "string" },
13+
"abstract": { "type": "string" }
14+
},
15+
"required": ["title"]
16+
},
17+
"examples": [
18+
{
19+
"README": {
20+
"title": "pgTAP 0.25.0"
21+
},
22+
"doc/pgtap": {
23+
"title": "pgTAP 0.25.0",
24+
"abstract": "pgTAP Documentation"
25+
}
26+
}
27+
]
28+
}

schema/v1/extension.schema.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
"type": "object",
77
"properties": {
88
"file": {
9-
"type": "string",
10-
"description": "The value must contain a relative file path from the root of the distribution to the file containing the extension. The path must be specified with unix conventions.",
11-
"minLength": 1
9+
"$ref": "path.schema.json",
10+
"description": "The value must contain a relative file path from the root of the distribution to the file containing the extension. The path must be specified with unix conventions."
1211
},
1312
"version": {
1413
"$ref": "version.schema.json",
@@ -20,8 +19,12 @@
2019
"minLength": 1
2120
},
2221
"docfile": {
22+
"$ref": "path.schema.json",
23+
"description": "The value must contain a relative file path from the root of the distribution to the file containing documentation for the extension. The path must be specified with unix conventions."
24+
},
25+
"docpath": {
2326
"type": "string",
24-
"description": "The value must contain a relative file path from the root of the distribution to the file containing documentation for the extension. The path must be specified with unix conventions.",
27+
"description": "The path to the documentation file for the extension, sans file name suffix. Added by the [API Server Meta API](https://github.com/pgxn/pgxn-api/wiki/meta-api#api-server-structure).",
2528
"minLength": 1
2629
}
2730
},

schema/v1/no_index.schema.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@
3131
"minItems": 1,
3232
"uniqueItems": true,
3333
"items": {
34-
"type": "string",
35-
"description": "Relative path in unix convention to a file to ignore.",
36-
"minLength": 1
34+
"$ref": "path.schema.json",
35+
"description": "Relative path in unix convention to a file to ignore."
3736
}
3837
},
3938
{
40-
"type": "string",
41-
"description": "Relative path in unix convention to a file to ignore.",
42-
"minLength": 1
39+
"$ref": "path.schema.json",
40+
"description": "Relative path in unix convention to a file to ignore."
4341
}
4442
]
4543
}

schema/v1/path.schema.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://pgxn.org/meta/v1/path.schema.json",
4+
"title": "Path",
5+
"description": "A *Path* is a string with a relative file path that identifies a file in the Distribution. The path **MUST** be specified with Unix conventions.",
6+
"type": "string",
7+
"minLength": 2,
8+
"format": "path",
9+
"$comment": "https://regex101.com/r/d49AVj",
10+
"examples": ["Makefile", "Changes", "doc/pair.md"]
11+
}

schema/v1/release.schema.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"unevaluatedProperties": false,
88
"allOf": [
99
{ "$ref": "base.schema.json" },
10+
{ "$ref": "api-extras.schema.json" },
1011
{
1112
"properties": {
1213
"user": {

schema/v1/releases.schema.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://pgxn.org/meta/v1/releases.schema.json",
4+
"title": "Releases",
5+
"type": "object",
6+
"description": "This object provides a complete history of all releases of the distribution, including those that were released after *this* release. Added by the [API Server Meta API](https://github.com/pgxn/pgxn-api/wiki/meta-api#api-server-structure).",
7+
"minProperties": 1,
8+
"properties": {
9+
"stable": { "$ref": "#/$defs/list" },
10+
"unstable": { "$ref": "#/$defs/list" },
11+
"testing": { "$ref": "#/$defs/list" }
12+
},
13+
"additionalProperties": false,
14+
"$defs": {
15+
"list": {
16+
"type": "array",
17+
"minItems": 1,
18+
"items": {
19+
"type": "object",
20+
"properties": {
21+
"date": {
22+
"type": "string",
23+
"format": "date-time",
24+
"description": "The timestamp for when the release was made.",
25+
"examples": ["2024-09-12T19:56:49Z"]
26+
},
27+
"version": {
28+
"$ref": "version.schema.json",
29+
"description": "The release version. Its value must be a [SemVer](https://semver.org)."
30+
}
31+
},
32+
"required": ["date", "version"],
33+
"additionalProperties": false
34+
}
35+
}
36+
}
37+
}

schema/v1/special_files.schema.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://pgxn.org/meta/v1/special_files.schema.json",
4+
"title": "Special Files",
5+
"type": "array",
6+
"items": { "$ref": "path.schema.json" },
7+
"description": "Lists the paths to special files in the distribution, such as `Changes`, `README`, `INSTALL`, `License`, and others.",
8+
"minItems": 1,
9+
"uniqueItems": true,
10+
"examples": [["Changes", "README.md", "META.json", "Makefile"]]
11+
}

0 commit comments

Comments
 (0)