Skip to content

Commit

Permalink
add schema validation for relgen
Browse files Browse the repository at this point in the history
also:

- show warnings / errors in GitHub when running from Actions

- allow running from npm
  • Loading branch information
josh-heyer committed Dec 12, 2024
1 parent a3df7b8 commit d9b8878
Show file tree
Hide file tree
Showing 20 changed files with 1,108 additions and 23 deletions.
620 changes: 620 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@
"install-docs:build": "docker compose -f docker/docker-compose.install-template.yaml run --rm install-docs-template-renderer",
"install-docs:deploy": "docker compose -f docker/docker-compose.install-template.yaml run --rm install-docs-template-renderer sh -c 'npm i && node deploy.mjs product_docs/docs advocacy_docs'",
"install-docs:rebuild-docker-image": "docker compose -f docker/docker-compose.install-template.yaml build --pull --no-cache",
"links:check": "docker compose -f docker/docker-compose.check-links.yaml run --rm docs-link-checker",
"links:rebuild-docker-image": "docker compose -f docker/docker-compose.check-links.yaml build --pull --no-cache",
"logs": "docker compose -f docker/docker-compose.quickstart.yaml logs -f",
"pdf:build": "docker compose -f docker/docker-compose.build-pdf.yaml run --rm --entrypoint scripts/pdf/generate_pdf.py docs-pdf-builder",
"pdf:build-all": "for i in product_docs/docs/**/*/ ; do echo \"$i\"; npm run pdf:build ${i%} || exit 1; done",
"pdf:build-all-ci": "for i in product_docs/docs/**/*/ ; do echo \"$i\"; python3 scripts/pdf/generate_pdf.py ${i%} || exit 1; done",
"pdf:rebuild-docker-image": "docker compose -f docker/docker-compose.build-pdf.yaml build --pull --no-cache",
"links:check": "docker compose -f docker/docker-compose.check-links.yaml run --rm docs-link-checker",
"links:rebuild-docker-image": "docker compose -f docker/docker-compose.check-links.yaml build --pull --no-cache",
"prepare": "./scripts/husky-install.sh",
"presetup": "./scripts/npm-preinstall.sh",
"releasenotes:generate": "relgen -p",
"releasenotes:generate-all": "for rnmetapath in `find . -wholename './product_docs/*/src/meta.yml' -o -wholename './advocacy_docs/*/src/meta.yml'`; do relgen -p ${rnmetapath%/src/meta.yml}; done",
"serve-build": "gatsby serve --prefix-paths",
"setup": "./scripts/npm-install.sh",
"shell": "docker exec -it edb-docs /bin/sh",
Expand Down Expand Up @@ -80,6 +82,7 @@
"react-helmet": "^6.1.0",
"react-instantsearch": "^7.8.1",
"rehype-parse": "^7.0.1",
"relgen": "file:tools/automation/generators/relgen",
"remark-admonitions": "github:josh-heyer/remark-admonitions",
"sass": "^1.77.6",
"truncate-utf8-bytes": "^1.0.2",
Expand Down
3 changes: 2 additions & 1 deletion product_docs/docs/pgd/5.6/rel_notes/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
title: EDB Postgres Distributed 5.6+ release notes
navTitle: Release notes
description: Release notes for EDB Postgres Distributed 5.6 and later
indexCards: none
navigation:
- pgd_5.6.1_rel_notes
- pgd_5.6.0_rel_notes
---


The EDB Postgres Distributed documentation describes the latest version of EDB Postgres Distributed 5, including minor releases and patches. The release notes provide information on what was new in each release. For new functionality introduced in a minor or patch release, the content also indicates the release that introduced the feature.


| Release Date | EDB Postgres Distributed | BDR extension | PGD CLI | PGD Proxy |
|---|---|---|---|---|
| 25 Nov 2024 | [5.6.1](./pgd_5.6.1_rel_notes) | 5.6.1 | 5.6.1 | 5.6.1 |
| 15 Oct 2024 | [5.6.0](./pgd_5.6.0_rel_notes) | 5.6.0 | 5.6.0 | 5.6.0 |

1 change: 1 addition & 0 deletions product_docs/docs/pgd/5.6/rel_notes/src/meta.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=/workspaces/docs/tools/automation/generators/relgen/meta-schema.json
product: EDB Postgres Distributed
shortname: pgd
title: EDB Postgres Distributed 5.6+ release notes
Expand Down
1 change: 1 addition & 0 deletions product_docs/docs/pgd/5.6/rel_notes/src/relnote_5.6.0.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=/workspaces/docs/tools/automation/generators/relgen/relnote-schema.json
product: EDB Postgres Distributed
version: 5.6.0
date: 15 October 2024
Expand Down
1 change: 1 addition & 0 deletions product_docs/docs/pgd/5.6/rel_notes/src/relnote_5.6.1.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=/workspaces/docs/tools/automation/generators/relgen/relnote-schema.json
product: EDB Postgres Distributed
version: 5.6.1
date: 25 November 2024
Expand Down
1 change: 1 addition & 0 deletions product_docs/docs/tpa/23/rel_notes/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Trusted Postgres Architect release notes
navTitle: Release notes
description: Release notes for Trusted Postgres Architect and later
indexCards: none
navigation:
- tpa_23.35.0_rel_notes
- tpa_23.34.1_rel_notes
Expand Down
1 change: 1 addition & 0 deletions product_docs/docs/tpa/23/rel_notes/src/meta.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=/workspaces/docs/tools/automation/generators/relgen/meta-schema.json
product: Trusted Postgres Architect
shortname: tpa
title: Trusted Postgres Architect release notes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=/workspaces/docs/tools/automation/generators/relgen/relnote-schema.json
product: Trusted Postgres Architect
version: 23.35.0
date: 25 November 2024
Expand Down
93 changes: 93 additions & 0 deletions tools/automation/generators/relgen/meta-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Release notes metadata",
"description": "Metadata used to structure release notes for a given product (or software collection)",
"type": "object",
"properties": {
"product": {
"description": "Full and formal name for the product",
"type": "string"
},
"shortname": {
"description": "Short product name for the product - used in filename generation",
"type": "string"
},
"title": {
"description": "Title for the index page.",
"type": "string"
},
"description": {
"description": "Description for the index page.",
"type": "string"
},
"columns": {
"description": "Details on the index pages columns, numbered 0 to at least 1.",
"type": "array",
"items": {
"type": "object",
"description": "column definition",
"patternProperties": {
"^\\d+$": {
"description": "column index",
"type": "null"
}
},
"properties": {
"label": {
"description": "Column heading",
"type": "string"
},
"key": {
"description": "key to use when generatings the column data",
"anyOf": [
{
"type": "string",
"enum": ["shortdate", "version-link"]
},
{
"type": "string"
}
]
}
},
"minProperties": 3
}
},
"components": {
"type": "array",
"description": "List of valid components for product",
"items": { "type": "string" }
},
"intro": {
"description": "Multi-line string that provides a brief introduction to the release notes. Supports Markdown.",
"type": "string"
},
"precursor": {
"description": "list of preceding releases which already have release notes. Required if there are preceding releases to be included. Will be appended to the table and navigation. If meta fields are in use, they are required in the precursor list under meta, too.",
"type": "array",
"items": {
"type": "object",
"properties": {
"version": {
"description": "version string used for this 'precursor' version.",
"type": "string"
},
"date": {
"description": "date this version was released",
"type": "string"
}
},
"additionalProperties": {
"description": "whatever values are needed for each of the meta columns defined above",
"type": "string"
}
}
}
},
"required": [
"product",
"shortname",
"title",
"columns"
]
}
110 changes: 110 additions & 0 deletions tools/automation/generators/relgen/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions tools/automation/generators/relgen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"description": "Release Notes Generator Generic",
"main": "relgen.js",
"type": "module",
"bin": {
"relgen": "./relgen.js"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand All @@ -14,8 +17,11 @@
"author": "Dj",
"license": "ISC",
"dependencies": {
"@actions/core": "^1.10.1",
"ajv": "^8.17.1",
"fast-glob": "^3.3.2",
"js-yaml": "^4.1.0",
"js-yaml-source-map": "^0.2.2",
"micromark": "^4.0.0",
"yargs": "^17.7.2"
}
Expand Down
Loading

0 comments on commit d9b8878

Please sign in to comment.