[engine] Pass selectors to select nodes; Use selectors in error messages

Review Request #4031 - Created July 18, 2016 and submitted

Information
Nick Howard (Twitter)
pants
3611
Reviewers
pants-reviews
jsirois, patricklaw, stuhood, zundel

Currently selectors are dropped when select nodes for task nodes are instantiated. This means that if a selector fails to match, the error message can't reproduce the selector.

This changes the select nodes so that they are passed the selector and can reuse it for producing error messages. It additionally overrides the __repr__ implementations for selectors so they'll be displayed similarly to how they were declared.

Currently a select failure will look like this:

Noop(msg=u"No source of SelectNode(subject=PathGlobs(dependencies=(PathDirWildcard(canonical_stat=Dir(path=u''), symbolic_path=u'', wildcard=u'fs_test', remainder=u'a/b/*'),)), product=<class 'pants_test.engine.test_isolated_process.Concatted'>, variants=None, variant_key=None).").

With the repr and message changes, it looks like this:

Noop(msg=u"No source of SelectNode(subject=PathGlobs(dependencies=(PathDirWildcard(canonical_stat=Dir(path=u''), symbolic_path=u'', wildcard=u'fs_test', remainder=u'a/b/*'),)), variants=None, selector=Select(Concatted)).")

CI away on PR.

Issues

  • 0
  • 0
  • 2
  • 2
Description From Last Updated
Stu Hood
Nick Howard (Twitter)
Stu Hood
Nick Howard (Twitter)
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted as https://github.com/pantsbuild/pants/commit/c08c8126402772840d66d392a2217a9371a363d0
Loading...