Add --dag-mermaid option to output workflow DAG in Mermaid format#154
Merged
Add --dag-mermaid option to output workflow DAG in Mermaid format#154
Conversation
Similar to --dag-ascii, this option renders the workflow job dependencies in Mermaid flowchart format (LR direction), which can be directly rendered in GitHub, GitLab, Notion, and other Markdown viewers. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Update README.md, README.ja.md, and CLI reference docs with --dag-mermaid option description and usage examples. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Code Metrics Report
Details | | main (028ef05) | #154 (e816d14) | +/- |
|---------------------|----------------|----------------|-------|
+ | Coverage | 54.6% | 54.8% | +0.1% |
| Files | 63 | 64 | +1 |
| Lines | 6375 | 6439 | +64 |
+ | Covered | 3483 | 3530 | +47 |
- | Code to Test Ratio | 1:1.0 | 1:1.0 | -0.1 |
| Code | 12570 | 12684 | +114 |
| Test | 13180 | 13180 | 0 |
- | Test Execution Time | 24s | 25s | +1s |Code coverage of files in pull request scope (69.4% → 70.1%)
Reported by octocov |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a --dag-mermaid CLI option to output workflow job dependencies in Mermaid flowchart format, complementing the existing --dag-ascii option. The Mermaid output can be directly rendered in GitHub, GitLab, Notion, and other Markdown viewers.
Changes:
- Added
DagMermaidRendererwith support for rendering workflow DAGs in Mermaid flowchart format (LR direction) - Integrated
--dag-mermaidflag into CLI argument parsing and help text - Added comprehensive test coverage with 12 golden test cases covering various DAG patterns
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| dag_mermaid.go | Core renderer implementation for Mermaid flowchart generation |
| dag_mermaid_test.go | Unit and golden tests for the DagMermaidRenderer |
| probe.go | Added DagMermaid() method to Probe API |
| cmd/probe/main.go | Integrated --dag-mermaid flag and runDagMermaid() handler |
| cmd/probe/main_test.go | Updated test expectations for new flag |
| README.md | Added documentation for --dag-mermaid option |
| README.ja.md | Added Japanese documentation for --dag-mermaid option |
| docs/src/en/reference/cli-reference.md | Added English CLI reference documentation |
| docs/src/ja/reference/cli-reference.md | Added Japanese CLI reference documentation |
| testdata/dag_mermaid/*.golden.txt | Golden test files for 12 DAG pattern variations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--dag-mermaidCLI option to render workflow job dependencies in Mermaid flowchart formatExample
Output:
flowchart LR subgraph build["Build"] build_step0["Compile"] end subgraph unit_test["Unit Test"] unit_test_step0["Run unit"] end subgraph lint["Lint"] lint_step0["Run lint"] end subgraph deploy["Deploy"] deploy_step0["Deploy app"] end build --> unit_test build --> lint unit_test --> deploy lint --> deployTest plan
DagMermaidRenderer🤖 Generated with Claude Code