ci: Reduce CI for draft pull requests - #157360
Conversation
|
I'm -1 on this. I fear it may lead to surprises, since we're skipping jobs, and it also complicates our workflows quite a bit. I also don't see much benefit. The JIT workflows only run in very specific scenarios (that is, when you're working on the JIT) and I presume that in those cases you'd want all of them to run. The mypy jobs only take a few seconds, so I'm not sure we're saving much there either. And finally, cutting most of the tests seems counterproductive as draft PRs will no longer be particularly useful. Also, do we really have that many draft PRs? I suppose Hugo can probably get some stats from Datadog on their CI usage. |
|
Ok, so if I understand correctly, this is targeted at people running CI on their forks, rather than on I'm still not convinced this would be desirable for users. I know some people run CI on their fork before opening a PR, to ensure there are no failures. That would no longer be reliable.
Indeed, in that case you'll get duplicate runs. We could add skips for one when both are true to avoid the duplicates, but that's also a little messy. It would cut the number of runs for a PR opened in a fork down by half. You can, however, also make such changes only in your fork.
That seems like a better solution to me, as users who are concerned about their usage can selectively disable workflows they don't need. I think that's far better than making that decision for them. We could perhaps document this in the devguide?
Currently, we're provided with an unlimited number of Actions minutes (at least for
In |
|
After checking, I found that only the lint workflow was triggered by both https://github.com/methane/cpython/actions/runs/34736727947/job/103669363596 I do get the impression that GitHub Actions has become less reliable, but let's leave things as they are until Microsoft reduces the free allowance. |

Summary
Reduce GitHub Actions load while a pull request is still a draft.
Testsworkflow still computes the changed-file context, but draft PRs suppress the expensive platform/test outputs.Lintremains unchanged and continues to run on draft PRs.mypyand tail-call matrices are skipped for draft PRs.ready_for_review, and a small dispatcher starts the fullTestsworkflow on the PR branch.Motivation
Large experimental changes often get many incremental pushes while they are still under development. Running the complete CPython CI matrix for each of those pushes consumes substantial runner capacity while providing relatively little additional signal. Draft PRs already communicate that the change is not ready for full review, so they are a useful boundary for lightweight vs. full CI.
This keeps early feedback (lint plus a representative JIT build/test when JIT-related files change) while deferring the expensive cross-platform matrices until the author explicitly marks the PR ready.
Behavior
Draft PR push:
Ready for review:
Pushes to
main, manual workflow dispatches, and non-draft PRs keep the existing behavior.