Skip to content

Fix code default profile - #44601

Merged
MagnusHJensen merged 3 commits into
mainfrom
fix-code-default-profile
May 1, 2026
Merged

Fix code default profile#44601
MagnusHJensen merged 3 commits into
mainfrom
fix-code-default-profile

Conversation

@MagnusHJensen

@MagnusHJensen MagnusHJensen commented May 1, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Changes
    • Updated the default Apple DEP enrollment profile: devices are now marked as supervised and the MDM profile is non-removable.
    • Simplified the returned default profile by removing several previously hard-coded enrollment defaults, reducing complexity and aligning behavior with external templates.

Copilot AI review requested due to automatic review settings May 1, 2026 17:36
@MagnusHJensen
MagnusHJensen requested a review from a team as a code owner May 1, 2026 17:36

@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 Fleet’s in-code default Apple DEP enrollment profile to match the intended “default profile” configuration (as used when no custom Setup Assistant profile is provided).

Changes:

  • Simplifies the default DEP profile fields to a smaller, stricter default (supervised + non-removable).
  • Clears the previous default skip list and other previously hard-coded defaults in favor of a minimal baseline.
  • Adds an inline note to keep the fleetctl “new” template in sync with this default.

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

Comment thread server/mdm/apple/apple_mdm.go Outdated
Comment thread server/mdm/apple/apple_mdm.go
@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

The GetDefaultProfile implementation in the Apple MDM module was simplified: explicit DEP enrollment defaults for pairing, auto-advance setup, multi-user mode, mandatory state, language/organization-magic, and a populated SkipSetupItems list were removed. The returned default profile now sets IsSupervised: true, sets IsMDMRemovable: false, and provides an empty skip-items list. A comment was added noting this definition must remain in sync with an external fleetctl template.

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided by the author; the required template sections are entirely missing. Add a detailed description including the related issue number, testing information, and any relevant checklist items from the repository's template.
Title check ❓ Inconclusive The title 'Fix code default profile' is vague and generic; it lacks specificity about what aspect of the default profile is being fixed or why. Use a more descriptive title such as 'Simplify DEP enrollment defaults and configure MDM profile settings' or 'Set supervised mode and non-removable MDM profile for default DEP enrollment'.
✅ Passed checks (3 passed)
Check name Status Explanation
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.

✏️ 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 fix-code-default-profile

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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@server/mdm/apple/apple_mdm.go`:
- Line 110: The struct literal sets SkipSetupItems to an empty slice
([]string{}) which will be marshaled away due to the
`json:"skip_setup_items,omitempty"` tag; change the initialization in
apple_mdm.go to use nil for SkipSetupItems (i.e., omit the field or set it to
nil) so it round-trips as nil and matches the expected in-memory default used by
the equality check in server/service/integration_mdm_dep_test.go; if you
actually need an explicit empty array instead, adjust the JSON tag on
godep.Profile.SkipSetupItems instead of using []string{} here.
🪄 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: 3e5031d7-b90b-44b7-8bd6-0e2ae34f7801

📥 Commits

Reviewing files that changed from the base of the PR and between 8755a4d and c69f960.

📒 Files selected for processing (1)
  • server/mdm/apple/apple_mdm.go

Comment thread server/mdm/apple/apple_mdm.go Outdated
@codecov

codecov Bot commented May 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.70%. Comparing base (8755a4d) to head (5d3433c).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #44601      +/-   ##
==========================================
+ Coverage   66.68%   66.70%   +0.01%     
==========================================
  Files        2645     2649       +4     
  Lines      212833   213274     +441     
  Branches     9610     9610              
==========================================
+ Hits       141928   142262     +334     
- Misses      58002    58064      +62     
- Partials    12903    12948      +45     
Flag Coverage Δ
backend 68.57% <100.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.

@MagnusHJensen

Copy link
Copy Markdown
Member Author

Removed the empty slice, and I think it's fine to have that in the .json, as it will be unmarshalled into nil, since it's empty.

@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)
server/mdm/apple/apple_mdm.go (1)

105-105: ⚡ Quick win

Make the sync note actionable with an exact template path.

This reminder is helpful; please include the concrete fleetctl new template file path in the comment so future updates don’t rely on tribal knowledge.

♻️ Suggested tweak
-	// If this definition change, make sure to update the fleetctl new template file
+	// If this definition changes, update <exact fleetctl template filepath> in the same PR.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@server/mdm/apple/apple_mdm.go` at line 105, Update the inline comment that
currently reads "// If this definition change, make sure to update the fleetctl
new template file" in apple_mdm.go so it includes the exact repository-relative
path to the corresponding fleetctl "new" template (replace the vague reminder
with a concrete path to the template file used by fleetctl new), e.g., change
the comment on that line to reference the precise template file location so
future edits know exactly which template to update.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@server/mdm/apple/apple_mdm.go`:
- Line 105: Update the inline comment that currently reads "// If this
definition change, make sure to update the fleetctl new template file" in
apple_mdm.go so it includes the exact repository-relative path to the
corresponding fleetctl "new" template (replace the vague reminder with a
concrete path to the template file used by fleetctl new), e.g., change the
comment on that line to reference the precise template file location so future
edits know exactly which template to update.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d967f0f4-2c9d-4fe8-abba-1db49976dafa

📥 Commits

Reviewing files that changed from the base of the PR and between c69f960 and 5d3433c.

📒 Files selected for processing (1)
  • server/mdm/apple/apple_mdm.go

@JordanMontgomery

Copy link
Copy Markdown
Member

Removed the empty slice, and I think it's fine to have that in the .json, as it will be unmarshalled into nil, since it's empty.

Only question about removing the empty slice does that cause it to send null to Apple? or empty array? Can you tell? I wonder if the Apple API is OK with null

@MagnusHJensen
MagnusHJensen merged commit 3675be2 into main May 1, 2026
40 of 41 checks passed
@MagnusHJensen
MagnusHJensen deleted the fix-code-default-profile branch May 1, 2026 18:27
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.

3 participants