Find per-user and MSIX-packaged AI apps in the ai_tools Windows collector - #50771
Conversation
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughWindows app scanning now discovers uninstall entries from machine-wide, current-user, and loaded real-user registry hives. It filters non-user hives and skips registry access failures. Appx/MSIX scanning reads staged and per-user package directories, filters resource packages, extracts metadata, and assigns scope. A shared collector deduplicates registry and Appx results while preserving discovery order and metadata. Tests cover parsing, scanning, vendor extraction, hive filtering, and collection behavior. Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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.
Actionable comments posted: 1
🤖 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 `@orbit/pkg/table/ai_tools/internal/apps/usersid.go`:
- Around line 26-29: The isRealUserHive logic must validate complete SIDs rather
than accepting any non-empty suffix after a known prefix. In
orbit/pkg/table/ai_tools/internal/apps/usersid.go lines 26-29, update
isRealUserHive to require decimal SID segments and the correct segment count for
every accepted SID form. In
orbit/pkg/table/ai_tools/internal/apps/usersid_test.go lines 12-33, add coverage
for malformed suffixes including non-numeric segments and incorrect segment
counts.
🪄 Autofix
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 Plus
Run ID: 70e15708-8735-4917-8c4c-fa8f32f89e2a
📒 Files selected for processing (3)
orbit/pkg/table/ai_tools/internal/apps/apps_windows.goorbit/pkg/table/ai_tools/internal/apps/usersid.goorbit/pkg/table/ai_tools/internal/apps/usersid_test.go
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #50771 +/- ##
==========================================
+ Coverage 68.50% 68.54% +0.04%
==========================================
Files 3974 3980 +6
Lines 255606 256253 +647
Branches 13658 13658
==========================================
+ Hits 175108 175661 +553
- Misses 64901 64975 +74
- Partials 15597 15617 +20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
2763e08 to
e961610
Compare
e961610 to
e53f89e
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@orbit/pkg/table/ai_tools/internal/apps/appx_scan_test.go`:
- Around line 60-71: Extend TestScanAppxDirsResourcePackageSkipped to create a
package with a custom resource ID and a manifest containing
<Properties><ResourcePackage>true</ResourcePackage></Properties>. Verify
scanAppxDirs produces zero apps, covering resource packages that do not use the
split. prefix.
In `@orbit/pkg/table/ai_tools/internal/apps/appx.go`:
- Around line 43-45: The resource-package check in appxPackage.isResourcePackage
must use Properties/ResourcePackage from readAppxManifest() when the manifest is
readable, while retaining the split. ResourceID prefix check only as the
unreadable-manifest fallback. In
orbit/pkg/table/ai_tools/internal/apps/appx.go#L43-L45, update the
manifest-based candidate filtering accordingly; in
orbit/pkg/table/ai_tools/internal/apps/appx_scan_test.go#L60-L71, add coverage
for a non-split. ResourceID with ResourcePackage=true.
🪄 Autofix
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 Plus
Run ID: 2681906b-0762-4f69-a5c9-7cc569a1f580
⛔ Files ignored due to path filters (1)
orbit/pkg/table/ai_tools/README.mdis excluded by!**/*.md
📒 Files selected for processing (10)
orbit/pkg/table/ai_tools/internal/apps/apps.goorbit/pkg/table/ai_tools/internal/apps/apps_windows.goorbit/pkg/table/ai_tools/internal/apps/appx.goorbit/pkg/table/ai_tools/internal/apps/appx_scan_test.goorbit/pkg/table/ai_tools/internal/apps/appx_test.goorbit/pkg/table/ai_tools/internal/apps/appx_windows.goorbit/pkg/table/ai_tools/internal/apps/collect.goorbit/pkg/table/ai_tools/internal/apps/collect_test.goorbit/pkg/table/ai_tools/internal/apps/usersid.goorbit/pkg/table/ai_tools/internal/apps/usersid_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
- orbit/pkg/table/ai_tools/internal/apps/usersid.go
- orbit/pkg/table/ai_tools/internal/apps/usersid_test.go
…ctor Resolves #50704 The apps collector read only HKLM and CURRENT_USER uninstall keys. Because the extension runs as SYSTEM, CURRENT_USER resolves to SYSTEM's own empty hive, so per-user Electron/Squirrel installers (Ollama, LM Studio) that offer no machine-wide option were invisible. Walk real users' loaded hives under HKEY_USERS instead, filtering to account SIDs (S-1-5-21-, S-1-12-1-) and skipping the redundant _Classes sub-hives. That still misses MSIX/Store packages, which register in the AppModel repository and never write an uninstall entry at all. Add a second pass over it, taking identity and version from the package full name.
e53f89e to
6055e47
Compare
Resolves #50704
scanApps read only HKLM plus the calling process's CURRENT_USER. Because fleetd runs as NT AUTHORITY\SYSTEM, CURRENT_USER resolves to SYSTEM's own empty hive, so per-user Electron/Squirrel installers (Ollama, ChatGPT desktop, LM Studio) were invisible — none of them offers a machine-wide install to begin with.
Walk the loaded hives under HKEY_USERS for real user SIDs, skipping _Classes hives and service accounts. Machine-wide roots are still searched first so an app installed both ways keeps scope "system".
Checklist for submitter
If some of the following don't apply, delete the relevant line.
Testing
Summary by CodeRabbit
New Features
Bug Fixes