-
Notifications
You must be signed in to change notification settings - Fork 585
Bug 1768542: Add snippet flag to ConsoleYAMLSample CRD
#509
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
Conversation
Snippets let you insert a partial YAML definition at the user's cursor in the console YAML editor.
|
@spadgett: An error was encountered searching for bug 1768542 on the Bugzilla server at https://bugzilla.redhat.com:
DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
Thanks for doing this @spadgett |
|
/bugzilla refresh |
|
@spadgett: This pull request references Bugzilla bug 1768542, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
| Description ConsoleYAMLSampleDescription `json:"description"` | ||
| // yaml is the YAML sample to display. | ||
| YAML ConsoleYAMLSampleYAML `json:"yaml"` | ||
| // snippet indicates that the YAML sample is not the full YAML 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.
So this implies its a snippet that can be injected into whatever bit of yaml is already loaded into the window? I assume if there is no yaml loaded it can't be injected? would it overwrite existing bits of yaml if there is a collision?
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.
The snippets currently are coded to be a YAML insert rather than a YAML replace. So if you have "no content" (a blank YAML) the snippet would just insert the lines as the first set of content.
It does no validation when being inserted.
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 should note, it will replace any highlighted text as well. So if you select all your YAML and do an insert of a snippet - it'll effectively replace the content. Which likely is not the desire, since a snippet is unlikely to have the necessary top-level properties to work (but nothing stops it from doing so).
It's an open ended addition to the way Samples work. They exist as another tab in the UI so one can pick from samples or snippets independently.
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.
Makes sense. Sounds like could be a bit gnarly usability at first, but fine once you get the hang of it.
|
/approve |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: benjaminapetersen, bparees, spadgett The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@spadgett: All pull requests linked via external trackers have merged. Bugzilla bug 1768542 has been moved to the MODIFIED state. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Snippets let you insert a partial YAML definition at the user's cursor in the console YAML editor.
/assign @bparees @benjaminapetersen
cc @andrewballantyne @christianvogt @sspeiche