Repository navigation
ci: run code analysis as a pass/fail workflow - #225
Conversation
The generated v1.0 and v2.0 URL classes have a property named like the class, which Code Analyzer reports as REDEF errors. The classes are generated, so code/resources/codeAnalyzerConfiguration.json lists them under ignoredFiles (read by MATLAB R2026b and later). personArray grows its argument cell once per person when the schema has preferredName; the AGROW hint is suppressed on that line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The code check ran as a step of the R2026a test job. When it failed, the openMINDS_Python checkout and install steps were skipped, while Run tests (if: always()) still ran and InteropTest failed on the missing interpreter. The check failed because MatBox rendered the code issues badge with pybadges, which imports imghdr, a module removed in Python 3.13. The new Analyse code workflow calls the matbox-actions check-code-workflow on R2026b. codecheckToolbox now accepts FoldersToCheck, fails on unresolved warnings or errors, and creates no badge. The README shows the workflow status instead of the generated code_issues.svg, and run_tests.yml drops the code check, SARIF upload and badge commit steps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
Analyse code runs on a fixed release, so its badge changes only when the code changes. The new workflow runs the same check weekly on the latest release. A failure there means a newer release reports issues the fixed release does not, and the pin in analyse-code.yml can be raised once they are resolved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
matbox.tasks.codecheckToolbox currently evaluates RequireIssuesResolved only when ShowIssues is true; that coupling is being fixed in MatBox. The comment now states the reason that holds either way: the table names the files to fix in a failed CI run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A first job reads the latest release name from the MathWorks URL that setup-matlab uses for "latest" and the matlab_release pinned in analyse-code.yml. The analysis runs only when they differ, on the resolved release, so the run checks the release that was compared. A manual run can force it with the force input. The job fails if analyse-code.yml has no pin of the form R2026b. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The workflows report a status, so they get a noun for both the file
and the display name, as in GitHub's starter workflows: code-analysis.yml
("Code analysis") and code-analysis-latest.yml ("Code analysis (latest
MATLAB)"). The README badge, the pin lookup in the weekly workflow and
the comment in codecheckToolbox follow the new names.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Test Results (R2022a)861 tests - 262 857 ✅ - 250 3m 4s ⏱️ - 1m 40s Results for commit 083026d. ± Comparison against base commit 6e61e90. This pull request removes 262 tests. |
Test Results (R2026a)861 tests - 262 859 ✅ - 247 6m 11s ⏱️ - 3m 6s Results for commit 083026d. ± Comparison against base commit 6e61e90. This pull request removes 262 tests. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #225 +/- ##
==========================================
- Coverage 80.61% 80.25% -0.37%
==========================================
Files 424 424
Lines 4436 4436
==========================================
- Hits 3576 3560 -16
- Misses 860 876 +16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Problem
The Run tests workflow fails on R2026a. The "Check for MATLAB code issues" step creates the code issues badge through
matbox.utility.createBadgeSvg, which calls the pybadges Python package. pybadges importsimghdr, a module removed in Python 3.13, so the step fails withModuleNotFoundError. GitHub then skips the openMINDS_Python checkout and install steps. "Run tests" still runs because it hasif: always(), and the three InteropTest tests fail becauseOPENMINDS_PYTHONpoints to an interpreter that was never installed.Change
.github/workflows/code-analysis.ymlcallsehennestad/matbox-actions/.github/workflows/check-code-workflow.yml@v1on R2026b, on push and pull request to main. It keeps the SARIF upload to code scanning.tools/tasks/codecheckToolbox.maccepts theFoldersToCheckargument that the check-code action passes. It setsRequireIssuesResolvedandShowIssuesso that any warning or error fails the job, and setsCreateBadge=false..github/workflows/code-analysis-latest.ymlruns the same check weekly and on manual dispatch on the latest MATLAB release.code-analysis.ymlstays on a fixed release so its badge changes only when the code changes. A first job compares the release that MathWorks reports as latest with the one pinned incode-analysis.yml, and the analysis runs only when they differ (or when a manual run setsforce). A failure in the weekly run means a newer release reports new issues; once they are resolved,matlab_releaseincode-analysis.ymlcan be raised..github/badges/code_issues.svg, which is deleted.run_tests.ymldrops the code check, SARIF upload and badge commit steps. The test job no longer depends on a code-check step.code/resources/codeAnalyzerConfiguration.jsonlists the generated v1.0 and v2.0URL.mclasses underignoredFiles. In these classes the property has the same name as the class, which Code Analyzer reports as twoREDEFerrors.ignoredFilesis read by MATLAB R2026b and later, so the workflow pins R2026b.tools/tests/oneOffs/personArray.msuppresses the oneAGROWhint.matbox.tasks.codecheckToolboxcurrently throws forRequireIssuesResolvedonly whenShowIssuesis also true. The wrapper sets both, so the check fails on remaining issues with current MatBox and after that coupling is fixed in MatBox.🤖 Generated with Claude Code