From b06616011e213bc8e4a53f784512e916898bafde Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Thu, 20 Nov 2025 15:41:00 -1000 Subject: [PATCH 1/2] Ensure CI runs on uncategorized changes --- script/ci-changes-detector | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/script/ci-changes-detector b/script/ci-changes-detector index 01bcb5690a..af3fcfa7a1 100755 --- a/script/ci-changes-detector +++ b/script/ci-changes-detector @@ -64,6 +64,7 @@ PRO_RUBY_CHANGED=false PRO_RSPEC_CHANGED=false PRO_JS_CHANGED=false PRO_DUMMY_CHANGED=false +UNCATEGORIZED_CHANGED=false # Analyze each changed file while IFS= read -r file; do @@ -138,7 +139,6 @@ while IFS= read -r file; do DOCS_ONLY=false PRO_LINT_CONFIG_CHANGED=true ;; - # CI infrastructure files (scripts, workflows, CI configs) # Changes to CI infrastructure should trigger tests to validate the changes work script/*|script/**/*|bin/*|bin/**/*|.github/workflows/*|.github/actions/*|.github/actions/**/*|lefthook.yml) @@ -151,6 +151,11 @@ while IFS= read -r file; do PRO_JS_CHANGED=true PRO_DUMMY_CHANGED=true ;; + # Any other file counts as a non-doc change; run the full suite for safety + *) + DOCS_ONLY=false + UNCATEGORIZED_CHANGED=true + ;; esac done <<< "$CHANGED_FILES" @@ -219,6 +224,7 @@ echo "Changed file categories:" [ "$PRO_DUMMY_CHANGED" = true ] && echo -e "${YELLOW} • React on Rails Pro Dummy app${NC}" [ "$LINT_CONFIG_CHANGED" = true ] && echo -e "${YELLOW} • Lint/format configuration${NC}" [ "$PRO_LINT_CONFIG_CHANGED" = true ] && echo -e "${YELLOW} • React on Rails Pro lint/format configuration${NC}" +[ "$UNCATEGORIZED_CHANGED" = true ] && echo -e "${YELLOW} • Uncategorized changes (running full suite for safety)${NC}" echo "" echo "Recommended CI jobs:" @@ -265,6 +271,18 @@ if [ "$PRO_DUMMY_CHANGED" = true ] || [ "$PRO_RUBY_CHANGED" = true ] || [ "$PRO_ RUN_PRO_DUMMY_TESTS=true fi +# If we encounter a change that isn't explicitly categorized, default to running everything +if [ "$UNCATEGORIZED_CHANGED" = true ]; then + RUN_LINT=true + RUN_RUBY_TESTS=true + RUN_JS_TESTS=true + RUN_DUMMY_TESTS=true + RUN_GENERATORS=true + RUN_PRO_LINT=true + RUN_PRO_TESTS=true + RUN_PRO_DUMMY_TESTS=true +fi + [ "$RUN_LINT" = true ] && echo " ✓ Lint (Ruby + JS)" [ "$RUN_RUBY_TESTS" = true ] && echo " ✓ RSpec gem tests" [ "$RUN_JS_TESTS" = true ] && echo " ✓ JS unit tests" From 5caded5aa420ce41196ef5d53969b844bc347d5d Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Thu, 20 Nov 2025 18:09:37 -1000 Subject: [PATCH 2/2] Improve ci-changes-detector documentation and clarity - Fix duplicate comment: distinguish Pro lint config from main repo config - Add explanatory comments to catch-all case explaining the philosophy - Add blank lines for better visual separation between cases - Clarify that uncategorized files trigger full suite for safety No functional changes, only improved documentation and code clarity. --- script/ci-changes-detector | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/script/ci-changes-detector b/script/ci-changes-detector index af3fcfa7a1..3586f45516 100755 --- a/script/ci-changes-detector +++ b/script/ci-changes-detector @@ -134,11 +134,12 @@ while IFS= read -r file; do LINT_CONFIG_CHANGED=true ;; - # Lint/format configuration + # React on Rails Pro lint/format configuration react_on_rails_pro/.rubocop.yml|react_on_rails_pro/.eslintrc*|react_on_rails_pro/.prettierrc*|react_on_rails_pro/tsconfig.json|react_on_rails_pro/.editorconfig|.github/workflows/pro-lint.yml) DOCS_ONLY=false PRO_LINT_CONFIG_CHANGED=true ;; + # CI infrastructure files (scripts, workflows, CI configs) # Changes to CI infrastructure should trigger tests to validate the changes work script/*|script/**/*|bin/*|bin/**/*|.github/workflows/*|.github/actions/*|.github/actions/**/*|lefthook.yml) @@ -151,7 +152,10 @@ while IFS= read -r file; do PRO_JS_CHANGED=true PRO_DUMMY_CHANGED=true ;; - # Any other file counts as a non-doc change; run the full suite for safety + + # Catch-all: any file not explicitly categorized above + # Philosophy: When in doubt, run everything to ensure safety + # This prevents new file types or directories from being silently ignored by CI *) DOCS_ONLY=false UNCATEGORIZED_CHANGED=true