Render stored reports directly from native YAML

This commit is contained in:
Dandaedre 2026-09-16 17:20:22 +02:00
parent a769b936d7
commit 5661ea1b64
Signed by: Dandaedre
GPG Key ID: 440C6592E8A26D99
7 changed files with 18 additions and 26 deletions

3
.gitignore vendored
View File

@ -224,3 +224,6 @@ core.*
#
# Ignore generated instances by DIRECTORY instead.
# =============================================================================
# Local architecture audits are working notes, not repository artifacts.
/audit/

View File

@ -12,6 +12,8 @@ Write a Reportist YAML or JSON file, then run:
```
See [`reporter/examples`](reporter/examples) for complete inputs.
To select a built-in palette in YAML, set `branding.theme` to `default` or
`teal`; an explicit theme object is also supported.
## Generate one diagnostic report
@ -43,14 +45,8 @@ commit them with the reports submodule update, and run:
./beffroi.sh all build/publication
```
Converted Reportist JSON is temporary and removed after a successful build.
Use `--keep-intermediates` to retain it for troubleshooting:
```bash
./beffroi.sh all build/publication --keep-intermediates
```
Use `--include-json` to place the structured report JSON beside report PDFs and
Stored report YAML is validated and rendered directly. Use `--include-json` to
export structured report JSON beside report PDFs and
the original diagnostic JSON beside diagnostic PDFs. Packaging includes these
JSON files, which is useful for downstream automation:
@ -68,7 +64,7 @@ destination.
./beffroi.sh report INPUT OUTPUT.pdf
./beffroi.sh diagnostic-pdf CAPTURE OUTPUT.pdf
./beffroi.sh diagnostic CAPTURE EVIDENCE_ROOT OUTPUT_DIR REFERENCE_TIME TITLE AUTHOR DATE
./beffroi.sh all NEW_OUTPUT_DIR [--keep-intermediates] [--include-json]
./beffroi.sh all NEW_OUTPUT_DIR [--include-json]
./beffroi.sh package BUILD_DIR ARTIFACT_DIR
./beffroi.sh test
./beffroi.sh bootstrap

View File

@ -8,7 +8,7 @@ Usage:
./beffroi.sh report INPUT OUTPUT.pdf
./beffroi.sh diagnostic-pdf CAPTURE OUTPUT.pdf
./beffroi.sh diagnostic CAPTURE EVIDENCE_ROOT OUTPUT_DIR REFERENCE_TIME TITLE AUTHOR DATE
./beffroi.sh all NEW_OUTPUT_DIR [--keep-intermediates] [--include-json]
./beffroi.sh all NEW_OUTPUT_DIR [--include-json]
./beffroi.sh package BUILD_DIR ARTIFACT_DIR
./beffroi.sh test
./beffroi.sh bootstrap

@ -1 +1 @@
Subproject commit d4b0f9f175a08ccaa490cda6d33e63f18a330e62
Subproject commit e44820591e0fe3f7acb0cf27d09d9aecbb5970c4

@ -1 +1 @@
Subproject commit a7cfd8b3f9e9ae2476446cd3e5d5e858a42c2958
Subproject commit c1eee6b7166a61e17d16216c1685a4e6c5ddf621

View File

@ -2,7 +2,7 @@
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")/.."
usage() {
echo "Usage: $0 NEW_OUTPUT_ROOT [--keep-intermediates] [--include-json]" >&2
echo "Usage: $0 NEW_OUTPUT_ROOT [--include-json]" >&2
exit 2
}
@ -10,11 +10,9 @@ output_root=${1:-}
[[ -n "$output_root" ]] || usage
shift
keep_intermediates=false
include_json=false
while (($#)); do
case $1 in
--keep-intermediates) keep_intermediates=true ;;
--include-json) include_json=true ;;
*) usage ;;
esac
@ -24,23 +22,15 @@ done
[[ ! -e "$output_root" ]]||{ echo "$output_root: output root already exists" >&2; exit 1; }
mkdir -p "$output_root/reports" "$output_root/diagnostics"
if [[ "$keep_intermediates" == true ]]; then
intermediate_dir=$output_root/reports/intermediates
else
intermediate_dir=$(mktemp -d "${TMPDIR:-/tmp}/beffroi-report-sources.XXXXXXXX")
trap 'rm -rf "$intermediate_dir"' EXIT
fi
reports/tools/convert-legacy-reports.sh reports/reports "$intermediate_dir"
reporter/tools/validate-all.sh "$intermediate_dir"
reporter/tools/render-all.sh "$intermediate_dir" --output-dir "$output_root/reports/pdfs"
reporter/tools/validate-all.sh reports/reports
reporter/tools/render-all.sh reports/reports --output-dir "$output_root/reports/pdfs"
reporter/render-diagnostics.sh reports/diagnostics \
--output-dir "$output_root/diagnostics" \
--author "${DIAGNOSTICS_AUTHOR:-Beffroi}" \
--logo reports/assets/beffroi.png
if [[ "$include_json" == true ]]; then
cp -R "$intermediate_dir/." "$output_root/reports/pdfs/"
reporter/tools/export-json-all.sh reports/reports --output-dir "$output_root/reports/pdfs"
while IFS= read -r -d '' source; do
relative=${source#reports/diagnostics/}
mkdir -p "$output_root/diagnostics/$(dirname "$relative")"

View File

@ -42,6 +42,9 @@ BRANDING_ROOT="$(pwd)/reports" \
BRANDING_DIRECTORY="$(pwd)/reports/config/branding" \
reports/tests/test.sh
echo 'Checking stored Reportist YAML'
reporter/tools/validate-all.sh reports/reports
pipeline_check_parent="$(mktemp -d "${TMPDIR:-/tmp}/beffroi-pipeline-check.XXXXXX")"
trap 'rm -rf -- "$pipeline_check_parent"' EXIT
pipeline_check_root="$pipeline_check_parent/run"