Skip to content

Commit

Permalink
Bit more verbose output from the switchboard task
Browse files Browse the repository at this point in the history
Makes it easier to debug eventual issues and makes it easier to fine
tune expressions.
  • Loading branch information
zregvart committed Dec 20, 2024
1 parent 734d196 commit cab9bea
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .tekton/tasks/task-switchboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)"

0 comments on commit cab9bea

Please sign in to comment.