console icon indicating copy to clipboard operation
console copied to clipboard

OCPBUGS-62611: Fix editing secrets with mixed text and binary data

Open TheRealJon opened this issue 4 months ago โ€ข 9 comments

When a secret contained both text and binary values, the edit form would fail due to a runtime error. The stringData initialization was returning null when any binary field was detected, breaking text field handling.

Now binary fields are skipped during stringData initialization while text fields are preserved, allowing proper editing of mixed-type secrets.

๐Ÿค– Generated with Claude Code

TheRealJon avatar Dec 08 '25 17:12 TheRealJon

@TheRealJon: This pull request references Jira Issue OCPBUGS-62611, which is invalid:

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

When a secret contained both text and binary values, the edit form would fail due to a runtime error. The stringData initialization was returning null when any binary field was detected, breaking text field handling.

Now binary fields are skipped during stringData initialization while text fields are preserved, allowing proper editing of mixed-type secrets.

๐Ÿค– Generated with Claude Code

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-robot avatar Dec 08 '25 17:12 openshift-ci-robot

Walkthrough

A reduce callback in SecretFormWrapper.tsx previously returned null when encountering binary values, potentially corrupting the accumulator. The fix returns the accumulator unchanged for binary values instead of null, while preserving existing Base64 decoding logic for non-binary values.

Changes

Cohort / File(s) Change Summary
Bug Fix in Binary Value Handling
frontend/public/components/secrets/create-secret/SecretFormWrapper.tsx
Modified reduce callback to return accumulator unchanged when encountering binary values instead of returning null, preventing premature termination or corruption of the accumulation object.

Estimated code review effort

๐ŸŽฏ 2 (Simple) | โฑ๏ธ ~10 minutes

  • Verify the fix correctly handles binary values without side effects
  • Confirm the change doesn't introduce regressions in decoding logic for non-binary values
  • Check if test coverage exists for binary value scenarios in secret form handling
โœจ Finishing touches
  • [ ] ๐Ÿ“ Generate docstrings
๐Ÿงช Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment

๐Ÿ“œ Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between 370e6b0c82e414a473fb3fb30ede556d9b92aee4 and 601c1710782cf995a09823269b08eece5320d40c.

๐Ÿ“’ Files selected for processing (1)
  • frontend/public/components/secrets/create-secret/SecretFormWrapper.tsx (1 hunks)
๐Ÿงฐ Additional context used
๐Ÿ““ Path-based instructions (1)
**

โš™๏ธ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • frontend/public/components/secrets/create-secret/SecretFormWrapper.tsx
๐Ÿ”‡ Additional comments (1)
frontend/public/components/secrets/create-secret/SecretFormWrapper.tsx (1)

60-68: Critical fix correctly resolves runtime error.

The change on line 63 fixes a critical bug where returning null for binary values would corrupt the reduce accumulator, causing subsequent iterations to fail when attempting acc[key] = ... on line 65. Returning acc unchanged correctly skips binary entries while preserving text field decoding, enabling editing of secrets with mixed text and binary data.


Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Dec 08 '25 17:12 coderabbitai[bot]

/jira refresh

TheRealJon avatar Dec 08 '25 17:12 TheRealJon

@TheRealJon: This pull request references Jira Issue OCPBUGS-62611, 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.21.0) matches configured target version for branch (4.21.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-robot avatar Dec 08 '25 17:12 openshift-ci-robot

/retest

TheRealJon avatar Dec 12 '25 14:12 TheRealJon

/retest

jhadvig avatar Dec 15 '25 10:12 jhadvig

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhadvig, 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[bot] avatar Dec 15 '25 10:12 openshift-ci[bot]

/retest

TheRealJon avatar Dec 16 '25 15:12 TheRealJon

/jira refresh

The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target different OCP), recalculating validity.

openshift-bot avatar Jan 01 '26 00:01 openshift-bot

@openshift-bot: This pull request references Jira Issue OCPBUGS-62611, which is invalid:

  • expected the bug to target either version "4.22." or "openshift-4.22.", but it targets "4.21.0" instead

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.

In response to this:

/jira refresh

The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target different OCP), recalculating validity.

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-robot avatar Jan 01 '26 00:01 openshift-ci-robot

/jira refresh

TheRealJon avatar Jan 05 '26 14:01 TheRealJon

@TheRealJon: This pull request references Jira Issue OCPBUGS-62611, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state POST, 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-robot avatar Jan 05 '26 14:01 openshift-ci-robot

/verified by @Leo6Leo

Leo6Leo avatar Jan 05 '26 16:01 Leo6Leo

@Leo6Leo: This PR has been marked as verified by @Leo6Leo.

In response to this:

/verified by @Leo6Leo

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-robot avatar Jan 05 '26 16:01 openshift-ci-robot

/retest-required

Remaining retests: 0 against base HEAD 24830e32f72e7da9cb20fd34dd6be5c13fdf126e and 2 for PR HEAD 601c1710782cf995a09823269b08eece5320d40c in total

openshift-ci-robot avatar Jan 05 '26 17:01 openshift-ci-robot

/retest-required

Remaining retests: 0 against base HEAD d00353d166cbb752ddfcde940ed2c4d62a33521c and 1 for PR HEAD 601c1710782cf995a09823269b08eece5320d40c in total

openshift-ci-robot avatar Jan 06 '26 05:01 openshift-ci-robot

/retest-required

Remaining retests: 0 against base HEAD 9c70ba0e0f17e4a9f037f79768fc7cc2a07ccf3b and 0 for PR HEAD 601c1710782cf995a09823269b08eece5320d40c in total

openshift-ci-robot avatar Jan 06 '26 22:01 openshift-ci-robot

/hold

Revision 601c1710782cf995a09823269b08eece5320d40c was retested 3 times: holding

openshift-ci-robot avatar Jan 06 '26 23:01 openshift-ci-robot

/retest

TheRealJon avatar Jan 09 '26 14:01 TheRealJon

/unhold /retest

logonoff avatar Jan 11 '26 21:01 logonoff

@TheRealJon: 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.

openshift-ci[bot] avatar Jan 12 '26 03:01 openshift-ci[bot]

@TheRealJon: Jira Issue Verification Checks: Jira Issue OCPBUGS-62611 :heavy_check_mark: This pull request was pre-merge verified. :heavy_check_mark: All associated pull requests have merged. :heavy_check_mark: All associated, merged pull requests were pre-merge verified.

Jira Issue OCPBUGS-62611 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. :clock4:

In response to this:

When a secret contained both text and binary values, the edit form would fail due to a runtime error. The stringData initialization was returning null when any binary field was detected, breaking text field handling.

Now binary fields are skipped during stringData initialization while text fields are preserved, allowing proper editing of mixed-type secrets.

๐Ÿค– Generated with Claude Code

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-robot avatar Jan 12 '26 03:01 openshift-ci-robot

Fix included in accepted release 4.22.0-0.nightly-2026-01-14-031657

openshift-merge-robot avatar Jan 14 '26 11:01 openshift-merge-robot