Skip to content

Add --graph option to display workflow job dependencies#150

Merged
linyows merged 4 commits intomainfrom
add-graph-option
Jan 15, 2026
Merged

Add --graph option to display workflow job dependencies#150
linyows merged 4 commits intomainfrom
add-graph-option

Conversation

@linyows
Copy link
Owner

@linyows linyows commented Jan 15, 2026

Summary

  • Add --graph CLI option to visualize workflow job dependencies as ASCII art
  • Display dependency graph without executing the workflow
  • Truncate long job names to 15 characters with trailing "~" for readability

Usage

probe --graph workflow.yml

Example Output

     [1st job]   [Standalone job]
         ┴ ┌─────────────────┐
           ↓                 ↓
  [2nd job-A (T~]   [2nd job-B]
      ┌────┘───────────────┌─┘
      ↓                    ↓
[Cleanup job]   [3rd job afte~]

Test plan

  • Unit tests for truncateLabel() function
  • Unit tests for RenderDependencyGraph() method
  • Manual testing with examples/needs-literal.yml
  • Verify --help displays new option

🤖 Generated with Claude Code

This feature allows users to visualize workflow job dependencies without
executing the workflow. Long job names are truncated to 15 characters
with a trailing "~" for better readability.

Usage: probe --graph workflow.yml

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

- ascii-dag: ASCII DAG rendering engine with Sugiyama layout algorithm
- dag: Generic DAG utilities for topological sorting and cycle detection

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

- Update README.md and README.ja.md with --graph option
- Update CLI reference documentation in both English and Japanese

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

- Fix errcheck: handle f.Close() and fmt.Fprintf errors
- Fix unused: remove unused functions, types, and variables
- Fix staticcheck: use switch statements and improve loop conditions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions

This comment has been minimized.

@github-actions
Copy link

Code Metrics Report

main (23359fe) #150 (e267841) +/-
Coverage 48.8% 53.1% +4.3%
Code to Test Ratio 1:1.1 1:1.0 -0.1
Details
  |                    | main (23359fe) | #150 (e267841) |  +/-  |
  |--------------------|----------------|----------------|-------|
+ | Coverage           |          48.8% |          53.1% | +4.3% |
  |   Files            |             52 |             63 |   +11 |
  |   Lines            |           5251 |           6138 |  +887 |
+ |   Covered          |           2563 |           3263 |  +700 |
- | Code to Test Ratio |          1:1.1 |          1:1.0 |  -0.1 |
  |   Code             |          10575 |          12169 | +1594 |
+ |   Test             |          12109 |          13230 | +1121 |

Code coverage of files in pull request scope (73.0% → 77.4%)

Files Coverage +/- Status
ascii-dag/cycles.go 83.3% +83.3% added
ascii-dag/dag.go 82.2% +82.2% added
ascii-dag/dag_options.go 25.0% +25.0% added
ascii-dag/dot.go 74.8% +74.8% added
ascii-dag/ir.go 90.7% +90.7% added
ascii-dag/layout.go 88.6% +88.6% added
ascii-dag/render.go 79.1% +79.1% added
cmd/probe/main.go 62.7% -7.0% modified
dag/cycles.go 80.8% +80.8% added
dag/roots.go 67.5% +67.5% added
dag/topo.go 82.6% +82.6% added
graph.go 92.3% +92.3% added
mail/mock_server.go 72.0% -1.1% affected
probe.go 73.8% -2.1% modified

Reported by octocov

@linyows linyows merged commit dff9fff into main Jan 15, 2026
7 checks passed
@linyows linyows deleted the add-graph-option branch January 15, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant