Set more attributes in RULES
Problem to solve
Id like to conditionally apply a cache policy of pull, or pull-push to cut minutes off pipelines, when I know the cache doesnt need to change. Specifically, when node_modules change. So there are rules for changes to, lets say package-lock.json. Currently, to have jobs conditionally do cache policy push or push-pull, you have to duplicate the same job, but set the opposite rule for changes to a watched file hash and set desired cache policy.
Intended users
I think conditionals and the rules feature is nice but extremely limited in the attributes it effects. I think you've done the hard part of the permutation on WHEN attribute for individual jobs. Developers and DevOps could probably find several uses for conditional attributes outside of when related attributes.
User experience goal
Reduce job declaration and duplication. Having conditionals on other job attributes would reduce the overall job numbers and tracking the diffs between them when we need conditionals.
Proposal
Allow more or all attributes to be over-ridden within the conditional block of rules. just as WHEN gets set in the conditional, other attributes could be as well.
Further details
- Conditionally setting the cache-policy.
- Conditionally setting the archive or cache locations
Permissions and Security
Consistent with current policies, no changes required.