Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add v1 release schema #24

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ jobs:
files: target/cover/coveralls
- name: Clear Badge Cache
uses: kevincobain2000/action-camo-purge@v1
if: github.ref_name == 'main'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Crate Usage
-----------

<details>
<summary>Click to show `Cargo.toml`.</summary>
<summary>Click to show <code>Cargo.toml</code>.</summary>

```toml
[dependencies]
Expand Down
126 changes: 126 additions & 0 deletions schema/v1/base.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://pgxn.org/meta/v1/base.schema.json",
"title": "Base Schema",
"description": "This is the base distribution schema, mixed into other schemas",
"type": "object",
"properties": {
"name": {
"$ref": "term.schema.json",
"description": "The name of the distribution. This is usually the same as the name of the “main extension” in the distribution, but may be completely unrelated to the extensions within the distribution. This value will be used in the distribution file name on PGXN.",
"examples": ["pgTAP", "vector"]
},
"version": {
"$ref": "version.schema.json",
"description": "The version of the distribution to which the metadata structure refers. Its value must be a [SemVer](https://semver.org)."
},
"abstract": {
"description": "A short description of the purpose of the distribution.",
"type": "string",
"minLength": 1,
"examples": [
"Unit testing for PostgreSQL",
"Open-source vector similarity search for Postgres"
]
},
"maintainer": { "$ref": "maintainer.schema.json" },
"license": { "$ref": "license.schema.json" },
"provides": { "$ref": "provides.schema.json" },
"meta-spec": { "$ref": "meta-spec.schema.json" },
"description": {
"description": "A longer, more complete description of the purpose or intended use of the distribution than the one provided by the `abstract` key.",
"type": "string",
"minLength": 1,
"examples": [
"pgTAP is a suite of database functions that make it easy to write TAP-emitting unit tests in psql scripts or xUnit-style test functions."
]
},
"generated_by": {
"description": "This field indicates the tool that was used to create this metadata. There are no defined semantics for this field, but it is traditional to use a string in the form “Software package version 1.23” or the maintainer’s ame, if the file was generated by hand.",
"type": "string",
"minLength": 1,
"examples": ["Module::Build::PGXN version 0.42"]
},
"tags": { "$ref": "tags.schema.json" },
"no_index": { "$ref": "no_index.schema.json" },
"prereqs": { "$ref": "prereqs.schema.json" },
"release_status": {
"description": "This field specifies the release status of this distribution. It **must** have one of the following values:\n\n* **stable**: Indicates an ordinary, “final” release that should be indexed by PGXN.\n\n* **testing**: Indicates a “beta” release that is substantially complete, but has an elevated risk of bugs and requires additional testing. The distribution should not be installed over a stable release without an explicit request or other confirmation from a user. This release status may also be used for “release candidate” versions of a distribution.\n\n* **unstable**: Indicates an “alpha” release that is under active development, but has been released for early feedback or testing and may be missing features or may have serious bugs. The distribution should not be installed over a stable release without an explicit request or other confirmation from a user.",
"enum": ["stable", "testing", "unstable"]
},
"resources": { "$ref": "resources.schema.json" }
},
"patternProperties": { "^[xX]_.": { "description": "Custom key" } },
"required": [
"name",
"version",
"abstract",
"maintainer",
"license",
"provides",
"meta-spec"
],
"examples": [
{
"name": "pgTAP",
"abstract": "Unit testing for PostgreSQL",
"description": "pgTAP is a suite of database functions that make it easy to write TAP-emitting unit tests in psql scripts or xUnit-style test functions.",
"version": "0.26.0",
"maintainer": [
"David E. Wheeler <theory@pgxn.org>",
"pgTAP List <pgtap-users@googlegroups.com>"
],
"license": {
"PostgreSQL": "https://www.postgresql.org/about/licence"
},
"prereqs": {
"runtime": {
"requires": {
"plpgsql": 0,
"PostgreSQL": "8.0.0"
},
"recommends": {
"PostgreSQL": "8.4.0"
}
}
},
"provides": {
"pgtap": {
"file": "sql/pgtap.sql",
"docfile": "doc/pgtap.mmd",
"version": "0.2.4",
"abstract": "Unit testing assertions for PostgreSQL"
},
"schematap": {
"file": "sql/schematap.sql",
"docfile": "doc/schematap.mmd",
"version": "0.2.4",
"abstract": "Schema testing assertions for PostgreSQL"
}
},
"resources": {
"homepage": "https://pgtap.org/",
"bugtracker": {
"web": "https://github.com/theory/pgtap/issues"
},
"repository": {
"url": "https://github.com/theory/pgtap.git",
"web": "https://github.com/theory/pgtap",
"type": "git"
}
},
"generated_by": "David E. Wheeler",
"meta-spec": {
"version": "1.0.0",
"url": "https://pgxn.org/meta/spec.txt"
},
"tags": [
"testing",
"unit testing",
"tap",
"tddd",
"test driven database development"
]
}
]
}
122 changes: 2 additions & 120 deletions schema/v1/distribution.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,124 +4,6 @@
"title": "Distribution",
"description": "The PGXN distribution metadata specification",
"type": "object",
"properties": {
"name": {
"$ref": "term.schema.json",
"description": "The name of the distribution. This is usually the same as the name of the “main extension” in the distribution, but may be completely unrelated to the extensions within the distribution. This value will be used in the distribution file name on PGXN.",
"examples": ["pgTAP", "vector"]
},
"version": {
"$ref": "version.schema.json",
"description": "The version of the distribution to which the metadata structure refers. Its value must be a [SemVer](https://semver.org)."
},
"abstract": {
"description": "A short description of the purpose of the distribution.",
"type": "string",
"minLength": 1,
"examples": [
"Unit testing for PostgreSQL",
"Open-source vector similarity search for Postgres"
]
},
"maintainer": { "$ref": "maintainer.schema.json" },
"license": { "$ref": "license.schema.json" },
"provides": { "$ref": "provides.schema.json" },
"meta-spec": { "$ref": "meta-spec.schema.json" },
"description": {
"description": "A longer, more complete description of the purpose or intended use of the distribution than the one provided by the `abstract` key.",
"type": "string",
"minLength": 1,
"examples": [
"pgTAP is a suite of database functions that make it easy to write TAP-emitting unit tests in psql scripts or xUnit-style test functions."
]
},
"generated_by": {
"description": "This field indicates the tool that was used to create this metadata. There are no defined semantics for this field, but it is traditional to use a string in the form “Software package version 1.23” or the maintainer’s ame, if the file was generated by hand.",
"type": "string",
"minLength": 1,
"examples": ["Module::Build::PGXN version 0.42"]
},
"tags": { "$ref": "tags.schema.json" },
"no_index": { "$ref": "no_index.schema.json" },
"prereqs": { "$ref": "prereqs.schema.json" },
"release_status": {
"description": "This field specifies the release status of this distribution. It **must** have one of the following values:\n\n* **stable**: Indicates an ordinary, “final” release that should be indexed by PGXN.\n\n* **testing**: Indicates a “beta” release that is substantially complete, but has an elevated risk of bugs and requires additional testing. The distribution should not be installed over a stable release without an explicit request or other confirmation from a user. This release status may also be used for “release candidate” versions of a distribution.\n\n* **unstable**: Indicates an “alpha” release that is under active development, but has been released for early feedback or testing and may be missing features or may have serious bugs. The distribution should not be installed over a stable release without an explicit request or other confirmation from a user.",
"enum": ["stable", "testing", "unstable"]
},
"resources": { "$ref": "resources.schema.json" }
},
"patternProperties": { "^[xX]_.": { "description": "Custom key" } },
"additionalProperties": false,
"required": [
"name",
"version",
"abstract",
"maintainer",
"license",
"provides",
"meta-spec"
],
"examples": [
{
"name": "pgTAP",
"abstract": "Unit testing for PostgreSQL",
"description": "pgTAP is a suite of database functions that make it easy to write TAP-emitting unit tests in psql scripts or xUnit-style test functions.",
"version": "0.26.0",
"maintainer": [
"David E. Wheeler <theory@pgxn.org>",
"pgTAP List <pgtap-users@googlegroups.com>"
],
"license": {
"PostgreSQL": "https://www.postgresql.org/about/licence"
},
"prereqs": {
"runtime": {
"requires": {
"plpgsql": 0,
"PostgreSQL": "8.0.0"
},
"recommends": {
"PostgreSQL": "8.4.0"
}
}
},
"provides": {
"pgtap": {
"file": "sql/pgtap.sql",
"docfile": "doc/pgtap.mmd",
"version": "0.2.4",
"abstract": "Unit testing assertions for PostgreSQL"
},
"schematap": {
"file": "sql/schematap.sql",
"docfile": "doc/schematap.mmd",
"version": "0.2.4",
"abstract": "Schema testing assertions for PostgreSQL"
}
},
"resources": {
"homepage": "https://pgtap.org/",
"bugtracker": {
"web": "https://github.com/theory/pgtap/issues"
},
"repository": {
"url": "https://github.com/theory/pgtap.git",
"web": "https://github.com/theory/pgtap",
"type": "git"
}
},
"generated_by": "David E. Wheeler",
"meta-spec": {
"version": "1.0.0",
"url": "https://pgxn.org/meta/spec.txt"
},
"tags": [
"testing",
"unit testing",
"tap",
"tddd",
"test driven database development"
]
}
]
"$ref": "base.schema.json",
"unevaluatedProperties": false
}
33 changes: 33 additions & 0 deletions schema/v1/release.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://pgxn.org/meta/v1/release.schema.json",
"title": "Release",
"description": "Distribution release metadata",
"type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "base.schema.json" },
{
"properties": {
"user": {
"$ref": "term.schema.json",
"description": "The PGXN username for the user who released the distribution to PGXN.",
"examples": ["theory", "michaelpq"]
},
"date": {
"type": "string",
"format": "date-time",
"description": "The timestamp for when the release was made.",
"examples": ["2024-09-12T19:56:49Z"]
},
"sha1": {
"description": "The SHA-1 hash digest for the release, in hex.",
"type": "string",
"pattern": "^[0-9a-fA-F]{40}$",
"examples": ["58065c7c27ea9906abaee8759f2047f27bb066cc"]
}
},
"required": ["user", "date", "sha1"]
}
]
}
Loading