Skip to content

Add SQL Server Management Studio as a Windows FMA - #47003

Merged
allenhouchins merged 3 commits into
mainfrom
allenhouchins-ssms
Jun 8, 2026
Merged

Add SQL Server Management Studio as a Windows FMA#47003
allenhouchins merged 3 commits into
mainfrom
allenhouchins-ssms

Conversation

@allenhouchins

@allenhouchins allenhouchins commented Jun 6, 2026

Copy link
Copy Markdown
Member

Add a new winget maintained-app entry for SQL Server Management Studio (SSMS) 22. Includes input JSON (Microsoft.SQLServerManagementStudio.22) and two PowerShell scripts: an installer wrapper that runs the Visual Studio bootstrapper (vs_SSMS.exe) with --quiet --norestart --wait, and an uninstaller that looks up the ARP entry for SSMS 22.x and invokes the Visual Studio Installer uninstall verb with silent switches. Also update outputs: add the app to apps.json and add version metadata (installer URL, sha256, and embedded script refs) in outputs/sql-server-management-studio/windows.json.

Summary by CodeRabbit

  • New Features

    • SQL Server Management Studio 22 is now supported for installation and management on Windows platforms, providing database developers and administrators with essential tools for development and administration
  • Improvements

    • Extended Windows script execution timeout to support installation of large and complex applications with substantial installation payloads

Add a new winget maintained-app entry for SQL Server Management Studio (SSMS) 22. Includes input JSON (Microsoft.SQLServerManagementStudio.22) and two PowerShell scripts: an installer wrapper that runs the Visual Studio bootstrapper (vs_SSMS.exe) with --quiet --norestart --wait, and an uninstaller that looks up the ARP entry for SSMS 22.x and invokes the Visual Studio Installer uninstall verb with silent switches. Also update outputs: add the app to apps.json and add version metadata (installer URL, sha256, and embedded script refs) in outputs/sql-server-management-studio/windows.json.
fleet-release
fleet-release previously approved these changes Jun 6, 2026
Raise the Windows script execution timeout from 5 to 10 minutes and add an explanatory comment. Some installers (e.g. Visual Studio bootstrappers) download large payloads at install time and can legitimately take longer than a few minutes; production allows up to 1 hour, so a 10-minute validator cap covers large-payload installers while avoiding hung scripts.
Use the explicit DisplayName "SQL Server Management Studio 22" across inputs and outputs and update osquery exists/patched queries to match that name. Simplify the uninstall PowerShell by removing the publisher/version checks and only matching the verified DisplayName (found via osquery), and update the uninstall script ref in the Windows output. These changes align detection and uninstallation with how SSMS 22 registers on real hosts.
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Script Diff Results

ee/maintained-apps/outputs/sql-server-management-studio/windows.json

=== Install Script (no changes) ===
=== Uninstall // 8efc7095 -> 13740770 ===

--- /tmp/old.NiWlYG	2026-06-06 14:49:08.239674338 +0000
+++ /tmp/new.u78gMv	2026-06-06 14:49:08.239674338 +0000
@@ -1,11 +1,9 @@
 # SSMS 22 is owned by the Visual Studio Installer. Its ARP entry registers under
-# DisplayName "SQL Server Management Studio" with DisplayVersion "22.x". The
-# UninstallString points at the VS Installer's setup.exe with an "uninstall
-# --installPath ..." command; we look it up from the registry rather than
-# hard-coding the install path, then ensure the silent switches are present.
-$displayName = "SQL Server Management Studio"
-$publisher = "Microsoft Corporation"
-$versionPrefix = "22."
+# DisplayName "SQL Server Management Studio 22" (verified via osquery on a real
+# host). The UninstallString points at the VS Installer's setup.exe with an
+# "uninstall --installPath ..." command; we look it up from the registry rather
+# than hard-coding the install path, then ensure the silent switches are present.
+$displayName = "SQL Server Management Studio 22"
 
 $paths = @(
   'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall',
@@ -17,9 +15,7 @@
 $uninstall = $null
 foreach ($p in $paths) {
   $items = Get-ItemProperty "$p\*" -ErrorAction SilentlyContinue | Where-Object {
-    $_.DisplayName -eq $displayName -and `
-    $_.Publisher -like "$publisher*" -and `
-    $_.DisplayVersion -like "$versionPrefix*"
+    $_.DisplayName -eq $displayName
   }
   if ($items) { $uninstall = $items | Select-Object -First 1; break }
 }

@codecov

codecov Bot commented Jun 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.03%. Comparing base (31a3657) to head (5770bdb).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #47003      +/-   ##
==========================================
- Coverage   67.04%   67.03%   -0.01%     
==========================================
  Files        2869     2869              
  Lines      225121   225121              
  Branches    11600    11600              
==========================================
- Hits       150926   150919       -7     
- Misses      60525    60529       +4     
- Partials    13670    13673       +3     
Flag Coverage Δ
backend 68.74% <ø> (-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.

@allenhouchins
allenhouchins marked this pull request as ready for review June 6, 2026 15:47
@allenhouchins
allenhouchins requested a review from a team as a code owner June 6, 2026 15:47
Copilot AI review requested due to automatic review settings June 6, 2026 15:47

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

@allenhouchins

Copy link
Copy Markdown
Member Author

@cdcme minor change. Increasing the timeout from 5 minutes to 10 minutes for larger packages to be able to validate. Production is configured at 1 hour which is too much for our testing since we want to catch any issues quickly.

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 SQL Server Management Studio (SSMS) 22 as a Fleet-maintained app (FMA) for Windows via winget, including install/uninstall PowerShell scripts and generated output manifests. It also adjusts the Windows maintained-app validator to allow longer-running installer scripts typical of Visual Studio-style bootstrappers.

Changes:

  • Add a new winget input manifest and accompanying install/uninstall PowerShell scripts for SSMS 22.
  • Generate and commit the maintained-app output manifest for SSMS 22 and register the app in the global apps.json list.
  • Increase the Windows validator script execution timeout from 5 minutes to 10 minutes to accommodate large-payload installers.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ee/maintained-apps/outputs/sql-server-management-studio/windows.json New generated Windows output manifest for SSMS 22, including queries, installer metadata, and embedded script refs.
ee/maintained-apps/outputs/apps.json Registers “SQL Server Management Studio” in the maintained apps catalog.
ee/maintained-apps/inputs/winget/sql-server-management-studio.json New winget input definition mapping SSMS 22 to scripts and identifiers.
ee/maintained-apps/inputs/winget/scripts/sql_server_management_studio_uninstall.ps1 Uninstaller that discovers SSMS 22 via ARP and invokes the VS Installer uninstall flow silently.
ee/maintained-apps/inputs/winget/scripts/sql_server_management_studio_install.ps1 Installer wrapper invoking vs_SSMS.exe with quiet/no-restart/wait.
cmd/maintained-apps/validate/windows.go Extends validator PowerShell execution timeout to 10 minutes for long-running installers.

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

Comment thread cmd/maintained-apps/validate/windows.go
@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This PR extends the maintained apps system to support SQL Server Management Studio 22 on Windows. The timeout for PowerShell script execution increases from 5 to 10 minutes to accommodate large bootstrapper payloads. Two new PowerShell scripts implement install and uninstall operations: the install script runs a Visual Studio bootstrapper with quiet flags; the uninstall script queries the Windows registry for the SSMS 22 uninstall entry, normalizes the uninstall command with silent flags, and executes it. A new Winget input manifest wires the scripts and detection query together, and output manifests declare the app to the maintained apps registry with versioning metadata and script references.

Possibly related PRs

  • fleetdm/fleet#46311: Introduces WinSCP install/uninstall wrapper scripts using the same Start-Process pattern and exit-code handling for Windows installer orchestration in maintained apps.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is missing the required template sections including checklist items for changes files, input validation, testing, and compatibility verification. Update the description to follow the provided template, including completed checklist items for changes files, testing, QA, and platform compatibility verification.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding SQL Server Management Studio (SSMS) as a Windows Fully Managed App (FMA).
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-ssms

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.

🧹 Nitpick comments (1)
ee/maintained-apps/inputs/winget/scripts/sql_server_management_studio_uninstall.ps1 (1)

36-47: ⚡ Quick win

Consider defensive check for executable path parsing.

The three sequential regex patterns provide broad fallback coverage, but pattern 3 ('^\s*(\S+)\s*(.*)$') will match any non-whitespace token as the executable path. If $uninstallCommand contains unexpected formatting or special characters, this could capture something invalid (e.g., &, |, or a malformed path).

While the try/catch block on lines 57-74 will catch exceptions from Start-Process if the path is invalid, adding an explicit check that $exePath ends with .exe and/or exists after parsing would make the error handling more robust and provide clearer diagnostics.

🛡️ Proposed validation after parsing
 } else {
     Throw "Could not parse uninstall string: $uninstallCommand"
 }
+
+if (-not $exePath.EndsWith('.exe', [StringComparison]::OrdinalIgnoreCase)) {
+    Throw "Parsed executable path does not end with .exe: $exePath"
+}
🤖 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
`@ee/maintained-apps/inputs/winget/scripts/sql_server_management_studio_uninstall.ps1`
around lines 36 - 47, After the regex parsing block for $uninstallCommand (the
branches that set $exePath and $existingArgs), add a defensive validation that
ensures $exePath is a sensible executable: verify it ends with “.exe”
(case-insensitive) and/or that the resolved path exists (use Test-Path or
Resolve-Path) and is a file; if the check fails, Throw a clear error including
the original $uninstallCommand and the parsed $exePath so downstream
Start-Process errors are avoided and diagnostics are clearer.
🤖 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
`@ee/maintained-apps/inputs/winget/scripts/sql_server_management_studio_uninstall.ps1`:
- Around line 36-47: After the regex parsing block for $uninstallCommand (the
branches that set $exePath and $existingArgs), add a defensive validation that
ensures $exePath is a sensible executable: verify it ends with “.exe”
(case-insensitive) and/or that the resolved path exists (use Test-Path or
Resolve-Path) and is a file; if the check fails, Throw a clear error including
the original $uninstallCommand and the parsed $exePath so downstream
Start-Process errors are avoided and diagnostics are clearer.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 927d4cbb-0c7c-4133-af39-db14ea39f950

📥 Commits

Reviewing files that changed from the base of the PR and between 31a3657 and 5770bdb.

📒 Files selected for processing (6)
  • cmd/maintained-apps/validate/windows.go
  • ee/maintained-apps/inputs/winget/scripts/sql_server_management_studio_install.ps1
  • ee/maintained-apps/inputs/winget/scripts/sql_server_management_studio_uninstall.ps1
  • ee/maintained-apps/inputs/winget/sql-server-management-studio.json
  • ee/maintained-apps/outputs/apps.json
  • ee/maintained-apps/outputs/sql-server-management-studio/windows.json

@allenhouchins
allenhouchins merged commit 827d86d into main Jun 8, 2026
47 checks passed
@allenhouchins
allenhouchins deleted the allenhouchins-ssms branch June 8, 2026 14:42
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.

4 participants