Skip to content

Commit ce978f0

Browse files
committed
Generate diagram workflow - closes #1244
1 parent 5553970 commit ce978f0

File tree

5 files changed

+52
-0
lines changed

5 files changed

+52
-0
lines changed

.github/workflows/diagram.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
14+
- name: Install Mermaid CLI
15+
run: npm install -g @mermaid-js/mermaid-cli
16+
17+
- name: Render Diagram
18+
run: mmdc -p docs/puppeteer-config.json -i docs/architecture.mmd -o docs/images/architecture.svg -t neutral
19+
20+
- name: Commit and Push
21+
run: |
22+
git config --local user.email "action@github.com"
23+
git config --local user.name "GitHub Action"
24+
git add docs/images/architecture.svg
25+
git commit -m "docs: update rendered mermaid diagram" || exit 0
26+
git push

.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)