Do we have any goals that take user input before r...
# general
w
Do we have any goals that take user input before running?
h
Not as far as I know. Input is expected to be provided by CLI specs or options.
Interactive input? Or could you hijack CLI specs for this? You could capture them before they're interpreted as target addresses.
f
What’s the context?
That is, what sort of user input are you collecting?
w
A built-in goal, or a goal rule (honestly don't know yet) for the
pants plugin
API (I saw Andreas had a PR about this too, which I need to investigate). https://github.com/pantsbuild/pants/discussions/20910 Doing
pants plugin init --type linter ...
is pretty trivial, but for new users, I think it would be a nicer experience ala
create-react-app
or
yeoman
or a variety of other tools to walk them through questions, rather than having them declare.
Step 1 is just full options-based from the CLI, but interaction would be the end goal
h
I don't see any reason not to do this
w
For sure, but unsure how we would handle an interactive use case
More accurately, I haven't thought about how we would handle the interactive use case - so I was checking if I could copy/paste from elsewhere. but, the variant that is all at the command line is DEFINITELY happening either way
c
experimental-deploy
on terraform eventually launches an InteractiveProcess which exposes the underlying
terraform
process, including prompts for confirmation and undefined variables
w
🤯
Well... That was easy...
😲 2
Though, I don't think a goal rule is the correct approach here - this isn't supposed to be chainable, and it needs to control the CLI in order to read subsequent "subcommands"
pants plugin init
for example
c
could use the separator like
pants plugin -- init
instead?
w
Yep, still can end up being
pants lint fmt plugin
- There is a PR open for allowing plugins to create BuiltinRules (https://github.com/pantsbuild/pants/pull/20913) and a bikeshed on the naming https://github.com/pantsbuild/pants/discussions/20931 I'm gonna hack on this as a plugin, but it'll probably be better suited as a builtin, if I can still do the same interactive stuff.
Yeah, builtingoal doesn't like my moves
Copy code
Exception: Side-effects are not allowed in this context: SideEffecting types must be acquired via parameters to `@rule`s.