Skip to content

Conversation

@spadgett
Copy link
Member

@spadgett spadgett commented Nov 4, 2019

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

Snippets let you insert a partial YAML definition at the user's cursor
in the console YAML editor.
@openshift-ci-robot
Copy link

@spadgett: An error was encountered searching for bug 1768542 on the Bugzilla server at https://bugzilla.redhat.com:

Get https://bugzilla.redhat.com/rest/bug/1768542?api_key=CENSORED: dial tcp: i/o timeout
Please contact an administrator to resolve this issue, then request a bug refresh with /bugzilla refresh.

Details

In response to this:

Bug 1768542: Add snippet flag to ConsoleYAMLSample CRD

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.

@openshift-ci-robot openshift-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 4, 2019
@andrewballantyne
Copy link

Thanks for doing this @spadgett

@spadgett
Copy link
Member Author

spadgett commented Nov 4, 2019

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Nov 4, 2019
@openshift-ci-robot
Copy link

@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.

Details

In response to this:

/bugzilla refresh

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
Copy link
Contributor

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?

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.

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.

Copy link
Contributor

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.

@bparees
Copy link
Contributor

bparees commented Nov 4, 2019

/approve

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 4, 2019
@benjaminapetersen
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 4, 2019
@openshift-ci-robot
Copy link

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 9c7826d into openshift:master Nov 4, 2019
@openshift-ci-robot
Copy link

@spadgett: All pull requests linked via external trackers have merged. Bugzilla bug 1768542 has been moved to the MODIFIED state.

Details

In response to this:

Bug 1768542: Add snippet flag to ConsoleYAMLSample CRD

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants