fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Setup experience: scope software via labels on macOS, Windows and Linux

Open marko-lisica opened this issue 1 year ago • 21 comments

Goal

User story
As an IT admin,
I want to install software (Fleet-maintained apps, App Store apps, or custom packages) during new host setup only on hosts that are a member of the specific label
so that I can scope software install more granularly (e.g. by department, role, software architecture, etc. OR to scope a stable version to new hosts.

Changes

Software's labels (scope) should be respected in setup experience for all supported platforms.

When a host enrolls, enqueueSetupExperienceItems selects every item flagged install_during_setup for the host's team and platform with no label filtering, so out-of-scope software is installed on and shown to the enrolling host. This story adds per-host label-scope filtering at enrollment, reusing the scope logic that already gates the normal install paths. Multi-platform setup experience, multiple packages per title, and the tabbed Install software UI already shipped, so label scope is the remaining gap.

More details in Figma

Product

  • [x] UI changes: Figma. The tabbed Install software UI already shipped; the dev notes (remove help text, Versions tooltip copy, first-added tooltip) appear delivered by #49079 and are verified in QA (#49407).
  • [x] CLI (fleetctl) usage changes: No changes
  • [x] YAML changes: Re-apply the setup_experience note reverted by #27119, updated for all platforms + label scope. Tracked in #49407.
  • [x] REST API changes: No changes. Setup experience selection is team-level and host-independent; scope filtering happens at enrollment.
  • [x] Fleet's agent (fleetd) changes: No changes
  • [x] Fleet server configuration changes: No changes
  • [x] Exposed, public API endpoint changes: No changes
  • [x] fleetdm.com changes: No changes
  • [x] GitOps mode UI changes: No changes
  • [x] GitOps generation changes: No changes
  • [x] Activity changes: No changes
  • [x] Permissions changes: No changes
  • [x] Changes to paid features or tiers: No changes. Custom packages and VPP are already Fleet Premium.
  • [x] My device and fleetdm.com/better changes: No changes
  • [x] Usage statistics: No changes
  • [x] Other reference documentation changes: articles/macos-setup-experience.md. Tracked in #49407.
  • [x] First draft of test plan added

Engineering

  • [x] Test plan is finalized
  • [x] Contributor API changes: No changes.
  • [x] Feature guide changes: articles/macos-setup-experience.md — note that setup experience respects label scope. Tracked in #49407.
  • [x] Database schema migrations: No changes. software_installer_labels, vpp_app_team_labels, and label_membership already exist.
  • [x] Load testing: Not required. The enqueue query gains an EXISTS scope predicate per software union part, run once per host at enrollment; same order as the existing per-item scope checks on the normal install path.
  • [x] Pre-QA load test: Not required.
  • [x] Load testing/osquery-perf improvements: None.
  • [x] This is a premium only feature: Yes. Scope tables and setup experience are already premium-gated; no new tier gating.

Risk assessment

  • Requires testing in a hosted environment: No. Local dev with hosts on each platform is sufficient.
  • Requires load testing: No.
  • Risk level: Low
  • Regression watch: no-label software must still install on every host; exclude-any must honor the label_updated_at vs label created_at timing for dynamic labels; the first-added dedup must select the first-added in-scope package per title.

Test plan

Make sure to go through the list and consider all events that might be related to this story, so we catch edge cases earlier.

Core flow

  • [ ] Mark software for setup experience with an include-any label. Enroll an in-scope host and an out-of-scope host. Confirm only the in-scope host installs it and shows it in setup progress.
  • [ ] Repeat with an exclude-any label.
  • [ ] Repeat with an include-all label.
  • [ ] Confirm software with no labels still installs on every host.

Platforms

  • [ ] macOS (Apple MDM / DEP).
  • [ ] Windows and Linux (Orbit enrollment).
  • [ ] iOS or iPadOS (VPP app).

GitOps

  • [ ] Set setup_experience: true on a label-scoped software item, run fleetctl gitops, enroll a host, and confirm scope is respected.

Edge cases

  • [ ] Two in-scope packages for one title: only the first-added installs.
  • [ ] First-added package out of scope, a later one in scope: the later one installs.
  • [ ] Host re-enrollment (failed-step reset) still applies scope and skips already-succeeded items.

Permissions

  • [ ] Setup experience configuration is premium; confirm no per-role behavior change.

Testing notes

Android is out of scope: it does not use the setup experience enqueue flow (software is baked into the Android policy at enroll).

Confirmation

  1. [ ] Engineer: Added comment to user story confirming successful completion of test plan.
  2. [ ] QA: Added comment to user story confirming successful completion of test plan.
  3. [ ] QA: Determined whether this story needs Playwright automation.
    • Needs automation: Yes / No
    • If yes, filed a follow-up issue in the :help-qa project with status "Needs automation":

marko-lisica avatar Dec 23 '24 13:12 marko-lisica

@mostlikelee I'm moving this to you. There's an open question on the API, however, which I think is in your corner. LMK if that's not the case/how you'd like to proceed on that question.

Thanks!

eugkuo avatar Jan 10 '25 13:01 eugkuo

calling out here that there may be dependencies here with the new unified MDM queue

mostlikelee avatar Jan 16 '25 18:01 mostlikelee

Hey @mostlikelee just a reminder that this story is ready to spec. Can you please fill out the TODOs in the "Engineering" section so we can estimate this one?

noahtalerman avatar Jan 21 '25 15:01 noahtalerman

@jmwatts can you take a 👀 at the QA plan?

mostlikelee avatar Jan 22 '25 16:01 mostlikelee

@mostlikelee the test plan looks good unless there will be specific things we will be able to do with the API that we were not able to do previously.

jmwatts avatar Jan 22 '25 23:01 jmwatts

  • GitOps error cases:
    • If setup_experience is set to true for a Windows or Linux package, we see the error spec'd here: https://github.com/fleetdm/fleet/pull/25338/files#r1932537780
    • If setup_experience is set to true for one or more software items and macos_setup.software is defined, we see the error spec'd here: https://github.com/fleetdm/fleet/pull/25338/files#r1931046283

@mostlikelee @jmwatts heads up that we missed drafting some error messages (see above). I added these to the "Test plan" section.

noahtalerman avatar Jan 28 '25 23:01 noahtalerman

Question from @RachelElysia:

Are we going to show the labels that are included/excluded?

Image

@noahtalerman: Yep! We show those labels in a tooltip on hover:

Image

Regarding the underline to know it's a tooltip, great catch. We use italics in this scenario where we show a tooltip with an arrow. I just updated Figma.

noahtalerman avatar Feb 05 '25 16:02 noahtalerman

I chatted with and we think it makes sense to deprioritize this story.

More context in the video here: https://drive.google.com/file/d/1gP5_0oSnhyNDU68llfxZf7Hfkx6L35ar/view?usp=sharing

noahtalerman avatar Mar 11 '25 22:03 noahtalerman

Granular control gained, Macs boot, software installed right, Fleet flows like cloud rain.

fleet-release avatar Mar 11 '25 22:03 fleet-release

Whoops, just meant to remove :product. Didn't mean to close the issue.

noahtalerman avatar Mar 11 '25 22:03 noahtalerman

Goal 2

User story
As an IT admin,
I want to install custom packages during new host setup only on hosts that are a member of the specific label
so that I can install the stable version of a custom package to new hosts while testing a new version on a test group of already enrolled hosts.

FYI @marko-lisica I wrote down a second story for this because we decided to address this story after multiple packages for one software title:

Image

noahtalerman avatar May 19 '26 20:05 noahtalerman

This is ready to be worked on.

marko-lisica avatar Jul 14 '26 11:07 marko-lisica

Hey @georgekarrv heads up that I assigned you this issue because I saw that subtasks are filed. So, I assume we're ready to move this one "Ready" during the next sprint planning.

Image

(https://fleetdm.com/handbook/company/product-groups#how-issues-move)

cc @cdcme @marko-lisica

noahtalerman avatar Jul 28 '26 16:07 noahtalerman

@marko-lisica chatted about this one during feature fest...IdP labels and any dynamic labels that require a user to exist won't work, right? If yes, let's make sure we document yet.

noahtalerman avatar Sep 17 '26 17:09 noahtalerman

@marko-lisica Quick question for you.

When a brand-new host enrolls, it hasn't run any label queries yet. So if software is scoped to a query-based label, we can't tell whether the host matches when setup starts. Manual labels and host vitals labels (IdP group, department) aren't affected, we already know those.

Two ways we could handle it:

  • Skip the software during setup. It installs right after through the normal path once the host reports labels. Simple, same behavior on every platform.
  • Hold setup until the host reports labels. Gets things like arch-specific packages into setup, but only on macOS, Windows, and Linux.

If we skip, do we want a short hint in the UI that query-based labels kick in after the host reports (the Figma removes the current "labels don't apply" footer), or is covering it in the guide enough?

cdcme avatar Sep 18 '26 13:09 cdcme

Can we support these: https://github.com/fleetdm/fleet/issues/39088?

marko-lisica avatar Sep 18 '26 15:09 marko-lisica

@marko-lisica @cdcme are all platforms covered by this story? We're about to build scoping Android software with labels.

Leanngove avatar Sep 23 '26 18:09 Leanngove

@marko-lisica @cdcme are all platforms covered by this story? We're about to build scoping Android software with labels.

@cdcme What do you think how should we do this. Should we split this into 2 stories: one for desktop (platforms running fleetd) and on for mobile?

marko-lisica avatar Sep 24 '26 14:09 marko-lisica

@marko-lisica yeah, I'd lean toward keeping them distinct.

cdcme avatar Sep 24 '26 15:09 cdcme

@Leanngove @cdcme I just renamed this issue. It should cover desktop platforms: macOS, Windows, and Linux.

I'll file new stories for iOS and Android.

marko-lisica avatar Sep 24 '26 15:09 marko-lisica