feat(graph): add plantuml output format - #528
Conversation
Add plantuml to azd app graph --output. It emits a PlantUML component diagram (@startuml/@enduml) with services as components, resources as databases, and dependency edges, matching the existing mermaid and dot renderers. Works with --output-file and --focus. Closes #525 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🚀 Website Preview Your PR preview is ready! 📎 Preview URL: https://jongio.github.io/azd-app/pr/528/ This preview will be automatically cleaned up when the PR is closed. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #528 +/- ##
==========================================
+ Coverage 61.78% 61.81% +0.02%
==========================================
Files 224 224
Lines 29382 29414 +32
==========================================
+ Hits 18154 18182 +28
- Misses 9980 9983 +3
- Partials 1248 1249 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
🚀 Test This PRA preview build ( 🌐 Website PreviewLive Preview: https://jongio.github.io/azd-app/pr/528/ One-Line Install (Recommended)PowerShell (Windows): iex "& { $(irm https://raw.githubusercontent.com/jongio/azd-app/main/cli/scripts/install-pr.ps1) } -PrNumber 528 -Version 0.20.0-pr528"Bash (macOS/Linux): curl -fsSL https://raw.githubusercontent.com/jongio/azd-app/main/cli/scripts/install-pr.sh | bash -s 528 0.20.0-pr528UninstallWhen you're done testing: PowerShell (Windows): iex "& { $(irm https://raw.githubusercontent.com/jongio/azd-app/main/cli/scripts/uninstall-pr.ps1) } -PrNumber 528"Bash (macOS/Linux): curl -fsSL https://raw.githubusercontent.com/jongio/azd-app/main/cli/scripts/uninstall-pr.sh | bash -s 528Build Info:
What to Test: |
Resolve keep-both conflicts in graph.go and graph_test.go so both the d2 and plantuml output formats survive: const block, long description, examples, flag help, validation switch, dispatch switch, escape helpers, and the renderer pair. Test file keeps all four test functions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a64f7322-0aed-4203-b539-e3081290ce7d
wbreza
left a comment
There was a problem hiding this comment.
Code Review — Approved
Overall assessment: Clean, purely additive change that adds a plantuml output format to azd app graph, faithfully mirroring the existing mermaid, dot, and d2 renderers. No blocking findings.
What was verified
- Wiring is complete and consistent: new
graphOutputPlantUMLconstant, flag help,--helpLong text, examples block, validationswitchinrunGraph, and therenderGraphdispatch are all updated together. - Renderer follows the established pattern:
renderGraphPlantUMLreusesmermaidNodeIDs(alias constraints are compatible, and the comment documents why), renders resources asdatabaseand services ascomponent— matching how sibling formats distinguish resources — and guards edges with the sameokFrom/okTocheck. - Escaping is correct and documented:
escapePlantUMLLabelmaps"to'(PlantUML has no escape for a literal quote inside a quoted name) and\nto the\nline-break sequence. - Tests are adequate:
TestRenderGraphPlantUML,TestRenderGraphPlantUMLNoProject, andTestEscapePlantUMLLabelcover the renderer, the empty-project title path, and the escaper. - No regressions: the updated invalid-format error message does not break
TestRunGraphInvalidFormat(it asserts only theinvalid output formatsubstring). No documentation drift — there is nograph.md; the--helpLong text is the source of truth and was updated.
Severity summary
- Critical: 0 · High: 0 · Medium: 0 · Low: 0
Result: Zero Critical/High/Medium findings — approving.
What
Adds
plantumlas an output format forazd app graph.azd app graph --output plantumlemits a PlantUML component diagram you can paste into docs or render with any PlantUML tool.Why
The command already produces Mermaid and Graphviz DOT. PlantUML is a common choice for architecture docs and is supported by many wikis and IDE plugins. This adds it alongside the existing diagram formats without changing any of them.
Details
plantumlvalue for--output(-o).@startuml/@enduml.component, resources render asdatabase, so the two are easy to tell apart.-->with sanitized aliases, reusing the same alias generator as the Mermaid renderer.titleline is emitted from the project name and omitted when the project is empty.--output-fileand--focus, same as the other formats.Tests
TestRenderGraphPlantUML,TestRenderGraphPlantUMLNoProject, andTestEscapePlantUMLLabelcover the rendered structure, the empty-project case, and label escaping.go build ./..., the commands package tests, andgolangci-lintall pass.Closes #525