From 34fb51d85dd1fd45eebaf5504f5b8c46f89f3929 Mon Sep 17 00:00:00 2001 From: Thomas SharedInbox Date: Thu, 21 May 2026 10:28:28 +0200 Subject: [PATCH] feat(ci): add Graph() to visualize CI pipeline as Mermaid diagram (#126) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a Ci.Graph() Dagger function that emits a Mermaid flowchart showing both the Dagger Check pipeline (toolchain → pubGetLayer → parallel steps) and the Codeberg CI job dependencies (check → build-linux / deploy-playstore → publish-website). Usage: dagger call -m ci --source=. graph task ci-graph Co-Authored-By: Claude Sonnet 4.6 --- Taskfile.yml | 5 +++++ ci/main.go | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/Taskfile.yml b/Taskfile.yml index 23120a2..be5752d 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -189,6 +189,11 @@ tasks: cmds: - dagger call --progress=plain -q -m ci --source=. test-sync-reliability + ci-graph: + desc: Print a Mermaid diagram of the CI pipeline — paste into mermaid.live or any Markdown renderer + cmds: + - dagger call --progress=plain -q -m ci --source=. graph + stalwart: desc: Start a Stalwart instance for local development (via Dagger) cmds: diff --git a/ci/main.go b/ci/main.go index 7474851..d28a471 100644 --- a/ci/main.go +++ b/ci/main.go @@ -665,3 +665,60 @@ func (m *Ci) PublishAndroid( signed := m.SignAndroidBundle(stamped, keystoreBase64, keystorePassword) return m.UploadToPlayStore(ctx, signed, playStoreConfig) } + +// Graph returns a Mermaid diagram of the CI pipeline structure. +// Paste the output into any Mermaid renderer (codeberg, github, mermaid.live) +// or save it as a .md file to get a rendered diagram. +// +// Usage: +// +// dagger call --progress=plain -q -m ci --source=. graph +func (m *Ci) Graph() string { + return `# CI Pipeline Graph + +` + "```" + `mermaid +flowchart TD + subgraph dagger ["Dagger · Check pipeline"] + toolchain["toolchain\nflutter:3.41.6 + NDK + apt"] + pubGet["pubGetLayer\nflutter pub get"] + stalwart(["Stalwart service\nIMAP · JMAP · SMTP · Sieve"]) + + toolchain --> pubGet + + pubGet --> hygiene["CheckHygiene"] + pubGet --> layers["CheckLayers"] + pubGet --> fmt["Format"] + pubGet --> analyze["Analyze"] + pubGet --> mocks["CheckMocks"] + pubGet --> coverage["Coverage\nunit tests + gate"] + pubGet --> backend["TestBackend\nIMAP / JMAP"] + pubGet --> integration["TestIntegration\nXvfb · Linux desktop"] + + stalwart --> backend + stalwart --> integration + + hygiene --> check{{"✓ Check"}} + layers --> check + fmt --> check + analyze --> check + mocks --> check + coverage --> check + backend --> check + integration --> check + end + + subgraph forgejo ["Codeberg CI · .forgejo/workflows/ci.yml"] + ciCheck["check"] + buildLinux["build-linux\n(main only)"] + deployPS["deploy-playstore\n(main only)"] + pubWeb["publish-website\n(main only)"] + + ciCheck --> buildLinux + ciCheck --> deployPS + buildLinux --> pubWeb + deployPS --> pubWeb + end + + check -- "task check-dagger" --> ciCheck +` + "```" +}