-
Notifications
You must be signed in to change notification settings - Fork 71
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
pack subcommands #93
pack subcommands #93
Conversation
[alternatives]: #alternatives | ||
|
||
- Keep it as it is. | ||
- Some [Config](#config) subcommands could be more intertwined with their respective resource. For example, `pack builder trust ...` instead of `pack config trust-builder ...`. |
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.
Another alternative is that pack config
could be a command where the first argument is the resource ala pack config:set <resource>
.
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.
That might get tricker b/c some of the config options have context specific usage. Example: setting a run-image-mirror requires and extra arg because you need to know what run-image you are mirroring.
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.
Made my best attempt at trying to prototype what this could look like here. Wasn't able to come up with a favorable format IMO.
I do agree with the motivations behind this RFC. Probably due to using the Heroku CLI, I have a preference for not using space and it's clearer to me. |
text/0000-pack-subcommands.md
Outdated
There would also be some alias subcommands for the `app` set of subcommands for easier usage and compatibility. | ||
|
||
* `pack build` -> `pack app build` | ||
* `pack inspect` -> `pack app inspect` |
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.
I like the pack build
and pack rebase
aliases but I think having a pack inspect
that can't inspect builders would be confusing. I instead of making it smarter (which might fall apart if someday we can inspect things that aren't images) I think we should just remove this alias.
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.
Based on some discussions I think we want to move to where pack inspect
can auto-detect the image resource type and display the appropriate information. For example, pack inspect <builder>
will display builder info, pack inspect <app-image>
will display app image information, etc.
[alternatives]: #alternatives | ||
|
||
- Keep it as it is. | ||
- Some [Config](#config) subcommands could be more intertwined with their respective resource. For example, `pack builder trust ...` instead of `pack config trust-builder ...`. |
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.
That might get tricker b/c some of the config options have context specific usage. Example: setting a run-image-mirror requires and extra arg because you need to know what run-image you are mirroring.
Signed-off-by: Javier Romero <rjavier@vmware.com>
Signed-off-by: Javier Romero <rjavier@vmware.com>
Signed-off-by: Javier Romero <rjavier@vmware.com>
Signed-off-by: Javier Romero <rjavier@vmware.com>
cfe0da8
to
a69fecf
Compare
Signed-off-by: Javier Romero <rjavier@vmware.com>
text/0000-pack-subcommands.md
Outdated
completion | ||
config | ||
default-builder | ||
set |
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.
so for this one, the command would be pack config default-builder set <value>
?
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.
Yes, that's correct.
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.
Can we consider pack config default-builder=<value>
?
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.
Is there a proposed similar solution to unsetting? Alternative to pack config default-builder unset
.
Maybe, since it's an uncommon operation, it can simply be a flag?
# set resource
pack config default-builder=<builder-name>
# unset resource
pack config default-builder --unset
# get
pack config default-builder
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.
@jromero is this a change you're hoping to make in the RFC?
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.
I personally prefer pack config default-builder set <value>
to pack config default-builder=<builder-name>
. Using the verb allow for more natural/consistent extension if we ever want to include other verbs. For example imagine a future where we want additional operations on set (in the other sense) values like pack config trusted-builders add <value>
.
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.
If other folks really don't like the verbs I will concede but even in that case I would prefer pack config default-builder <builder-name>
to pack config default-builder=<builder-name>
. Having an =
in a positional argument bugs me for some reason.
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.
@ekcasey I think that's b/c in unix tooling you usually see it on flags and not position args. Take ls
for instance:
--format=WORD
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.
Changes in this regard have been made to the RFC. Please re-review.
text/0000-pack-subcommands.md
Outdated
completion | ||
config | ||
default-builder | ||
set |
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.
Yes, that's correct.
Signed-off-by: Javier Romero <rjavier@vmware.com> Co-authored-by: David Freilich <dfreilich@vmware.com>
Signed-off-by: Javier Romero <rjavier@vmware.com>
Signed-off-by: Javier Romero <rjavier@vmware.com>
Signed-off-by: Javier Romero <rjavier@vmware.com>
Signed-off-by: Javier Romero <rjavier@vmware.com>
Signed-off-by: Javier Romero <rjavier@vmware.com>
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.
Overall, definitely a fan. I think there was a bit of a regression with inspect
, so I'd appreciate a clarification there, but 🥳
remove | ||
list | ||
help | ||
inspect |
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.
We currently have both pack inspect-image
and pack inspect-builder
. What would you envision with this inspect
command?
|
||
##### Singular | ||
|
||
Singular resources would have no subcommands but accept possitional arguments and flags with an implied `get` operation and a common `--unset` flag. |
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.
Singular resources would have no subcommands but accept possitional arguments and flags with an implied `get` operation and a common `--unset` flag. | |
Singular resources would have no subcommands but accept positional arguments and flags with an implied `get` operation and a common `--unset` flag. |
pack config default-builder --unset | ||
|
||
# gets the default builder | ||
pack config default-builder |
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.
If there is none set, what should the default behavior be? Should it run pack suggest-builders
?
- Only allow manual edits of config file. | ||
- A `config` command would allow providing `help` for possible operations and argument values. | ||
- Some [Config](#config) subcommands could be more intertwined with their respective resource. For example, `pack builder trust ...` instead of `pack config trust-builder ...`. | ||
- Other commands are operations on the resource whereas having `config` subcommands would make it more obvious that |
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.
I like this point a lot. I think it makes the UX a bit more sensible, though sometimes wordy.
Moving this to Final Comment Period to close on Sept. 9, 2020. |
Readable