Skip to content

Commit 001b7ad

Browse files
committed
Generate diagram workflow - refs #1244
1 parent 5553970 commit 001b7ad

File tree

5 files changed

+53
-0
lines changed

5 files changed

+53
-0
lines changed

.github/workflows/diagram.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Render Mermaid Diagrams
2+
on:
3+
push:
4+
paths:
5+
- 'docs/*.mmd' # Trigger only when mermaid files change
6+
7+
jobs:
8+
render:
9+
runs-on: ubuntu-latest
10+
# Grant the action permission to write to the repository
11+
permissions:
12+
contents: write
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Install Mermaid CLI
18+
run: npm install -g @mermaid-js/mermaid-cli
19+
20+
- name: Render Diagram
21+
run: mmdc -p docs/puppeteer-config.json -i docs/architecture.mmd -o docs/images/architecture.svg -t neutral
22+
23+
- name: Commit and Push
24+
uses: stefanzweifel/git-auto-commit-action@v7
25+
with:
26+
commit_message: "docs: update rendered mermaid diagram [skip ci]"
27+
file_pattern: 'docs/images/*.svg'

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ repos:
1919
- id: mixed-line-ending
2020
- id: check-yaml
2121
- id: pretty-format-json
22+
args: [--autofix]
2223
- id: detect-private-key
2324
- id: debug-statements
2425

docs/architecture.mmd

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
sequenceDiagram
2+
autonumber
3+
participant Pytest as Pytest runner
4+
participant ProcFactory as postgresql_proc_factory
5+
participant PgServer as PostgreSQL process
6+
participant TemplateDB as Template DB (seeded)
7+
participant TestDB as Per-test DB (clone)
8+
9+
Pytest->>ProcFactory: request postgresql_proc with load=[load_database]
10+
ProcFactory->>PgServer: start server
11+
ProcFactory->>TemplateDB: invoke load_database (create metadata, seed data)
12+
Note right of TemplateDB: Template is created and seeded once per full run
13+
loop per test
14+
Pytest->>PgServer: request clone of TemplateDB
15+
PgServer->>TestDB: create cloned database for test
16+
Pytest->>TestDB: run test using cloned DB
17+
Pytest->>TestDB: teardown: commit transaction
18+
Pytest->>TestDB: teardown: drop_all metadata (cleanup)
19+
end

docs/images/.keep

Whitespace-only changes.

docs/puppeteer-config.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"args": [
3+
"--no-sandbox",
4+
"--disable-setuid-sandbox"
5+
]
6+
}

0 commit comments

Comments
 (0)