Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace the goals goal with a help plugin which supports both v1 and v2 #7598

Merged

Conversation

stuhood
Copy link
Member

@stuhood stuhood commented Apr 20, 2019

Problem

In #6880, there will be two types of Goals:

  1. v1 pants.goal.goal.Goals, registered on a singleton
  2. v2 pants.engine.goal.Goals, registered as a ScopeInfo category via @console_rules.

But ./pants goals supports only the first form (via access to the singleton), and would need to dig deep into self.context in order to get access to the scope info (...like ./pants options does: but that's a story for another day!).

Solution

Convert ./pants goals into a plugin to the arg splitter, similar to ./pants help. While the arg-splitter method is not incredibly scalable, it seems like it should be sufficiently scalable to support most of our "meta-goals".

Result

v1 and v2 Goals are supported, we have one fewer v1 Task, and #6880 is unblocked.

@stuhood stuhood force-pushed the stuhood/replace-goals-task-with-help-printer branch from 408b9d6 to eb5d4b9 Compare April 20, 2019 04:41
from pants_test.pants_run_integration_test import PantsRunIntegrationTest


class TestListGoalsIntegration(PantsRunIntegrationTest):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great to unit test instead.

src/python/pants/help/help_printer.py Outdated Show resolved Hide resolved
@stuhood stuhood merged commit d31c194 into pantsbuild:master Apr 20, 2019
@stuhood stuhood deleted the stuhood/replace-goals-task-with-help-printer branch April 20, 2019 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants