Convert change detection to a Python script #129627
Open
+242
−106
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The change detection workflow is becoming increasingly complex.
We have grown from a fairly simple
grep
command to skip documentation files (#19983) to a large and complex shell script (embedded within a YAML document), indeed one sufficiently complex to merit a dedicated workflow file (#122336)A potted history of significant revisions is thus:
CODEOWNERS
update #128754reusable-change-detection.yml
onworkflow_dispatch
#122966regexp
inbuild.yml
to not trigger the jobs on*.md
and*.ini
files. #120435There are further proposed changes, such as skipping Windows tests on changes to the Unix build configuration:
configure
/Makefile
changes #128446Even having recently improved readability of the central
grep
command (#128754), this workflow remains difficult to correctly modify (#128450).This PR converts the core logic into a short Python script,
Tools/build/compute-changes.py
, which determines which workflows to run. I imagine this will make it easier to introduce future conditional workflows, which we should probably adopt more of to reduce time and resources spent waiting for CI.I have reused the "changed files" logic introduced in #108065, meaning we can also combine the duplicative MSI and Docs changes steps, which reduces the overall work done.
I've tested this quite a bit on my fork and detection works well, as does workflow dispatch.
A
cc @webknjaz (sorry for the ping; I can't request-review)