-
Notifications
You must be signed in to change notification settings - Fork 0
ROX-31367: Filter operator-index-pipelines more robust #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kurlov
merged 18 commits into
master
from
akurlov/ROX-31367-filter-only-operator-index-pipeline-validate-release
Jan 22, 2026
+69
−1
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1cdeb23
Filter operator-index-pipelines more robust
kurlov bda48e7
Add CI task to checks to validate pipeline naming scheme
kurlov 00af41a
Update image
kurlov 98eb9cb
Use image with yq installed
kurlov 2968e55
Apply suggestions from code review
kurlov 4915783
Add ok message
kurlov 351970c
Rename task
kurlov c942aff
Fix task start
kurlov 453cdc8
Add retries
kurlov 19eb10c
Add debug
kurlov 50cedc4
Add debug
kurlov 998a295
Add debug
kurlov 0f42f72
refactor counting
kurlov 39faef1
Looking for sanity
kurlov 1847bdd
Looking for sanity 2
kurlov 06323db
While ifs instead
kurlov b6c17a1
Remove debugging
kurlov 3721007
Use for loop for files
kurlov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| apiVersion: tekton.dev/v1 | ||
| kind: Task | ||
| metadata: | ||
| name: validate-pipeline-files | ||
| namespace: rh-acs-tenant | ||
| spec: | ||
| description: Validates that the number of .tekton/operator-index-ocp-*-build.yaml files matches the number of operator-index pipelines. This enforces the naming scheme for pipeline files. | ||
| params: | ||
| - name: SOURCE_ARTIFACT | ||
| description: The Trusted Artifact URI pointing to the artifact with | ||
| the application source code. This should be the result of the git-clone task, | ||
| results from other tasks might fail as dirty. | ||
| type: string | ||
| volumes: | ||
| - name: workdir | ||
| emptyDir: { } | ||
| stepTemplate: | ||
| volumeMounts: | ||
| - mountPath: /var/workdir | ||
| name: workdir | ||
| steps: | ||
| - name: use-trusted-artifact | ||
| image: quay.io/redhat-appstudio/build-trusted-artifacts:latest@sha256:9b180776a41d9a22a1c51539f1647c60defbbd55b44bbebdd4130e33512d8b0d | ||
| args: | ||
| - use | ||
| - $(params.SOURCE_ARTIFACT)=/var/workdir/source | ||
| - name: validate-pipeline-files | ||
| image: quay.io/konflux-ci/release-service-utils:latest@sha256:2f9e6863e82bbc9ddce5a290f3fd0e87657c475e3de8a832b2ef7f8d0671e7d3 | ||
| workingDir: /var/workdir/source | ||
| script: | | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| echo "Validating pipeline files..." | ||
|
|
||
| named_files_count=$(find .tekton -maxdepth 1 -name 'operator-index-ocp-*-*-build.yaml' -type f | wc -l | tr -d ' ') | ||
| echo "Found $named_files_count files matching pattern .tekton/operator-index-ocp-*-*-build.yaml" | ||
|
|
||
| pipelines_count=0 | ||
| for file in .tekton/*.yaml; do | ||
| if yq eval '.spec.pipelineRef.name == "operator-index-pipeline"' "$file" 2>/dev/null | grep -q "true"; then | ||
| pipelines_count=$((pipelines_count + 1)) | ||
| fi | ||
| done | ||
| echo "Found $pipelines_count files with .spec.pipelineRef.name == 'operator-index-pipeline'" | ||
|
|
||
| if [[ "$named_files_count" -ne "$pipelines_count" ]]; then | ||
| echo >&2 "ERROR: The number of .tekton/operator-index-ocp-*-*-build.yaml files ($named_files_count) does not match" | ||
| echo >&2 " the number of files with .spec.pipelineRef.name == 'operator-index-pipeline' ($pipelines_count)" | ||
| echo >&2 "" | ||
| echo >&2 "All pipeline files referencing 'operator-index-pipeline' must follow the naming scheme:" | ||
| echo >&2 " .tekton/operator-index-ocp-vX-Y-build.yaml" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Pipeline file naming validation passed: $pipelines_count files" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.