-
-
Notifications
You must be signed in to change notification settings - Fork 636
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
Rename @console_rule
to @goal_rule
#8942
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little bit of a heavy-handed change, so I would like to see many approvals before this got merged; but I agree with the reasoning and I think this change would help for teachability of the pants concepts to new contributors 😄
Good stuff, Eric! I’m onboard with
Given that I’m still new to Pants V2, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍 (for the same reasons you and others have already touched on)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really well-thought-out argument. Thank you for taking the time to describe it so clearly!
3b1d8e9
to
17ba88e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me.
Not to throw a wrench in the works, but: did you consider just @goal
...? I'd be fine with either
I'd vote for |
Any time that you add a new top-level goal in V2—that is a "verb" for Pants like
test
,fmt
,setup-py
, anddependencies
—you must define the same three basic things:One of those does not fit with the other two. In contrast, these three all belong:
What is an
@console_rule
?There are (at least) 3 ways of conceptualizing what an
@console_rule
means:Console
.@console_rules
can write to stdout and stderr.@console_rule
.@console_rules
and contrasts with normal@rules
.@console_rule
not returning aGoal
#8931 (comment), this idea on uncachability is the main mental model for some.engine.goal.Goal
.All three of these properties are true and important components of an
@console_rule
. However, I argue that #3 is the most important: fundamentally, an@console_rule
is a special rule that hooks up to a Pants goal.Right now, the name
@console_rule
optimizes for property #1. In contrast,@goal_rule
focuses on property #3.(NB: all three of these properties will continue applying regardless of the name)
Leveraging prior Pants knowledge
Most Pants users are familiar with the idea of a goal. It's the very first concept introduced in our docs and every single Pants run involves invoking goals, regardless of V1 vs. V2.
In contrast, fewer users are familiar with the
Console
abstraction, which is never mentioned in our docs and is more of an implementation detail for how V2 Pants works.We do expect users to soon write their own rules in plugins. The name
@goal_rule
will allow them to leverage their prior knowledge, just assubsystem_rule
leverages prior knowledge better thanoptionable_rule
did.