Skip to content

Replace local matrix_builder.js with @vlsi/github-actions-random-matrix npm package#3265

Merged
krmahadevan merged 1 commit into
testng-team:masterfrom
vlsi:ci_matrix
Mar 27, 2026
Merged

Replace local matrix_builder.js with @vlsi/github-actions-random-matrix npm package#3265
krmahadevan merged 1 commit into
testng-team:masterfrom
vlsi:ci_matrix

Conversation

@vlsi

@vlsi vlsi commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Migrate matrix.js to matrix.mjs (ESM), use createGitHubMatrixBuilder() which provides seeded RNG for reproducible CI matrix generation.

Previously, the matrix was randomized on every run, and now every PR would get a own stable seed.

Summary by CodeRabbit

  • Chores
    • Refactored CI/CD workflow matrix generation to use modern ECMAScript modules
    • Integrated external npm-based matrix builder package for improved maintainability
    • Added npm dependency management to workflow automation
    • Updated workflow configuration to leverage standardized matrix generation

…ix npm package

Migrate matrix.js to matrix.mjs (ESM), use createGitHubMatrixBuilder()
which provides seeded RNG for reproducible CI matrix generation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vlsi vlsi requested review from juherr and krmahadevan as code owners March 26, 2026 17:17
@coderabbitai

coderabbitai Bot commented Mar 26, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1ccc6541-7b18-43ad-9538-fac7e9fe7b09

📥 Commits

Reviewing files that changed from the base of the PR and between 8d167fb and 1ae5193.

⛔ Files ignored due to path filters (1)
  • .github/workflows/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • .github/workflows/matrix.mjs
  • .github/workflows/matrix_builder.js
  • .github/workflows/package.json
  • .github/workflows/test.yml
  • .gitignore
💤 Files with no reviewable changes (1)
  • .github/workflows/matrix_builder.js

📝 Walkthrough

Walkthrough

This refactoring migrates the workflow matrix generation from an internal CommonJS script with embedded matrix building logic to external ES modules, replacing the local MatrixBuilder class with a dependency on @vlsi/github-actions-random-matrix.

Changes

Cohort / File(s) Summary
Workflow Matrix Refactoring
.github/workflows/matrix.mjs, .github/workflows/package.json
Converted matrix generation script to ES modules with import statements and replaced internal MatrixBuilder class usage with external createGitHubMatrixBuilder() from the new dependency. Added package.json declaring @vlsi/github-actions-random-matrix v2.0.0 as a dependency.
Removed Internal Matrix Builder
.github/workflows/matrix_builder.js
Deleted entire 255-line file containing Axis and MatrixBuilder classes, as functionality is now provided by the external @vlsi/github-actions-random-matrix package.
CI/CD Configuration
.github/workflows/test.yml
Updated matrix preparation step to run matrix.mjs instead of matrix.js and added npm ci --prefix .github/workflows command to install workflow dependencies before matrix generation.
Repository Configuration
.gitignore
Added node_modules to ignore list, preventing workflow dependencies from being tracked in version control.

Poem

🐰 Goodbye old builder, your code served us well,
Now external packages handle the spell!
With ES modules and npm ci,
Our workflows are cleaner—hop, skip, and fly! ✨

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: replacing the local matrix_builder.js implementation with an npm package.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@juherr juherr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a dependabot entry that will update the package.json in case you release a new version?

@vlsi

vlsi commented Mar 26, 2026

Copy link
Copy Markdown
Contributor Author

Does dependabot require explicit opt-in? I haven't used it. I know renovate picks up project.json automatically

@krmahadevan krmahadevan merged commit 88c32ff into testng-team:master Mar 27, 2026
9 of 10 checks passed
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.

3 participants