-
-
Notifications
You must be signed in to change notification settings - Fork 638
Fix ci-changes-detector to recognize Pro package test files #2077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Root Cause: The ci-changes-detector script was missing patterns for test files in the Pro package. When PR #2074 changed only `packages/react-on-rails-pro/tests/testUtils.ts`, the detector incorrectly classified it as a docs-only change because the pattern only matched `packages/react-on-rails-pro/src/**/*`. This triggered the ensure-master-docs-safety action, which correctly failed the workflow since the previous commit had test failures. The safety mechanism worked as intended, but the root cause was the missing pattern. Changes: - Add patterns for `packages/react-on-rails/tests/**/*` to trigger JS tests - Add patterns for `packages/react-on-rails-pro/tests/**/*` to trigger Pro tests - Add patterns for `scripts/`, `package.json`, and `tsconfig.json` in both packages - Update comments to clarify what's included in each pattern Impact: - Pro and open-source package test file changes will now correctly trigger CI - Package configuration changes will trigger appropriate test suites - Prevents false-positive "docs-only" detection that blocks deployments 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
WalkthroughModified the CI change detection script to include additional JavaScript/TypeScript source file patterns (tests, scripts, tsconfig.json, and package.json files) for both React on Rails core and Pro variants, expanding when JS_CHANGED and PRO_JS_CHANGED flags are triggered. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (7)📓 Common learnings📚 Learning: 2025-04-26T21:55:55.874ZApplied to files:
📚 Learning: 2025-02-12T16:38:06.537ZApplied to files:
📚 Learning: 2025-09-16T08:01:11.146ZApplied to files:
📚 Learning: 2025-10-23T17:22:01.074ZApplied to files:
📚 Learning: 2025-02-18T13:08:01.477ZApplied to files:
📚 Learning: 2025-09-15T21:24:48.207ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (2)
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. Comment |
Code ReviewSummaryThis PR correctly fixes a critical gap in the ci-changes-detector script that was causing test file changes in Pro package to be incorrectly classified as docs-only changes. The fix is well-targeted and addresses the root cause identified in the PR description. ✅ Strengths
🔍 Observations & Minor Suggestions
🎯 Code Quality Assessment
🧪 Test CoverageManual Testing: Documented and adequate for this change 🚀 RecommendationAPPROVE - This PR is ready to merge. It correctly addresses the identified issue, maintains code consistency, and includes appropriate documentation of the changes. The fix is minimal, targeted, and well-tested manually. The pattern additions are defensive and future-proof the script against similar issues. Optional Follow-up (separate PR, not blocking):
Great work identifying and fixing this! 🎉 |
Code Review: Fix ci-changes-detector to recognize Pro package test files✅ Overall AssessmentThis is an excellent bug fix that addresses a real issue in the CI change detection logic. The PR is well-documented, thoroughly tested, and follows best practices. 🎯 What This FixesRoot Cause: When PR #2074 modified Solution: Add patterns to detect changes in 💡 Strengths
🔍 Code Quality AnalysisPattern Correctness ✅
Existing Directory Verification ✅
🤔 Minor Observations
🔒 Security ConsiderationsNo security concerns. This is a shell script used in CI for change detection only. 🎭 Performance ConsiderationsNo performance impact. The script already iterates through all changed files; adding more patterns to the case statement is negligible overhead. 🧪 Test Coverage AssessmentThe PR description shows manual testing with realistic file paths:
Recommendation: Consider adding integration tests for this script in the future, but manual testing is sufficient for this bug fix. ✨ Suggestions (Optional, Non-Blocking)
🎉 Recommendation: APPROVE ✅This PR:
The fix is minimal, focused, and addresses exactly what needs to be fixed without over-engineering. Great work! 🚀 Generated with Claude Code |
Root Cause: The ci-changes-detector script classified changes to itself and other CI infrastructure files (script/, bin/, .github/workflows/, etc.) as docs-only changes. This created a meta-problem where: 1. PR #2077 merged, changing only script/ci-changes-detector 2. Detector classified this as docs-only (ironically!) 3. ensure-master-docs-safety action ran and found previous commit had failures 4. CI correctly failed to prevent false-positive "passing" status The previous commit (3eb3961 "convert testUtils to ts") had test failures, so the safety mechanism was working correctly. But the root cause was that changes to CI infrastructure weren't triggering CI validation. Changes: - Add pattern for script/*, bin/*, .github/workflows/*, .github/actions/* - CI infrastructure changes now trigger ALL test suites - Ensures changes to CI scripts are validated before merge - Prevents meta-problem where detector changes bypass detection Impact: - Changes to CI infrastructure will trigger full test suite - Validates that CI script changes work correctly - Prevents silent breakage of CI infrastructure - Completes the fix from PR #2077 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
## 🚨 URGENT HOTFIX for Master This fixes the 9 failing detect-changes jobs on master caused by PR #2077. ## Root Cause PR #2077 added patterns for Pro test files BUT the ci-changes-detector script itself was missing a pattern for CI infrastructure files (`script/*`, `bin/*`, `.github/workflows/*`). When PR #2077 merged (changing only `script/ci-changes-detector`): 1. Detector classified this as docs-only (ironically!) 2. ensure-master-docs-safety ran and found previous commit had failures 3. CI correctly failed to prevent false-positive "passing" The safety mechanism worked correctly, but revealed a meta-problem: **changes to CI infrastructure bypass CI validation**. ## Changes - ✅ Add pattern for `script/*`, `bin/*`, `.github/workflows/*`, `.github/actions/*`, `lefthook.yml` - ✅ CI infrastructure changes now trigger ALL test suites - ✅ Ensures changes to CI scripts are validated before merge - ✅ Prevents the detector from bypassing its own detection ## Testing ```bash # Before fix echo "script/ci-changes-detector" | script/ci-changes-detector # Output: ✓ Documentation-only changes # After fix echo "script/ci-changes-detector" | script/ci-changes-detector # Output: Changed file categories: # • Ruby source code # • JavaScript/TypeScript code # • Dummy app # • Generators # [... all test suites triggered] ``` ## Impact - Fixes 9 failing jobs on master immediately - Completes the fix from PR #2077 - Ensures CI infrastructure changes are properly validated - Prevents future meta-problems 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Enhanced CI infrastructure change detection to trigger comprehensive test validation when CI configuration files are modified. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Claude <noreply@anthropic.com>
Summary
Fixes the ci-changes-detector script to correctly identify test file changes in both the open-source and Pro packages, preventing false-positive "docs-only" detection.
Root Cause
The ci-changes-detector script was missing patterns for test files in the Pro package. When PR #2074 changed only
packages/react-on-rails-pro/tests/testUtils.ts, the detector incorrectly classified it as a docs-only change because the pattern only matchedpackages/react-on-rails-pro/src/**/*.This triggered the ensure-master-docs-safety action, which correctly failed the workflow since the previous commit had test failures. The safety mechanism worked as intended, but the root cause was the missing pattern.
Changes
packages/react-on-rails/tests/**/*to trigger JS testspackages/react-on-rails-pro/tests/**/*to trigger Pro testsscripts/,package.json, andtsconfig.jsonin both packagesTesting
Tested with multiple file patterns:
packages/react-on-rails-pro/tests/testUtils.ts→ correctly detected as PRO_JS_CHANGEDpackages/react-on-rails/tests/test.ts→ correctly detected as JS_CHANGEDpackages/react-on-rails-pro/package.json→ correctly detected as PRO_JS_CHANGEDREADME.md→ correctly detected as docs_onlyImpact
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.