Skip to content

OCPBUGS-56087: Opening Edit Secret modal and saving without changes throws error #15058

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Mylanos
Copy link
Contributor

@Mylanos Mylanos commented May 15, 2025

restructure initialization of stringData

previously when you tried to edit a Secret with binary data, the stringData was initialized to be a key pair with null value instead of being an empty object, which resulted in errors when saving the secret without changes. After those changes we omit key pairs that have binary values from the stringData.

after:

Screen.Recording.2025-05-16.at.16.29.29.mov

@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. 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 May 15, 2025
@openshift-ci-robot
Copy link
Contributor

@Mylanos: This pull request references Jira Issue OCPBUGS-56087, which is invalid:

  • expected the bug to target the "4.20.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:

restructure initialization of stringData

previously when you tried to edit a Secret with binary data, the stringData was initialized to be a key pair with null value instead of an empty object, which resulted in errors when saving the secret without changes. After those changes we omit key pairs that have binary values from the stringData.

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 requested review from cajieh and rhamilto May 15, 2025 13:02
@openshift-ci openshift-ci bot added the component/core Related to console core functionality label May 15, 2025
Copy link
Contributor

openshift-ci bot commented May 15, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Mylanos

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 May 15, 2025
@Mylanos
Copy link
Contributor Author

Mylanos commented May 15, 2025

/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 May 15, 2025
@openshift-ci-robot
Copy link
Contributor

@Mylanos: This pull request references Jira Issue OCPBUGS-56087, 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.20.0) matches configured target version for branch (4.20.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @yapei

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 requested a review from yapei May 15, 2025 13:40
@Mylanos Mylanos changed the title OCPBUGS-56087: open Edit Secret modal but didn't change anything will throw error OCPBUGS-56087: Opening Edit Secret modal and saving without changes throws error May 16, 2025
@openshift-ci-robot
Copy link
Contributor

@Mylanos: This pull request references Jira Issue OCPBUGS-56087, which is valid.

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

Requesting review from QA contact:
/cc @yapei

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

In response to this:

restructure initialization of stringData

previously when you tried to edit a Secret with binary data, the stringData was initialized to be a key pair with null value instead of being an empty object, which resulted in errors when saving the secret without changes. After those changes we omit key pairs that have binary values from the stringData.

after:

Screen.Recording.2025-05-16.at.16.29.29.mov

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.

}),
acc[key] = value ? Base64.decode(value) : '';
return acc;
}, {} as { [key: string]: string }),
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit - you can avoid accumulator type as cast like so

Object.entries<Record<string, string>>( ... )

previously when you tried to edit a Secret with binary data, the string data was initialized with a keypair with null value instead of an empty object, which resulted in errors when saving the secret without changes. After those changes we omit keypairs that have binary values.
@Mylanos Mylanos force-pushed the open-edit-secret-modal-no-change-error branch from 3e2a80d to 154c422 Compare May 16, 2025 15:35
Copy link
Contributor

openshift-ci bot commented May 16, 2025

@Mylanos: 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-sigs/prow repository. I understand the commands that are listed here.

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 jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants