re: the discussion of improving `--changed` : have...
# development
w
re: the discussion of improving
--changed
: have been thinking about it for a while, and finally spent the time to put it on paper: https://github.com/pantsbuild/pants/issues/11206
💯 1
f
Is that the flag that is used for CI server?
w
correct: i added a paragraph in there mentioning CI
f
The way I do it at RapidSOS is by building the whole dependency graph manually, then run a graph search for each file if it traceable to python_test targets. We use a github API to get list of files that were changed by the PR, and run the unittests based on that.
w
@fresh-architect-74417: are you currently using
./pants --changed-dependees=transitive list …
?
f
no
I built my own solution.
w
ah.
f
If you want me to explain it to you on hangout, I will be happy to do so.
w
yea, currently using
--changed
would be the recommended approach: https://www.pantsbuild.org/docs/using-pants-in-ci#recommended-commands
possibly! does your approach use
./pants dependencies --transitive
to build the graph?
f
No, I use ast to read BUILD files directly, then build a network graph based on the data structure I get from there.
😄
w
interesting! … yea, honestly i might recommend switching to using the approach from https://www.pantsbuild.org/docs/using-pants-in-ci#recommended-commands , because it will work with dependency inference
f
Only the files that are impacted by the change runs.
I'm doing the same thing, but with a custom script.
w
right, but see my point about dependency inference. the dependencies are not listed in BUILD files in that case... would need to also parse import statements in your code, but that would involve reimplementing what pants already does.
👍 2