Skip to content

[release-4.19] OLS-2925: Fix revert not clearing edit icon from attachment label#1862

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:release-4.19from
openshift-cherrypick-robot:cherry-pick-1861-to-release-4.19
Apr 23, 2026
Merged

[release-4.19] OLS-2925: Fix revert not clearing edit icon from attachment label#1862
openshift-merge-bot[bot] merged 1 commit intoopenshift:release-4.19from
openshift-cherrypick-robot:cherry-pick-1861-to-release-4.19

Conversation

@openshift-cherrypick-robot
Copy link
Copy Markdown

@openshift-cherrypick-robot openshift-cherrypick-robot commented Apr 23, 2026

This is an automated cherry-pick of #1861

/assign kyoto

Summary by CodeRabbit

  • Bug Fixes

    • Fixed attachment revert functionality to correctly restore and include the original attachment value when reverting edits, ensuring proper attachment references are maintained during revert operations.
  • Tests

    • Added test coverage for attachment revert behavior to validate that reverting edited attachments correctly clears modified state and restores original information.

The onRevert handler passed undefined as originalValue to
attachmentSet, which triggered the re-attach guard added in eb78619
and silently preserved the edited value in the attachments map. Pass
the reverted value as originalValue instead so the guard is bypassed
and isAttachmentChanged returns false.

Made-with: Cursor
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 23, 2026

@openshift-cherrypick-robot: Ignoring requests to cherry-pick non-bug issues: OLS-2925

Details

In response to this:

This is an automated cherry-pick of #1861

/assign kyoto

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.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 980a6b38-5189-42e8-a1fe-e1199deab6e1

📥 Commits

Reviewing files that changed from the base of the PR and between a4a10fa and 9d188b9.

📒 Files selected for processing (2)
  • src/components/AttachmentModal.tsx
  • unit-tests/redux-reducers.test.ts

📝 Walkthrough

Walkthrough

The pull request updates the attachment revert functionality to explicitly pass the resolved original value to the attachment update function instead of undefined, and adds a test case validating this revert behavior.

Changes

Cohort / File(s) Summary
Attachment Revert Logic
src/components/AttachmentModal.tsx
Updated onRevert to supply the resolved original value to attachmentSet(...) instead of undefined, ensuring reverted attachments include an explicit reference value.
Revert Behavior Validation
unit-tests/redux-reducers.test.ts
Added unit test for the AttachmentSet revert behavior, verifying that when an edited attachment's value is restored to match its original value, the changed state is properly cleared.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A whisker of change, a fix most neat,
Reverting attachments, now complete!
Original values, no longer lost,
With tests that verify, at any cost.
Hoppy coding, bug-free and bright!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main change: fixing the revert functionality to clear the edit icon from attachment labels by passing the resolved original value to attachmentSet.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci openshift-ci Bot requested review from kyoto and xrajesh April 23, 2026 10:31
@kyoto
Copy link
Copy Markdown
Member

kyoto commented Apr 23, 2026

/approve
/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Apr 23, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 23, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kyoto

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 Apr 23, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 23, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 23, 2026

@openshift-cherrypick-robot: This pull request references OLS-2925 which is a valid jira issue.

Details

In response to this:

This is an automated cherry-pick of #1861

/assign kyoto

Summary by CodeRabbit

  • Bug Fixes

  • Fixed attachment revert functionality to correctly restore and include the original attachment value when reverting edits, ensuring proper attachment references are maintained during revert operations.

  • Tests

  • Added test coverage for attachment revert behavior to validate that reverting edited attachments correctly clears modified state and restores original information.

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-merge-bot openshift-merge-bot Bot merged commit 25e7b93 into openshift:release-4.19 Apr 23, 2026
4 checks passed
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. 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.

3 participants