From a92dca09f6c566d1792db34d46be17a968c72092 Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Wed, 1 Jul 2026 16:44:24 +0200 Subject: [PATCH] ci: only run catlin validate on the resource version directory The catlin validate gate (added when catlin lint moved from Prow to GitHub Actions) reduced every changed file to its containing directory via `dirname` and passed the result to `catlin validate`. For a new task version this includes the `tests/` and `tests/fixtures/` subdirectories, so catlin ends up validating the test manifests (a `TaskRun` or `Pipeline`) as if they were catalog resources: FILE: task///tests/run.yaml ERROR: Resource path is invalid; expected path: pipeline/... ERROR: Pipeline "..." must have a label "app.kubernetes.io/version" ... catlin also errors with "unknown kind TaskRun" for TaskRun-based tests, so any new task version that ships a tests/run.yaml fails the gate. No new task version had been added since the gate landed, so this went unnoticed. Reduce each changed path to its `task//` version directory instead. catlin validates only the catalog resource in that directory and does not descend into tests/ or samples/, which are not catalog resources. The existing `[[ -d ]]` filter still drops removed directories and non-directory matches such as task//OWNERS. Signed-off-by: Vincent Demeester --- .github/workflows/ci.yaml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f76dea2ac4..4f079d3db4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -49,11 +49,14 @@ jobs: env: PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }} run: | - # Detect changed task directories + # Detect changed task version directories (task//). + # Reduce every changed file to its version directory so that catlin + # only validates the catalog resource itself, never the test + # manifests under tests/ (TaskRun/Pipeline) or files under samples/, + # which are not catalog resources and would fail validation. changed_tasks=$( git --no-pager diff --name-only ${PULL_BASE_SHA}..HEAD | \ - { grep 'task/[^/]*/[^/]*/' || true; } | \ - xargs -I {} dirname {} | \ + { grep -oE '^task/[^/]+/[^/]+' || true; } | \ sort -u ) if [[ -z "$changed_tasks" ]]; then @@ -75,11 +78,11 @@ jobs: env: PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }} run: | - # Detect changed task directories + # Detect changed task version directories (task//). + # See the note in the "catlin validate" step above. changed_tasks=$( git --no-pager diff --name-only ${PULL_BASE_SHA}..HEAD | \ - { grep 'task/[^/]*/[^/]*/' || true; } | \ - xargs -I {} dirname {} | \ + { grep -oE '^task/[^/]+/[^/]+' || true; } | \ sort -u ) if [[ -z "$changed_tasks" ]]; then