Skip to content

Rename policy detector and references to Management#6

Merged
rodchristiansen merged 4 commits into
mainfrom
refactor/policy-to-management
Jun 16, 2026
Merged

Rename policy detector and references to Management#6
rodchristiansen merged 4 commits into
mainfrom
refactor/policy-to-management

Conversation

@rodchristiansen

Copy link
Copy Markdown
Contributor

What

Renames the Windows "Policy" detector abstraction to "Management", unifying it with the macOS side (where MDMDetectorManagementDetector in a sibling PR). One mental model across both platforms.

  • PolicyDetectorManagementDetector (file + type)
  • IsManagedByPolicy / IsPolicyManagedIsManaged
  • ConfigSource.PolicyConfigSource.Management
  • LoadFromPolicyLoadFromManagement, LoadPolicyAndUserSettingsLoadManagementAndUserSettings
  • comment/section references to "Policy" state → "Management"

Kept as-is (intentional)

These name the actual Windows Group Policy mechanism, not our abstraction — and per request the registry path stays put:

  • HKLM\SOFTWARE\Policies\BootstrapMate registry path and its PolicyRegistryPath constant
  • the ADMX/ADML templates and BootstrapMate.Policies namespace
  • "Group Policy" / "Intune CSP" wording in comments

Safety

Pure rename, no behavioural change. ⚠️ Not built locally (dotnet unavailable on the author's machine) — relying on CI (windows-latest, dotnet 10) to compile-verify. Please confirm CI is green before merging.

Notes

Based on main, independent of the Authenticode PR #5 (which also touches ConfigManager.cs / PolicyDetectorManagementDetector). If both land, expect a merge resolution; happy to rebase whichever merges second.

Unify the management-detection vocabulary with the macOS side (where
MDMDetector becomes ManagementDetector), so both platforms share one model:

- PolicyDetector -> ManagementDetector (file + type)
- IsManagedByPolicy / IsPolicyManaged -> IsManaged
- ConfigSource.Policy -> ConfigSource.Management
- LoadFromPolicy -> LoadFromManagement, LoadPolicyAndUserSettings ->
  LoadManagementAndUserSettings
- comment/section references to 'Policy' state -> 'Management'

Kept as-is (Windows Group Policy platform terms, not our abstraction):
the HKLM\SOFTWARE\Policies\BootstrapMate registry path and its
PolicyRegistryPath constant, the ADMX/ADML templates, and 'Group Policy' /
'Intune CSP' wording that names the actual OS mechanism.

Pure rename — no behavioural change.

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

Pull request overview

This PR renames the Windows “Policy” management abstraction to “Management” to align terminology and naming with the macOS side, while keeping references to the actual Windows Group Policy mechanism (registry path / ADMX namespace) intact.

Changes:

  • Rename PolicyDetectorManagementDetector and update related method names (IsManagedByPolicyIsManaged).
  • Rename config source and loaders (ConfigSource.PolicyConfigSource.Management, LoadPolicyAndUserSettingsLoadManagementAndUserSettings, LoadFromPolicyLoadFromManagement).
  • Update UI/viewmodel wording and references from “policy” to “management” where it refers to the abstraction.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/BootstrapMate.Core/ManagementDetector.cs Renames the detector type and public API to “Management” while preserving registry-based detection behavior.
src/BootstrapMate.Core/ConfigManager.cs Updates config loading/sourcing terminology and calls into ManagementDetector.
src/BootstrapMate.App/ViewModels/PrefsViewModel.cs Updates viewmodel terminology and uses ManagementDetector for lock-state computation.

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

Comment on lines 7 to 10
/// <summary>
/// ViewModel for the Prefs tab. Mirrors macOS SettingsViewModel.
/// Loads from ConfigManager, saves non-policy settings via elevated CLI, shows policy lock state.
/// Loads from ConfigManager, saves non-managed settings via elevated CLI, shows management lock state.
/// </summary>
Comment on lines 104 to 108
/// <summary>
/// Save user-configured settings to HKLM\SOFTWARE\BootstrapMate\Settings.
/// Skips any key that is already policy-managed.
/// Requires elevation.
/// </summary>
SaveUserSettings writes to HKCU (no elevation), but the doc comments said
HKLM + 'Requires elevation' and still referred to 'policy-managed'. Update
both ConfigManager and PrefsViewModel comments to match the actual
behaviour: user-hive (HKCU) writes, skipping managed keys.
… reads

The signature PR added VerifyPackageSignatures/ExpectedPublisher/AllowUnsigned
reads in LoadFromPolicy using the 'policy' variable; this branch renamed that
method to LoadFromManagement with a 'management' variable. The textual merge
left the new reads referencing the old name — update them.
@rodchristiansen rodchristiansen force-pushed the refactor/policy-to-management branch from 2c2d4cd to ec42fb0 Compare June 16, 2026 01:47
@rodchristiansen rodchristiansen merged commit b5e3a68 into main Jun 16, 2026
2 checks passed
@rodchristiansen rodchristiansen deleted the refactor/policy-to-management branch June 16, 2026 01:58
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