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 1846863: Fix runtime error on legacy operand form #5737

Merged
merged 1 commit into from Jun 22, 2020

Conversation

TheRealJon
Copy link
Member

@TheRealJon TheRealJon commented Jun 15, 2020

Legacy operand form k8sCreate catch callback was trying to use err.json.message which doesn't always exist. Update to use err.message which should always be defined since it is initialized by the Error constructor. For safe measure, added a fallback value in case err.message is falsy.

The legacy operand form was also adding a namespace property to every resources before submitting, which was incorrect. Update to only add namespace if model is namespaced.

@openshift-ci-robot openshift-ci-robot added bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Jun 15, 2020
@openshift-ci-robot
Copy link
Contributor

@TheRealJon: This pull request references Bugzilla bug 1846863, 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.6.0) matches configured target release for branch (4.6.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1846863: Fix runtime error on legacy operand 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.

@TheRealJon
Copy link
Member Author

/hold

Was unable to reproduce the original bug, but this is my best guess for the cause since it is the only place in the olm package where we were trying to access a .json property. Hold until I can get more info to reproduce and test this fix.

@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 Jun 15, 2020
@spadgett
Copy link
Member

@TheRealJon Can you force an error by injecting some invalid data before create? Then you might be able to reproduce.

@spadgett
Copy link
Member

Even just

k8sCreate(model, {})

might be enough to see if it blows up on the error handling.

@TheRealJon
Copy link
Member Author

@spadgett Yeah, I'm sure I could make it blow up manually. I just want to verify that this PR actually fixes the linked bug before specifically merging it as a fix.

@openshift-ci-robot
Copy link
Contributor

@TheRealJon: This pull request references Bugzilla bug 1846863, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.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 1846863: Fix runtime error on legacy operand 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.

@TheRealJon
Copy link
Member Author

/hold cancel

Was able to duplicate and confirm a fix for the linked bug. Updated the description to reflect the other changes.

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 16, 2020
@TheRealJon
Copy link
Member Author

cc @spadgett

@@ -520,7 +519,7 @@ export const DEPRECATED_CreateOperandForm: React.FC<OperandFormProps> = ({
const existing = immutableFormData.getIn([...pathToArray(pathBeforeIndex), 0]);
const item = Immutable.Map(existing || {}).setIn(pathToArray(pathAfterIndex), value);
const list = Immutable.List([item]);
onChange(immutableFormData.setIn(pathToArray(pathBeforeIndex), list));
onChange(immutableFormData.setIn(pathToArray(pathBeforeIndex), list).toJS());
Copy link
Member Author

Choose a reason for hiding this comment

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

This is not technically part of the bug fix, but was a problem that I noticed while scanning the code. onChange shouldn't return an Immutable.Map instance.

@TheRealJon
Copy link
Member Author

/assign @spadgett

Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: spadgett, TheRealJon

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 Jun 22, 2020
@openshift-merge-robot openshift-merge-robot merged commit 09cfe19 into openshift:master Jun 22, 2020
@openshift-ci-robot
Copy link
Contributor

@TheRealJon: All pull requests linked via external trackers have merged: openshift/console#5737. Bugzilla bug 1846863 has been moved to the MODIFIED state.

In response to this:

Bug 1846863: Fix runtime error on legacy operand 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.

@spadgett spadgett added this to the v4.6 milestone Jun 24, 2020
@jhadvig
Copy link
Member

jhadvig commented Jul 2, 2020

/cherrypick release-4.5

@openshift-cherrypick-robot

@jhadvig: new pull request created: #5878

In response to this:

/cherrypick release-4.5

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.

@TheRealJon TheRealJon deleted the 1846863-bz branch January 28, 2022 14:24
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/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/olm Related to OLM lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants