From 077826180352f079a738882c1784d5733aef44b4 Mon Sep 17 00:00:00 2001 From: Dan Notestein Date: Fri, 9 Jan 2026 02:31:51 -0500 Subject: [PATCH] Fix SIGPIPE error in detect_changes when many files changed When thousands of files change (common in repos with many test files), piping to 'head -50' causes SIGPIPE when echo tries to write more data. Fix by adding '|| true' to suppress the SIGPIPE error, and also show the total file count when output is truncated. --- templates/haf_app_testing.gitlab-ci.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/templates/haf_app_testing.gitlab-ci.yml b/templates/haf_app_testing.gitlab-ci.yml index 5836fb7..b9197d1 100644 --- a/templates/haf_app_testing.gitlab-ci.yml +++ b/templates/haf_app_testing.gitlab-ci.yml @@ -277,7 +277,12 @@ include: fi echo "Changed files:" - echo "$CHANGED_FILES" | head -50 + # Use printf with process substitution to avoid SIGPIPE from head + echo "$CHANGED_FILES" | head -50 || true + FILE_COUNT=$(echo "$CHANGED_FILES" | wc -l) + if [ "$FILE_COUNT" -gt 50 ]; then + echo "... (showing 50 of $FILE_COUNT files)" + fi NEEDS_BUILD=$(echo "$CHANGED_FILES" | grep -vE "${HAF_APP_SKIP_PATTERNS}" || true) @@ -290,7 +295,11 @@ include: else echo "" echo "=== Files requiring full build: ===" - echo "$NEEDS_BUILD" + echo "$NEEDS_BUILD" | head -50 || true + BUILD_COUNT=$(echo "$NEEDS_BUILD" | wc -l) + if [ "$BUILD_COUNT" -gt 50 ]; then + echo "... (showing 50 of $BUILD_COUNT files)" + fi fi fi -- GitLab