OCPBUGS-62611: Fix editing secrets with mixed text and binary data
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: 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.
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
nullfor binary values would corrupt the reduce accumulator, causing subsequent iterations to fail when attemptingacc[key] = ...on line 65. Returningaccunchanged 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.
/jira refresh
@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.
/retest
/retest
[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
- ~~frontend/OWNERS~~ [TheRealJon,jhadvig]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/retest
/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: 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.
/jira refresh
@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.
/verified by @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.
/retest-required
Remaining retests: 0 against base HEAD 24830e32f72e7da9cb20fd34dd6be5c13fdf126e and 2 for PR HEAD 601c1710782cf995a09823269b08eece5320d40c in total
/retest-required
Remaining retests: 0 against base HEAD d00353d166cbb752ddfcde940ed2c4d62a33521c and 1 for PR HEAD 601c1710782cf995a09823269b08eece5320d40c in total
/retest-required
Remaining retests: 0 against base HEAD 9c70ba0e0f17e4a9f037f79768fc7cc2a07ccf3b and 0 for PR HEAD 601c1710782cf995a09823269b08eece5320d40c in total
/hold
Revision 601c1710782cf995a09823269b08eece5320d40c was retested 3 times: holding
/retest
/unhold /retest
@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.
@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.
Fix included in accepted release 4.22.0-0.nightly-2026-01-14-031657