I think <https://github.com/tj-actions/changed-fil...
# development
b
I think https://github.com/tj-actions/changed-files isn't behaving how we expect... https://github.com/pantsbuild/pants/pull/19021 changed two files, but the GHA output has:
affected=$(python build-support/bin/classify_changed_files.py ".github/workflows/auto-cherry-picker.yaml|build-support/bin/cherry_pick.sh|docs/markdown/Python/python/python-lockfiles.md|pants.toml|src/python/pants/backend/python/framework/django/BUILD|src/python/pants/backend/python/framework/django/dependency_inference.py|src/python/pants/backend/python/framework/django/dependency_inference_test.py|src/python/pants/backend/python/framework/django/detect_apps.py|src/python/pants/backend/python/framework/django/detect_apps_test.py|src/python/pants/backend/python/framework/django/scripts/BUILD|src/python/pants/backend/python/framework/django/scripts/dependency_visitor.py|src/python/pants/backend/python/subsystems/python_tool_base.py|src/python/pants/backend/python/subsystems/python_tool_base_test.py|src/python/pants/backend/python/util_rules/BUILD|src/python/pants/backend/python/util_rules/pex.py|src/python/pants/backend/python/util_rules/pex_from_targets.py|src/python/pants/backend/python/util_rules/pex_from_targets_test.py|src/python/pants/backend/python/util_rules/pex_requirements.py|src/python/pants/backend/python/util_rules/pex_test.py|src/python/pants/init/plugin_resolver.py")
CC @happy-kitchen-89482
Solving this may free up some ARM/Mac runners 😂
I'm thinking it's not doing the merge-base calculation correctly?
h
It is not, this has been known for a while
b
ugh
h
it diffs against current main
not against its merge base
b
We should probably fix that 😅
h
yes
It has many knobs and dials but I haven't figured out the right one yet
b
In theory, GHA will be testing the merge commit of PR branch into target branch (i.e. the actual 'current' state of the code, if it was merged)... so diffing against
main
should be right... but maybe it's diffing PR HEAD against
main
HEAD, rather than PR merge against
main
HEAD? We do something similar internally, to detect when
path/of/interest
has changes, but by invoking
git
directly:
Copy code
git diff --exit-code --stat origin/main HEAD  -- path/of/interest
but alternatives like
git diff --name-only ...
and feeding that into the classify-changes script might be an option too.
b
FWIW GitHub itself has the info for the merge base of the default branch
b
I've implemented something like what we do https://github.com/pantsbuild/pants/pull/19045, which seems to simplify things conceptually, I think
b
b
Hm, I don't think so. As I guess you might've noticed, the workflow treats pushes as special, for building wheels, overriding whatever the classification script says (except if it says docs only): https://github.com/pantsbuild/pants/blob/4c708a001b19813fdc1fdbcae6ab7d2010208443/build-support/bin/generate_github_workflows.py#L88 / https://github.com/pantsbuild/pants/blob/4c708a001b19813fdc1fdbcae6ab7d2010208443/.github/workflows/test.yaml#L330-L331
b
Ok just wanted to check
b