Summary
I would like to be able to conditionally set pr-run-mode based on the branch it is running from.
The primary motivation being that I would like to minimize CI time on regular PRs, while enabling a sort of 'dry run' on release PRs.
Proposal
At the moment, the following configuration options are available, which apply globally for every PR:
[dist]
pr-run-mode = "upload"
pr-run-mode = "plan"
pr-run-mode = "skip"
I am suggesting we allow richer data, so that the behaviour can be changed based on the branch. For example, one way to configure this could be:
[dist]
pr-run-mode = {
"release/*" = "upload",
"renovate/*" = "skip",
"*" = "plan, # fallback
}
Dist would go through each pattern, and stop at the first matching pattern. So in this case, dist would:
- Compile all binaries on any release PR (to perform a dry run)
- Skip entirely Renovate PRs (automated, low risk)
- Use the standard plan mode for all other PRs.
Draft PRs
I would ideally also like to incorporate whether the PR is a draft or not. My typical workflow maintains a release PR at all times in draft mode, and most CI is configured to skip most jobs if the PR is a draft. When the PR is marked as 'ready', then all CI runs as usual. This is rather important since the release PR is updated after every merge to main, which would then consume a lot of CI time.
To incorporate such patterns (and open up possibility of further config), I would suggestion an alternative config:
[dist]
pr-run-mode = [
{ branch = "release/*", draft = true, mode = "skip" },
{ branch = "release/*", mode = "upload" },
{ branch = "renovate/*", mode = "skip" },
# fallback matches everything else
{ mode = "plan" },
]
Implementation
I would be happy to take some time and look at how/if this could be done.
From a backward compatibility perspective, this would be a strict schema expansion. Existing behaviour would be kept.
Summary
I would like to be able to conditionally set
pr-run-modebased on the branch it is running from.The primary motivation being that I would like to minimize CI time on regular PRs, while enabling a sort of 'dry run' on release PRs.
Proposal
At the moment, the following configuration options are available, which apply globally for every PR:
I am suggesting we allow richer data, so that the behaviour can be changed based on the branch. For example, one way to configure this could be:
Dist would go through each pattern, and stop at the first matching pattern. So in this case, dist would:
Draft PRs
I would ideally also like to incorporate whether the PR is a draft or not. My typical workflow maintains a release PR at all times in draft mode, and most CI is configured to skip most jobs if the PR is a draft. When the PR is marked as 'ready', then all CI runs as usual. This is rather important since the release PR is updated after every merge to
main, which would then consume a lot of CI time.To incorporate such patterns (and open up possibility of further config), I would suggestion an alternative config:
Implementation
I would be happy to take some time and look at how/if this could be done.
From a backward compatibility perspective, this would be a strict schema expansion. Existing behaviour would be kept.