From cab9bea3a155da70eb32525bce51c3f213289c6c Mon Sep 17 00:00:00 2001 From: Zoran Regvart Date: Fri, 29 Nov 2024 15:41:29 +0100 Subject: [PATCH] Bit more verbose output from the switchboard task Makes it easier to debug eventual issues and makes it easier to fine tune expressions. --- .tekton/tasks/task-switchboard.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.tekton/tasks/task-switchboard.yaml b/.tekton/tasks/task-switchboard.yaml index 1ad0d93ae8..b4cb4a2495 100644 --- a/.tekton/tasks/task-switchboard.yaml +++ b/.tekton/tasks/task-switchboard.yaml @@ -46,10 +46,15 @@ spec: ec opa check --v1-compatible "${rules}" - pr_number=$(gh search prs --repo konflux-ci/build-definitions "$(params.revision)" --json number --jq '.[].number') + pr_number="$(gh search prs --repo konflux-ci/build-definitions "$(params.revision)" --json number --jq '.[].number')" - ec opa eval --v1-compatible --data "${rules}" --input \ - <(gh pr view "https://github.com/konflux-ci/build-definitions/pull/${pr_number}" --json files --jq '[.files.[].path']) \ + echo "Determined pull request number ${pr_number}" + + changed="$(gh pr view "https://github.com/konflux-ci/build-definitions/pull/${pr_number}" --json files --jq '[.files.[].path'])" + echo Changed files: + echo "${changed}" | jq -r '.[]' + + echo "${changed}" | ec opa eval --v1-compatible --data "${rules}" --stdin-input \ 'data[_]' \ | jq '[.result.[].expressions.[].value | to_entries | .[] | select(.value == true) | .key]' \ | tee "$(results.bindings.path)"