Skip to content

ACM-34028 Add preserveResourcesOnDeletion toggle to ApplicationSet create/edit wizard#6326

Merged
openshift-merge-bot[bot] merged 6 commits into
stolostron:mainfrom
jeswanke:ACM-34028-Add-preserveResourcesOnDeletion-toggle-to-ApplicationSet-create-edit-wizard
Jun 11, 2026
Merged

ACM-34028 Add preserveResourcesOnDeletion toggle to ApplicationSet create/edit wizard#6326
openshift-merge-bot[bot] merged 6 commits into
stolostron:mainfrom
jeswanke:ACM-34028-Add-preserveResourcesOnDeletion-toggle-to-ApplicationSet-create-edit-wizard

Conversation

@jeswanke

@jeswanke jeswanke commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

📝 Summary

CleanShot 2026-06-10 at 10 01 38@2x CleanShot 2026-06-10 at 10 02 23@2x

Ticket Summary (Title):
Add preserveResourcesOnDeletion toggle to ApplicationSet create/edit wizard

Ticket Link:
https://redhat.atlassian.net/browse/ACM-34028

Type of Change:

  • 🐞 Bug Fix
  • ✨ Feature
  • 🔧 Refactor
  • 💸 Tech Debt
  • 🧪 Test-related
  • 📄 Docs

✅ Checklist

General

  • PR title follows the convention (e.g. ACM-12340 Fix bug with...)
  • Code builds and runs locally without errors
  • No console logs, commented-out code, or unnecessary files
  • All commits are meaningful and well-labeled
  • All new display strings are externalized for localization (English only)
  • (Nice to have) JSDoc comments added for new functions and interfaces

If Feature

  • UI/UX reviewed (if applicable)
  • All acceptance criteria met
  • Unit test coverage added or updated
  • Relevant documentation or comments included

If Bugfix

  • Root cause and fix summary are documented in the ticket (for future reference / errata)
  • Fix tested thoroughly and resolves the issue
  • Test(s) added to prevent regression

🗒️ Notes for Reviewers

Summary by CodeRabbit

  • New Features

    • Added an "ApplicationSet Sync Policy" option in the wizard with a checkbox to control whether resources created by child applications are preserved when the ApplicationSet is deleted; default is set to not preserve.
  • Bug Fixes

    • Improved review/form layout to better handle long labels and fixed icon layout in boolean summaries for consistent alignment.
  • Tests

    • Updated tests and fixtures to reflect the new sync-policy default and checkbox behavior.

Signed-off-by: John Swanke <jswanke@redhat.com>
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 9efe45f6-8d25-447b-b96b-8b233f0c230d

📥 Commits

Reviewing files that changed from the base of the PR and between bad425f and f62f4b8.

📒 Files selected for processing (1)
  • frontend/src/resources/application-set.ts

📝 Walkthrough

Walkthrough

Adds an ApplicationSet syncPolicy checkbox (default false) and initializes payload; updates tests and fixtures to toggle and assert preserveResourcesOnDeletion; changes review layout heuristic to use proportion of long term labels; adds flexShrink to CheckIcon rendering.

Changes

ApplicationSet Sync Policy Preservation Checkbox

Layer / File(s) Summary
Sync policy types
frontend/src/resources/application-set.ts
Adds ApplicationSetSyncPolicy with optional preserveResourcesOnDeletion?: boolean and extends ApplicationSet.spec to include syncPolicy?: ApplicationSetSyncPolicy.
Sync policy default in payload
frontend/src/wizards/Argo/ArgoWizard.tsx
Wizard-generated ApplicationSet payload now initializes spec.syncPolicy.preserveResourcesOnDeletion to false.
Sync policy UI control
frontend/src/wizards/Argo/ArgoWizard.tsx
New wizard section "ApplicationSet Sync Policy" with a WizCheckbox bound to spec.syncPolicy.preserveResourcesOnDeletion and explanatory label.
Test coverage and fixtures for sync policy
frontend/src/wizards/Argo/ArgoWizard.test.tsx, frontend/src/routes/Applications/CreateArgoApplication/CreatePullApplicationSet.test.tsx
Create-git test now clicks the general-page checkbox; submitted ApplicationSet expectations include syncPolicy.preserveResourcesOnDeletion (true/false as appropriate); Git and Helm mock fixtures initialize it to false.

Review layout and icon tweaks

Layer / File(s) Summary
Horizontal term width heuristic
frontend/packages/react-form-wizard/src/review/utils.ts
horizontalTermWidthModifierForInputRun(nodes) returns compact for empty input and otherwise computes the ratio of term texts (label ?? path) longer than 32 chars; selects wide when ratio ≥ 0.6 (replaces previous max-length ≥ 64 rule).
CheckIcon inline layout
frontend/packages/react-form-wizard/src/review/ReviewStep.tsx
CheckIcon in collapsed boolean badges and boolean term text now includes style={{ flexShrink: 0 }} to stabilize inline layout.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Title is specific, directly references the feature (preserveResourcesOnDeletion toggle), and clearly matches the changeset modifications across the wizard components.
Description check ✅ Passed Description includes checklist completion (PR title format, code builds, localization), ticket link, and feature type. However, several feature-related items remain unchecked: UI/UX review, acceptance criteria, and unit test coverage updates.
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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Signed-off-by: John Swanke <jswanke@redhat.com>
@jeswanke jeswanke requested a review from fxiang1 June 10, 2026 14:53
@fxiang1

fxiang1 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

@jeswanke This looks great! One bug I found is when you go to the review step there's no text for the preserveResourcesOnDeletion checkbox. Can you fix this?

image

jeswanke added 2 commits June 10, 2026 14:52
Signed-off-by: John Swanke <jswanke@redhat.com>
Signed-off-by: John Swanke <jswanke@redhat.com>
@jeswanke

Copy link
Copy Markdown
Contributor Author

@fxiang1 -- so there won't be a checkbox--just a checkmark--but I saw it was really small so I made it bigger

CleanShot 2026-06-10 at 15 00 02@2x

@fxiang1

fxiang1 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

@jeswanke Thanks! I guess I didn't see the smaller one.

/lgtm

Signed-off-by: John Swanke <jswanke@redhat.com>
@openshift-ci openshift-ci Bot removed the lgtm label Jun 10, 2026
Signed-off-by: John Swanke <jswanke@redhat.com>
@jeswanke

Copy link
Copy Markdown
Contributor Author

@fxiang1 hey Feng--they removed your lgtm

@fxiang1

fxiang1 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm label Jun 11, 2026
@openshift-ci

openshift-ci Bot commented Jun 11, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fxiang1, jeswanke

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

@sonarqubecloud

Copy link
Copy Markdown

@openshift-merge-bot openshift-merge-bot Bot merged commit cf28c8c into stolostron:main Jun 11, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants