Migrate chart generation to use GFM mermaid#103
Open
ycfreeman wants to merge 11 commits intocatchpoint:masterfrom
Open
Migrate chart generation to use GFM mermaid#103ycfreeman wants to merge 11 commits intocatchpoint:masterfrom
ycfreeman wants to merge 11 commits intocatchpoint:masterfrom
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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