[engine] Iterative improvements for`changed` and friends.
Review Request #4269 - Created Sept. 27, 2016 and submitted
|jsirois, nhoward_tw, stuhood, yujiec|
- Kill implied
::on no targets passed in the v2
./pants --enable-v2-engine lista functional no-op to match the behavior of
./pants --enable-v2-engine --changed-parent=HEAD listw/ no changes.
FilesetWithSpec.iter_relative_paths(), a test and utilization in
- Add a
changedintegration test for unclaimed source files.
- Add a
listintegration test for
./pants --enable-v2-engine list.
Can we add a warning here indicating that this behaviour will be removed when v2 becomes the default?
I can't see a good way to trigger an error here in the future, but if you can (perhaps based on differentiating between goals that consume targets, and goals that don't, and then blowing up in TargetRoots?) it would be great to add it.
Probably clearer/more-efficient to use the list constructor here.
This is duped in
_parse_specs... it's a small bit of code, so not a huge issue, but might hint at a larger duplicated codepath I'm not seeing.
Offtopic for today, but it occurs to me that as part of our native support for filesystems operations in the graph, a cleaner way to support this might be to add a native ProductGraph method to "find all subjects of types
(X, Y, Z)below some Node/Selector".
This sortof conflicts with what I've said about the public API of the ProductGraph and Engine (ie: you shouldn't investigate the structure of the graph, as that is an implementation detail). But on the other hand, I think we can safely say that quickly/easily/accurately determining Filesystem/Subsystem dependencies is the entire reason the Engine exists in the first place, so we should do whatever it takes to make this type of usecase easy.
It would be nice to use this in
target.pyor https://github.com/pantsbuild/pants/blob/master/src/python/pants/source/payload_fields.py#L66 , to be doubly sure that it doesn't go out of sync.
Address Stu, Yujie & Nick's feedback + rebase master.