Skip to content

Update Fleet-maintained apps - #44564

Closed
fleet-release wants to merge 3 commits into
mainfrom
fma-2605010211
Closed

Update Fleet-maintained apps#44564
fleet-release wants to merge 3 commits into
mainfrom
fma-2605010211

Conversation

@fleet-release

@fleet-release fleet-release commented May 1, 2026

Copy link
Copy Markdown
Contributor

Automated ingestion of latest Fleet-maintained app data.

Summary by CodeRabbit

  • Chores
    • Updated application metadata for Microsoft Teams, Rancher Desktop, Teleport Connect, Teleport Suite, and Zotero on macOS to support and correctly identify the latest available versions.

Generated automatically with cmd/maintained-apps.

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

@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

Script Diff Results

ee/maintained-apps/outputs/microsoft-teams/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/rancher/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/teleport-connect/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/teleport-suite/darwin.json

=== Install // 35762c86 -> 2c7e3ed1 ===

--- /tmp/old.1SB7DR	2026-05-01 02:14:33.994027244 +0000
+++ /tmp/new.OPExIA	2026-05-01 02:14:33.995027267 +0000
@@ -96,5 +96,5 @@
 
 # install pkg files
 quit_and_track_application 'com.gravitational.teleport.tsh'
-sudo installer -pkg "$TMPDIR/teleport-18.7.5.pkg" -target /
+sudo installer -pkg "$TMPDIR/teleport-18.7.6.pkg" -target /
 relaunch_application 'com.gravitational.teleport.tsh'

=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/zotero/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The head commit changed during the review from a1a8217 to feaf24d.

Walkthrough

This PR updates version metadata for five macOS applications in the maintained-apps outputs directory: Microsoft Teams (26072.608.4595.8484 to 26093.311.4599.3126), Rancher Desktop (1.22.0 to 1.22.1), Teleport Connect (to 18.7.6), Teleport Suite (18.7.5 to 18.7.6), and Zotero (9.0.1 to 9.0.2). Each update includes changes to version strings, patched query comparisons, installer URLs, and SHA256 checksums. The Teleport Suite update also includes a new install script reference.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is minimal but adequate for an automated data update. However, it lacks the structured sections (checklist items, testing details, database info) specified in the template. While this appears to be an automated ingestion PR, consider whether the template checklist items apply and should be documented, even if marked as N/A.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Update Fleet-maintained apps' is concise and clearly summarizes the main change—updating multiple Fleet-maintained application definitions with new versions.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fma-2605010211

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

🧹 Nitpick comments (1)
ee/maintained-apps/outputs/teleport-suite/darwin.json (1)

19-19: ⚡ Quick win

Add a guard for INSTALLER_PATH to improve failure mode.

The script computes TMPDIR from $(realpath "$INSTALLER_PATH") and later relies on INSTALLER_PATH implicitly. If INSTALLER_PATH is missing/empty due to a harness change or download failure, the script will likely fail with confusing errors from realpath/dirname/installer.

Add an explicit check early in the script and exit with a clear message.

🔧 Proposed change
 APPDIR="/Applications/"
+if [[ -z "${INSTALLER_PATH:-}" ]]; then
+  echo "INSTALLER_PATH is not set; cannot locate the installer package."
+  exit 1
+fi
 TMPDIR=$(dirname "$(realpath "$INSTALLER_PATH")")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ee/maintained-apps/outputs/teleport-suite/darwin.json` at line 19, The script
uses INSTALLER_PATH to compute TMPDIR via realpath which will produce confusing
errors if INSTALLER_PATH is empty or unset; add an explicit guard near the top
(before TMPDIR is computed) that checks INSTALLER_PATH is non-empty, prints a
clear error like "INSTALLER_PATH is not set or file does not exist" and exits
non-zero; ensure the check validates the file exists (e.g., test -f
"$INSTALLER_PATH") and references INSTALLER_PATH and TMPDIR so reviewers can
find the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ee/maintained-apps/outputs/rancher/darwin.json`:
- Line 9: The installer_url value for Rancher Desktop v1.22.1 is pointing to a
non-existent asset and must be corrected; open the Rancher Desktop v1.22.1
release page, identify the actual aarch64 DMG asset filename, and replace the
current installer_url string for "installer_url" with the exact GitHub release
download URL that matches that filename (keeping the same v1.22.1 tag and
architecture), then validate the URL returns HTTP 200.
- Line 7: The current queries.patched SQL can misreport when osquery's apps
table returns multiple rows per bundle_identifier; change the predicate to
deduplicate by taking the maximum bundle_short_version per bundle_identifier and
compare that aggregated value to '1.22.1'. Concretely, replace the subquery in
queries.patched with an aggregation such as selecting MAX(bundle_short_version)
for bundle_identifier = 'io.rancherdesktop.app' (e.g., using a derived table or
GROUP BY) and then use version_compare(max_version, '1.22.1') to decide
patched/unpatched so only the newest installed instance is evaluated.

In `@ee/maintained-apps/outputs/teleport-suite/darwin.json`:
- Line 19: The install script in refs["2c7e3ed1"] hard-codes the package
filename in the installer command; change the installer invocation (the install
step after quit_and_track_application and before relaunch_application) to use
the existing INSTALLER_PATH (or basename "$INSTALLER_PATH") instead of
"$TMPDIR/teleport-18.7.6.pkg" so the script installs whatever file the harness
staged regardless of filename.
- Line 19: The script in refs["2c7e3ed1"] uses bash-only features (e.g., [[ ]],
local, (( )), SECONDS) but declares #!/bin/sh; change the shebang to #!/bin/bash
so functions quit_and_track_application and relaunch_application run under bash
(update the very first line of the script to use /bin/bash).

---

Nitpick comments:
In `@ee/maintained-apps/outputs/teleport-suite/darwin.json`:
- Line 19: The script uses INSTALLER_PATH to compute TMPDIR via realpath which
will produce confusing errors if INSTALLER_PATH is empty or unset; add an
explicit guard near the top (before TMPDIR is computed) that checks
INSTALLER_PATH is non-empty, prints a clear error like "INSTALLER_PATH is not
set or file does not exist" and exits non-zero; ensure the check validates the
file exists (e.g., test -f "$INSTALLER_PATH") and references INSTALLER_PATH and
TMPDIR so reviewers can find the change.
🪄 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: 234e9fdf-fd38-4a6e-9f8f-be7333910375

📥 Commits

Reviewing files that changed from the base of the PR and between 81e6f11 and 4f8f168.

📒 Files selected for processing (5)
  • ee/maintained-apps/outputs/microsoft-teams/darwin.json
  • ee/maintained-apps/outputs/rancher/darwin.json
  • ee/maintained-apps/outputs/teleport-connect/darwin.json
  • ee/maintained-apps/outputs/teleport-suite/darwin.json
  • ee/maintained-apps/outputs/zotero/darwin.json

"queries": {
"exists": "SELECT 1 FROM apps WHERE bundle_identifier = 'io.rancherdesktop.app';",
"patched": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM apps WHERE bundle_identifier = 'io.rancherdesktop.app' AND version_compare(bundle_short_version, '1.22.0') < 0);"
"patched": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM apps WHERE bundle_identifier = 'io.rancherdesktop.app' AND version_compare(bundle_short_version, '1.22.1') < 0);"

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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "1) Find implementation/usage of version_compare()"
rg -n "version_compare\s*\(" -S .

echo "2) Inspect schema / uniqueness assumptions for apps table keyed by bundle_identifier + host"
rg -n "CREATE TABLE.*apps|UNIQUE.*apps|bundle_identifier" -S .

Repository: fleetdm/fleet

Length of output: 50370


🏁 Script executed:

# Find version_compare function definition/implementation
rg -A 10 "version_compare\s*[=:]|CREATE.*FUNCTION.*version_compare|FUNCTION.*version_compare" .

Repository: fleetdm/fleet

Length of output: 39


🏁 Script executed:

# Find apps table schema definition
rg -B 2 -A 10 "CREATE TABLE\s+apps|apps\s*\(" . --type sql

Repository: fleetdm/fleet

Length of output: 39


🏁 Script executed:

# Search for documentation or comments about version_compare
rg -B 3 -A 3 "version_compare" . --type md --type txt | head -100

Repository: fleetdm/fleet

Length of output: 8859


🏁 Script executed:

# Check for uniqueness constraints or indexes on apps.bundle_identifier
rg "bundle_identifier.*UNIQUE|UNIQUE.*bundle_identifier|PRIMARY KEY" . --type sql

Repository: fleetdm/fleet

Length of output: 15027


🏁 Script executed:

# Find the apps table schema definition specifically
rg -A 20 "CREATE TABLE.*\`?apps\`?" server/datastore/mysql/schema.sql

Repository: fleetdm/fleet

Length of output: 5320


🏁 Script executed:

# Check migrations for apps table
fd -e sql . server/datastore/mysql/migrations | xargs rg -l "CREATE TABLE.*apps"

Repository: fleetdm/fleet

Length of output: 41


🌐 Web query:

osquery version_compare function semantics SQLite

💡 Result:

The osquery version_compare function is a custom SQLite scalar function that compares two version strings and returns -1 if the left is less than the right, 0 if equal, or 1 if greater. Syntax: version_compare(LEFT_VERSION, RIGHT_VERSION, [COMPARE_FLAVOR]) - LEFT_VERSION and RIGHT_VERSION are strings to compare. - COMPARE_FLAVOR is optional: 'ARCH', 'DPKG', or 'RHEL' for Linux package versioning schemes. Default is semantic versioning. Examples: - version_compare('1.0', '1.0') returns 0 - version_compare('4:1.1.0', '4:1.1.0-3', 'ARCH') returns 0 - version_compare('50.4.1b', '50.4.1c') returns -1 - version_compare('1:1.2.13-2', '4.2.1', 'ARCH') returns 1 It was added via PR #8168 (merged Dec 2023), implementing package-aware parsing (splitting on '.', grouping numerics/alphanumerics). There is also a 'VERSION' collation for use in ORDER BY or WHERE with >/< operators. This is an osquery extension to SQLite, registered via registerVersionExtensions, available in osquery shell/daemon.

Citations:


🏁 Script executed:

# Search for osquery apps table documentation or handling in Fleet
rg -i "apps.*table|bundle_identifier.*multiple|osquery.*apps" docs/ --type md | head -50

Repository: fleetdm/fleet

Length of output: 1080


🏁 Script executed:

# Look for any discussions about apps table uniqueness or deduplication
rg -A 5 -B 5 "apps.*WHERE.*bundle_identifier" server/ --type go | head -100

Repository: fleetdm/fleet

Length of output: 8652


🌐 Web query:

osquery macOS apps table multiple rows same bundle_identifier

💡 Result:

osquery’s macOS apps table can show multiple rows for the same bundle_identifier when multiple app bundles with that identifier are found (or when the table ends up collecting the same app bundle via different paths, such as a symlinked .app vs the real .app). The table schema includes bundle_identifier as a CFBundleIdentifier value; and osquery enumerates apps by first using LaunchServices and then supplementing with directory scanning. How to query (examples) 1) List all rows (potentially multiple) for a bundle identifier: SELECT name, path, bundle_identifier, bundle_version FROM apps WHERE bundle_identifier = 'com.example.bundle'; 2) Count how many app rows match that bundle identifier: SELECT bundle_identifier, COUNT(*) AS row_count FROM apps WHERE bundle_identifier = 'com.example.bundle' GROUP BY bundle_identifier; Why duplicates happen - osquery collects candidate app bundles into a set of Info.plist paths, then parses each plist into rows, so if you have more than one distinct app bundle on disk sharing the same CFBundleIdentifier, you’ll get multiple rows. - Also, osquery explicitly “supplements LaunchServices with directory scanning” in its apps table implementation, to find apps missing from LaunchServices (e.g., due to stale registrations). This means you can end up with multiple Info.plist paths for the “same” logical app (for example: symlink path in /Applications plus real path in a subdirectory), producing multiple rows with the same bundle_identifier. What to do if you want to deduplicate results yourself - Deduplicate on the Info.plist path (or on a normalized/resolved path) rather than bundle_identifier. - If you want a per-bundle_identifier “best” row, you’ll need a deterministic rule (e.g., choose the shortest path, or prefer /Applications/.app over subdirectories), because osquery doesn’t guarantee uniqueness by bundle_identifier. If you tell me your exact osquery version and paste one or two sample rows (name/path/bundle_version), I can suggest a concrete SQL dedupe query that fits your situation.

Citations:


🏁 Script executed:

# Search for any Fleet guidance or acknowledgment about handling multiple app rows
rg -i "multiple.*app|dedup|distinct.*app|bundle_identifier.*multiple" docs/ server/ --type go --type md | grep -v test | head -30

Repository: fleetdm/fleet

Length of output: 3965


🏁 Script executed:

# Check if there are any comments in patch_policy code about this concern
cat -n pkg/patch_policy/patch_policy.go | head -100

Repository: fleetdm/fleet

Length of output: 3754


Clarify queries.patched handling of osquery apps table returning multiple versions (risk: false "unpatched" reports).

The version_compare() function semantics are correct—version_compare(bundle_short_version, '1.22.1') < 0 properly means "is this version older than 1.22.1". However, there is a substantive risk:

osquery's macOS apps table can return multiple rows per bundle_identifier (due to LaunchServices supplementation, symlinks, or multiple app bundles with the same identifier on disk). The query logic:

NOT EXISTS (SELECT 1 FROM apps WHERE bundle_identifier = '…' AND version_compare(bundle_short_version, '1.22.1') < 0)

will incorrectly report the app as "not patched" if any row has a version older than 1.22.1, even if another row exists with a newer version. This could cause hosts with multiple app instances to remain flagged as unpatched indefinitely.

Consider either:

  1. Deduplicating osquery results per bundle_identifier (e.g., selecting the max version), or
  2. Documenting this as a known limitation requiring users to ensure single-instance apps.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ee/maintained-apps/outputs/rancher/darwin.json` at line 7, The current
queries.patched SQL can misreport when osquery's apps table returns multiple
rows per bundle_identifier; change the predicate to deduplicate by taking the
maximum bundle_short_version per bundle_identifier and compare that aggregated
value to '1.22.1'. Concretely, replace the subquery in queries.patched with an
aggregation such as selecting MAX(bundle_short_version) for bundle_identifier =
'io.rancherdesktop.app' (e.g., using a derived table or GROUP BY) and then use
version_compare(max_version, '1.22.1') to decide patched/unpatched so only the
newest installed instance is evaluated.

"patched": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM apps WHERE bundle_identifier = 'io.rancherdesktop.app' AND version_compare(bundle_short_version, '1.22.1') < 0);"
},
"installer_url": "https://github.com/rancher-sandbox/rancher-desktop/releases/download/v1.22.0/Rancher.Desktop-1.22.0.aarch64.dmg",
"installer_url": "https://github.com/rancher-sandbox/rancher-desktop/releases/download/v1.22.1/Rancher.Desktop-1.22.1.aarch64.dmg",

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.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

URL="https://github.com/rancher-sandbox/rancher-desktop/releases/download/v1.22.1/Rancher.Desktop-1.22.1.aarch64.dmg"

echo "Checking URL resolves (HTTP status)"
curl -sS -o /dev/null -w "%{http_code}\n" -L "$URL"

Repository: fleetdm/fleet

Length of output: 97


Fix the broken installer_url - returns HTTP 404.

The URL for the Rancher Desktop v1.22.1 aarch64 DMG currently resolves to a 404 error, indicating the asset does not exist at this location. Verify the correct asset filename on the Rancher Desktop releases page and update the URL accordingly to ensure downloads succeed.

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

In `@ee/maintained-apps/outputs/rancher/darwin.json` at line 9, The installer_url
value for Rancher Desktop v1.22.1 is pointing to a non-existent asset and must
be corrected; open the Rancher Desktop v1.22.1 release page, identify the actual
aarch64 DMG asset filename, and replace the current installer_url string for
"installer_url" with the exact GitHub release download URL that matches that
filename (keeping the same v1.22.1 tag and architecture), then validate the URL
returns HTTP 200.

],
"refs": {
"35762c86": "#!/bin/sh\n\n# variables\nAPPDIR=\"/Applications/\"\nTMPDIR=$(dirname \"$(realpath \"$INSTALLER_PATH\")\")\n# functions\n\nquit_and_track_application() {\n local bundle_id=\"$1\"\n local var_name=\"APP_WAS_RUNNING_$(echo \"$bundle_id\" | tr '.-' '__')\"\n local timeout_duration=10\n\n # check if the application is running\n local app_running\n app_running=$(osascript -e \"application id \\\"$bundle_id\\\" is running\" 2>/dev/null)\n if [[ \"$app_running\" != \"true\" ]]; then\n eval \"export $var_name=0\"\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ -z \"$console_user\" || \"$console_user\" == \"root\" || \"$console_user\" == \"loginwindow\" ]]; then\n echo \"Not logged into a non-root GUI; skipping quitting application ID '$bundle_id'.\"\n eval \"export $var_name=0\"\n return\n fi\n\n # App was running, mark it for relaunch\n eval \"export $var_name=1\"\n echo \"Application '$bundle_id' was running; will relaunch after installation.\"\n\n echo \"Quitting application '$bundle_id'...\"\n\n # try to quit the application within the timeout period\n local quit_success=false\n SECONDS=0\n while (( SECONDS < timeout_duration )); do\n if osascript -e \"tell application id \\\"$bundle_id\\\" to quit\" >/dev/null 2>&1; then\n if ! pgrep -f \"$bundle_id\" >/dev/null 2>&1; then\n echo \"Application '$bundle_id' quit successfully.\"\n quit_success=true\n break\n fi\n fi\n sleep 1\n done\n\n if [[ \"$quit_success\" = false ]]; then\n echo \"Application '$bundle_id' did not quit.\"\n fi\n}\n\n\nrelaunch_application() {\n local bundle_id=\"$1\"\n local var_name=\"APP_WAS_RUNNING_$(echo \"$bundle_id\" | tr '.-' '__')\"\n local was_running\n\n # Check if the app was running before installation\n eval \"was_running=\\$$var_name\"\n if [[ \"$was_running\" != \"1\" ]]; then\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ -z \"$console_user\" || \"$console_user\" == \"root\" || \"$console_user\" == \"loginwindow\" ]]; then\n echo \"Not logged into a non-root GUI; skipping relaunching application ID '$bundle_id'.\"\n return\n fi\n\n echo \"Relaunching application '$bundle_id'...\"\n\n # Launch the app in the logged-in user's GUI session. Apps launched by root\n # won't register with the user's Dock/GUI, so run 'open' as the console user.\n # Use 'launchctl asuser' to bootstrap into the console user's Mach namespace\n # and GUI session — 'sudo -u' alone doesn't do this, which can cause\n # LSOpenURLsWithRole() failures even when 'open' exits 0.\n local open_status=0\n if [[ $EUID -eq 0 ]]; then\n local console_uid\n console_uid=$(id -u \"$console_user\")\n /bin/launchctl asuser \"$console_uid\" sudo -u \"$console_user\" open -b \"$bundle_id\" >/dev/null 2>&1 || open_status=$?\n else\n open -b \"$bundle_id\" >/dev/null 2>&1 || open_status=$?\n fi\n\n if [[ $open_status -eq 0 ]]; then\n echo \"Application '$bundle_id' relaunched successfully.\"\n else\n echo \"Failed to relaunch application '$bundle_id'.\"\n fi\n}\n\n\n# install pkg files\nquit_and_track_application 'com.gravitational.teleport.tsh'\nsudo installer -pkg \"$TMPDIR/teleport-18.7.5.pkg\" -target /\nrelaunch_application 'com.gravitational.teleport.tsh'\n",
"2c7e3ed1": "#!/bin/sh\n\n# variables\nAPPDIR=\"/Applications/\"\nTMPDIR=$(dirname \"$(realpath \"$INSTALLER_PATH\")\")\n# functions\n\nquit_and_track_application() {\n local bundle_id=\"$1\"\n local var_name=\"APP_WAS_RUNNING_$(echo \"$bundle_id\" | tr '.-' '__')\"\n local timeout_duration=10\n\n # check if the application is running\n local app_running\n app_running=$(osascript -e \"application id \\\"$bundle_id\\\" is running\" 2>/dev/null)\n if [[ \"$app_running\" != \"true\" ]]; then\n eval \"export $var_name=0\"\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ -z \"$console_user\" || \"$console_user\" == \"root\" || \"$console_user\" == \"loginwindow\" ]]; then\n echo \"Not logged into a non-root GUI; skipping quitting application ID '$bundle_id'.\"\n eval \"export $var_name=0\"\n return\n fi\n\n # App was running, mark it for relaunch\n eval \"export $var_name=1\"\n echo \"Application '$bundle_id' was running; will relaunch after installation.\"\n\n echo \"Quitting application '$bundle_id'...\"\n\n # try to quit the application within the timeout period\n local quit_success=false\n SECONDS=0\n while (( SECONDS < timeout_duration )); do\n if osascript -e \"tell application id \\\"$bundle_id\\\" to quit\" >/dev/null 2>&1; then\n if ! pgrep -f \"$bundle_id\" >/dev/null 2>&1; then\n echo \"Application '$bundle_id' quit successfully.\"\n quit_success=true\n break\n fi\n fi\n sleep 1\n done\n\n if [[ \"$quit_success\" = false ]]; then\n echo \"Application '$bundle_id' did not quit.\"\n fi\n}\n\n\nrelaunch_application() {\n local bundle_id=\"$1\"\n local var_name=\"APP_WAS_RUNNING_$(echo \"$bundle_id\" | tr '.-' '__')\"\n local was_running\n\n # Check if the app was running before installation\n eval \"was_running=\\$$var_name\"\n if [[ \"$was_running\" != \"1\" ]]; then\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ -z \"$console_user\" || \"$console_user\" == \"root\" || \"$console_user\" == \"loginwindow\" ]]; then\n echo \"Not logged into a non-root GUI; skipping relaunching application ID '$bundle_id'.\"\n return\n fi\n\n echo \"Relaunching application '$bundle_id'...\"\n\n # Launch the app in the logged-in user's GUI session. Apps launched by root\n # won't register with the user's Dock/GUI, so run 'open' as the console user.\n # Use 'launchctl asuser' to bootstrap into the console user's Mach namespace\n # and GUI session — 'sudo -u' alone doesn't do this, which can cause\n # LSOpenURLsWithRole() failures even when 'open' exits 0.\n local open_status=0\n if [[ $EUID -eq 0 ]]; then\n local console_uid\n console_uid=$(id -u \"$console_user\")\n /bin/launchctl asuser \"$console_uid\" sudo -u \"$console_user\" open -b \"$bundle_id\" >/dev/null 2>&1 || open_status=$?\n else\n open -b \"$bundle_id\" >/dev/null 2>&1 || open_status=$?\n fi\n\n if [[ $open_status -eq 0 ]]; then\n echo \"Application '$bundle_id' relaunched successfully.\"\n else\n echo \"Failed to relaunch application '$bundle_id'.\"\n fi\n}\n\n\n# install pkg files\nquit_and_track_application 'com.gravitational.teleport.tsh'\nsudo installer -pkg \"$TMPDIR/teleport-18.7.6.pkg\" -target /\nrelaunch_application 'com.gravitational.teleport.tsh'\n",

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Avoid hard-coding the pkg filename in the install script.

In refs["2c7e3ed1"], the installer command uses a fixed filename:
sudo installer -pkg "$TMPDIR/teleport-18.7.6.pkg" -target /

That’s brittle if the harness downloads/stages the package to INSTALLER_PATH under a different filename (even if it’s the same content). Since the script already derives TMPDIR from "$INSTALLER_PATH", it’s safer to install exactly "$INSTALLER_PATH" (or at least "$INSTALLER_PATH"’s basename), avoiding any filename mismatch.

🔧 Proposed change
-quit_and_track_application 'com.gravitational.teleport.tsh'
-sudo installer -pkg "$TMPDIR/teleport-18.7.6.pkg" -target /
-relaunch_application 'com.gravitational.teleport.tsh'
+quit_and_track_application 'com.gravitational.teleport.tsh'
+sudo installer -pkg "$INSTALLER_PATH" -target /
+relaunch_application 'com.gravitational.teleport.tsh'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ee/maintained-apps/outputs/teleport-suite/darwin.json` at line 19, The
install script in refs["2c7e3ed1"] hard-codes the package filename in the
installer command; change the installer invocation (the install step after
quit_and_track_application and before relaunch_application) to use the existing
INSTALLER_PATH (or basename "$INSTALLER_PATH") instead of
"$TMPDIR/teleport-18.7.6.pkg" so the script installs whatever file the harness
staged regardless of filename.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Find maintained-apps related files to understand the execution context
find . -type f -name "*.ts" -o -name "*.js" -o -name "*.go" -o -name "*.py" | head -20

Repository: fleetdm/fleet

Length of output: 1097


🏁 Script executed:

# Search for how install_script_ref is executed
rg "install_script_ref" -A 5 -B 5 --max-count=20

Repository: fleetdm/fleet

Length of output: 50370


🏁 Script executed:

# Look for maintained-apps installer implementation
find . -path "*maintained-apps*" -type f \( -name "*.ts" -o -name "*.js" -o -name "*.go" -o -name "*.py" \) | head -30

Repository: fleetdm/fleet

Length of output: 2154


🏁 Script executed:

# Find where scripts are executed in the maintained apps infrastructure
cat -n ee/maintained-apps/maintained_apps.go | head -100

Repository: fleetdm/fleet

Length of output: 3265


🏁 Script executed:

# Look at darwin validation code
cat -n cmd/maintained-apps/validate/darwin.go

Repository: fleetdm/fleet

Length of output: 13702


🏁 Script executed:

# Check app commander for script execution
cat -n cmd/maintained-apps/validate/app_commander.go | head -150

Repository: fleetdm/fleet

Length of output: 5398


🏁 Script executed:

find . -path "*/orbit/pkg/scripts*" -type f | head -20

Repository: fleetdm/fleet

Length of output: 243


🏁 Script executed:

# Look at the scripts execution code
find . -name "*.go" -path "*/orbit/pkg/scripts*" -exec wc -l {} + | sort -n

Repository: fleetdm/fleet

Length of output: 285


🏁 Script executed:

cat -n orbit/pkg/scripts/exec_nonwindows.go

Repository: fleetdm/fleet

Length of output: 1782


🏁 Script executed:

cat -n orbit/pkg/scripts/scripts.go | head -80

Repository: fleetdm/fleet

Length of output: 3077


🏁 Script executed:

# Find and read fleet.ValidateShebang implementation
rg -A 30 "func ValidateShebang" --type go

Repository: fleetdm/fleet

Length of output: 1805


🏁 Script executed:

# Find the shebangInfo function to understand the logic
rg -B 5 -A 40 "func shebangInfo" --type go

Repository: fleetdm/fleet

Length of output: 2703


🏁 Script executed:

# Continue reading the shebangInfo function to see the full logic
rg -A 100 "func shebangInfo" --type go | head -150

Repository: fleetdm/fleet

Length of output: 5892


🏁 Script executed:

# Check what the actual behavior is on macOS - look for any tests or documentation
rg "bin/sh" --type go -B 2 -A 2 | head -50

Repository: fleetdm/fleet

Length of output: 3249


🏁 Script executed:

# Check if there are comments about macOS /bin/sh behavior
rg "Catalina|zsh|/bin/sh" server/fleet/scripts.go -B 2 -A 2

Repository: fleetdm/fleet

Length of output: 1956


Change shebang from #!/bin/sh to #!/bin/bash.

The install script in refs["2c7e3ed1"] declares #!/bin/sh but uses bash-specific syntax: [[ ... ]], local, (( ... )), and the SECONDS timing variable. When the script is executed with its declared shebang, it will run with /bin/sh (which is zsh on macOS Catalina and later), causing failures since zsh in sh-compatible mode does not support these bash features.

🔧 Proposed change
-#!/bin/sh\n\n# variables
+#!/bin/bash\n\n# variables
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"2c7e3ed1": "#!/bin/sh\n\n# variables\nAPPDIR=\"/Applications/\"\nTMPDIR=$(dirname \"$(realpath \"$INSTALLER_PATH\")\")\n# functions\n\nquit_and_track_application() {\n local bundle_id=\"$1\"\n local var_name=\"APP_WAS_RUNNING_$(echo \"$bundle_id\" | tr '.-' '__')\"\n local timeout_duration=10\n\n # check if the application is running\n local app_running\n app_running=$(osascript -e \"application id \\\"$bundle_id\\\" is running\" 2>/dev/null)\n if [[ \"$app_running\" != \"true\" ]]; then\n eval \"export $var_name=0\"\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ -z \"$console_user\" || \"$console_user\" == \"root\" || \"$console_user\" == \"loginwindow\" ]]; then\n echo \"Not logged into a non-root GUI; skipping quitting application ID '$bundle_id'.\"\n eval \"export $var_name=0\"\n return\n fi\n\n # App was running, mark it for relaunch\n eval \"export $var_name=1\"\n echo \"Application '$bundle_id' was running; will relaunch after installation.\"\n\n echo \"Quitting application '$bundle_id'...\"\n\n # try to quit the application within the timeout period\n local quit_success=false\n SECONDS=0\n while (( SECONDS < timeout_duration )); do\n if osascript -e \"tell application id \\\"$bundle_id\\\" to quit\" >/dev/null 2>&1; then\n if ! pgrep -f \"$bundle_id\" >/dev/null 2>&1; then\n echo \"Application '$bundle_id' quit successfully.\"\n quit_success=true\n break\n fi\n fi\n sleep 1\n done\n\n if [[ \"$quit_success\" = false ]]; then\n echo \"Application '$bundle_id' did not quit.\"\n fi\n}\n\n\nrelaunch_application() {\n local bundle_id=\"$1\"\n local var_name=\"APP_WAS_RUNNING_$(echo \"$bundle_id\" | tr '.-' '__')\"\n local was_running\n\n # Check if the app was running before installation\n eval \"was_running=\\$$var_name\"\n if [[ \"$was_running\" != \"1\" ]]; then\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ -z \"$console_user\" || \"$console_user\" == \"root\" || \"$console_user\" == \"loginwindow\" ]]; then\n echo \"Not logged into a non-root GUI; skipping relaunching application ID '$bundle_id'.\"\n return\n fi\n\n echo \"Relaunching application '$bundle_id'...\"\n\n # Launch the app in the logged-in user's GUI session. Apps launched by root\n # won't register with the user's Dock/GUI, so run 'open' as the console user.\n # Use 'launchctl asuser' to bootstrap into the console user's Mach namespace\n # and GUI session — 'sudo -u' alone doesn't do this, which can cause\n # LSOpenURLsWithRole() failures even when 'open' exits 0.\n local open_status=0\n if [[ $EUID -eq 0 ]]; then\n local console_uid\n console_uid=$(id -u \"$console_user\")\n /bin/launchctl asuser \"$console_uid\" sudo -u \"$console_user\" open -b \"$bundle_id\" >/dev/null 2>&1 || open_status=$?\n else\n open -b \"$bundle_id\" >/dev/null 2>&1 || open_status=$?\n fi\n\n if [[ $open_status -eq 0 ]]; then\n echo \"Application '$bundle_id' relaunched successfully.\"\n else\n echo \"Failed to relaunch application '$bundle_id'.\"\n fi\n}\n\n\n# install pkg files\nquit_and_track_application 'com.gravitational.teleport.tsh'\nsudo installer -pkg \"$TMPDIR/teleport-18.7.6.pkg\" -target /\nrelaunch_application 'com.gravitational.teleport.tsh'\n",
"2c7e3ed1": "#!/bin/bash\n\n# variables\nAPPDIR=\"/Applications/\"\nTMPDIR=$(dirname \"$(realpath \"$INSTALLER_PATH\")\")\n# functions\n\nquit_and_track_application() {\n local bundle_id=\"$1\"\n local var_name=\"APP_WAS_RUNNING_$(echo \"$bundle_id\" | tr '.-' '__')\"\n local timeout_duration=10\n\n # check if the application is running\n local app_running\n app_running=$(osascript -e \"application id \\\"$bundle_id\\\" is running\" 2>/dev/null)\n if [[ \"$app_running\" != \"true\" ]]; then\n eval \"export $var_name=0\"\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ -z \"$console_user\" || \"$console_user\" == \"root\" || \"$console_user\" == \"loginwindow\" ]]; then\n echo \"Not logged into a non-root GUI; skipping quitting application ID '$bundle_id'.\"\n eval \"export $var_name=0\"\n return\n fi\n\n # App was running, mark it for relaunch\n eval \"export $var_name=1\"\n echo \"Application '$bundle_id' was running; will relaunch after installation.\"\n\n echo \"Quitting application '$bundle_id'...\"\n\n # try to quit the application within the timeout period\n local quit_success=false\n SECONDS=0\n while (( SECONDS < timeout_duration )); do\n if osascript -e \"tell application id \\\"$bundle_id\\\" to quit\" >/dev/null 2>&1; then\n if ! pgrep -f \"$bundle_id\" >/dev/null 2>&1; then\n echo \"Application '$bundle_id' quit successfully.\"\n quit_success=true\n break\n fi\n fi\n sleep 1\n done\n\n if [[ \"$quit_success\" = false ]]; then\n echo \"Application '$bundle_id' did not quit.\"\n fi\n}\n\n\nrelaunch_application() {\n local bundle_id=\"$1\"\n local var_name=\"APP_WAS_RUNNING_$(echo \"$bundle_id\" | tr '.-' '__')\"\n local was_running\n\n # Check if the app was running before installation\n eval \"was_running=\\$$var_name\"\n if [[ \"$was_running\" != \"1\" ]]; then\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ -z \"$console_user\" || \"$console_user\" == \"root\" || \"$console_user\" == \"loginwindow\" ]]; then\n echo \"Not logged into a non-root GUI; skipping relaunching application ID '$bundle_id'.\"\n return\n fi\n\n echo \"Relaunching application '$bundle_id'...\"\n\n # Launch the app in the logged-in user's GUI session. Apps launched by root\n # won't register with the user's Dock/GUI, so run 'open' as the console user.\n # Use 'launchctl asuser' to bootstrap into the console user's Mach namespace\n # and GUI session — 'sudo -u' alone doesn't do this, which can cause\n # LSOpenURLsWithRole() failures even when 'open' exits 0.\n local open_status=0\n if [[ $EUID -eq 0 ]]; then\n local console_uid\n console_uid=$(id -u \"$console_user\")\n /bin/launchctl asuser \"$console_uid\" sudo -u \"$console_user\" open -b \"$bundle_id\" >/dev/null 2>&1 || open_status=$?\n else\n open -b \"$bundle_id\" >/dev/null 2>&1 || open_status=$?\n fi\n\n if [[ $open_status -eq 0 ]]; then\n echo \"Application '$bundle_id' relaunched successfully.\"\n else\n echo \"Failed to relaunch application '$bundle_id'.\"\n fi\n}\n\n\n# install pkg files\nquit_and_track_application 'com.gravitational.teleport.tsh'\nsudo installer -pkg \"$TMPDIR/teleport-18.7.6.pkg\" -target /\nrelaunch_application 'com.gravitational.teleport.tsh'\n",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ee/maintained-apps/outputs/teleport-suite/darwin.json` at line 19, The script
in refs["2c7e3ed1"] uses bash-only features (e.g., [[ ]], local, (( )), SECONDS)
but declares #!/bin/sh; change the shebang to #!/bin/bash so functions
quit_and_track_application and relaunch_application run under bash (update the
very first line of the script to use /bin/bash).

@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

Script Diff Results

ee/maintained-apps/outputs/microsoft-teams/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/rancher/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/teleport-connect/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/teleport-suite/darwin.json

=== Install // 35762c86 -> 2c7e3ed1 ===

--- /tmp/old.Du30nl	2026-05-01 14:20:01.186449541 +0000
+++ /tmp/new.rG36mV	2026-05-01 14:20:01.186449541 +0000
@@ -96,5 +96,5 @@
 
 # install pkg files
 quit_and_track_application 'com.gravitational.teleport.tsh'
-sudo installer -pkg "$TMPDIR/teleport-18.7.5.pkg" -target /
+sudo installer -pkg "$TMPDIR/teleport-18.7.6.pkg" -target /
 relaunch_application 'com.gravitational.teleport.tsh'

=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/zotero/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

Script Diff Results

ee/maintained-apps/outputs/microsoft-teams/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/teleport-connect/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/teleport-suite/darwin.json

=== Install // 35762c86 -> 2c7e3ed1 ===

--- /tmp/old.hHCpwO	2026-05-01 14:20:32.386016798 +0000
+++ /tmp/new.Jp42bT	2026-05-01 14:20:32.386016798 +0000
@@ -96,5 +96,5 @@
 
 # install pkg files
 quit_and_track_application 'com.gravitational.teleport.tsh'
-sudo installer -pkg "$TMPDIR/teleport-18.7.5.pkg" -target /
+sudo installer -pkg "$TMPDIR/teleport-18.7.6.pkg" -target /
 relaunch_application 'com.gravitational.teleport.tsh'

=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/zotero/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

Closing in favor of #44579.

@github-actions github-actions Bot closed this May 1, 2026
@allenhouchins
allenhouchins deleted the fma-2605010211 branch June 12, 2026 19:37
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