Skip to content

Commit 55dd80e

Browse files
vdemeestertekton-robot
authored andcommitted
ci: only run catlin validate when a resource manifest changes
catlin (all versions through HEAD) only registers the tekton.dev/v1beta1 scheme and cannot parse tekton.dev/v1 resources, failing with: no kind "Task" is registered for version "tekton.dev/v1" See tektoncd/catlin#10. The catalog already ships 37 tekton.dev/v1 Tasks. Normal PRs touch a single task and rarely a v1 one, so this went unnoticed. A broad, README-only PR touching nearly every task directory makes the catlin validate gate reduce every changed file to its version directory and validate the whole catalog, hitting v1 resources catlin cannot parse. Filter the changed-file set to resource manifests that live directly in a version directory (task/<name>/<version>/*.yaml) before reducing to the version directory. README/OWNERS-only changes, test manifests under tests/, and files under samples/ no longer trigger validation, so a docs-only change validates nothing and does not fail on catlin's missing v1 support. Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
1 parent 81c9609 commit 55dd80e

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,21 @@ jobs:
4949
env:
5050
PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }}
5151
run: |
52-
# Detect changed task version directories (task/<name>/<version>).
53-
# Reduce every changed file to its version directory so that catlin
54-
# only validates the catalog resource itself, never the test
55-
# manifests under tests/ (TaskRun/Pipeline) or files under samples/,
56-
# which are not catalog resources and would fail validation.
52+
# Detect task version directories (task/<name>/<version>) whose
53+
# resource manifest changed. Only consider YAML files that live
54+
# directly in the version directory (task/<name>/<version>/*.yaml);
55+
# this excludes README/OWNERS-only changes as well as the test
56+
# manifests under tests/ (TaskRun/Pipeline) and files under samples/,
57+
# none of which are catalog resources. Reducing to the version
58+
# directory means catlin only ever validates the catalog resource.
5759
changed_tasks=$(
5860
git --no-pager diff --name-only ${PULL_BASE_SHA}..HEAD | \
61+
{ grep -E '^task/[^/]+/[^/]+/[^/]+\.yaml$' || true; } | \
5962
{ grep -oE '^task/[^/]+/[^/]+' || true; } | \
6063
sort -u
6164
)
6265
if [[ -z "$changed_tasks" ]]; then
63-
echo "No file changes detected in task directories"
66+
echo "No changed task resource manifests detected"
6467
exit 0
6568
fi
6669
# Filter out removed directories
@@ -78,15 +81,16 @@ jobs:
7881
env:
7982
PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }}
8083
run: |
81-
# Detect changed task version directories (task/<name>/<version>).
84+
# Detect task version directories whose resource manifest changed.
8285
# See the note in the "catlin validate" step above.
8386
changed_tasks=$(
8487
git --no-pager diff --name-only ${PULL_BASE_SHA}..HEAD | \
88+
{ grep -E '^task/[^/]+/[^/]+/[^/]+\.yaml$' || true; } | \
8589
{ grep -oE '^task/[^/]+/[^/]+' || true; } | \
8690
sort -u
8791
)
8892
if [[ -z "$changed_tasks" ]]; then
89-
echo "No file changes detected in task directories"
93+
echo "No changed task resource manifests detected"
9094
exit 0
9195
fi
9296
# Script linting is informational (matching previous Prow behavior)

0 commit comments

Comments
 (0)