Skip to content

Use new multiplatform keys on the front end - #41763

Merged
sgress454 merged 7 commits into
mainfrom
sgress454/update-frontend-to-use-new-multiplatform-keys
Mar 30, 2026
Merged

Use new multiplatform keys on the front end#41763
sgress454 merged 7 commits into
mainfrom
sgress454/update-frontend-to-use-new-multiplatform-keys

Conversation

@sgress454

@sgress454 sgress454 commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

Related issue: Resolves #41601

Details

This PR updates the front end to use the following renamed API keys:

  • bootstrap_package -> macos_bootstrap_package
  • manual_agent_install -> macos_manual_agent_install
  • enable_release_device_manually -> apple_ enable_release_device_manually
  • script -> macos_script
  • macos_setup -> setup_experience
  • macos_settings -> apple_settings
  • custom_settings -> configuration_profiles
  • macos_setup_assistant -> apple_setup_assistant

It also ensures that consumers of the "get fleet config" API pull from the .fleet property rather than .team, so that they can use all of the newly renamed response fields.

Summary by CodeRabbit

  • Refactor
    • Restructured Mobile Device Management configuration for Apple devices, reorganizing setup experience, bootstrap package, and device configuration field organization.
    • Updated filter terminology and query parameters throughout device management interfaces, improving how users filter and navigate Apple device settings.
    • Enhanced configuration field naming conventions for better clarity and maintainability across device management features.

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.

Testing

  • Added/updated automated tests

  • QA'd all new/changed functionality manually


    Manual Test Plan

    Prerequisites

    • Fleet server with MDM enabled (macOS at minimum)
    • At least one macOS host enrolled in Fleet MDM
    • A team configured with setup experience settings

    1. Manage Hosts — Filters
  • macOS settings filter:

    • Go to Hosts > Manage Hosts
    • Filter by macOS settings status (e.g. Pending, Verified, Failed)
    • Verify the filter applies and hosts list updates
    • Check that the URL contains apple_settings=
    • Copy the URL, paste it in a new tab — verify the filter is still applied
    • Manually edit the URL to use macos_settings= instead — verify it still works (backward compat)
    • Clear the filter pill — verify both apple_settings and macos_settings are removed from the URL
  • Bootstrap package filter:

    • Filter by bootstrap package status
    • Verify the URL contains macos_bootstrap_package=
    • Manually edit the URL to use bootstrap_package= — verify it still works
    • Clear the filter pill — verify both params are removed

    1. Setup Experience (Controls Page)
  • Bootstrap package:

    • Go to Controls > Setup experience for a team
    • Upload a bootstrap package — verify it appears in the table
    • Toggle the "manual agent install" advanced option on/off — verify it saves
    • Delete the bootstrap package — verify it's removed
    • In the bootstrap package table, click "View all hosts" link for a status row — verify it navigates to Manage Hosts with macos_bootstrap_package in the URL
  • End user authentication:

    • Toggle end user authentication on/off for a team and for "No team"
    • Verify the toggle reflects the saved state after page reload
  • Setup assistant:

    • Upload a setup assistant profile
    • Verify the "release device manually" toggle works for both a team and "No team"
  • Install software:

    • Verify the "require all software" checkbox reflects the correct saved state for both team and "No team"

@codecov

codecov Bot commented Mar 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.64%. Comparing base (6853b51) to head (41b6b63).
⚠️ Report is 36 commits behind head on main.

Files with missing lines Patch % Lines
...rience/cards/BootstrapPackage/BootstrapPackage.tsx 0.00% 1 Missing ⚠️
...ngsModal/OSSettingsTable/OSSettingsTableConfig.tsx 0.00% 1 Missing ⚠️
frontend/utilities/url/index.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #41763   +/-   ##
=======================================
  Coverage   66.64%   66.64%           
=======================================
  Files        2532     2532           
  Lines      202930   202931    +1     
  Branches     9026     9026           
=======================================
+ Hits       135242   135243    +1     
  Misses      55441    55441           
  Partials    12247    12247           
Flag Coverage Δ
frontend 54.32% <70.00%> (+<0.01%) ⬆️

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.

@sgress454
sgress454 force-pushed the sgress454/update-frontend-to-use-new-multiplatform-keys branch from 6410513 to 259a8ab Compare March 27, 2026 16:40
@sgress454

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 27, 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.

@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This PR refactors frontend MDM configuration naming to use more generic/Apple-specific field names across type definitions, components, utilities, and services. Primary changes include renaming macos_settingsapple_settings, macos_setupsetup_experience, and nested properties like custom_settingsconfiguration_profiles, bootstrap_packagemacos_bootstrap_package, manual_agent_installmacos_manual_agent_install, enable_release_device_manuallyapple_enable_release_device_manually, and macos_setup_assistantapple_setup_assistant. Changes span TypeScript interfaces, mock objects, React components accessing these fields, URL query parameter handling, and API service implementations. The teams API response shape is also extended with a new fleet: ITeamConfig field alongside the existing team property.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly summarizes the main change: updating frontend to use new multiplatform keys instead of macOS-specific keys.
Linked Issues check ✅ Passed The PR addresses all 8 required key mappings from issue #41601: bootstrap_package, manual_agent_install, enable_release_device_manually, macos_setup, macos_settings, custom_settings, and macos_setup_assistant are systematically renamed across interfaces, mocks, and components.
Out of Scope Changes check ✅ Passed All changes are within scope—renaming configuration keys across frontend interfaces, mocks, and components to align with backend aliases. Query parameter remapping and one data source change (team to fleet) directly support the multiplatform key objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description includes the related issue, completed checklist items, and a detailed manual test plan covering all key functionality changes.

✏️ 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/update-frontend-to-use-new-multiplatform-keys

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.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx (1)

832-841: ⚠️ Potential issue | 🟡 Minor

Drop the deprecated key when rewriting these filters.

If a user lands on a legacy link, spreading queryParams preserves bootstrap_package / macos_settings and then adds macos_bootstrap_package / apple_settings on top. That leaves contradictory URL state, and the backend contract in server/service/transport.go:361-375 treats both aliases together as invalid.

Suggested fix
   const handleChangeBootstrapPackageStatusFilter = (
     newStatus: BootstrapPackageStatus
   ) => {
     router.replace(
       getNextLocationPath({
         pathPrefix: PATHS.MANAGE_HOSTS,
         routeTemplate,
         routeParams,
-        queryParams: { ...queryParams, macos_bootstrap_package: newStatus },
+        queryParams: {
+          ...omit(queryParams, ["bootstrap_package"]),
+          macos_bootstrap_package: newStatus,
+        },
       })
     );
   };
@@
         routeTemplate,
         routeParams,
         queryParams: {
-          ...queryParams,
+          ...omit(queryParams, ["macos_settings"]),
           apple_settings: newMacSettingsStatus,
           page: 0, // resets page index
         },
       })

Also applies to: 893-901

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx` around lines 832 -
841, When rewriting filter query params in
handleChangeBootstrapPackageStatusFilter (and the other host filter handlers
that add macos_bootstrap_package / apple_settings), remove the deprecated alias
keys (bootstrap_package and macos_settings) from the queryParams before calling
getNextLocationPath; i.e., build the new queryParams by spreading queryParams
but explicitly deleting or omitting bootstrap_package and macos_settings and
then setting macos_bootstrap_package (or apple_settings) so the URL contains
only the canonical keys; update the analogous handler at the other block to do
the same.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@frontend/pages/ManageControlsPage/SetupExperience/cards/BootstrapPackage/BootstrapPackage.tsx`:
- Around line 141-145: The current flow calls mdmAPI.deleteBootstrapPackage(...)
and then mdmAPI.updateSetupExperienceSettings(...) so a PATCH failure
incorrectly makes the UI report the whole delete as failed and leaves
macos_manual_agent_install enabled; fix by treating the cleanup as best-effort:
either set macos_manual_agent_install to false before calling
deleteBootstrapPackage, or (preferred) wrap updateSetupExperienceSettings in its
own try/catch so deleteBootstrapPackage success is honored regardless of PATCH
outcome—use the functions deleteBootstrapPackage and
updateSetupExperienceSettings and the currentTeamId/macos_manual_agent_install
flag in BootstrapPackage.tsx, ensure the UI flash for deletion is only tied to
deleteBootstrapPackage success and log or silently ignore PATCH errors while
keeping the admin-visible state consistent.

In `@frontend/services/entities/teams.ts`:
- Around line 27-30: The ILoadTeamResponse interface currently claims both team
and fleet exist simultaneously; change it to reflect that the backend returns
one field aliased as either name by making team and fleet optional (team?:
ITeamConfig; fleet?: ITeamConfig) or, preferably, convert the interface to a
union type (export type ILoadTeamResponse = { team: ITeamConfig } | { fleet:
ITeamConfig }) so callers of ILoadTeamResponse, and code referring to
data.team/data.fleet, correctly model a single present property; update any
usage that assumes both properties exist to handle the optional/union shape.

---

Outside diff comments:
In `@frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx`:
- Around line 832-841: When rewriting filter query params in
handleChangeBootstrapPackageStatusFilter (and the other host filter handlers
that add macos_bootstrap_package / apple_settings), remove the deprecated alias
keys (bootstrap_package and macos_settings) from the queryParams before calling
getNextLocationPath; i.e., build the new queryParams by spreading queryParams
but explicitly deleting or omitting bootstrap_package and macos_settings and
then setting macos_bootstrap_package (or apple_settings) so the URL contains
only the canonical keys; update the analogous handler at the other block to do
the same.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 917bf6bf-e19c-4a81-bb09-3bd8a78765e0

📥 Commits

Reviewing files that changed from the base of the PR and between 915feb9 and 4b472df.

📒 Files selected for processing (28)
  • frontend/__mocks__/configMock.ts
  • frontend/__mocks__/hostMock.ts
  • frontend/__mocks__/mdmMock.ts
  • frontend/interfaces/config.ts
  • frontend/interfaces/host.ts
  • frontend/interfaces/team.ts
  • frontend/pages/ManageControlsPage/OSSettings/cards/DiskEncryption/DiskEncryption.tsx
  • frontend/pages/ManageControlsPage/OSSettings/cards/Passwords/Passwords.tsx
  • frontend/pages/ManageControlsPage/SetupExperience/cards/BootstrapPackage/BootstrapPackage.tsx
  • frontend/pages/ManageControlsPage/SetupExperience/cards/BootstrapPackage/components/BootstrapAdvancedOptions/BootstrapAdvancedOptions.tsx
  • frontend/pages/ManageControlsPage/SetupExperience/cards/BootstrapPackage/components/BootstrapPackageTable/BootstrapPackageTableConfig.tsx
  • frontend/pages/ManageControlsPage/SetupExperience/cards/EndUserAuthentication/EndUserAuthentication.tsx
  • frontend/pages/ManageControlsPage/SetupExperience/cards/InstallSoftware/InstallSoftware.tsx
  • frontend/pages/ManageControlsPage/SetupExperience/cards/RunScript/RunScript.tsx
  • frontend/pages/ManageControlsPage/SetupExperience/cards/SetupAssistant/SetupAssistant.tsx
  • frontend/pages/ManageControlsPage/SetupExperience/helpers.ts
  • frontend/pages/hosts/ManageHostsPage/HostsPageConfig.tsx
  • frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx
  • frontend/pages/hosts/ManageHostsPage/components/HostsFilterBlock/HostsFilterBlock.tsx
  • frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx
  • frontend/pages/hosts/details/HostDetailsPage/HostDetailsPage.tsx
  • frontend/pages/hosts/details/OSSettingsModal/OSSettingsTable/OSSettingsTableConfig.tsx
  • frontend/pages/hosts/details/cards/HostSummary/OSSettingsIndicator/OSSettingsIndicator.tsx
  • frontend/services/entities/hosts.ts
  • frontend/services/entities/mdm.ts
  • frontend/services/entities/teams.ts
  • frontend/utilities/url/index.ts
  • frontend/utilities/url/url.tests.ts

Comment thread frontend/services/entities/teams.ts
@sgress454
sgress454 marked this pull request as ready for review March 27, 2026 17:57
@sgress454
sgress454 requested a review from a team as a code owner March 27, 2026 17:57
Copilot AI review requested due to automatic review settings March 27, 2026 17:57

@claude claude Bot left a comment

Copy link
Copy Markdown

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 and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

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

Updates the Fleet frontend to use the newly aliased/renamed multiplatform API keys (notably for Apple settings and Setup Experience), and aligns team/fleet config consumption with the updated response shape.

Changes:

  • Renames host query params and filters (e.g., macos_settingsapple_settings, bootstrap_packagemacos_bootstrap_package) while preserving legacy URL compatibility on initial load/clear.
  • Migrates Setup Experience + Apple settings consumers to the new config keys (e.g., macos_setupsetup_experience, manual_agent_installmacos_manual_agent_install).
  • Updates team config fetch/select logic to prefer the new .fleet response property.

Reviewed changes

Copilot reviewed 28 out of 29 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
frontend/utilities/url/url.tests.ts Updates URL utility tests to expect new query param keys.
frontend/utilities/url/index.ts Switches reconciled query param keys to the new aliases.
frontend/services/entities/teams.ts Updates team load response typing to include fleet key.
frontend/services/entities/mdm.ts Renames setup experience update payload keys to new aliases.
frontend/services/entities/hosts.ts Updates hosts API query params to send new filter keys.
frontend/pages/hosts/details/cards/HostSummary/OSSettingsIndicator/OSSettingsIndicator.tsx Updates wording to reflect Apple settings terminology.
frontend/pages/hosts/details/OSSettingsModal/OSSettingsTable/OSSettingsTableConfig.tsx Switches host MDM settings access to apple_settings.
frontend/pages/hosts/details/HostDetailsPage/HostDetailsPage.tsx Switches host MDM setup/settings access to new keys.
frontend/pages/hosts/details/DeviceUserPage/DeviceUserPage.tsx Switches host MDM setup/settings access to new keys.
frontend/pages/hosts/ManageHostsPage/components/HostsFilterBlock/HostsFilterBlock.tsx Updates filter labels and clears both canonical + legacy params.
frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx Reads canonical params with fallback to legacy; writes canonical params on change.
frontend/pages/hosts/ManageHostsPage/HostsPageConfig.tsx Whitelists both canonical + legacy query param keys for manage-hosts routing behavior.
frontend/pages/ManageControlsPage/SetupExperience/helpers.ts Updates manual agent install config lookup to new setup_experience key.
frontend/pages/ManageControlsPage/SetupExperience/cards/SetupAssistant/SetupAssistant.tsx Selects .fleet and updates release-device flag key.
frontend/pages/ManageControlsPage/SetupExperience/cards/RunScript/RunScript.tsx Selects .fleet for team config in Setup Experience.
frontend/pages/ManageControlsPage/SetupExperience/cards/InstallSoftware/InstallSoftware.tsx Selects .fleet and updates config field path to setup_experience.
frontend/pages/ManageControlsPage/SetupExperience/cards/EndUserAuthentication/EndUserAuthentication.tsx Selects .fleet and updates config field path to setup_experience.
frontend/pages/ManageControlsPage/SetupExperience/cards/BootstrapPackage/components/BootstrapPackageTable/BootstrapPackageTableConfig.tsx Updates “view all hosts” link param to macos_bootstrap_package.
frontend/pages/ManageControlsPage/SetupExperience/cards/BootstrapPackage/components/BootstrapAdvancedOptions/BootstrapAdvancedOptions.tsx Updates API payload key to macos_manual_agent_install.
frontend/pages/ManageControlsPage/SetupExperience/cards/BootstrapPackage/BootstrapPackage.tsx Selects .fleet and updates API payload key to macos_manual_agent_install.
frontend/pages/ManageControlsPage/OSSettings/cards/Passwords/Passwords.tsx Selects .fleet for team config in OS settings.
frontend/pages/ManageControlsPage/OSSettings/cards/DiskEncryption/DiskEncryption.tsx Selects .fleet for team config in OS settings.
frontend/interfaces/team.ts Renames team MDM config keys to new aliases.
frontend/interfaces/host.ts Renames host MDM data keys to new aliases.
frontend/interfaces/config.ts Renames global MDM config keys to new aliases.
frontend/mocks/mdmMock.ts Updates mock host MDM keys to new aliases.
frontend/mocks/hostMock.ts Updates mock host MDM keys to new aliases.
frontend/mocks/configMock.ts Updates mock global MDM config keys to new aliases.
changes/41601-use-multiplatform-names-in-front-end Adds user-visible change note.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 190 to 195
if (macSettingsStatus) {
// ensure macos_settings filter is always applied in
// ensure apple_settings filter is always applied in
// conjunction with a fleet_id, 0 (no fleets) by default
reconciled.macos_settings = macSettingsStatus;
reconciled.apple_settings = macSettingsStatus;
reconciled.fleet_id = teamId ?? 0;
}

Copilot AI Mar 27, 2026

Copy link

Choose a reason for hiding this comment

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

reconcileMutuallyInclusiveHostParams currently always initializes reconciled with fleet_id: teamId, so when teamId is undefined and no inclusive filters are set it returns { fleet_id: undefined }. That contradicts the unit test case that expects an empty object when neither macSettingsStatus nor teamId are present. Consider only including fleet_id when teamId is defined (or when a filter requires defaulting it to 0), so the "no params" case returns {}.

Copilot uses AI. Check for mistakes.
Comment thread frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx
Comment thread frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx
Comment thread frontend/services/entities/teams.ts

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

Assuming I understand what's going on correctly with the one line-level comment I added, we're good to go here I think. Copilot's reviews seem a bit off-base here.

label={label}
onClear={() => handleClearFilter(["macos_settings"])}
onClear={() =>
handleClearFilter(["macos_settings", "apple_settings"])

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.

Do we need to specify both here because we want URL parameters with the older names to continue working with the new UI? Seems to match how HostsPageConfig.tsx changes are?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I thought we did but after going through and testing everything, I found we rewrite the keys in the URL so I'm pretty sure macos_settings is never going to be there to clear. It doesn't hurt to keep it for now in case there's an edge case I'm missing. We'll do a sweep and 🔪 all older keys for good in Fleet 5.

@sgress454
sgress454 merged commit f1bad72 into main Mar 30, 2026
23 checks passed
@sgress454
sgress454 deleted the sgress454/update-frontend-to-use-new-multiplatform-keys branch March 30, 2026 13:56
This was referenced Apr 8, 2026
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.

Update frontend API params to use aliased setup experience keys

3 participants