update "No New Tests" PR filter list

For a while now we trigger CI tests based on if source files, i.e. *.go
files were changed. The "No New Tests" filter however checked something
else via a exclude list that was not being updated.

That means in many cases we needed to add the label when it is clear
that these thing should not need tests, i.e. packit or rpm/ changes.
To avoid the manual updates of all directories just grep for source
files.

Fixes: #28849

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
(cherry picked from commit 126d3e27ae)
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2026-06-16 14:09:29 +02:00
parent 544c24c392
commit 2f11e2fc8d

View File

@@ -23,25 +23,13 @@ fi
# Nothing changed under test subdirectory.
#
# This is OK if the only files being touched are "safe" ones.
# This is OK if no source code files were changed.
# Also we allow vendor updated without tests so exclude the vendor files
# and also the version files so release PRs do not need tests.
filtered_changes=$(git diff --name-only $base $head |
grep -F -vx .cirrus.yml |
grep -F -vx .pre-commit-config.yaml |
grep -F -vx .gitignore |
grep -F -vx go.mod |
grep -F -vx go.sum |
grep -F -vx podman.spec.rpkg |
grep -F -vx .golangci.yml |
grep -F -vx winmake.ps1 |
grep -E -v '/*Makefile$' |
grep -E -v '^[^/]+\.md$' |
grep -E -v '^.github' |
grep -E -v '^contrib/' |
grep -E -v '^docs/' |
grep -E -v '^hack/' |
grep -E -v '^nix/' |
grep -E -v '^vendor/' |
grep -E -v '^version/')
grep -E -v '^(test/tools/)?vendor/' |
grep -E -v '^version/' |
grep -E -x '.*\.(go|c|h)')
if [[ -z "$filtered_changes" ]]; then
exit 0
fi