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

OCPBUGS-26566: Page fails to return to the Secrets list after clicking 'Cancel' on any Secret creation page #13504

Conversation

cyril-ui-developer
Copy link
Contributor

Before:

Screenshot 2024-01-12 at 8 56 26 AM
Screenshot 2024-01-12 at 8 56 42 AM

After:

Screenshot 2024-01-12 at 8 54 30 AM
Screenshot 2024-01-12 at 8 54 54 AM

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jan 12, 2024
@openshift-ci-robot
Copy link
Contributor

@cyril-ui-developer: This pull request references Jira Issue OCPBUGS-26566, which is invalid:

  • expected the bug to target the "4.16.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Before:

Screenshot 2024-01-12 at 8 56 26 AM
Screenshot 2024-01-12 at 8 56 42 AM

After:

Screenshot 2024-01-12 at 8 54 30 AM
Screenshot 2024-01-12 at 8 54 54 AM

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 openshift-eng/jira-lifecycle-plugin repository.

@cyril-ui-developer
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jan 12, 2024
@openshift-ci-robot
Copy link
Contributor

@cyril-ui-developer: This pull request references Jira Issue OCPBUGS-26566, which is valid. The bug has been moved to the POST state.

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

Requesting review from QA contact:
/cc @XiyunZhao

In response to this:

/jira 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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the component/core Related to console core functionality label Jan 12, 2024
@sg00dwin
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 12, 2024
Copy link
Member

@TheRealJon TheRealJon left a comment

Choose a reason for hiding this comment

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

Removing the onCancel prop from this component changes the API. I'm not sure this is necessary to fix the bug. It might cause regressions if it's being used anywhere. Also, if this prop is going to be removed, the component prop types need to be updated as well.

@@ -272,7 +273,7 @@ export const SecretFormWrapper: React.FC<BaseEditSecretProps_> = (props) => {
errorMessage={error || ''}
inProgress={inProgress}
submitText={t('public~Create')}
cancel={props.onCancel || defaultCancel}
cancel={cancel}
Copy link
Member

Choose a reason for hiding this comment

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

We probably need to keep the original logic using props.onCancel.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We probably need to keep the original logic using props.onCancel.

Please can you explain why?

type="button"
variant="secondary"
id="cancel"
onClick={onCancel || defaultCancel}
Copy link
Member

Choose a reason for hiding this comment

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

Same here.

@cyril-ui-developer
Copy link
Contributor Author

secrets/create-secret.tsx

@TheRealJon Yes, removing onCancel is not needed to fix the issue but it is not adding any value too. I removed because it is an optional props, and I doubt if this could ever cause any regression.
However we can clean up the other places where it is being used later.

@TheRealJon
Copy link
Member

@TheRealJon Yes, removing onCancel is not needed to fix the issue but it is not adding any value too. I removed because it is an optional props, and I doubt if this could ever cause any regression. However we can clean up the other places where it is being used later.

If we know the onCancel prop of the SecretFormWrapper component is unused, I think it's okay to remove it. We also need to remove it from BaseEditSecretProps_.

@cyril-ui-developer
Copy link
Contributor Author

@TheRealJon Yes, removing onCancel is not needed to fix the issue but it is not adding any value too. I removed because it is an optional props, and I doubt if this could ever cause any regression. However we can clean up the other places where it is being used later.

If we know the onCancel prop of the SecretFormWrapper component is unused, I think it's okay to remove it. We also need to remove it from BaseEditSecretProps_.

Yes, I agree. But should be a separate bug or tech-debt stuff since it would require verifying every place where it is used.

@TheRealJon
Copy link
Member

TheRealJon commented Feb 1, 2024

Yes, I agree. But it should be a separate bug or tech-debt stuff since it would require verifying every place where it is used.

Could you clarify? The changes here and here are removing support for the onCancel prop in the SecretFormWrapper component. If this needs to be addressed as a tech debt issue, those changes must be removed from this PR. Otherwise, we have to do due diligence to remove it from that component's API as part of this PR.

@cyril-ui-developer
Copy link
Contributor Author

Yes, I agree. But it should be a separate bug or tech-debt stuff since it would require verifying every place where it is used.

Could you clarify? The changes here and here are removing support for the onCancel prop in the SecretFormWrapper component. If this needs to be addressed as a tech debt issue, those changes must be removed from this PR. Otherwise, we have to do due diligence to remove it from that component's API as part of this PR.

Never mind, it seems it is a small change to remove the onCancel props.

@openshift-ci openshift-ci bot added component/dev-console Related to dev-console and removed lgtm Indicates that a PR is ready to be merged. labels Feb 2, 2024
@cyril-ui-developer cyril-ui-developer force-pushed the page-fail-return-secret-list branch 2 times, most recently from 7c3a185 to 77d66e5 Compare February 2, 2024 14:48
Copy link
Member

@TheRealJon TheRealJon left a comment

Choose a reason for hiding this comment

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

This could cause a regression in dev console.

@@ -24,7 +24,6 @@ const CreateSecretModal: React.FC<Props> = ({ close, namespace, save, secretType

return (
<SecretFormWrapper
onCancel={close}
Copy link
Member

Choose a reason for hiding this comment

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

This seems to have more impact than intended. Now clicking cancel in this dev console secret modal will not close the modal. I think we need to retain support for the optional onCancel prop in the SecretFormWrapper component since the API is being used here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seems to have more impact than intended. Now clicking cancel in this dev console secret modal will not close the modal. I think we need to retain support for the optional onCancel prop in the SecretFormWrapper component since the API is being used here.

Hmm, I traced where SecretFormWrapper is used in CreateSecretModal, and I couldn't find any instance that is passing in the onCancel props. Are you referring to the "Add secret to workload" in dev-console, or something else?

Copy link
Member

Choose a reason for hiding this comment

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

IIUC, the original behavior of the SecretFormWrapper component uses the optional onCancel callback prop when the cancel button is clicked. Dev console appears to use the SecretFormWrapper component in a modal, and uses this onCancel prop to close the modal. So, from what I can tell, removing onCancel from SecretFormWrapper may cause a regression in the dev console. I think it's beyond the scope of this bug to track down the usage of this specific prop and remove it. We should leave it as it was since there does seem to be some risk of regression.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IIUC, the original behavior of the SecretFormWrapper component uses the optional onCancel callback prop when the cancel button is clicked. Dev console appears to use the SecretFormWrapper component in a modal, and uses this onCancel prop to close the modal. So, from what I can tell, removing onCancel from SecretFormWrapper may cause a regression in the dev console. I think it's beyond the scope of this bug to track down the usage of this specific prop and remove it. We should leave it as it was since there does seem to be some risk of regression.

@TheRealJon Updated! PTAL.

@cyril-ui-developer
Copy link
Contributor Author

/retest

Copy link
Member

@TheRealJon TheRealJon 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 openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 7, 2024
Copy link
Contributor

openshift-ci bot commented Feb 7, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cyril-ui-developer, sg00dwin, 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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 7, 2024
Copy link
Contributor

openshift-ci bot commented Feb 7, 2024

@cyril-ui-developer: all tests passed!

Full PR test history. Your PR dashboard.

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-merge-bot openshift-merge-bot bot merged commit a9730e2 into openshift:master Feb 7, 2024
6 checks passed
@openshift-ci-robot
Copy link
Contributor

@cyril-ui-developer: Jira Issue OCPBUGS-26566: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-26566 has been moved to the MODIFIED state.

In response to this:

Before:

Screenshot 2024-01-12 at 8 56 26 AM
Screenshot 2024-01-12 at 8 56 42 AM

After:

Screenshot 2024-01-12 at 8 54 30 AM
Screenshot 2024-01-12 at 8 54 54 AM

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build openshift-enterprise-console-container-v4.16.0-202402072112.p0.ga9730e2.assembly.stream.el8 for distgit openshift-enterprise-console.
All builds following this will include this PR.

@openshift-merge-robot
Copy link
Contributor

Fix included in accepted release 4.16.0-0.nightly-2024-02-08-073857

@rhamilto
Copy link
Member

/cherry-pick release-4.15

@openshift-cherrypick-robot

@rhamilto: new pull request created: #13630

In response to this:

/cherry-pick release-4.15

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. component/core Related to console core functionality component/dev-console Related to dev-console jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. 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

8 participants