Skip to content

Update apps when closed - #48662

Merged
allenhouchins merged 4 commits into
mainfrom
dogfood-update-when-app-closed
Jul 6, 2026
Merged

Update apps when closed#48662
allenhouchins merged 4 commits into
mainfrom
dogfood-update-when-app-closed

Conversation

@marko-lisica

@marko-lisica marko-lisica commented Jul 2, 2026

Copy link
Copy Markdown
Member

Related to: #39962

Summary by CodeRabbit

  • New Features
    • Added pre-install checks to prevent several fleet-managed app installs from starting while the apps are already running (including Slack and Zoom, plus others).
    • Enabled automatic update installation with continuous automations for a broad set of macOS and Windows apps, including Chrome, 1Password, Slack, Zoom, and Visual Studio Code.
  • Bug Fixes
    • Updated update guidance to direct users to Self-service for the latest versions, reducing conflicting “built-in update” instructions when apps are already running.

Enable software installation and continuous automations for Zoom.
@allenhouchins

allenhouchins commented Jul 2, 2026

Copy link
Copy Markdown
Member

@marko-lisica this change scares me! Doesn't setting install_software: true mean its just going to install Zoom whenever the policy fails, which could be in the middle of a Zoom meeting? continuous_automations_enabled just retries that action if the policy is still failing. There isn't any logic for don't install if software is running in this config currently.

Edit: NM! Just saw the recent commit.

…l software and continuous automation for patch policies
@marko-lisica

Copy link
Copy Markdown
Member Author

Hey @allenhouchins, sorry, I just opened PR real quick so I can work on it in the code editor. Now it's complete.

We want to dogfood what we planned for #39962. The idea is to add a query to the FMA manifest that checks if the app is running, and if yes install will fail. As part of this story we will improve UI to show "install skipped" instead of failure.

This way, we can use the existing interface to silently update apps when they are closed.

@marko-lisica
marko-lisica marked this pull request as ready for review July 2, 2026 20:52

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

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This PR adds pre-install query references for fleet-maintained macOS and Windows apps in workstations.yml, and adds the corresponding query files for detecting whether those apps are running. It also updates macOS and Windows patch policies to enable software installation and continuous automations, and revises resolution text to direct updates through Self-service.

Changes

Cohort: Fleet-maintained app gating and policy changes

Cohort / File(s) Summary
Pre-install queries Added macOS and Windows is-*-running.yml queries that check the processes table for matching app processes or paths
Fleet configuration wiring Added pre_install_query references for macOS and Windows fleet-maintained apps in workstations.yml
Patch policy updates Set install_software: true, added continuous_automations_enabled: true, and updated resolution text for macOS and Windows app policies

Sequence Diagram(s)

sequenceDiagram
  participant workstations.yml
  participant pre_install_query
  participant processes

  workstations.yml->>pre_install_query: Reference is-*-running.yml
  pre_install_query->>processes: Check app name or app path
  processes-->>pre_install_query: Matching process found or absent
  pre_install_query-->>workstations.yml: Return gate result
Loading

Estimated code review effort: Medium

Possibly related PRs

  • fleetdm/fleet#48022 — Both PRs modify it-and-security/fleets/workstations.yml app definitions for the same fleet-maintained apps.

Suggested labels: configuration, it-and-security, macos, windows

Suggested reviewers: None specified in the provided context.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only references issue #39962 and omits the required checklist, testing, and related details from the template. Expand it to include the issue link plus the template sections: checklist items, testing notes, database/GitOps items, and any applicable removals.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: enabling app updates once apps are closed.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dogfood-update-when-app-closed

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.

@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)
it-and-security/fleets/workstations.yml (1)

361-367: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Trailing whitespace on Slack's pre_install_query.path line.

Line 362 has trailing whitespace after is-slack-running.yml. Also note the key ordering differs between the Slack entry (pre_install_query placed after setup_experience) and the Zoom entry (pre_install_query placed first, before self_service/setup_experience) — purely cosmetic but worth aligning for consistency.

🧹 Proposed cleanup
     - slug: slack/darwin # Slack for macOS
       self_service: true
       setup_experience: true
       pre_install_query:
-        path: ../lib/macos/misc/pre-install-queries/is-slack-running.yml      
+        path: ../lib/macos/misc/pre-install-queries/is-slack-running.yml
       categories:
         - Communication
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@it-and-security/fleets/workstations.yml` around lines 361 - 367, Remove the
trailing whitespace on the Slack entry’s pre_install_query.path line in
workstations.yml, and align the Slack block’s key order with the Zoom block for
consistency. Use the existing Slack and Zoom stanza structure around the slug
and pre_install_query keys to update the YAML cleanly without changing behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@it-and-security/fleets/workstations.yml`:
- Around line 361-367: Remove the trailing whitespace on the Slack entry’s
pre_install_query.path line in workstations.yml, and align the Slack block’s key
order with the Zoom block for consistency. Use the existing Slack and Zoom
stanza structure around the slug and pre_install_query keys to update the YAML
cleanly without changing behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 077643c0-faaf-4258-aecb-6d58e756797e

📥 Commits

Reviewing files that changed from the base of the PR and between e762246 and 94f1f26.

📒 Files selected for processing (4)
  • it-and-security/fleets/workstations.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-slack-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-zoom-running.yml
  • it-and-security/lib/macos/policies/patch-fleet-maintained-apps.yml

@allenhouchins

Copy link
Copy Markdown
Member

@marko-lisica sorry I am QUICK any time a change is proposed to dogfood! :-) I saw your follow up commit as soon as I hit enter.

I might want to expand on this PR. There's no reason I wouldn't want this behavior on all apps, except for a few where I want to force an update regardless if its running or not — unless you can think of a reason not to that I might not be considering. I also want to double check the preinstall queries just to make sure they target the app without picking up on a background or helper app that then prevents the app from updating. I also want to update the Resolution message to say something like "This app will automatically update when its closed for an hour. You can also...." Or something like that. Any thoughts on the updated message?

@marko-lisica

Copy link
Copy Markdown
Member Author

except for a few where I want to force an update regardless if its running or not — unless you can think of a reason not to that I might not be considering

Sounds good to me. I don't see any reason why not. I assume Okta Verify is an app where you don't care whether it's open or not.

I also want to double check the preinstall queries just to make sure they target the app without picking up on a background or helper app that then prevents the app from updating.

I double checked these 2. I guess we could ask Claude to expand this PR to all apps and then review queries manually.

I also want to update the Resolution message to say something like "This app will automatically update when its closed for an hour. You can also...." Or something like that. Any thoughts on the updated message?

Hmm. I guess you'll need a resolution message if you're failing the policy. This will likely be for apps that are always open, so for those, the resolution is to open the self-service tab and hit update.

I guess we could add the sentence you proposed to the description: "This app will automatically update when it's closed for an hour."

We'll soon introduce notifications and a deadline, but even in that case, the resolution message can point to the self-service. Wdyt?

@marko-lisica

Copy link
Copy Markdown
Member Author

@allenhouchins ^

@marko-lisica marko-lisica changed the title Update Zoom policy to allow installations and automations Update apps when closed Jul 2, 2026
Add pre-install query checks for macOS and Windows apps to verify they're not running before installation. Enable continuous automations and automatic installation for fleet-maintained apps instead of requiring manual user action. Simplify policy resolution messages by removing references to built-in update functionality.

@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 (2)
it-and-security/lib/windows/policies/patch-fleet-maintained-apps.yml (1)

1-9: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Same resolution-text gap as the macOS policy file.

These Windows resolutions were also reworded to Self-service wording but likewise omit the "will auto-update once closed" explanation discussed in the PR conversation. Same suggestion applies here for consistency between platforms.

Also applies to: 20-28

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@it-and-security/lib/windows/policies/patch-fleet-maintained-apps.yml` around
lines 1 - 9, The Windows Slack policy resolution text in the
patch-fleet-maintained-apps YAML is missing the “will auto-update once closed”
explanation, creating a mismatch with the intended cross-platform wording.
Update the resolution for the Slack policy entry in this file so it matches the
macOS policy phrasing and clearly tells users that Slack will auto-update after
they close it, using the existing policy entry identifiers like the Slack app
slug and policy name to locate the affected block.
it-and-security/lib/macos/policies/patch-fleet-maintained-apps.yml (1)

3-9: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Resolution text doesn't yet mention the "auto-updates after being closed" behavior.

Per the PR discussion, the plan was to add a sentence clarifying that the app will automatically update once closed (e.g., for ~an hour), while still pointing users to Self-service for immediate updates. None of the reworded resolution (or description) strings in this diff include that explanation yet — as-is, users failing these policies will just see "Download the latest version from Self-service" with no indication that leaving the app closed will resolve it automatically.

Worth adding before this ships broadly, since it directly affects how confusing/actionable the failing-policy message is to end users.

Also applies to: 101-107

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@it-and-security/lib/macos/policies/patch-fleet-maintained-apps.yml` around
lines 3 - 9, The policy messaging for the Google Chrome maintained-app rule is
missing the planned auto-update guidance, so update the `resolution` (and any
related `description`) text in the maintained-app policy entry to mention that
the app will automatically update after it has been closed for a while, while
still directing users to Self-service for an immediate update. Use the
`resolution` field in this policy YAML as the primary place to add the
clarification, and keep the wording user-facing and actionable.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@it-and-security/lib/macos/policies/patch-fleet-maintained-apps.yml`:
- Around line 3-9: The policy messaging for the Google Chrome maintained-app
rule is missing the planned auto-update guidance, so update the `resolution`
(and any related `description`) text in the maintained-app policy entry to
mention that the app will automatically update after it has been closed for a
while, while still directing users to Self-service for an immediate update. Use
the `resolution` field in this policy YAML as the primary place to add the
clarification, and keep the wording user-facing and actionable.

In `@it-and-security/lib/windows/policies/patch-fleet-maintained-apps.yml`:
- Around line 1-9: The Windows Slack policy resolution text in the
patch-fleet-maintained-apps YAML is missing the “will auto-update once closed”
explanation, creating a mismatch with the intended cross-platform wording.
Update the resolution for the Slack policy entry in this file so it matches the
macOS policy phrasing and clearly tells users that Slack will auto-update after
they close it, using the existing policy entry identifiers like the Slack app
slug and policy name to locate the affected block.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6ba011be-0d3e-4364-8a26-2f5d55b2393d

📥 Commits

Reviewing files that changed from the base of the PR and between 1439804 and 77eaac7.

📒 Files selected for processing (42)
  • it-and-security/fleets/workstations.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-1password-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-android-studio-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-aws-vpn-client-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-brave-browser-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-claude-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-cursor-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-docker-desktop-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-figma-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-firefox-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-github-desktop-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-google-chrome-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-google-drive-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-grammarly-desktop-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-iterm2-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-logi-options-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-loom-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-obsidian-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-parallels-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-postman-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-rectangle-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-slack-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-spotify-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-sublime-text-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-utm-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-visual-studio-code-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-whatsapp-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-zed-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-zoom-running.yml
  • it-and-security/lib/macos/policies/patch-fleet-maintained-apps.yml
  • it-and-security/lib/macos/policies/update-claude.yml
  • it-and-security/lib/macos/policies/update-slack.yml
  • it-and-security/lib/windows/misc/pre-install-queries/is-1password-running.yml
  • it-and-security/lib/windows/misc/pre-install-queries/is-claude-running.yml
  • it-and-security/lib/windows/misc/pre-install-queries/is-firefox-running.yml
  • it-and-security/lib/windows/misc/pre-install-queries/is-google-chrome-running.yml
  • it-and-security/lib/windows/misc/pre-install-queries/is-slack-running.yml
  • it-and-security/lib/windows/misc/pre-install-queries/is-visual-studio-code-running.yml
  • it-and-security/lib/windows/misc/pre-install-queries/is-zoom-running.yml
  • it-and-security/lib/windows/policies/patch-fleet-maintained-apps.yml
  • it-and-security/lib/windows/policies/update-claude.yml
  • it-and-security/lib/windows/policies/update-slack.yml
✅ Files skipped from review due to trivial changes (21)
  • it-and-security/lib/macos/misc/pre-install-queries/is-sublime-text-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-obsidian-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-parallels-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-github-desktop-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-logi-options-running.yml
  • it-and-security/lib/windows/misc/pre-install-queries/is-google-chrome-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-claude-running.yml
  • it-and-security/lib/macos/policies/update-claude.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-loom-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-android-studio-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-aws-vpn-client-running.yml
  • it-and-security/lib/macos/policies/update-slack.yml
  • it-and-security/lib/windows/policies/update-slack.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-spotify-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-cursor-running.yml
  • it-and-security/lib/windows/misc/pre-install-queries/is-zoom-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-visual-studio-code-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-slack-running.yml
  • it-and-security/lib/windows/policies/update-claude.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-google-drive-running.yml
  • it-and-security/lib/macos/misc/pre-install-queries/is-zoom-running.yml

@allenhouchins
allenhouchins merged commit 2359a3e into main Jul 6, 2026
10 checks passed
@allenhouchins
allenhouchins deleted the dogfood-update-when-app-closed branch July 6, 2026 02:54
allenhouchins added a commit that referenced this pull request Jul 6, 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.

3 participants