Skip to content

Conversation

@justin808
Copy link
Member

@justin808 justin808 commented Nov 17, 2025

Summary

This PR modernizes GitHub Actions workflows by simplifying the matrix strategy and improving job naming for better clarity and maintainability.

Changes

Workflow Matrix Strategy

Before: Used complex include/exclude logic with conditional expressions
After: Dynamic matrix generation using fromJson() with centralized logic

  • Centralized matrix determination: All workflows now use a common determine-matrix step that outputs either ["latest"] (master/force_run/full-ci label) or ["latest","minimum"] (PRs)
  • Version translation: Ruby/Node versions are dynamically mapped from dependency level (latest → Ruby 3.4/Node 22, minimum → Ruby 3.2/Node 20)
  • Eliminated complex conditionals: Removed hard-to-read ternary expressions and include/exclude blocks

Job Naming Improvements

Renamed jobs for clarity and consistency:

Main repo:

  • buildlint-js-and-ruby
  • examplesbuild-examples-and-test-generators
  • rspec-package-testsbasic-gem-tests
  • dummy-app-integration-testsspec-dummy-integration-tests
  • build (package-js-tests) → package-js-tests

Pro repo:

  • build-dummy-app-webpack-test-bundlespro-build-dummy-app-webpack-test-bundles
  • rspec-dummy-app-node-rendererpro-dummy-app-node-renderer
  • dummy-app-node-renderer-e2e-testsnode-renderer-e2e-tests
  • package-js-testspro-package-js-tests
  • rspec-package-specspro-gem-tests
  • lint-js-and-rubypro-lint-js-and-ruby

Generator Configuration

  • Re-enabled build_test_command in generator templates since generators now properly configure TestHelper
  • Re-enabled auto_load_bundle for generated examples
  • Fixed generate_packs execution with validation skip during generator runtime

Benefits

  1. Easier to understand: Matrix logic is now centralized and explicit
  2. Easier to maintain: Changes to version mappings happen in one place
  3. Better UX: Job names clearly indicate what they do and which package they test
  4. Consistent: All workflows follow the same pattern

Testing

  • CI workflows validated through multiple test runs
  • No functional changes to test execution, only organizational improvements

Related PRs

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com


This change is Reviewable

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 17, 2025

Warning

Rate limit exceeded

@justin808 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 23 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 37f5894 and 7bb4f23.

📒 Files selected for processing (6)
  • .github/workflows/examples.yml (5 hunks)
  • .github/workflows/gem-tests.yml (5 hunks)
  • .github/workflows/integration-tests.yml (8 hunks)
  • .github/workflows/package-js-tests.yml (3 hunks)
  • lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt (1 hunks)
  • rakelib/shakapacker_examples.rake (1 hunks)
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch judahmeek/ci-workflow-modernization

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.

@claude
Copy link

claude bot commented Nov 17, 2025

Code Review - PR 2039: Modernize CI workflows with simplified matrix strategy

Overview

This PR successfully modernizes the GitHub Actions workflow matrix strategy by replacing complex include/exclude logic with centralized, dynamic matrix generation. The changes improve maintainability and clarity while preserving all functionality.


Strengths

1. Matrix Strategy Improvements

  • Excellent centralization: The determine-matrix step consolidates logic that was previously scattered
  • Much clearer: Replacing ternary expressions in exclude blocks with explicit JSON arrays is far more readable
  • Consistent pattern: All workflows now follow the same approach

2. Dynamic Version Translation

  • The translate-matrix step cleanly maps dependency-level to specific Ruby/Node versions
  • Centralizes version management - changing supported versions becomes a simple edit
  • Eliminates hardcoded version numbers scattered throughout matrix definitions

3. Job Naming

  • New names are more descriptive: build-examples-and-test-generators, spec-dummy-integration-tests, basic-gem-tests
  • Pro package jobs now have clear pro- prefixes, reducing confusion
  • Better UX in GitHub Actions UI and easier to reference in documentation/scripts

4. Generator Configuration

  • Re-enabling build_test_command and auto_load_bundle aligns with TestHelper fixes
  • The REACT_ON_RAILS_SKIP_VALIDATION wrapper is a pragmatic temporary solution
  • Adding bundle exec rake react_on_rails:generate_packs ensures generated examples are fully configured

Areas for Improvement

1. Minor: Inconsistent Matrix Strategy in package-js-tests.yml
The determine-matrix step outputs Node versions directly instead of dependency levels like other workflows. While this works, it creates an inconsistency in the pattern.

2. TODO Comment in shakapacker_examples.rake
Create a follow-up issue to track removing REACT_ON_RAILS_SKIP_VALIDATION flag once the next release is out.

3. Removed Cache Workaround for Node 22
The PR removes conditional cache logic that was working around a V8 bug. Has the bug referenced in nodejs/node issue 56010 been resolved?

4. Change in yalc publish Command
Changed from yalc publish to yarn yalc publish - this is likely correct but worth explicit testing as it is a functional change.


Testing Considerations

Required Validation:

  1. Verify both latest and minimum dependency levels run on master
  2. Verify only latest runs on regular PRs
  3. Verify full-ci label triggers both levels
  4. Verify Pro workflow jobs correctly depend on renamed pro-build-dummy-app-webpack-test-bundles
  5. Test generator examples actually build and pass tests with new configuration

The changes to pro-integration-tests.yml and pro-test-package-and-gem.yml correctly update job dependencies. This is critical for workflow execution.


Security and Performance

  • No security concerns: Changes are purely organizational
  • Performance neutral: Same number of jobs run, just clearer organization
  • Cache keys preserved: All cache key generation updated correctly, maintaining cache effectiveness

Recommendations

Before merging:

  1. Verify CI passes on this PR with both latest and minimum configurations (use full-ci label)
  2. Consider creating a follow-up issue for the REACT_ON_RAILS_SKIP_VALIDATION removal
  3. Confirm Node 22 cache workaround can be safely removed
  4. Update bin/ci-rerun-failures script if it references old job names

After merging:

  1. Monitor first few PRs to ensure matrix logic works as expected
  2. Update any documentation that references old job names
  3. Consider extracting the determine-matrix and translate-matrix steps into reusable composite actions

Changelog Impact

Per CLAUDE.md guidelines, this PR should NOT have a CHANGELOG entry as it is an internal CI/infrastructure improvement with no user-visible changes.


Overall Assessment

This is a high-quality refactoring that significantly improves CI workflow maintainability. The centralized matrix logic is much easier to understand and modify than the previous include/exclude approach. The changes are well-structured and show good attention to detail (updated cache keys, artifact names, job dependencies).

The few minor issues noted above are optional improvements - the PR is solid as-is. Excellent work on untangling the complex conditional matrix logic!

Recommendation: Approve with minor suggestions


Review generated by Claude Code

Correct job name from 'pro-build-dummy-app-webpack-test-bundles' to 'build-dummy-app-webpack-test-bundles' in job dependencies.

The job was renamed in the workflow refactoring but the reference updates were missed, causing actionlint failures.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@justin808
Copy link
Member Author

/run-skipped-ci

@github-actions
Copy link
Contributor

🚀 Full CI Mode Enabled

All checks are already running - nothing to do!

All CI checks are already running on this PR. Added the full-ci label - future commits will run the full CI suite.

@Judahmeek
Copy link
Contributor

clone of #2034 (with reductions) and superseded by #2040, #2036, #2038

@Judahmeek Judahmeek closed this Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants