Add GitOps exceptions UI to Change Management settings - #42348
Conversation
Add an "Exceptions" section with checkboxes for Labels, Software, and Enroll secrets that appears when GitOps mode is enabled. Excepted entities can be managed in the UI even when GitOps mode is active.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review.
Tip: disable this comment in your organization's Code Review settings.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #42348 +/- ##
=======================================
Coverage 66.51% 66.52%
=======================================
Files 2526 2528 +2
Lines 202660 202743 +83
Branches 9026 9063 +37
=======================================
+ Hits 134793 134867 +74
- Misses 55694 55703 +9
Partials 12173 12173
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds GitOps “exceptions” controls to the Admin → Integrations → Change management settings so users can opt specific resources out of GitOps enforcement, and wires those settings to gitops.exceptions in app config.
Changes:
- Extend Change Management form state/UI to include GitOps exceptions (labels/software/enroll secrets) and persist them via
configAPI.update. - Add
IGitOpsExceptionstype and include it inIGitOpsModeConfig. - Update config mock and a couple of existing tests to include the new
gitops.exceptionsshape.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/pages/admin/OrgSettingsPage/cards/FleetDesktop/FleetDesktop.tests.tsx | Update mock config in tests to include gitops.exceptions. |
| frontend/pages/admin/IntegrationsPage/cards/MdmSettings/components/EndUserMigrationSection/EndUserMigrationSection.tests.tsx | Update mock config in tests to include gitops.exceptions. |
| frontend/pages/admin/IntegrationsPage/cards/ChangeManagement/ChangeManagement.tsx | Add exceptions fields to form state, render exception checkboxes, and send gitops.exceptions on save. |
| frontend/interfaces/config.ts | Add IGitOpsExceptions and make it part of IGitOpsModeConfig. |
| frontend/mocks/configMock.ts | Provide default gitops.exceptions values in the config mock. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
WalkthroughThis PR extends GitOps configuration management to support exceptions for labels, software, and secrets. It introduces a new Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
frontend/pages/admin/IntegrationsPage/cards/ChangeManagement/ChangeManagement.tsx (1)
225-257: Exceptions section always enabled regardless of GitOps mode state.The Exceptions checkboxes remain enabled even when "Enable GitOps mode" is unchecked, unlike the "Git repository URL" field which is disabled. Based on the PR screenshot, this appears intentional to allow pre-configuring exceptions before enabling GitOps mode.
Consider whether to visually indicate that exceptions only take effect when GitOps mode is enabled, or disable the exceptions section when
gitOpsModeEnabledis false (similar to the URL field). This is a minor UX consideration and can be deferred if the current behavior is deliberate.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/pages/admin/IntegrationsPage/cards/ChangeManagement/ChangeManagement.tsx` around lines 225 - 257, Exceptions checkboxes are currently always enabled regardless of gitOpsModeEnabled; update the ChangeManagement component to reflect GitOps state by disabling the exception inputs when gitOpsModeEnabled is false. Specifically, use the gitOpsModeEnabled prop/state in the ChangeManagement component to pass a disabled prop (or conditionally render disabled styling/behavior) to each Checkbox for exceptLabels, exceptSoftware, and exceptSecrets so they mirror the Git repository URL field; optionally add a small tooltip or muted helper text near the "Exceptions" label that clarifies exceptions only apply when GitOps is enabled.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@frontend/pages/admin/IntegrationsPage/cards/ChangeManagement/ChangeManagement.tsx`:
- Around line 225-257: Exceptions checkboxes are currently always enabled
regardless of gitOpsModeEnabled; update the ChangeManagement component to
reflect GitOps state by disabling the exception inputs when gitOpsModeEnabled is
false. Specifically, use the gitOpsModeEnabled prop/state in the
ChangeManagement component to pass a disabled prop (or conditionally render
disabled styling/behavior) to each Checkbox for exceptLabels, exceptSoftware,
and exceptSecrets so they mirror the Git repository URL field; optionally add a
small tooltip or muted helper text near the "Exceptions" label that clarifies
exceptions only apply when GitOps is enabled.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: e7aaa69b-6032-45d7-8369-1cac5924fd55
📒 Files selected for processing (5)
frontend/__mocks__/configMock.tsfrontend/interfaces/config.tsfrontend/pages/admin/IntegrationsPage/cards/ChangeManagement/ChangeManagement.tsxfrontend/pages/admin/IntegrationsPage/cards/MdmSettings/components/EndUserMigrationSection/EndUserMigrationSection.tests.tsxfrontend/pages/admin/OrgSettingsPage/cards/FleetDesktop/FleetDesktop.tests.tsx
Agent-Logs-Url: https://github.com/fleetdm/fleet/sessions/2aa42e1c-0a0f-4caf-96bd-5a2f94a7295d Co-authored-by: sgress454 <553428+sgress454@users.noreply.github.com>
Added
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…eptions" This reverts commit 21418e4.
Related issue: Resolves #42182
Checklist for submitter
If some of the following don't apply, delete the relevant line.
changes/,orbit/changes/oree/fleetd-chrome/changes.See Changes files for more information.
will add to last PR
Testing
ChangeManagement.tests.tsxwith unit/integration tests covering:gitops.exceptionspayload viaconfigAPI.updategitops.exceptionsconfig as expectedSummary by CodeRabbit
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.