Skip to content

Conversation

yozaam
Copy link
Contributor

@yozaam yozaam commented Sep 7, 2021

Fixes:

https://issues.redhat.com/browse/ODC-6300

Analysis / Root cause:

https://issues.redhat.com/browse/ODC-6300?focusedCommentId=18891580&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-18891580

As mentioned here -> the local state is not getting updated with the env values coming from reload ( from formData )

Solution Description:

added hook to set local state when the envs prop changes

Screen shots / Gifs for design review:

reloadResetEnvironment

Unit test coverage report:

Test setup:

Steps to Reproduce

  1. Create a devfile
  2. Go to build tab -> Edit BuilldConfig form
  3. Add a config map "devfile-sample-1-ca" in the environment section and save it
  4. Switch to YAML view and change the config map to "devfile-sample-1-global-ca"
  5. Return to Form view and click on Reload button
  • Expected results:
    • Config map should be restored to "devfile-sample-1-ca"

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

@openshift-ci openshift-ci bot added the bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. label Sep 7, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 7, 2021

@yozaam: This pull request references Bugzilla bug 2001804, 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.10.0) matches configured target release for branch (4.10.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 2001804: Reload feature on Environment section in Build Config form does not work properly

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 openshift-ci bot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Sep 7, 2021
@openshift-ci openshift-ci bot added the component/shared Related to console-shared label Sep 7, 2021
@yozaam
Copy link
Contributor Author

yozaam commented Sep 8, 2021

/cc @nemesis09

@openshift-ci openshift-ci bot requested a review from nemesis09 September 8, 2021 05:48
@yozaam
Copy link
Contributor Author

yozaam commented Sep 15, 2021

/retest-required

@nemesis09
Copy link
Contributor

/retest

4 similar comments
@nemesis09
Copy link
Contributor

/retest

@nemesis09
Copy link
Contributor

/retest

@yozaam
Copy link
Contributor Author

yozaam commented Sep 16, 2021

/retest

@yozaam
Copy link
Contributor Author

yozaam commented Sep 20, 2021

/retest

@nemesis09
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 29, 2021
@invincibleJai
Copy link
Member

@yozaam I see one issue with the configMap key not getting persisted in form view. PTAL at the attached gif

Kapture 2021-09-29 at 20 21 13

Copy link
Member

Choose a reason for hiding this comment

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

i think we memoize it and use environmentVariables directly in useEffect as well

Suggested change
const environmentVariables = getEnvironmentVariables(envs);
const environmentVariables = React.useMemo(() => {
return !_.isEmpty(envs) ? envs.map((env) => _.values(env)) : [['', '']];
},[envs])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

alright, trying it now

regarding configMap key, can I make a new issue ?
when we select the key on latest master branch also it doesn't appear

Copy link
Member

Choose a reason for hiding this comment

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

yeah, we can log a new one for that.

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 believe the issue was caused because a prop had the name key which is reserved by React
changed the prop to pairKey

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 30, 2021
@openshift-ci openshift-ci bot added the component/core Related to console core functionality label Sep 30, 2021
@debsmita1
Copy link
Contributor

tried this out locally
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 30, 2021
@invincibleJai
Copy link
Member

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 1, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: debsmita1, invincibleJai, nemesis09, yozaam

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 1, 2021
@openshift-merge-robot openshift-merge-robot merged commit 39ac721 into openshift:master Oct 1, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 1, 2021

@yozaam: All pull requests linked via external trackers have merged:

Bugzilla bug 2001804 has been moved to the MODIFIED state.

In response to this:

Bug 2001804: Reload feature on Environment section in Build Config form does not work properly

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.10 milestone Oct 7, 2021
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-low Referenced Bugzilla bug's severity is low 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/core Related to console core functionality component/shared Related to console-shared lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants