Skip to content

Add GitOps exceptions UI to Change Management settings - #42348

Merged
sgress454 merged 5 commits into
mainfrom
sgress454/gitops-exceptions-pr3-ui
Mar 30, 2026
Merged

Add GitOps exceptions UI to Change Management settings#42348
sgress454 merged 5 commits into
mainfrom
sgress454/gitops-exceptions-pr3-ui

Conversation

@sgress454

@sgress454 sgress454 commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Related issue: Resolves #42182

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.
    will add to last PR

Testing

  • Added/updated automated tests
    • Added ChangeManagement.tests.tsx with unit/integration tests covering:
      • Exceptions checkboxes render correctly from config for new install (only Enroll secrets checked) and migrated instances (Labels and Enroll secrets checked)
      • Form save sends the correct gitops.exceptions payload via configAPI.update
      • Form validation shows error when GitOps mode is enabled but no repo URL is provided
      • Non-premium tier renders the premium feature message
  • QA'd all new/changed functionality manually
    • verified that Labels and Secrets are checked for pre-existing (migrated) instance
    • verified that only Secrets is checked for new instance
    • verified that changing the settings in the UI and saving persists the gitops.exceptions config as expected

Summary by CodeRabbit

  • New Features
    • Added GitOps exceptions configuration in Change Management settings with toggles for Labels, Software, and Enroll Secrets, enabling granular control over exception flags.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

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.
@sgress454
sgress454 requested a review from a team as a code owner March 24, 2026 22:34
Copilot AI review requested due to automatic review settings March 24, 2026 22:34

@claude claude 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.

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.

@sgress454

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

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.

@codecov

codecov Bot commented Mar 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.52%. Comparing base (8b3674b) to head (11e0144).
⚠️ Report is 136 commits behind head on main.

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           
Flag Coverage Δ
frontend 54.51% <100.00%> (+0.11%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

Copilot AI 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.

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 IGitOpsExceptions type and include it in IGitOpsModeConfig.
  • Update config mock and a couple of existing tests to include the new gitops.exceptions shape.

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.

@coderabbitai

coderabbitai Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This PR extends GitOps configuration management to support exceptions for labels, software, and secrets. It introduces a new IGitOpsExceptions interface to define the exception structure and updates IGitOpsModeConfig to include this property. The ChangeManagement form is extended with three new boolean state fields corresponding to these exceptions. The ChangeManagement UI now includes an "Exceptions" section with checkboxes for Labels, Software, and Enroll secrets. Configuration loading and submission logic has been updated to read from and write to gitops.exceptions. Mock configurations and related test files have been updated to reflect the new structure.

Possibly related PRs

  • Add "exceptions" GitOps config #42013: Modifies the same GitOps config shape by adding exceptions object with labels, software, and secrets properties, with corresponding updates to code, tests, and mocks.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding GitOps exceptions UI to Change Management settings, which matches the primary purpose of the changeset.
Description check ✅ Passed The description includes the related issue (#42182), testing checklist items are checked with details provided, and manual QA is documented. However, a changes file is noted as pending for a follow-up PR.
Linked Issues check ✅ Passed The code changes fully implement the requirements from issue #42182: UI controls for exempting Software, Labels, and Secrets from GitOps are added to Change Management, the gitops.exceptions config is updated and persisted, and test coverage is included.
Out of Scope Changes check ✅ Passed All code changes are directly scoped to implementing GitOps exceptions UI in Change Management settings. Test updates in EndUserMigrationSection and FleetDesktop are necessary mock configuration adjustments to accommodate the new exceptions structure.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ 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 sgress454/gitops-exceptions-pr3-ui

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.

@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/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 gitOpsModeEnabled is 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

📥 Commits

Reviewing files that changed from the base of the PR and between 2e6ffa7 and 1d43e10.

📒 Files selected for processing (5)
  • frontend/__mocks__/configMock.ts
  • frontend/interfaces/config.ts
  • frontend/pages/admin/IntegrationsPage/cards/ChangeManagement/ChangeManagement.tsx
  • frontend/pages/admin/IntegrationsPage/cards/MdmSettings/components/EndUserMigrationSection/EndUserMigrationSection.tests.tsx
  • frontend/pages/admin/OrgSettingsPage/cards/FleetDesktop/FleetDesktop.tests.tsx

Copilot AI commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai review

Added ChangeManagement.tests.tsx in commit 21418e4 with 6 tests covering:

  • Non-premium tier renders the premium feature message
  • New install default state: only Enroll secrets checked (secrets=true, labels=false, software=false)
  • Migrated instance state: Labels and Enroll secrets checked (labels=true, secrets=true, software=false)
  • Form save sends the correct gitops.exceptions payload via PATCH /config
  • Form save with GitOps mode enabled sends correct payload including repo URL
  • Form validation shows error when GitOps mode is enabled but no repo URL is provided

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:

  • fleettest.test
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/fleet/fleet/node_modules/.bin/jest --config ./frontend/test/jest.config.js --testPathPattern=ChangeManagement --no-coverage (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/fleet/fleet/node_modules/.bin/jest --config ./frontend/test/jest.config.js --testPathPattern=IntegrationPage --no-coverage (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@iansltx iansltx self-assigned this Mar 30, 2026
@sgress454
sgress454 merged commit e54ea7b into main Mar 30, 2026
19 checks passed
@sgress454
sgress454 deleted the sgress454/gitops-exceptions-pr3-ui branch March 30, 2026 13:57
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.

Add GitOps exceptions to Change Management UI

5 participants