-
Notifications
You must be signed in to change notification settings - Fork 0
chore: update diagrams and viewer #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Pau Capdevila <[email protected]>
We could enable GitHub Pages in the repo settings |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
@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) |
There was a problem hiding this comment.
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.
@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.
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