Define a lifecycle for Config objects.

Review Request #2920 — Created Oct. 2, 2015 and submitted

jsirois
pants
jsirois/engine/exp/graph/inherit
2302, 2308
2914
2924
8e36536...
pants-reviews
patricklaw, stuhood, zundel
The lifecycle is enforced by `Graph` and includes new support for:
1. Resolved object replacement:
   This is used to implement 2 forms of value inheritance, aka.
   templating.
2. Resolved object validation:
   This gives a first class home for validation logic and ensures the
   full hydrated object closure is available to run that logic against.

Additionally, `Graph` gains support for cycle detection at resolve time
and it now plumbs resolved objects addresses into their `address` field.

 src/python/pants/engine/exp/BUILD                                                  |  23 ++++---
 src/python/pants/engine/exp/addressable.py                                         | 159 ++++++++++++++++++++++++++++++++++++------
 src/python/pants/engine/exp/graph.py                                               |  86 +++++++++++++++++------
 src/python/pants/engine/exp/mapper.py                                              |   2 +-
 src/python/pants/engine/exp/{serializable.py => objects.py}                        |  36 ++++++++++
 src/python/pants/engine/exp/parsers.py                                             |   2 +-
 src/python/pants/engine/exp/targets.py                                             | 186 ++++++++++++++++++++++++++++++++++++++++++++++----
 tests/python/pants_test/engine/exp/examples/graph_test/self_contained.BUILD        |  57 +++++++++++++---
 tests/python/pants_test/engine/exp/examples/graph_test/self_contained.BUILD.json   |   3 +
 tests/python/pants_test/engine/exp/examples/graph_test/self_contained.BUILD.python |   3 +
 tests/python/pants_test/engine/exp/test_graph.py                                   |  15 ++--
 11 files changed, 488 insertions(+), 84 deletions(-)
CI went green here:
  https://travis-ci.org/pantsbuild/pants/builds/83265481
JS
  1. Eric might be interested in particular in the production_thrift_configs abstract target in tests/python/pants_test/engine/exp/examples/graph_test/self_contained.BUILD. This target is "merged" above by the java1 target and serves as an example of a new way to encapsulate - for example - standard deploy_excludes for webapps amongst many other uses.

    1. This is pretty cool. I've kind of put that on the backburner for the moment. It seems that those issues aren't blocking my progress, so I may just wait a while to fix <scope>provided</scope> in our repo.

  2. 
      
JS
ZU
  1. 
      
  2. I don't understand what this bare ApacheThriftConfig is doing here.

    1. Me either - fumble fixed.
      
      I went ahead and added a bunch more tests for all the modules in engine/exp while I was at it.
      These may or may not make things easier to review - hoping they help.
  3. 
      
JS
JS
JS
  1. Submitted TBR @ https://github.com/pantsbuild/pants/commit/50c2d785a7754339af31b0908be09f0f03afb1ad
  2. 
      
JS
JS
JS
JS
Review request changed

Status: Closed (submitted)

Loading...