-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feature/plugins: config layout, --plugins flag, and plugin name validation
#1403
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
should run for a subcommand. This option is global. Refactoring of
getBaseFlags -> parseBaseFlags allows multiple global flags to be
parsed for a cli struct. plugin filtering considers short names,
ex. --plugins="go" rather than --plugins="go.kubebuilder.io/v2.0.0".
WithDefaultPlugins sets the default plugins a CLi should use in case
--plugins or the config 'layout' are not set
pkg/model/config: Config support the 'layout' key which indicates the
plugin that scaffolded a project, by plugin key
pkg/plugin: SplitKey, KeyFor, Key, GetShortName are utility functions
for plugin keys
* pkg/{cli,plugin}: add plugin name validation
* pkg/plugin/{v1,v2}: set layout key in config
Please enter the commit message for your changes. Lines starting- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,7 +62,7 @@ project versions (via `SupportedProjectVersions()`). | |
| Example `PROJECT` file: | ||
|
|
||
| ```yaml | ||
| version: "3-alpha" | ||
| version: "2" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ??
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @DirectXMan12
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was pushback against upgrading to "3-alpha". Regardless of whether we bump I figured it was better to make the change in a follow-up.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's ok, but I think if we're gonna make a field mandatory that's a change in version. |
||
| layout: go/v1.0.0 | ||
| domain: testproject.org | ||
| repo: github.com/test-inc/testproject | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
Why we need to:
What is the diff between plugin and default plugin?
What does the default plugin mean? When the default plugin should or not be used?
Is not it redundant?
Uh oh!
There was an error while loading. Please reload this page.
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.
Imagine the case where there are multiple plugins per project version available to a user, ex. two different Go plugins
goandgo-xthat support project version 2:One of those two should be defaulted to in case the user doesn’t set
—pluginsoninitor they don’t have alayoutkey in their config (project version 1). However theCLIwon’t know which it should default to unless one is explicitly set. See #1403 (comment) for more details on why I chose to set defaults explicitly.