Skip to content

Show .py script-only packages as available for install on macOS hosts#49457

Open
cdcme wants to merge 1 commit into
mainfrom
fix-49455-py-installer-macos-availability
Open

Show .py script-only packages as available for install on macOS hosts#49457
cdcme wants to merge 1 commit into
mainfrom
fix-49455-py-installer-macos-availability

Conversation

@cdcme

@cdcme cdcme commented Jul 17, 2026

Copy link
Copy Markdown
Member

Related issue: Resolves #49455

Offer .py script-only packages on macOS hosts, matching .sh.

Checklist for submitter

  • Input data is properly validated, 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

  • Added/updated automated tests
  • QA'd all new/changed functionality manually

Summary by CodeRabbit

  • New Features

    • Python (.py) installers are now recognized alongside shell (.sh) installers across macOS and Linux.
    • Eligible Python installers appear in software availability, self-service installation, and setup experience flows.
    • Windows continues to exclude Unix-specific script installers.
  • Bug Fixes

    • Improved consistency when selecting compatible installers across Unix-like platforms.
  • Tests

    • Added coverage for Python installer compatibility across supported platforms.

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@b70087b). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #49457   +/-   ##
=======================================
  Coverage        ?   68.07%           
=======================================
  Files           ?     3882           
  Lines           ?   246406           
  Branches        ?    13173           
=======================================
  Hits            ?   167731           
  Misses          ?    63528           
  Partials        ?    15147           
Flag Coverage Δ
backend 69.53% <100.00%> (?)
frontend 60.16% <ø> (?)

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.

@cdcme
cdcme marked this pull request as ready for review July 17, 2026 00:39
@cdcme
cdcme requested review from a team as code owners July 17, 2026 00:39
Copilot AI review requested due to automatic review settings July 17, 2026 00:39

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

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 .py like .sh for darwin↔linux script packages.
  • Update service-layer host/installer compatibility check to allow .py on unix-like hosts.
  • Extend automated tests to cover .py script 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.

Comment on lines 541 to 546
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)
@coderabbitai

coderabbitai Bot commented Jul 17, 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: fbf92a04-676a-4cbd-83cb-d0d6417f8ae6

📥 Commits

Reviewing files that changed from the base of the PR and between b70087b and 57b5c09.

📒 Files selected for processing (9)
  • ee/server/service/software_installers.go
  • ee/server/service/software_installers_test.go
  • frontend/utilities/file/fileUtils.tsx
  • server/datastore/mysql/setup_experience.go
  • server/datastore/mysql/software.go
  • server/datastore/mysql/software_installers.go
  • server/datastore/mysql/software_installers_test.go
  • server/datastore/mysql/software_test.go
  • server/datastore/mysql/software_titles.go

Walkthrough

The change treats .py installers like .sh installers on Unix-like hosts. Compatibility checks, datastore queries, setup-experience validation, self-service detection, and software-title filtering now include Linux-stored Python installers for macOS and Linux. Tests cover installer compatibility and visibility across Darwin, Linux, and Windows hosts. Frontend documentation now describes script package platform coverage.

Possibly related issues

Possibly related PRs

  • fleetdm/fleet#49070 — Introduces related .py script-only installer eligibility and platform handling.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: exposing .py script-only packages for install on macOS hosts.
Description check ✅ Passed The description includes the related issue, a concise summary, and the required testing checklist entries.
Linked Issues check ✅ Passed The changes address #49455 by allowing .py packages in the macOS discovery and eligibility paths, including self-service and setup experience.
Out of Scope Changes check ✅ Passed No clear out-of-scope code changes are present; the extra comment update is aligned with the same installer platform behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 fix-49455-py-installer-macos-availability

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.

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.

Software: .py script-only packages not offered as available-for-install on macOS hosts

4 participants