Skip to content

Patch when closed: default continuous automation off for Force patch - #50691

Merged
jkatz01 merged 1 commit into
feat/39962-patch-when-closedfrom
jk-PWC-disable-automation-checkbox
Aug 6, 2026
Merged

Patch when closed: default continuous automation off for Force patch#50691
jkatz01 merged 1 commit into
feat/39962-patch-when-closedfrom
jk-PWC-disable-automation-checkbox

Conversation

@jkatz01

@jkatz01 jkatz01 commented Aug 6, 2026

Copy link
Copy Markdown
Member
  • Sets continuous automations to off by default in the Deploy modal and Edit policy page

Related issue: Resolves #

Checklist for submitter

If some of the following don't apply, delete the relevant line.

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
    See Changes files for more information.

  • Input data is properly validated, SELECT * is avoided, SQL injection is prevented (using placeholders for values in statements), JS inline code is prevented especially for url redirects, and untrusted data interpolated into shell scripts/commands is validated against shell metacharacters.

  • Timeouts are implemented and retries are limited to avoid infinite loops

  • If paths of existing endpoints are modified without backwards compatibility, checked the frontend/CLI for any necessary changes

Testing

For unreleased bug fixes in a release candidate, one of:

  • Confirmed that the fix is not expected to adversely impact load test results
  • Alerted the release DRI if additional load testing is needed

Summary by CodeRabbit

  • Bug Fixes
    • Continuous automation settings now behave consistently when creating or editing Force patch policies.
    • Manual patching disables continuous automation, while closed patching enables it.
    • Other patch selections preserve the current automation setting.
    • Saving existing policies now correctly retains the configured automation state.

The continuous software & script automations checkbox no longer follows the
Patch radio. Selecting Force patch in Edit policy leaves it unchecked and lets
the user turn it on without switching to another option.

Force patch policies created from Add software and the Deploy modal also start
with continuous automation off, matching how the server creates them.
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (feat/39962-patch-when-closed@298146f). Learn more about missing BASE report.

Additional details and impacted files
@@                       Coverage Diff                       @@
##             feat/39962-patch-when-closed   #50691   +/-   ##
===============================================================
  Coverage                                ?   67.99%           
===============================================================
  Files                                   ?     3897           
  Lines                                   ?   248993           
  Branches                                ?    13327           
===============================================================
  Hits                                    ?   169293           
  Misses                                  ?    64475           
  Partials                                ?    15225           
Flag Coverage Δ
frontend 61.05% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jkatz01
jkatz01 marked this pull request as ready for review August 6, 2026 18:18
@jkatz01
jkatz01 requested a review from a team as a code owner August 6, 2026 18:18
@jkatz01

jkatz01 commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@RachelElysia RachelElysia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@jkatz01
jkatz01 merged commit 1f86654 into feat/39962-patch-when-closed Aug 6, 2026
15 of 21 checks passed
@jkatz01
jkatz01 deleted the jk-PWC-disable-automation-checkbox branch August 6, 2026 18:26
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The frontend now enables continuous automation only for closed-patch policies. Manual patching disables it, while other patch options preserve the stored toggle state. The automation toggle no longer changes the patch option. Policy forms pass patch controls through patchSlot, and tests cover creation, updates, editing, toggling, and saved payloads for Force patch policies.

Possibly related PRs

  • fleetdm/fleet#49871: Updates backend handling for continuous_automations_enabled in patch_when_closed policies.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Force patch behavior change and the default continuous automation setting.
Description check ✅ Passed The description summarizes the change and documents automated testing and manual QA, but leaves the related issue and several checklist items incomplete.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jk-PWC-disable-automation-checkbox

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
frontend/pages/policies/components/PolicyAutomationsFields/PolicyAutomationsFields.tests.tsx (1)

459-477: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the persisted value for Force patch.

These tests verify only the rendered checkbox state. They do not verify getAutomationsPayload(). A payload regression could leave the checkbox checked but save continuous_automations_enabled: false. Use a valid patch fixture with patch_software and a handle ref. Assert that the payload contains continuous_automations_enabled: true after the explicit toggle and for the already-enabled case.

Also applies to: 479-492

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@frontend/pages/policies/components/PolicyAutomationsFields/PolicyAutomationsFields.tests.tsx`
around lines 459 - 477, Update the Force patch tests around renderWithHandle to
use a valid patch fixture including patch_software and a handle ref, then assert
getAutomationsPayload() contains continuous_automations_enabled: true after
explicitly toggling the checkbox and in the already-enabled case. Keep the
existing checkbox state assertions while adding payload verification for both
scenarios.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@frontend/pages/policies/components/PolicyAutomationsFields/PolicyAutomationsFields.tests.tsx`:
- Around line 459-477: Update the Force patch tests around renderWithHandle to
use a valid patch fixture including patch_software and a handle ref, then assert
getAutomationsPayload() contains continuous_automations_enabled: true after
explicitly toggling the checkbox and in the already-enabled case. Keep the
existing checkbox state assertions while adding payload verification for both
scenarios.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b02a4ed7-5e22-4386-918a-c911088e446a

📥 Commits

Reviewing files that changed from the base of the PR and between 298146f and 436037d.

📒 Files selected for processing (6)
  • frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/DeployModal/DeployModal.tests.tsx
  • frontend/pages/SoftwarePage/components/forms/SoftwareDeploySelector/SoftwareDeploySelector.tsx
  • frontend/pages/policies/components/PolicyAutomationsFields/PolicyAutomationsFields.tests.tsx
  • frontend/pages/policies/components/PolicyAutomationsFields/PolicyAutomationsFields.tsx
  • frontend/pages/policies/edit/components/PolicyForm/PolicyForm.tests.tsx
  • frontend/pages/policies/edit/components/PolicyForm/PolicyForm.tsx
💤 Files with no reviewable changes (1)
  • frontend/pages/policies/edit/components/PolicyForm/PolicyForm.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants