Skip to content

Partial revert of #38785 work-in-progress#44061

Merged
getvictor merged 1 commit intomainfrom
victor/38785-revert
Apr 24, 2026
Merged

Partial revert of #38785 work-in-progress#44061
getvictor merged 1 commit intomainfrom
victor/38785-revert

Conversation

@getvictor
Copy link
Copy Markdown
Member

@getvictor getvictor commented Apr 23, 2026

Related issue: Resolves #38785

This feature has been pushed to 4.86

Summary by CodeRabbit

Release Notes

  • Setup Experience Updates
    • Windows: Automatic cancellation of pending setup steps when required software installation fails has been removed from the device setup experience
    • macOS: Device setup experience behavior remains unchanged, continuing to enforce software requirements during enrollment
    • Behavior is now platform-specific to align with individual operating system requirements

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.83%. Comparing base (2d687d9) to head (b1bddaf).
⚠️ Report is 66 commits behind head on main.

Files with missing lines Patch % Lines
server/service/setup_experience.go 77.77% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #44061   +/-   ##
=======================================
  Coverage   66.83%   66.83%           
=======================================
  Files        2609     2609           
  Lines      210477   210496   +19     
  Branches     9268     9268           
=======================================
+ Hits       140668   140682   +14     
- Misses      56992    56996    +4     
- Partials    12817    12818    +1     
Flag Coverage Δ
backend 68.62% <77.77%> (+<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.

@getvictor getvictor marked this pull request as ready for review April 23, 2026 18:04
Copilot AI review requested due to automatic review settings April 23, 2026 18:04
@getvictor getvictor requested a review from a team as a code owner April 23, 2026 18:04
Copy link
Copy Markdown

@claude claude Bot left a comment

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.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 23, 2026

Walkthrough

This pull request removes Windows-specific setup experience cancellation functionality and restricts the "cancel pending steps" behavior to macOS only. The changes eliminate the RequireAllSoftwareWindows configuration handling from isAllSetupExperienceSoftwareRequired, modify maybeCancelPendingSetupExperienceSteps to return early for non-darwin platforms, and delete the associated unit test that validated the Windows-specific behavior across multiple platforms.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is minimal but adequate for a revert. It identifies the related issue (#38785), notes the feature has been pushed to 4.86, but lacks checklist details. Complete the PR description checklist by explicitly stating which items apply and which were intentionally skipped for this revert.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: a partial revert of the work-in-progress changes from PR #38785.
Linked Issues check ✅ Passed The PR performs a partial revert of #38785 by removing Windows-specific cancel behavior and restoring macOS-only logic, which aligns with the issue's requirements for controlled rollback.
Out of Scope Changes check ✅ Passed All changes are scoped to reverting Windows setup experience cancel behavior introduced in #38785; changes align with the partial revert objective.
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 victor/38785-revert

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
server/service/setup_experience.go (1)

240-257: Simplified logic looks correct; consider small readability tweak.

The revert correctly drops the host.Platform/RequireAllSoftwareWindows branching and now resolves RequireAllSoftware from either the app config (no team) or the team config. Logic is fine, but the local requireAllSoftware variable can be returned directly from each branch to avoid the extra assignment-then-return pattern.

♻️ Optional simplification
 func isAllSetupExperienceSoftwareRequired(ctx context.Context, ds fleet.Datastore, host *fleet.Host) (bool, error) {
 	teamID := host.TeamID
-	requireAllSoftware := false
 	if teamID == nil || *teamID == 0 {
 		ac, err := ds.AppConfig(ctx)
 		if err != nil {
 			return false, ctxerr.Wrap(ctx, err, "getting app config")
 		}
-		requireAllSoftware = ac.MDM.MacOSSetup.RequireAllSoftware
-	} else {
-		team, err := ds.TeamLite(ctx, *teamID)
-		if err != nil {
-			return false, ctxerr.Wrap(ctx, err, "load team")
-		}
-		requireAllSoftware = team.Config.MDM.MacOSSetup.RequireAllSoftware
+		return ac.MDM.MacOSSetup.RequireAllSoftware, nil
 	}
-	return requireAllSoftware, nil
+	team, err := ds.TeamLite(ctx, *teamID)
+	if err != nil {
+		return false, ctxerr.Wrap(ctx, err, "load team")
+	}
+	return team.Config.MDM.MacOSSetup.RequireAllSoftware, nil
 }

Also note: since host is no longer dereferenced here, the signature could in principle drop the unused fields, but keeping *fleet.Host aligns with the caller and IsAllSetupExperienceSoftwareRequired wrapper, so leaving it is fine.

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

In `@server/service/setup_experience.go` around lines 240 - 257, The function
isAllSetupExperienceSoftwareRequired uses a local requireAllSoftware variable
unnecessarily; simplify by returning the resolved value directly from each
branch to improve readability: inside the nil/zero teamID branch, after fetching
ac := ds.AppConfig(ctx), return ac.MDM.MacOSSetup.RequireAllSoftware (wrapping
errors with ctxerr.Wrap as currently done), and in the else branch after loading
team via ds.TeamLite(ctx, *teamID), return
team.Config.MDM.MacOSSetup.RequireAllSoftware (again preserving error wrapping).
Keep the same error handling and function signature.
🤖 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/service/setup_experience.go`:
- Around line 240-257: The function isAllSetupExperienceSoftwareRequired uses a
local requireAllSoftware variable unnecessarily; simplify by returning the
resolved value directly from each branch to improve readability: inside the
nil/zero teamID branch, after fetching ac := ds.AppConfig(ctx), return
ac.MDM.MacOSSetup.RequireAllSoftware (wrapping errors with ctxerr.Wrap as
currently done), and in the else branch after loading team via ds.TeamLite(ctx,
*teamID), return team.Config.MDM.MacOSSetup.RequireAllSoftware (again preserving
error wrapping). Keep the same error handling and function signature.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9b37fafb-82ca-41cd-a5c6-10740cf5b919

📥 Commits

Reviewing files that changed from the base of the PR and between 9ff63eb and b1bddaf.

📒 Files selected for processing (3)
  • changes/38785-windows-setup-experience-cancel
  • server/service/setup_experience.go
  • server/service/setup_experience_test.go
💤 Files with no reviewable changes (2)
  • changes/38785-windows-setup-experience-cancel
  • server/service/setup_experience_test.go

Comment thread server/service/setup_experience.go
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 partially reverts work related to Windows “cancel setup if software fails” by removing Windows-specific handling in the setup experience service logic and dropping the accompanying changelog entry.

Changes:

  • Remove Windows platform branching for determining “require all software” in setup experience configuration lookup.
  • Restrict setup-experience step cancellation to macOS hosts only.
  • Remove the changes/ entry that documented the Windows setting/behavior.

Reviewed changes

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

File Description
server/service/setup_experience.go Removes Windows-specific “require all software” lookup and limits cancellation logic to macOS.
server/service/setup_experience_test.go Deletes unit test coverage that verified platform-specific config behavior.
changes/38785-windows-setup-experience-cancel Removes the changelog entry describing the Windows setting/behavior.

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

Comment thread server/service/setup_experience.go
Comment thread server/service/setup_experience.go
Comment thread server/service/setup_experience.go
Comment thread server/service/setup_experience_test.go
Comment thread server/service/setup_experience.go
Copy link
Copy Markdown
Contributor

@ksykulev ksykulev left a comment

Choose a reason for hiding this comment

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

As far as I can see no docs or api that reference it and nothing in the front end. looks good.

@getvictor getvictor merged commit 5b82531 into main Apr 24, 2026
75 of 77 checks passed
@getvictor getvictor deleted the victor/38785-revert branch April 24, 2026 18:36
getvictor added a commit that referenced this pull request Apr 28, 2026
This reverts commit 5b82531.

<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #38785 



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **New Features**
* Windows setup experience now supports requiring all software
installations: enrollment can be configured to cancel if any required
software fails to install.

* **Tests**
* Added test coverage for platform-specific setup software requirements.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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.

Windows setup experience: If software fails cancel setup

3 participants