Skip to content

Migrate chart generation to use GFM mermaid#103

Open
ycfreeman wants to merge 11 commits intocatchpoint:masterfrom
ycfreeman:master
Open

Migrate chart generation to use GFM mermaid#103
ycfreeman wants to merge 11 commits intocatchpoint:masterfrom
ycfreeman:master

Conversation

@ycfreeman
Copy link
Copy Markdown

@ycfreeman ycfreeman commented Feb 20, 2026

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 mermaid out of the box, which has this xychart built in
so this PR just mimics the look and feel of the original graphs, live with the limitations of what mermaid can do and call it a day

Limitations

  • x axes for the line graphs with all the time labels look rubbish, so the labels are removed
  • mermaid can't happen inside a markdown table, also removed, all the graphs are now in different lines instead of inside a table
  • there's no way to do legend nicely in mermaid xychart, therefore it is moved outside and use placehold.co for the little squares

feel free to clean up the code as see fit

Summary by CodeRabbit

Release Notes

  • Improvements

    • Enhanced system performance reports with improved section organisation and clearer metric presentation.
  • Chores

    • Added comprehensive testing framework with automated test coverage for graphing functionality.
    • Updated development dependencies including TypeScript and Node type definitions to latest stable versions.

Copilot AI review requested due to automatic review settings February 20, 2026 11:40
Copy link
Copy Markdown

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 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.

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.

Globadge unexpectedly require authentication with a token

2 participants