Skip to content

Add --dag-ascii option for job and step visualization#151

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

Add --dag-ascii option for job and step visualization#151
linyows merged 4 commits intomainfrom
add-graph-detailed-option

Conversation

@linyows
Copy link
Owner

@linyows linyows commented Jan 17, 2026

Summary

  • Add --dag-ascii option to display workflow job dependencies as ASCII art with steps
  • Remove deprecated --graph and --graph-detailed options
  • Refactor rendering code with consistent naming (DagAsciiRenderer, DagAsciiJobNode)
  • Use bullet for embedded action steps to distinguish from regular steps ()

Example Output

╭───────────────────────╮
│       First job       │
├───────────────────────┤
│ ○ Get ID              │
│ ↗ Authentication(Embe…│
│ ○ Echo with outputs o…│
╰───────────────────────╯

Changes

File Description
dag_ascii.go New renderer implementation
dag_ascii_test.go Tests for the renderer
workflow.go Added RenderDagAscii() method
probe.go Added DagAscii() method
cmd/probe/main.go CLI option handling
graph.go Removed (deprecated)
graph_test.go Removed (deprecated)

Test plan

  • Run go test ./... - all tests pass
  • Run probe --dag-ascii examples/embedded-job.yml - renders correctly
  • Run probe --help - shows new option

🤖 Generated with Claude Code

- Add --dag-ascii option to display workflow job dependencies as ASCII art
- Remove deprecated --graph and --graph-detailed options
- Refactor renderConnections into smaller, focused methods for maintainability
- Use ↗ bullet for embedded action steps to distinguish from regular steps

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 CLI options section
- Update English and Japanese CLI reference documentation
- Add detailed output example showing box-style ASCII art

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

This comment has been minimized.

@github-actions

This comment has been minimized.

@linyows linyows requested a review from Copilot January 17, 2026 11:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces the deprecated --graph option with a new --dag-ascii option that provides enhanced workflow visualization. The new renderer displays jobs as boxes containing their steps, using different bullet symbols (○ for regular steps, ↗ for embedded actions) for better visual distinction.

Changes:

  • Replaced --graph CLI option with --dag-ascii for improved workflow visualization
  • Implemented new DagAsciiRenderer to display jobs with their constituent steps in box format
  • Removed deprecated graph rendering implementation and associated tests

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
dag_ascii.go New renderer implementation with box-based job visualization and step display
dag_ascii_test.go Comprehensive test coverage for the new renderer functionality
workflow.go Added RenderDagAscii() method to support new visualization
probe.go Renamed Graph() to DagAscii() to reflect new functionality
cmd/probe/main.go Updated CLI to use --dag-ascii flag and corresponding handler
cmd/probe/main_test.go Updated tests to reflect new CLI option
graph.go Removed deprecated graph rendering code
graph_test.go Removed tests for deprecated functionality
docs/src/en/reference/cli-reference.md Updated documentation with new option and example output
docs/src/ja/reference/cli-reference.md Updated Japanese documentation with new option and example output
README.md Updated README to reference new --dag-ascii option
README.ja.md Updated Japanese README to reference new --dag-ascii option

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

dag_ascii.go Outdated
lines = append(lines, nodeVertical+strings.Repeat(" ", leftPad)+name+strings.Repeat(" ", rightPad)+nodeVertical)

// Separator
lines = append(lines, nodeTeeRight+strings.Repeat(nodeHorizontal, innerWidth)+"┤")
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hard-coded string "┤" duplicates the constant nodeTeeLeft. Replace with the constant for consistency and maintainability.

Suggested change
lines = append(lines, nodeTeeRight+strings.Repeat(nodeHorizontal, innerWidth)+"┤")
lines = append(lines, nodeTeeRight+strings.Repeat(nodeHorizontal, innerWidth)+nodeTeeLeft)

Copilot uses AI. Check for mistakes.
Use the nodeTeeLeft constant instead of hard-coded "┤" for consistency
and maintainability.

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

This comment has been minimized.

@github-actions

This comment has been minimized.

- Rename createBoxes method to createNodes
- Rename renderDagAsciiJobNode parameter from box to node
- Rename levelBoxes to levelNodes in renderLevel
- Rename box loop variable to node in renderLevel
- Rename childBox/parentBox to childNode/parentNode in buildConnectionMap
- Rename box to node in calculateLevelPositions
- Add rune constants for connection line characters (conn*)
- Use conn* constants in flagsToChar instead of literal runes
- Update comments accordingly

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 (dff9fff) #151 (2941244) +/-
Coverage 53.1% 54.4% +1.3%
Code to Test Ratio 1:1.0 1:1.0 -0.1
Test Execution Time 22s 14s -8s
Details
  |                     | main (dff9fff) | #151 (2941244) |  +/-  |
  |---------------------|----------------|----------------|-------|
+ | Coverage            |          53.1% |          54.4% | +1.3% |
  |   Files             |             63 |             63 |     0 |
  |   Lines             |           6138 |           6382 |  +244 |
+ |   Covered           |           3264 |           3477 |  +213 |
- | Code to Test Ratio  |          1:1.0 |          1:1.0 |  -0.1 |
  |   Code              |          12169 |          12579 |  +410 |
+ |   Test              |          13230 |          13462 |  +232 |
+ | Test Execution Time |            22s |            14s |   -8s |

Code coverage of files in pull request scope (70.7% → 76.7%)

Files Coverage +/- Status
cmd/probe/main.go 62.7% 0.0% modified
dag_ascii.go 87.9% +87.9% added
graph.go 0.0% -92.4% removed
mail/mock_server.go 72.0% -1.1% affected
probe.go 73.8% 0.0% modified
workflow.go 69.4% +1.3% modified

Reported by octocov

@linyows linyows merged commit 1853798 into main Jan 17, 2026
7 checks passed
@linyows linyows deleted the add-graph-detailed-option branch January 17, 2026 11:47
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.

2 participants