Skip to content
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

Bug 1808402: Add yaml editor for values.yaml in helm install form #4513

Merged

Conversation

rohitkrai03
Copy link
Contributor

@rohitkrai03 rohitkrai03 commented Feb 26, 2020

Fixes - https://issues.redhat.com/browse/ODC-3066

This PR -

  • Adds a new formik field that wraps EditYAML component.
  • Updates EditYAML with some new props to configure editor so that it's suitable in a Formik form.
  • Uses /api/helm/chart endpoint to fetch chart details and dump chart values in the yaml editor and then uses that to send payload to helm installation API.

Steps to test this PR -

  • Run ./build-backend.sh on latest master to get the backend API endpoint changes in bridge.
  • Run export HELM_REPOSITORY_CONFIG="/tmp/repositories.yaml" before running ./bin/bridge.

Screenshots -
Screenshot from 2020-02-27 00-34-20

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. component/core Related to console core functionality component/dev-console Related to dev-console component/shared Related to console-shared labels Feb 26, 2020
@rohitkrai03 rohitkrai03 changed the title [WIP] Add yaml editor for values.yaml in helm install form Bug 1808402: Add yaml editor for values.yaml in helm install form Feb 28, 2020
@openshift-ci-robot openshift-ci-robot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Feb 28, 2020
@openshift-ci-robot
Copy link
Contributor

@rohitkrai03: This pull request references Bugzilla bug 1808402, 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.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1808402: Add yaml editor for values.yaml in helm install form

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.

@rohitkrai03
Copy link
Contributor Author

/cherry-pick release-4.4

@openshift-cherrypick-robot

@rohitkrai03: once the present PR merges, I will cherry-pick it on top of release-4.4 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.4

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.

@rohitkrai03 rohitkrai03 force-pushed the helm-yaml-editor branch 2 times, most recently from 982bdac to 3e9c73b Compare February 28, 2020 14:21
@openshift-ci-robot
Copy link
Contributor

@rohitkrai03: This pull request references Bugzilla bug 1808402, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1808402: Add yaml editor for values.yaml in helm install form

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.

Copy link
Contributor

@sahil143 sahil143 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rohitkrai03 Install button is enabled even when yaml and release name is empty
Screenshot from 2020-02-28 20-19-21

@divyanshiGupta
Copy link
Contributor

divyanshiGupta commented Feb 28, 2020

@rohitkrai03 Install button is enabled even when yaml and release name is empty
Screenshot from 2020-02-28 20-19-21

I think its because he removed the !dirty check https://github.com/openshift/console/pull/4513/files#diff-f0de5f537d36f5bc5d39101ea3ea898fL31.

@rohitkrai03 ^^

Copy link
Contributor

@sahil143 sahil143 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rohitkrai03 Height of YAML editor increases after it's rendered and also every time install is clicked.
yaml-editor
yaml-editor-2

Too much whitespace between Yaml Editor and Submit/Cancel button
Screenshot from 2020-02-28 20-37-57

@sahil143
Copy link
Contributor

Also, there is a scrollbar on this page whereas all other Yaml pages throughout console don't have one, probably because Yaml editor itself has scrollbar for code.

@rohitkrai03
Copy link
Contributor Author

@rohitkrai03 Install button is enabled even when yaml and release name is empty
Screenshot from 2020-02-28 20-19-21

Fixed this. Now release name field will always be populated with default value and yaml editor will only be shown if there is values.yaml to show.

@rohitkrai03
Copy link
Contributor Author

@rohitkrai03 Height of YAML editor increases after it's rendered and also every time install is clicked.
yaml-editor
yaml-editor-2

Too much whitespace between Yaml Editor and Submit/Cancel button
Screenshot from 2020-02-28 20-37-57
Fixed.

@rohitkrai03
Copy link
Contributor Author

rohitkrai03 commented Feb 28, 2020

Also, there is a scrollbar on this page whereas all other Yaml pages throughout console don't have one, probably because Yaml editor itself has scrollbar for code.

Other yaml pages let the editor handle create, update or other actions. The hieght is controlled by yaml editor along with the action buttons inside the editor. Now we are using it as a form field instead of self contained page, this is why the action buttons are not fixed at the bottom similar to all other forms that we have.

@rohitkrai03
Copy link
Contributor Author

/assign @christianvogt

@@ -0,0 +1,4 @@
.yaml-editor-formik-field {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.yaml-editor-formik-field {
.ocs-yaml-editor-field {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


const initialValues: HelmInstallFormData = {
releaseName: '',
releaseName: chartName ? `${chartName}-defaulted` : '',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know the screenshot in design has a suffix -defaulted but was this really the intention? Why not default to simply the chart name itself? Was this confirmed with UX or assumed based on screenshot?

cc @Veethika @serenamarie125

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just followed what the UX design doc had in the screenshot assuming that's what the ask was. @serenamarie125 @Veethika can you confirm?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it wasn't explicitly called out, i feel like it was just an artifact of design filling in arbitrary data.

I don't know how a suffix of -defaulted is better than simply the chart name itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to have just the chart name as default pre-populated release name.

Comment on lines 70 to 75
export interface YAMLEditorFieldProps extends FieldProps {
onChange?: (value: string) => void;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do these prop types keep going into this file instead of co-located in the component file itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the components such as DropdownField and NSDropdownField share prop types along with extending the base FieldProps. That is why all the field props are there in one file.

@openshift-ci-robot
Copy link
Contributor

@rohitkrai03: This pull request references Bugzilla bug 1808402, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1808402: Add yaml editor for values.yaml in helm install form

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.

@rohitkrai03
Copy link
Contributor Author

@serenamarie125 This PR - #4507 adds the ability in topology for a helm release to be added in an application group. But according to you we are not allowing that in 4.4. cc: @christianvogt

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Mar 3, 2020
@rohitkrai03
Copy link
Contributor Author

/test e2e-gcp-console

@divyanshiGupta
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 3, 2020
@rohitkrai03
Copy link
Contributor Author

/test e2e-gcp-console

1 similar comment
@rohitkrai03
Copy link
Contributor Author

/test e2e-gcp-console

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@christianvogt
Copy link
Contributor

/lgtm cancel

@rohitkrai03 size of the main vendor bundle has increased big time.

@openshift-ci-robot openshift-ci-robot removed lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 3, 2020
@serenamarie125
Copy link
Contributor

Yup, i'm saying to hide it from the secondary masthead when showing the Install Chart form - we can see it in the animated gifs

@rohitkrai03
Copy link
Contributor Author

rohitkrai03 commented Mar 4, 2020

/lgtm cancel

@rohitkrai03 size of the main vendor bundle has increased big time.

@christianvogt Not sure why that would happen, I am using the yaml editor as an async component. The whole page is on async route. So how would that affect vendor bundle size?

@rohitkrai03
Copy link
Contributor Author

I ran analyze locally on my branch as well as master. Below are the results which seem to be exactly same -

YAML Branch -
Yaml-branch

Master Branch -
Master-branch

@rohitkrai03
Copy link
Contributor Author

/test e2e-gcp-console

@rohitkrai03
Copy link
Contributor Author

rohitkrai03 commented Mar 4, 2020

@christianvogt Seems to be a flake in the test. The job succeeded when I reran it.

@rohitkrai03
Copy link
Contributor Author

/test e2e-gcp-console

@andrewballantyne
Copy link
Contributor

@christianvogt Seems to be a flake in the test. The job succeeded when I reran it.

@rohitkrai03 @christianvogt Yeah... this is unfortunately a known bundle flake. I did briefly express shock to @spadgett about this a while back on a PR... I am still quite confused how a process of bundling is not deterministic. You'd think the items to bundle are static; must be some race condition to bundling x before y... and one gets a better result through uglify or something.

I believe it was related to Pattenfly icons the last time - not sure if that's always the case. Maybe we should look into this for 4.5 and try to cut down on this flake? (it happens pretty frequently)

@christianvogt
Copy link
Contributor

/approve
/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christianvogt, divyanshiGupta, rohitkrai03

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 4, 2020
@openshift-merge-robot openshift-merge-robot merged commit 75b76b9 into openshift:master Mar 4, 2020
@openshift-ci-robot
Copy link
Contributor

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

In response to this:

Bug 1808402: Add yaml editor for values.yaml in helm install form

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-cherrypick-robot

@rohitkrai03: new pull request created: #4642

In response to this:

/cherry-pick release-4.4

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.

@spadgett spadgett added this to the v4.5 milestone Mar 9, 2020
@rohitkrai03 rohitkrai03 deleted the helm-yaml-editor branch March 30, 2020 15:19
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. component/core Related to console core functionality component/dev-console Related to dev-console component/shared Related to console-shared kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet