Skip to content

Conversation

pau-hedgehog
Copy link
Contributor

@pau-hedgehog pau-hedgehog commented Aug 11, 2025

diagrams are now in svg format

viewer in action can be seen here: https://raw.githack.com/githedgehog/lab-ci/pau/fix_diagrams/envs/diagram-viewer.html

@pau-hedgehog pau-hedgehog self-assigned this Aug 11, 2025
@pau-hedgehog
Copy link
Contributor Author

We could enable GitHub Pages in the repo settings

@pau-hedgehog pau-hedgehog marked this pull request as ready for review August 11, 2025 12:52
Copy link

@Copilot 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 updates the diagram generation and viewer system to use SVG format instead of PNG, and adds support for multiple diagram styles (cisco, hedgehog, and default). The changes include generating new diagram formats, creating SVGs with transparent backgrounds, and implementing an HTML viewer for interactive diagram viewing.

Key changes:

  • Add support for multiple DrawIO diagram styles (cisco, hedgehog, default)
  • Switch from PNG to SVG format generation for all diagram types
  • Implement an HTML viewer generation feature using Go

Reviewed Changes

Copilot reviewed 7 out of 13 changed files in this pull request and generated 2 comments.

File Description
envs/justfile Updates diagram generation commands to create multiple styles and SVG outputs, adds HTML viewer generation
envs/env-ci-1.l/diagrams/spine-leaf/env-ci-1-spine-leaf.mermaid Reorders connection definitions in the generated Mermaid diagram
envs/env-ci-1.l/diagrams/spine-leaf/env-ci-1-spine-leaf.drawio Updates DrawIO diagram with reordered connection elements and labels
envs/env-ci-1.l/diagrams/spine-leaf/env-ci-1-spine-leaf.dot Reorders connection definitions in the DOT format diagram

@just create-html

create-html: _check-go
@go run ${FABRICATOR_PATH:-../../fabricator}/hack/generate_viewer.go --dirs "env-ci-1.l/diagrams" --output-dir . --output-file diagram-viewer.html
Copy link
Preview

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

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

The error handling for the Go command execution is inadequate. If the Go script fails, the justfile will continue execution without indication of failure. Consider adding error handling or using a shell operator to propagate failures.

Suggested change
@go run ${FABRICATOR_PATH:-../../fabricator}/hack/generate_viewer.go --dirs "env-ci-1.l/diagrams" --output-dir . --output-file diagram-viewer.html
@go run ${FABRICATOR_PATH:-../../fabricator}/hack/generate_viewer.go --dirs "env-ci-1.l/diagrams" --output-dir . --output-file diagram-viewer.html || exit 1

Copilot uses AI. Check for mistakes.

@go run ${FABRICATOR_PATH:-../../fabricator}/hack/generate_viewer.go --dirs "env-ci-1.l/diagrams" --output-dir . --output-file diagram-viewer.html

_check-go:
@command -v go >/dev/null 2>&1 || (echo "Go not installed. Install from https://golang.org" && exit 1)
Copy link
Preview

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

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

The error message provides a generic installation URL but doesn't specify the minimum Go version required. This could lead to compatibility issues if an older Go version is installed.

Suggested change
@command -v go >/dev/null 2>&1 || (echo "Go not installed. Install from https://golang.org" && exit 1)
@command -v go >/dev/null 2>&1 || (echo "Go not installed or version too old. Please install Go >= 1.18 from https://golang.org/dl/" && exit 1)

Copilot uses AI. Check for mistakes.

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