Skip to content

feat: write badge JSON instead of rendering SVG via pybadges - #62

Merged
ehennestad merged 5 commits into
mainfrom
emit-badge-json
Jul 20, 2026
Merged

feat: write badge JSON instead of rendering SVG via pybadges#62
ehennestad merged 5 commits into
mainfrom
emit-badge-json

Conversation

@ehennestad

@ehennestad ehennestad commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

Removes the runtime dependency on Python, pip, and the deprecated pybadges package by moving badge SVG rendering out of MATLAB. Supersedes #47.

  • When the MATBOX_BADGE_FORMAT=json environment variable is set (current matbox-actions set it — feat: render SVG badges from MatBox badge JSON with badge-maker matbox-actions#8), testToolbox and codecheckToolbox write badge descriptions as JSON (docs/reports/badges/*.json) and CI renders them to .github/badges/*.svg with badge-maker, the shields.io reference implementation (CC0, local render, no external service)
  • Without the variable — local runs, or repositories pinned to older matbox-actions refs (which still install the latest MatBox) — badge creation falls back to the legacy pybadges SVG path, so no combination of action/MatBox versions loses badges and merge order does not matter
  • createBadgeSvg is deprecated but remains as the fallback; the matbox.py namespace is retained — it is independently useful for downstream toolboxes with Python requirements
  • MatBox's own CI migrates to the matbox-actions@v1 reusable test workflow; the duplicate internal actions and reusable workflows are deleted from main (repositories pinned to @v0.9 resolve via the tag and keep working through the pybadges fallback)
  • tools/tasks/codecheckToolbox wrapper now accepts varargin, required because the v1 check-code action forwards name-value arguments to wrappers

Tests

New TasksTest case sets MATBOX_BADGE_FORMAT=json and verifies codecheckToolbox writes code_issues.json with the expected label and a valid color. Full TasksTest suite passes locally (5/5).

The legacy pybadges path can be deleted in a future major release once older matbox-actions refs are retired. Expect a one-time badge-churn commit in downstream repos on first run with both changes (badge-maker's markup differs slightly from pybadges'; visually equivalent).

🤖 Generated with Claude Code

Badge SVG rendering moves out of MATLAB: testToolbox and
codecheckToolbox now write badge descriptions as JSON files to
docs/reports/badges/, and the matbox-actions check-code/test-code
actions render them to .github/badges/*.svg with badge-maker, the
shields.io reference implementation. This removes the runtime
dependency on Python, pip, and the deprecated pybadges package.

- createBadgeSvg is deprecated (kept for backward compatibility)
- matbox.py namespace is retained; it is useful for downstream
  toolboxes with Python requirements
- MatBox's own CI migrates from the legacy internal actions (@v0.9)
  to the matbox-actions@v1 reusable test workflow; the duplicate
  internal actions and reusable workflows are deleted from main
  (tag-pinned @v0.9 consumers are unaffected)
- tools/tasks/codecheckToolbox wrapper accepts varargin, required
  because the v1 check-code action forwards name-value arguments

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Test Results

24 tests   24 ✅  24s ⏱️
 5 suites   0 💤
 1 files     0 ❌

Results for commit acb6e4e.

♻️ This comment has been updated with latest results.

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.75%. Comparing base (2519f3d) to head (2548ff3).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
code/+matbox/+tasks/testToolbox.m 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #62      +/-   ##
==========================================
+ Coverage   42.02%   44.75%   +2.72%     
==========================================
  Files          59       61       +2     
  Lines        1468     1524      +56     
==========================================
+ Hits          617      682      +65     
+ Misses        851      842       -9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ehennestad and others added 2 commits July 17, 2026 12:06
Repositories pinned to older matbox-actions refs still install the
latest MatBox, so unconditionally switching to badge JSON would leave
their committed badges silently stale (nothing renders the JSON).
Badge creation now writes JSON only when MATBOX_BADGE_FORMAT=json,
which current matbox-actions set; otherwise it falls back to the
legacy pybadges SVG path. Every action/MatBox version combination
keeps producing badges, and merge order no longer matters.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ehennestad
ehennestad merged commit 62c4514 into main Jul 20, 2026
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