cirruslabs / cirrus-cli

CLI for executing Cirrus tasks locally and in any CI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"depends on task ... but their only_if conditions are different" warning is too aggressive

anarazel opened this issue · comments

Hi,

cirrus warns about a task depending on another having differing only_if conditions even if the depended-on task does not have an only-if condition.

My use case is having a "sanity check" task that all other tasks depend upon, so we don't start a lot of expensive tasks just to see them all fail due to a compilation failure or such.

Most of our tasks have an only_if condition that allows tasks to be skipped based on extra contents in the commit message:

  depends_on: SanityCheck
  only_if: $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*freebsd.*'

obviously we can't have that exactly that condition in SanityCheck.

I don't want to use skip: instead of only_if, because indicating that the tasks passed would provide false assurance. I could live with using skip: SanityCheck, but that's not sufficient to make the warning go away.

Perhaps the warning could check if the depended-on has an only_if at all?

Regards,

Andres

Example task showing the warnings: https://cirrus-ci.com/build/5616229361123328

Related PR: #543.

Thanks!