From 029229143bf5dc74d1f4c8c4d15dcb1c68fb95b1 Mon Sep 17 00:00:00 2001 From: Alex Wilkerson John Date: Fri, 10 Jul 2026 14:11:02 -0400 Subject: [PATCH] ci: exempt version.go from the test-presence check Release Please bumps `internal/version/version.go` (its `var Number`, via the x-release-please-version marker) on every release PR, with no other code and nothing to test. The test-presence gate flagged those PRs as "Go source changed without any updates under tests/", blocking releases. Exempt internal/version/version.go from the check; it holds only the version string. Real code changes elsewhere are still enforced. Co-Authored-By: Claude Opus 4.8 (1M context) Signed-off-by: Alex Wilkerson John --- scripts/ci/check_test_presence.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/ci/check_test_presence.sh b/scripts/ci/check_test_presence.sh index 57415d4..dba712d 100755 --- a/scripts/ci/check_test_presence.sh +++ b/scripts/ci/check_test_presence.sh @@ -4,7 +4,10 @@ set -euo pipefail base_ref="${1:-origin/main}" changed_files="$(git diff --name-only "${base_ref}"...HEAD)" -code_changes="$(printf '%s\n' "$changed_files" | grep -E '^(cmd/|internal/|pkg/).+\.go$' | grep -Ev '(^|/).+_test\.go$|(^|/)doc\.go$' || true)" +# internal/version/version.go is exempt: Release Please bumps its `var Number` +# via the x-release-please-version marker, so release PRs change it with no +# accompanying code to test. It holds only the version string. +code_changes="$(printf '%s\n' "$changed_files" | grep -E '^(cmd/|internal/|pkg/).+\.go$' | grep -Ev '(^|/).+_test\.go$|(^|/)doc\.go$|^internal/version/version\.go$' || true)" test_changes="$(printf '%s\n' "$changed_files" | grep -E '(^tests/|_test\.go$)' || true)" if [ -z "$code_changes" ]; then