Skip to content

Add R and Git as Windows Fleet-maintained apps - #46988

Merged
allenhouchins merged 7 commits into
mainfrom
allenhouchins-r-git-ssms
Jun 8, 2026
Merged

Add R and Git as Windows Fleet-maintained apps#46988
allenhouchins merged 7 commits into
mainfrom
allenhouchins-r-git-ssms

Conversation

@allenhouchins

@allenhouchins allenhouchins commented Jun 6, 2026

Copy link
Copy Markdown
Member

Adds two winget-sourced Windows FMAs:

  • R (RProject.R) -> 'R for Windows', Inno Setup exe, machine scope
  • Git (Git.Git) -> 'Git', Inno Setup exe, machine scope

Both use custom Inno install/uninstall scripts (no MSI ProductCode) with registry-UninstallString-based uninstall and fuzzy name matching, since their ARP DisplayName embeds the version ('R for Windows ', 'Git version ').

test-fma-windows-pr-only.yml: add has_r/has_git detection and removal of the runner's pre-installed R and Git. Git for Windows provides the Git Bash 'bash' the workflow uses, so the apps.json filtering is split into its own step that runs before Git removal, and validation runs 'go run -buildvcs=false' (so Go does not invoke the now-removed git for VCS stamping).

SSMS was investigated but intentionally skipped: SSMS 21/22 is a Visual Studio online bootstrapper (no MSI ProductCode, multi-GB network install), which is a fragile FMA candidate, and the runner has no standalone SSMS to uninstall.

Summary by CodeRabbit

  • New Features
    • Added support for Git (Windows) with automated install/uninstall and UI icon.
    • Added support for R for Windows with automated install/uninstall and UI icon.
    • Windows testing workflow now detects and conditionally prepares environments when Git or R are present.

allenhouchins and others added 2 commits June 5, 2026 20:07
Adds two winget-sourced Windows FMAs:
- R (RProject.R) -> 'R for Windows', Inno Setup exe, machine scope
- Git (Git.Git) -> 'Git', Inno Setup exe, machine scope

Both use custom Inno install/uninstall scripts (no MSI ProductCode) with
registry-UninstallString-based uninstall and fuzzy name matching, since their
ARP DisplayName embeds the version ('R for Windows <ver>', 'Git version <ver>').

test-fma-windows-pr-only.yml: add has_r/has_git detection and removal of the
runner's pre-installed R and Git. Git for Windows provides the Git Bash 'bash'
the workflow uses, so the apps.json filtering is split into its own step that
runs before Git removal, and validation runs 'go run -buildvcs=false' (so Go
does not invoke the now-removed git for VCS stamping).

SSMS was investigated but intentionally skipped: SSMS 21/22 is a Visual Studio
online bootstrapper (no MSI ProductCode, multi-GB network install), which is a
fragile FMA candidate, and the runner has no standalone SSMS to uninstall.
Add React SVG icon components for Git and R that embed PNG images (frontend/pages/SoftwarePage/components/icons/Git.tsx and R.tsx). Add corresponding image assets (website/assets/images/app-icon-git-60x60@2x.png, app-icon-r-60x60@2x.png). Update icons index to import and expose the new icons and register them in SOFTWARE_NAME_TO_ICON_MAP (keys: "git" and "r for windows").
@codecov

codecov Bot commented Jun 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.06%. Comparing base (bab14d7) to head (beaf66a).

Files with missing lines Patch % Lines
...ontend/pages/SoftwarePage/components/icons/Git.tsx 50.00% 1 Missing ⚠️
frontend/pages/SoftwarePage/components/icons/R.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #46988      +/-   ##
==========================================
+ Coverage   67.05%   67.06%   +0.01%     
==========================================
  Files        2892     2890       -2     
  Lines      225143   225073      -70     
  Branches    11743    11743              
==========================================
- Hits       150968   150950      -18     
+ Misses      60503    60453      -50     
+ Partials    13672    13670       -2     
Flag Coverage Δ
frontend 56.96% <50.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

After launching Git for Windows' Inno Setup uninstaller, poll the registry (2s intervals, 120s timeout) until the uninstall entry is removed to handle unins000.exe relaunch behavior; fail if it remains. Also update the Windows output ref to the new uninstall script version so callers (e.g. Fleet's install/uninstall verification) see a consistent post-uninstall state.
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Script Diff Results

ee/maintained-apps/outputs/git/windows.json

=== Install Script (no changes) ===
=== Uninstall // 61ac5463 -> c16b1f30 ===

--- /tmp/old.cdMnH7	2026-06-06 02:11:09.987210848 +0000
+++ /tmp/new.f6N4Yj	2026-06-06 02:11:09.988210832 +0000
@@ -67,6 +67,28 @@
     $process = Start-Process @processOptions
     $exitCode = $process.ExitCode
     Write-Host "Uninstall exit code: $exitCode"
+
+    # Inno Setup's unins000.exe relaunches itself (it copies to a temp _iu*.tmp and
+    # spawns that copy), so the process we waited on returns BEFORE the uninstall
+    # has finished. Poll the registry until the entry is gone so the post-uninstall
+    # state is consistent for callers (e.g. Fleet's install/uninstall verification).
+    $deadline = (Get-Date).AddSeconds(120)
+    do {
+        Start-Sleep -Seconds 2
+        $stillPresent = $false
+        foreach ($p in $paths) {
+            $match = Get-ItemProperty "$p\*" -ErrorAction SilentlyContinue | Where-Object {
+                $_.DisplayName -like $displayNameLike -and $_.Publisher -like $publisherLike
+            }
+            if ($match) { $stillPresent = $true; break }
+        }
+    } while ($stillPresent -and ((Get-Date) -lt $deadline))
+
+    if ($stillPresent) {
+        Write-Host "Uninstall entry still present after waiting; uninstall did not complete"
+        Exit 1
+    }
+
     if ($ExpectedExitCodes -contains $exitCode) { Exit 0 }
     Exit $exitCode
 } catch {

ee/maintained-apps/outputs/r/windows.json

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

Loosen the registry DisplayName match for Git for Windows to "Git*" and rely on the publisher (The Git Development Community) as the anchor. Updated explanatory comments and matching logic in the workflow and winget uninstall script to handle runners that list Git as just "Git". Also bumped the uninstall_script_ref in ee/maintained-apps/outputs/git/windows.json to reference the updated script.
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Script Diff Results

ee/maintained-apps/outputs/git/windows.json

=== Install Script (no changes) ===
=== Uninstall // c16b1f30 -> 3233086c ===

--- /tmp/old.1uQQVb	2026-06-06 02:27:48.820604852 +0000
+++ /tmp/new.JzBhGR	2026-06-06 02:27:48.821604866 +0000
@@ -1,8 +1,10 @@
 # Locates Git for Windows' Inno Setup uninstaller from the registry and runs it
-# silently. The DisplayName embeds the version (e.g. "Git version 2.54.0"), so
-# match by prefix and require the Git Development Community publisher.
+# silently. The registry DisplayName is not reliably "Git version <ver>" (e.g. the
+# GitHub-hosted runner's Git is listed as just "Git"), so anchor the match on the
+# publisher -- which is unique to Git for Windows -- and only loosely guard the
+# DisplayName. This mirrors the generated exists query's publisher clause.
 
-$displayNameLike = "Git version *"
+$displayNameLike = "Git*"
 $publisherLike = "The Git Development Community*"
 
 $paths = @(

ee/maintained-apps/outputs/r/windows.json

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

@allenhouchins
allenhouchins marked this pull request as ready for review June 8, 2026 13:56
Copilot AI review requested due to automatic review settings June 8, 2026 13:56
@fleet-release
fleet-release requested a review from eashaw June 8, 2026 13:56

@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

This PR adds two new Windows Fleet-maintained apps (FMAs)—R for Windows and Git for Windows—sourced via winget, along with corresponding frontend software icons and CI workflow updates to validate these apps on GitHub-hosted Windows runners.

Changes:

  • Added Windows FMA manifests + install/uninstall PowerShell scripts for R (RProject.R) and Git (Git.Git).
  • Added Git and R for Windows icons and wired them into the software-name-to-icon mapping.
  • Updated the Windows PR-only FMA validation workflow to detect these slugs and remove preinstalled runner copies of R/Git (and avoid go run VCS stamping when Git is removed).

Reviewed changes

Copilot reviewed 13 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
frontend/pages/SoftwarePage/components/icons/Git.tsx Adds Git software icon component.
frontend/pages/SoftwarePage/components/icons/R.tsx Adds R for Windows software icon component.
frontend/pages/SoftwarePage/components/icons/index.ts Registers new icons and maps software names (git, r for windows) to icon components.
ee/maintained-apps/inputs/winget/git.json Adds winget input definition for Git (Windows).
ee/maintained-apps/inputs/winget/r.json Adds winget input definition for R (Windows).
ee/maintained-apps/inputs/winget/scripts/git_install.ps1 Adds Git install script (Inno Setup silent install).
ee/maintained-apps/inputs/winget/scripts/git_uninstall.ps1 Adds Git uninstall script (registry-based, Inno Setup, includes completion polling).
ee/maintained-apps/inputs/winget/scripts/r_install.ps1 Adds R install script (Inno Setup silent install).
ee/maintained-apps/inputs/winget/scripts/r_uninstall.ps1 Adds R uninstall script (registry-based, Inno Setup).
ee/maintained-apps/outputs/git/windows.json Adds generated Git Windows manifest (queries, installer URL, scripts embedded by ref).
ee/maintained-apps/outputs/r/windows.json Adds generated R Windows manifest (queries, installer URL, scripts embedded by ref).
ee/maintained-apps/outputs/apps.json Adds Git and R for Windows entries to the published maintained-app catalog list.
.github/workflows/test-fma-windows-pr-only.yml Adds detection + removal steps for preinstalled R/Git and adjusts validation ordering/flags.

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

Comment thread ee/maintained-apps/outputs/git/windows.json
Comment thread ee/maintained-apps/inputs/winget/git.json
Comment thread ee/maintained-apps/inputs/winget/scripts/r_uninstall.ps1
@allenhouchins

Copy link
Copy Markdown
Member Author

@georgekarrv more removing things from runners in order to cleanly validate our FMAs.

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e057a5c0-22b1-46ec-8657-4a8c6c24fb88

📥 Commits

Reviewing files that changed from the base of the PR and between bab14d7 and beaf66a.

⛔ Files ignored due to path filters (2)
  • website/assets/images/app-icon-git-60x60@2x.png is excluded by !**/*.png
  • website/assets/images/app-icon-r-60x60@2x.png is excluded by !**/*.png
📒 Files selected for processing (13)
  • .github/workflows/test-fma-windows-pr-only.yml
  • ee/maintained-apps/inputs/winget/git.json
  • ee/maintained-apps/inputs/winget/r.json
  • ee/maintained-apps/inputs/winget/scripts/git_install.ps1
  • ee/maintained-apps/inputs/winget/scripts/git_uninstall.ps1
  • ee/maintained-apps/inputs/winget/scripts/r_install.ps1
  • ee/maintained-apps/inputs/winget/scripts/r_uninstall.ps1
  • ee/maintained-apps/outputs/apps.json
  • ee/maintained-apps/outputs/git/windows.json
  • ee/maintained-apps/outputs/r/windows.json
  • frontend/pages/SoftwarePage/components/icons/Git.tsx
  • frontend/pages/SoftwarePage/components/icons/R.tsx
  • frontend/pages/SoftwarePage/components/icons/index.ts

Walkthrough

This PR adds Git and R for Windows as new maintained applications. It updates apps.json, adds winget input manifests, adds PowerShell install/uninstall scripts, updates the Windows FMA CI workflow to detect these apps and conditionally remove pre-installed versions, adds Windows release output definitions (installer URL, checksum, detection SQL, script refs), and registers new frontend icon components.

Possibly related PRs

  • fleetdm/fleet#47024: Also updates the frontend software icon registry (SOFTWARE_NAME_TO_ICON_MAP) to register additional Windows app icons.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'Add R and Git as Windows Fleet-maintained apps' accurately describes the main changes: it adds two new Windows applications (R and Git) as Fleet-maintained apps, which aligns directly with the substantial changes across workflow files, manifest files, PowerShell scripts, JSON configurations, and frontend icon components.
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 allenhouchins-r-git-ssms

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


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.

@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: 3

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

Inline comments:
In @.github/workflows/test-fma-windows-pr-only.yml:
- Around line 561-563: The Inno uninstaller is being launched with Start-Process
using -Wait but its exit code is not checked, so update both invocations of
Start-Process that use $exePath with -PassThru to capture the process object
(e.g., $proc = Start-Process ... -PassThru -Wait -NoNewWindow), then inspect
$proc.ExitCode and throw or call Write-Error/exit with a non-zero status if
ExitCode -ne 0 so the workflow fails fast when the uninstaller fails; apply the
same change to the second Start-Process occurrence that currently waits but does
not validate the exit code.

In `@ee/maintained-apps/inputs/winget/scripts/r_uninstall.ps1`:
- Around line 67-71: Start waiting for the uninstaller to fully finish instead
of reading ExitCode immediately: change the Start-Process invocation using
$processOptions to include -PassThru and ensure you call $process.WaitForExit()
(or use Start-Process -Wait -PassThru) so the script blocks until that process
has exited, then read $process.ExitCode; additionally, for Inno Setup style
uninstallers that spawn helpers, add a short polling loop after WaitForExit that
checks for any remaining processes with the same ProcessName or known child PIDs
and only proceed once those are gone before comparing against $ExpectedExitCodes
and calling Exit.

In `@ee/maintained-apps/outputs/git/windows.json`:
- Around line 6-7: The detection SQLs under the "exists" and "patched" keys
currently use "name LIKE 'Git %'" which misses programs named exactly "Git";
update both queries to check for either name = 'Git' OR name LIKE 'Git %'
(keeping the publisher and version_compare logic intact) so hosts with the exact
"Git" name are correctly detected and evaluated by the exists and patched
checks.
🪄 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: 0946d427-11f7-4741-925d-85bf279ce7c5

📥 Commits

Reviewing files that changed from the base of the PR and between 36e4fda and ec85e44.

⛔ Files ignored due to path filters (2)
  • website/assets/images/app-icon-git-60x60@2x.png is excluded by !**/*.png
  • website/assets/images/app-icon-r-60x60@2x.png is excluded by !**/*.png
📒 Files selected for processing (13)
  • .github/workflows/test-fma-windows-pr-only.yml
  • ee/maintained-apps/inputs/winget/git.json
  • ee/maintained-apps/inputs/winget/r.json
  • ee/maintained-apps/inputs/winget/scripts/git_install.ps1
  • ee/maintained-apps/inputs/winget/scripts/git_uninstall.ps1
  • ee/maintained-apps/inputs/winget/scripts/r_install.ps1
  • ee/maintained-apps/inputs/winget/scripts/r_uninstall.ps1
  • ee/maintained-apps/outputs/apps.json
  • ee/maintained-apps/outputs/git/windows.json
  • ee/maintained-apps/outputs/r/windows.json
  • frontend/pages/SoftwarePage/components/icons/Git.tsx
  • frontend/pages/SoftwarePage/components/icons/R.tsx
  • frontend/pages/SoftwarePage/components/icons/index.ts

Comment thread .github/workflows/test-fma-windows-pr-only.yml
Comment thread ee/maintained-apps/inputs/winget/scripts/r_uninstall.ps1
Comment thread ee/maintained-apps/outputs/git/windows.json
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Script Diff Results

ee/maintained-apps/outputs/git/windows.json

=== Install Script (no changes) ===
=== Uninstall // c16b1f30 -> 3233086c ===

--- /tmp/old.240P7y	2026-06-08 15:09:05.433495853 +0000
+++ /tmp/new.5m26eN	2026-06-08 15:09:05.433495853 +0000
@@ -1,8 +1,10 @@
 # Locates Git for Windows' Inno Setup uninstaller from the registry and runs it
-# silently. The DisplayName embeds the version (e.g. "Git version 2.54.0"), so
-# match by prefix and require the Git Development Community publisher.
+# silently. The registry DisplayName is not reliably "Git version <ver>" (e.g. the
+# GitHub-hosted runner's Git is listed as just "Git"), so anchor the match on the
+# publisher -- which is unique to Git for Windows -- and only loosely guard the
+# DisplayName. This mirrors the generated exists query's publisher clause.
 
-$displayNameLike = "Git version *"
+$displayNameLike = "Git*"
 $publisherLike = "The Git Development Community*"
 
 $paths = @(

ee/maintained-apps/outputs/r/windows.json

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

@allenhouchins
allenhouchins merged commit 77b2cdc into main Jun 8, 2026
29 checks passed
@allenhouchins
allenhouchins deleted the allenhouchins-r-git-ssms branch June 8, 2026 17:41
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