Skip to content

Commit 98a983f

Browse files
justin808claude
andcommitted
Add additional precompile output checks from issue #2081
Added checks for: - Duplicate locale generation (react_on_rails:locale task) - Duplicate webpack builds (via "Built at:" message count) - ENOENT errors (missing files/directories) - Deprecation warnings (logged as warning, not failure) These patterns were explicitly requested in the updated issue description to catch silent bugs that don't cause precompile to fail but indicate problems like doubled build times or missing dependencies. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 7e8a892 commit 98a983f

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

.github/workflows/precompile-check.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ jobs:
170170
fi
171171
fi
172172
173-
# Pattern 2: Duplicate task execution messages
173+
# Pattern 2: Duplicate task execution messages (generate_packs)
174174
if grep -q "react_on_rails:generate_packs" precompile_output.txt; then
175175
GENERATE_PACKS_COUNT=$(grep -c "react_on_rails:generate_packs" precompile_output.txt || true)
176176
if [ "$GENERATE_PACKS_COUNT" -gt 1 ]; then
@@ -181,6 +181,26 @@ jobs:
181181
fi
182182
fi
183183
184+
# Pattern 2b: Duplicate locale generation
185+
if grep -q "react_on_rails:locale" precompile_output.txt; then
186+
LOCALE_COUNT=$(grep -c "react_on_rails:locale" precompile_output.txt || true)
187+
if [ "$LOCALE_COUNT" -gt 1 ]; then
188+
echo "::error::FAILURE: react_on_rails:locale task ran $LOCALE_COUNT times (should only run once)."
189+
echo " Matching lines:"
190+
grep -n "react_on_rails:locale" precompile_output.txt
191+
FAILURES_FOUND=1
192+
fi
193+
fi
194+
195+
# Pattern 2c: Duplicate webpack builds (check "Built at:" messages)
196+
BUILT_AT_COUNT=$(grep -c "Built at:" precompile_output.txt || true)
197+
if [ "$BUILT_AT_COUNT" -gt 1 ]; then
198+
echo "::error::FAILURE: Detected $BUILT_AT_COUNT webpack builds (expected 1). Tasks may be running twice."
199+
echo " Matching lines:"
200+
grep -n "Built at:" precompile_output.txt | head -5
201+
FAILURES_FOUND=1
202+
fi
203+
184204
# Pattern 3: Module not found errors
185205
if grep -Ei "module not found|cannot find module|can't resolve" precompile_output.txt; then
186206
echo "::error::FAILURE: Module resolution errors detected in precompile output."
@@ -189,6 +209,14 @@ jobs:
189209
FAILURES_FOUND=1
190210
fi
191211
212+
# Pattern 3b: ENOENT errors (missing files/directories)
213+
if grep -q "Error: ENOENT" precompile_output.txt; then
214+
echo "::error::FAILURE: Missing file or directory errors detected."
215+
echo " Sample matching lines:"
216+
grep -n "Error: ENOENT" precompile_output.txt | head -3
217+
FAILURES_FOUND=1
218+
fi
219+
192220
# Pattern 4: Webpack build errors (use specific webpack error markers)
193221
if grep -Ei "webpack.*error|failed to compile|compilation failed|ERROR in" precompile_output.txt; then
194222
echo "::error::FAILURE: Webpack compilation errors detected."
@@ -229,6 +257,14 @@ jobs:
229257
grep -i "warning" precompile_output.txt | head -5
230258
fi
231259
260+
# Pattern 9: Deprecation warnings (log for visibility, don't fail)
261+
DEPRECATION_COUNT=$(grep -c "DEPRECATION" precompile_output.txt || true)
262+
if [ "$DEPRECATION_COUNT" -gt 0 ]; then
263+
echo "::warning::Found $DEPRECATION_COUNT deprecation warnings. These may indicate future breakage."
264+
echo " Deprecation messages:"
265+
grep -n "DEPRECATION" precompile_output.txt | head -5
266+
fi
267+
232268
if [ "$FAILURES_FOUND" -eq 1 ]; then
233269
echo ""
234270
echo "=========================================="

0 commit comments

Comments
 (0)