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 1806994: fixes issue with editing knative service created via cli #4464

Merged

Conversation

invincibleJai
Copy link
Member

@invincibleJai invincibleJai commented Feb 25, 2020

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

Analysis / Root cause:
Edit flow doesn't work in knative service is created via CLI i.e on edit it doesn't show associated image as pre selected

Solution Description:
if associated imageStreams are not found while editing going with value provided by user in yaml for container image

Screen shots / Gifs for design review:
ezgif com-optimize

Test Coverage
Screenshot 2020-03-09 at 8 59 21 PM

Screenshot 2020-03-09 at 9 38 21 PM

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

@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 Feb 25, 2020
@openshift-ci-robot
Copy link
Contributor

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

In response to this:

Bug 1806994: fixes issue with editing knative service created via cli

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/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 25, 2020
@openshift-ci-robot openshift-ci-robot added component/dev-console Related to dev-console component/knative Related to knative-plugin labels Feb 25, 2020
@openshift-ci-robot
Copy link
Contributor

@invincibleJai: This pull request references Bugzilla bug 1806994, which is valid.

In response to this:

Bug 1806994: fixes issue with editing knative service created via cli

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.

@invincibleJai
Copy link
Member Author

/kind bug

@openshift-ci-robot openshift-ci-robot added kind/bug Categorizes issue or PR as related to a bug. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Feb 25, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 25, 2020
return {
...deployImageInitialValues,
searchTerm: name,
registry: 'external',
Copy link
Contributor

Choose a reason for hiding this comment

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

can we change this to RegistryType.External

Suggested change
registry: 'external',
registry:RegistryType.External,

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

const deployImageInitialValues = {
searchTerm: '',
return {
...deployImageInitialValues,
registry: 'internal',
Copy link
Contributor

Choose a reason for hiding this comment

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

We could use the enum here RegistryType.Internal.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@@ -371,6 +375,17 @@ export const getInitialValues = (
internalImageValues = _.isEmpty(externalImageValues)
? getInternalImageInitialValues(_.get(appResources, 'editAppResource.data'))
: {};
if (
_.isEmpty(externalImageValues) &&
!_.get(internalImageValues, 'imageStream.tag') &&
Copy link
Member

Choose a reason for hiding this comment

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

Can we optional chaining here instead of get function?

Copy link
Member Author

Choose a reason for hiding this comment

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

Chaining would look for type here as above we have {} in case externalImageValues is not empty so added get

internalImageValues = _.isEmpty(externalImageValues)
      ? getInternalImageInitialValues(_.get(appResources, 'editAppResource.data'))
      : {};

Copy link
Member

@vikram-raj vikram-raj left a comment

Choose a reason for hiding this comment

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

/lgtm

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

@invincibleJai if we disable edit for knative service created from outside of dev console. Then we don't need this change, correct? (see #4506)

If we can't ensure that all edit use cases are covered for ksvc created from cli or elsewhere, then I'm still reluctant to make these changes for 4.4 rather than simply disable the action.

@invincibleJai
Copy link
Member Author

invincibleJai commented Feb 28, 2020

@invincibleJai if we disable edit for knative service created from outside of dev console. Then we don't need this change, correct? (see #4506)

yeah we don't need this then.

If we can't ensure that all edit use cases are covered for ksvc created from cli or elsewhere, then I'm still reluctant to make these changes for 4.4 rather than simply disable the action.

yeah i verified but i think for 4.4 we can be consistent to support Edit flow only for the resources created via DevConsole

@invincibleJai
Copy link
Member Author

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 28, 2020
@andrewballantyne
Copy link
Contributor

@invincibleJai @christianvogt is there a reason we are keeping this open & the ticket still targeted for 4.4? I think we can drop both the PR and the ticket back into the backlog / obsolete it because we're not addressing the edit flow on resources not created by the add flow.

@christianvogt
Copy link
Contributor

christianvogt commented Feb 29, 2020

@andrewballantyne
I think it's a valid fix to address editing resources from other sources. I think that's something we will want to address for 4.5.
We can review this and merge it to master for 4.5.
One reason hold it to ensure we don't make it harder for other fixes in this area until 4.4 closes.

We can drop the 4.4 target on the ticket though.

@andrewballantyne
Copy link
Contributor

Will need a rebase @invincibleJai

@invincibleJai invincibleJai force-pushed the fix-kn-svc-cli-edit branch 2 times, most recently from 2a3e875 to 27da1a6 Compare March 9, 2020 15:34
@openshift-ci-robot
Copy link
Contributor

@invincibleJai: This pull request references Bugzilla bug 1806994, 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 1806994: fixes issue with editing knative service created via cli

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.

@karthikjeeyar
Copy link
Contributor

@invincibleJai Verified locally, now edit works well for the knative resource created via cli.
While editing a knative service (created via cli), without making any changes in the form, submit button is enabled, on submitting it creates new revision with newly generated name. Is it by intention?

@invincibleJai
Copy link
Member Author

@invincibleJai Verified locally, now edit works well for the knative resource created via cli.
While editing a knative service (created via cli), without making any changes in the form, submit button is enabled, on submitting it creates new revision with newly generated name. Is it by intention?

yeah even for other flows on edit Submit button is enabled for edit and for knative on edit we create new Image Stream if tag is same as same image may be updated with same tag. If you try a different tag , then new Image Stream won't be created but updated

@karthikjeeyar
Copy link
Contributor

Verified locally, editing works fine for knative services created via cli and webconsole
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 10, 2020
@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed lgtm Indicates that a PR is ready to be merged. labels Mar 11, 2020
@karthikjeeyar
Copy link
Contributor

/lgtm

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

/retest

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

2 similar comments
@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

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

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: invincibleJai, karthikjeeyar, vikram-raj

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

openshift-ci-robot commented Mar 11, 2020

@invincibleJai: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/verify 3a0ccca link /test verify

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@openshift-bot
Copy link
Contributor

/retest

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

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

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

@openshift-merge-robot openshift-merge-robot merged commit ef1163b into openshift:master Mar 11, 2020
@openshift-ci-robot
Copy link
Contributor

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

In response to this:

Bug 1806994: fixes issue with editing knative service created via cli

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 18, 2020
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/dev-console Related to dev-console component/knative Related to knative-plugin 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

9 participants