https://pantsbuild.org/ logo
w

witty-crayon-22786

11/19/2020, 12:28 AM
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

fresh-architect-74417

11/19/2020, 12:41 AM
Is that the flag that is used for CI server?
w

witty-crayon-22786

11/19/2020, 12:42 AM
correct: i added a paragraph in there mentioning CI
f

fresh-architect-74417

11/19/2020, 12:45 AM
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

witty-crayon-22786

11/19/2020, 12:46 AM
@fresh-architect-74417: are you currently using
./pants --changed-dependees=transitive list …
?
f

fresh-architect-74417

11/19/2020, 12:46 AM
no
I built my own solution.
w

witty-crayon-22786

11/19/2020, 12:46 AM
ah.
f

fresh-architect-74417

11/19/2020, 12:47 AM
If you want me to explain it to you on hangout, I will be happy to do so.
w

witty-crayon-22786

11/19/2020, 12:47 AM
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

fresh-architect-74417

11/19/2020, 12:50 AM
No, I use ast to read BUILD files directly, then build a network graph based on the data structure I get from there.
😄
w

witty-crayon-22786

11/19/2020, 12:51 AM
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

fresh-architect-74417

11/19/2020, 12:52 AM
Only the files that are impacted by the change runs.
I'm doing the same thing, but with a custom script.
w

witty-crayon-22786

11/19/2020, 12:54 AM
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