Show .py script-only packages as available for install on macOS hosts#49457
Show .py script-only packages as available for install on macOS hosts#49457cdcme wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #49457 +/- ##
=======================================
Coverage ? 68.07%
=======================================
Files ? 3882
Lines ? 246406
Branches ? 13173
=======================================
Hits ? 167731
Misses ? 63528
Partials ? 15147
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:
|
There was a problem hiding this comment.
Pull request overview
Enables Python script-only (.py) software packages (stored as platform='linux') to be treated like shell script (.sh) packages for macOS host eligibility/availability, across datastore discovery, self-service checks, setup experience validation, and the install service gate.
Changes:
- Update MySQL datastore platform-compatibility gates to treat
.pylike.shfor darwin↔linux script packages. - Update service-layer host/installer compatibility check to allow
.pyon unix-like hosts. - Extend automated tests to cover
.pyscript installers for darwin visibility and self-service.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| server/datastore/mysql/software.go | Treat .py like .sh when resolving/listing host-available installers for darwin. |
| server/datastore/mysql/software_titles.go | Include .py in darwin-only setup-experience title filtering logic. |
| server/datastore/mysql/software_test.go | Add coverage that .py installers are visible to darwin hosts (like .sh). |
| server/datastore/mysql/software_installers.go | Include .py in self-service installer existence check for darwin. |
| server/datastore/mysql/software_installers_test.go | Add self-service .py coverage for darwin/linux/windows platform gating. |
| server/datastore/mysql/setup_experience.go | Allow .py (linux-stored) selection for macOS setup experience (validation path). |
| frontend/utilities/file/fileUtils.tsx | Update platform display comment to reflect .sh + .py behavior. |
| ee/server/service/software_installers.go | Allow .py script packages on any unix-like host in compatibility helper. |
| ee/server/service/software_installers_test.go | Add unit coverage for .py compatibility on darwin/unix-like vs windows. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| switch { | ||
| case tuple.Platform == platform: | ||
| nativeSoftwareIDs = append(nativeSoftwareIDs, tuple.ID) | ||
| case platform == string(fleet.MacOSPlatform) && tuple.Platform == "linux" && tuple.Extension == "sh": | ||
| // .sh scripts can run on macOS; track the selection in the cross-platform table. | ||
| case platform == string(fleet.MacOSPlatform) && tuple.Platform == "linux" && (tuple.Extension == "sh" || tuple.Extension == "py"): | ||
| // .sh and .py scripts can run on macOS; track the selection in the cross-platform table. | ||
| crossSoftwareIDs = append(crossSoftwareIDs, tuple.ID) |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
WalkthroughThe change treats Possibly related issues
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 |
Related issue: Resolves #49455
Offer
.pyscript-only packages on macOS hosts, matching.sh.Checklist for submitter
SELECT *is avoided, SQL injection is prevented (using placeholders for values in statements), JS inline code is prevented especially for url redirects, and untrusted data interpolated into shell scripts/commands is validated against shell metacharacters.Testing
Summary by CodeRabbit
New Features
.py) installers are now recognized alongside shell (.sh) installers across macOS and Linux.Bug Fixes
Tests