Migrate chart generation to use GFM mermaid - #103
Conversation
fix: try fixing with mermaid
There was a problem hiding this comment.
Pull request overview
This PR migrates chart generation from the Globadge API (which recently started requiring authentication) to GitHub Flavored Markdown's built-in mermaid chart support. The change addresses issue #97 where the action was failing with 403 errors due to Globadge API authentication requirements.
Changes:
- Replaced external Globadge API calls with inline mermaid chart generation using xychart syntax
- Added comprehensive test coverage using vitest framework for the new graphing functionality
- Updated development dependencies including TypeScript (5.3.3 → 5.9.3) and
@types/node(^16.3.3 → ^20.19.33)
Reviewed changes
Copilot reviewed 7 out of 17 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/graphing.ts | New module implementing mermaid-based chart generation for line and stacked area graphs |
| src/statCollector.ts | Refactored to use new graphing functions; removed axios-based API calls to Globadge; simplified output format |
| src/interfaces/index.ts | Removed GraphResponse interface no longer needed after API removal |
| tests/graphing.test.ts | New comprehensive test suite for graphing functionality using faker for deterministic test data |
| vitest.config.ts | New vitest configuration for test runner |
| tsconfig.test.json | New TypeScript configuration for test files |
| tsconfig.json | Updated to exclude vitest.config.ts and test files |
| package.json | Added vitest and @faker-js/faker as dev dependencies; updated test script; upgraded TypeScript and @types/node |
| package-lock.json | Lock file updates for all dependency changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Stacked bar chart
Updated README to clarify project status and implementation details.
Updated README to clarify the implementation details and inspiration for the project.
|
Thanks for this! It seems to work well, even with the dark theme. The typical issue with Github Flavored Markdown Mermaid is that long-running workflows quickly exceed the hard-coded (?) mermaid And the memory diagram seems to only consider physical RAM, ignoring swap. I think that's inherited from the original action. - uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 64 |
Fixes: #97
tried other graphing libraries and apparently GHA comments does not support data url at all
so there's pretty much no way to host the generated graph inside an action except relying an external service
later found out apparently GFM supports latest
mermaidout of the box, which has thisxychartbuilt inso this PR just mimics the look and feel of the original graphs, live with the limitations of what
mermaidcan do and call it a dayLimitations
mermaidcan't happen inside a markdown table, also removed, all the graphs are now in different lines instead of inside a tablemermaidxychart, therefore it is moved outside and useplacehold.cofor the little squaresfeel free to clean up the code as see fit
Summary by CodeRabbit
Release Notes
Improvements
Chores