Fix Windows Git FMA patch policy never detecting outdated installs - #50424
Conversation
Git for Windows registers itself in the uninstall registry as exactly "Git" (install.iss sets UninstallDisplayName=Git since 2021), so the generated `programs.name LIKE 'Git %'` condition never matched any install and the patch policy always returned Pass. Switch the input to the custom fuzzy pattern "Git%", which matches both the current DisplayName and the pre-2021 "Git <version>" form, and keeps the existing publisher guard that excludes GitHub Desktop, Git LFS, GitKraken and Git Extensions. This mirrors the "Git*" match the app's own uninstall script and the FMA Windows CI workflow already use.
WalkthroughUpdated Windows Git detection queries to match program names beginning with 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
ee/maintained-apps/outputs/git/windows.json (1)
6-7: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd regression coverage for the Windows Git queries.
Test both
GitandGit <version>names withThe Git Development Community. Also test an unrelated publisher. Verify that an older matching version fails thepatchedquery and the active version passes.🤖 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/outputs/git/windows.json` around lines 6 - 7, Add regression coverage for the Windows Git query definitions in “exists” and “patched”. Exercise both “Git” and “Git <version>” names for “The Git Development Community”, plus an unrelated publisher; assert that older matching versions fail “patched” while the active version passes, and verify the expected existence 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 `@ee/maintained-apps/outputs/git/windows.json`:
- Around line 6-7: Add regression coverage for the Windows Git query definitions
in “exists” and “patched”. Exercise both “Git” and “Git <version>” names for
“The Git Development Community”, plus an unrelated publisher; assert that older
matching versions fail “patched” while the active version passes, and verify the
expected existence behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 6eb5710a-bce7-456c-9b6f-e2fe100af2be
📒 Files selected for processing (3)
changes/50283-git-fma-windows-patch-policyee/maintained-apps/inputs/winget/git.jsonee/maintained-apps/outputs/git/windows.json
|
Skipping CodeRabbit's suggestion. The version half of the suggestion isn't testable in Go — The coverage that would actually have caught this is at the validator level: |
Related issue: Resolves #50283
Git for Windows registers itself in the Windows uninstall registry as exactly
Git— its Inno Setup script has setUninstallDisplayName={#APP_NAME}since build-extra#365 (2021). The generated queries matchedprograms.name LIKE 'Git %', which cannot match that name, so the patch policy'sNOT EXISTS (...)was always true and every host reportedPassregardless of installed version — update automations never fired. The same mismatch meant an existing Git install couldn't be matched to the maintained app.The input now uses the custom fuzzy pattern
Git%, which also covers the pre-2021Git <version>DisplayName form (the oldest installs, which are exactly what a patch policy needs to flag), and relies on the existingpublisher = 'The Git Development Community'guard to exclude GitHub Desktop, Git LFS, GitKraken and Git Extensions. This is the same match the app's own uninstall script and the FMA Windows CI workflow already use.Instances that already created this policy pick up the corrected query when the next Git version becomes active, since the patch policy query is regenerated from the active installer.
Checklist for submitter
changes/.Testing
Verified the
LIKEsemantics in SQLite against real-worldprogramsrows (old pattern missesGit, new pattern matches both DisplayName forms, publisher guard still excludes GitHub Desktop / Git LFS / GitKraken / Git Extensions), and confirmed winget'sPackageVersionmatches the registryDisplayVersionfor Git so up-to-date hosts still pass.outputs/git/windows.jsonwas regenerated with the ingester rather than hand-edited. Not manually QA'd on a Windows host — relying ontest-fma-windowsvalidation.Summary by CodeRabbit