CircleCI-Public / orb-tools-orb

Various tools for authoring and publishing CircleCI orbs
https://circleci.com/orbs/registry/orb/circleci/orb-tools
MIT License
51 stars 76 forks source link

change(review.bats): only run "run" tests on actual run steps #196

Closed danielma closed 1 year ago

danielma commented 1 year ago

I know this used to work before, but recently this review has been failing on all my builds.

The issue is that it's attempting to check non "run" steps against the same validation rules, and causing errors that just output null

I've fixed it here by using select to make sure the check only loops through run steps

orb-publisher commented 1 year ago

Your development orb has been published. It will expire in 30 days. You can preview what this will look like on the CircleCI Orb Registry at the following link: https://circleci.com/developer/orbs/orb/circleci/orb-tools?version=dev:39065431c55b749d1ded9a19d44c16b238522a50

ankorstore-haddowg commented 1 year ago

Had the same issue but only running the BATS checks locally, the orb checks in the CI passed 🤷. seems yq may have altered behaviour? either way this solution or a | select(.has(.run)) | worked for me

danielma commented 1 year ago

Yep, there was some YQ behavior change, and the latest version of the orb is actually pinned to an earlier tag https://github.com/CircleCI-Public/orb-tools-orb/pull/177

ankorstore-haddowg commented 1 year ago

really think the script should be forward-compatible instead... pinning the image is a bit of an odd response... I curl the bats file and use it in a local pre-commit hook to review locally and would like to not have to pin my yq.

KyleTryon commented 1 year ago

Ensuring this change will be present in #181 I will close this PR after #181 has been merged. Thank you for sharing.

KyleTryon commented 1 year ago

It looks like I may be able to merge this without conflict. Going to give it a shot, thank you!