-
Notifications
You must be signed in to change notification settings - Fork 113
Description
Description
It would be really nice, in my opinion, for builds with no tasks, or builds where all tasks are SKIPPED, for the CIRRUS_LAST_GREEN_CHANGE not to be updated or changed by these builds. (That the CIRRUS_LAST_GREEN_CHANGE would remain the same as before the build with only skipped tasks, or no tasks, had run.)
This aids in the ability to filter most build types/build triggers to safeguard credits, and follow-up with a cron rule to actually build the repo every so often.
Context
- Builds with no tasks can happen due to the use of
only_if:in.cirrus.yml. - Builds with all skipped tasks can happen due to use of
skip:in.cirrus.yml.
For example, our real-world use-case: we are using only_if: to skip PR and branch push builds, and instead only build our default branch every few days with cron builds. And we are using skip: based on checking CIRRUS_LAST_GREEN_CHANGE to skip if the current commit has already been built before. (We could do both via only_if:, but the result seems to be the same, from some quick testing. I didn't test doing all the skipping logic in skip:, but I expect no difference?) But the cron builds see the skipped branch push builds to our default branch as successful, in terms of the fact that they update CIRRUS_LAST_GREEN_CHANGE. So these cron builds are now skipping as well! We have effectively no builds ever, with our current setup.
Basically I consider it (subjectively) a bug that CIRRUS_LAST_GREEN_CHANGE updates to the commit of these builds which have no tasks scheduled due to only_if:, or all tasks skipped due to skip:.
If there is any concern about breaking existing workflows, then perhaps the info should be presented in a new env var? Perhaps called: CIRRUS_LAST_GREEN_CHANGE_WITH_TASKS?
Anything Else
Similar to previous issue I found, #891.
But unlike that issue, I'm referring to situations where the overall build is reporting asCOMPLETED aka successful, but there were no tasks or all skipped tasks. Whereas I suppose #891 was just about if the entire build was SKIPPED.