Skip to content

Commit 90f6310

Browse files
committed
Ensure CI runs on uncategorized changes
1 parent 3eb3961 commit 90f6310

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

script/ci-changes-detector

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ PRO_RUBY_CHANGED=false
6464
PRO_RSPEC_CHANGED=false
6565
PRO_JS_CHANGED=false
6666
PRO_DUMMY_CHANGED=false
67+
UNCATEGORIZED_CHANGED=false
6768

6869
# Analyze each changed file
6970
while IFS= read -r file; do
@@ -138,6 +139,11 @@ while IFS= read -r file; do
138139
DOCS_ONLY=false
139140
PRO_LINT_CONFIG_CHANGED=true
140141
;;
142+
# Any other file counts as a non-doc change; run the full suite for safety
143+
*)
144+
DOCS_ONLY=false
145+
UNCATEGORIZED_CHANGED=true
146+
;;
141147
esac
142148
done <<< "$CHANGED_FILES"
143149

@@ -206,6 +212,7 @@ echo "Changed file categories:"
206212
[ "$PRO_DUMMY_CHANGED" = true ] && echo -e "${YELLOW} • React on Rails Pro Dummy app${NC}"
207213
[ "$LINT_CONFIG_CHANGED" = true ] && echo -e "${YELLOW} • Lint/format configuration${NC}"
208214
[ "$PRO_LINT_CONFIG_CHANGED" = true ] && echo -e "${YELLOW} • React on Rails Pro lint/format configuration${NC}"
215+
[ "$UNCATEGORIZED_CHANGED" = true ] && echo -e "${YELLOW} • Uncategorized changes (running full suite for safety)${NC}"
209216

210217
echo ""
211218
echo "Recommended CI jobs:"
@@ -252,6 +259,18 @@ if [ "$PRO_DUMMY_CHANGED" = true ] || [ "$PRO_RUBY_CHANGED" = true ] || [ "$PRO_
252259
RUN_PRO_DUMMY_TESTS=true
253260
fi
254261

262+
# If we encounter a change that isn't explicitly categorized, default to running everything
263+
if [ "$UNCATEGORIZED_CHANGED" = true ]; then
264+
RUN_LINT=true
265+
RUN_RUBY_TESTS=true
266+
RUN_JS_TESTS=true
267+
RUN_DUMMY_TESTS=true
268+
RUN_GENERATORS=true
269+
RUN_PRO_LINT=true
270+
RUN_PRO_TESTS=true
271+
RUN_PRO_DUMMY_TESTS=true
272+
fi
273+
255274
[ "$RUN_LINT" = true ] && echo " ✓ Lint (Ruby + JS)"
256275
[ "$RUN_RUBY_TESTS" = true ] && echo " ✓ RSpec gem tests"
257276
[ "$RUN_JS_TESTS" = true ] && echo " ✓ JS unit tests"

0 commit comments

Comments
 (0)