Skip to content

Python script-only packages: follow-on QA fixes - #50143

Merged
cdcme merged 2 commits into
mainfrom
fix-41470-follow-on
Jul 30, 2026
Merged

Python script-only packages: follow-on QA fixes#50143
cdcme merged 2 commits into
mainfrom
fix-41470-follow-on

Conversation

@cdcme

@cdcme cdcme commented Jul 29, 2026

Copy link
Copy Markdown
Member

Related issues: Resolves #50068, Resolves #50106, Resolves #50107, Resolves #50108, Resolves #50110, Resolves #50114

Follow-on fixes from QA of #41470 (Python script-only packages):

Checklist for submitter

  • Changes file added for user-visible changes in changes/.

Testing

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

fleetd/orbit/Fleet Desktop

  • If the change applies to only one platform, confirmed that runtime.GOOS is used as needed to isolate changes.
  • Verified compatibility with the latest released version of Fleet (orbit-only change; the server↔agent SoftwareInstallDetails contract is unchanged).

Summary by CodeRabbit

  • Bug Fixes
    • Improved installer validation and rejection messaging for unsupported/invalid package contents (including correcting “add” vs “edit” wording and avoiding duplicated phrasing).
    • Added clearer diagnostics when install scripts fail to start (including empty output cases).
    • Corrected handling of script-only packages so Python scripts use the proper script type/extension, reducing misleading tracebacks.
    • Updated platform availability messaging so .sh/.py packages display macOS+Linux support.
  • New Features
    • Python script-only packages can now specify macOS and Linux setup experience platforms.

Copilot AI review requested due to automatic review settings July 29, 2026 13:31

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.

Warning

  • Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.

Pull request overview

This PR addresses follow-on QA fixes for “Python script-only packages,” improving validation messaging consistency across add/edit flows, enabling .py setup_experience_platform parity with .sh, and enhancing install-time diagnostics and script temp-file handling in orbit.

Changes:

  • Backend: make installer validation errors action-neutral; improve unsupported-type messaging; allow .py setup-experience platforms; correct “macOS and Linux hosts” wording.
  • Agent (orbit): choose temp script extension based on shebang (.py/.sh/.ps1) and surface execve failures (exit code -1) into script output.
  • Frontend/tests: normalize edit-modal error prefixing to avoid doubled verbs; ensure add flow tarball errors include the correct verb; update/extend tests accordingly.

Reviewed changes

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

Show a summary per file
File Description
changes/41470-python-script-only-followups User-visible change entry (content excluded by policy).
server/service/integration_enterprise_test.go Updates integration expectations for action-neutral backend error messages.
server/fleet/software_test.go Adds coverage for -1 (script timeout/could-not-run) output enhancement behavior.
server/fleet/software_installer.go Adds “couldn’t run script” copy for exit code -1; allows .py setup-experience platforms.
server/fleet/software_installer_test.go Adds tests for allowed setup-experience platforms (including .py).
server/fleet/scripts.go Clarifies semantics of ExitCodeScriptTimeout = -1 in comments.
orbit/pkg/installer/installer.go Uses shebang-based temp script extensions; folds execve errors into output when exit -1 and output is empty.
orbit/pkg/installer/installer_test.go Adds tests for script extension selection and execve error surfacing.
frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditSoftwareModal/helpers.tsx Ensures edit flow always shows a single consistent “Couldn’t edit software.” prefix.
frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditSoftwareModal/helpers.tests.tsx Adds unit tests for edit modal error-message normalization.
frontend/pages/SoftwarePage/SoftwareAddPage/SoftwareCustomPackage/helpers.tsx Ensures tarball “learn more” message includes add-flow verb prefix.
frontend/pages/SoftwarePage/SoftwareAddPage/SoftwareCustomPackage/helpers.tests.tsx Updates/adds tests for new add-flow error behavior.
ee/server/service/software_installers.go Makes shared validation messages action-neutral; improves unsupported-format message; fixes platform rejection wording.
ee/server/service/software_installers_test.go Updates tests to match “macOS and Linux hosts” and .py setup-experience platforms.
cmd/fleetctl/integrationtest/gitops/software_test.go Updates GitOps integration tests for the new unsupported-format error message.
Files excluded by content exclusion policy (1)
  • changes/41470-python-script-only-followups

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

Comment thread orbit/pkg/installer/installer.go Outdated
@cdcme
cdcme marked this pull request as ready for review July 29, 2026 13:37
@cdcme
cdcme requested review from a team as code owners July 29, 2026 13:37
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.01887% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.09%. Comparing base (f5ca4b5) to head (353fa79).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
ee/server/service/software_installers.go 74.07% 7 Missing ⚠️
...wareTitleDetailsPage/EditSoftwareModal/helpers.tsx 77.77% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #50143      +/-   ##
==========================================
+ Coverage   68.08%   68.09%   +0.01%     
==========================================
  Files        3936     3936              
  Lines      250647   250705      +58     
  Branches    13275    13279       +4     
==========================================
+ Hits       170642   170708      +66     
+ Misses      64693    64686       -7     
+ Partials    15312    15311       -1     
Flag Coverage Δ
backend 69.42% <84.09%> (+<0.01%) ⬆️
frontend 60.99% <77.77%> (+0.04%) ⬆️

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.

@coderabbitai

coderabbitai Bot commented Jul 29, 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 Plus

Run ID: 163b83cd-c442-456b-98c9-2f164375b5d0

📥 Commits

Reviewing files that changed from the base of the PR and between 3c38da0 and 353fa79.

📒 Files selected for processing (2)
  • orbit/pkg/installer/installer.go
  • orbit/pkg/installer/installer_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • orbit/pkg/installer/installer_test.go

Walkthrough

Updated installer validation messages to report content mismatches and correct add/edit actions. Added .py support for Darwin/Linux setup-experience platforms and compatibility messaging. Orbit now selects script extensions from shebangs and surfaces execution failures with exit code -1. Install result handling includes script-run diagnostics, while frontend helpers normalize add/edit error messages. Tests were updated across server, agent, GitOps, and frontend code.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is specific, concise, and matches the main QA follow-on fixes for Python script-only packages.
Description check ✅ Passed The description covers the related issues, summary, testing, and fleetd/orbit notes required by the template.
Linked Issues check ✅ Passed The changes address the objectives in #50068, #50106, #50107, #50108, #50110, and #50114.
Out of Scope Changes check ✅ Passed The listed changes all support the QA fixes and tests described in the linked issues; no unrelated code paths stand out.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-41470-follow-on

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.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ee/server/service/software_installers.go (1)

2551-2558: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use an extension-specific message for shell/shebang mismatches.

At Line [2556], a .sh file with a valid Python shebang reaches this branch, but ErrUnsupportedInterpreter explicitly lists Python as supported. The error therefore says the interpreter is unsupported when the actual problem is that a shell package uses the wrong interpreter. Return a shell-specific validation message here.

🤖 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/server/service/software_installers.go` around lines 2551 - 2558, Update
the `.sh` validation branch in the extension switch to return a shell-specific
message when `directExecute` is true and `kind != fleet.ShebangShell`, rather
than using `fleet.ErrUnsupportedInterpreter`. Keep the existing `InternalErr`
context and validation conditions unchanged.
🤖 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.

Outside diff comments:
In `@ee/server/service/software_installers.go`:
- Around line 2551-2558: Update the `.sh` validation branch in the extension
switch to return a shell-specific message when `directExecute` is true and `kind
!= fleet.ShebangShell`, rather than using `fleet.ErrUnsupportedInterpreter`.
Keep the existing `InternalErr` context and validation conditions unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 31bef814-4542-4f0a-8858-330fbebd8b16

📥 Commits

Reviewing files that changed from the base of the PR and between 699bdb5 and 3c38da0.

📒 Files selected for processing (15)
  • changes/41470-python-script-only-followups
  • cmd/fleetctl/integrationtest/gitops/software_test.go
  • ee/server/service/software_installers.go
  • ee/server/service/software_installers_test.go
  • frontend/pages/SoftwarePage/SoftwareAddPage/SoftwareCustomPackage/helpers.tests.tsx
  • frontend/pages/SoftwarePage/SoftwareAddPage/SoftwareCustomPackage/helpers.tsx
  • frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditSoftwareModal/helpers.tests.tsx
  • frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditSoftwareModal/helpers.tsx
  • orbit/pkg/installer/installer.go
  • orbit/pkg/installer/installer_test.go
  • server/fleet/scripts.go
  • server/fleet/software_installer.go
  • server/fleet/software_installer_test.go
  • server/fleet/software_test.go
  • server/service/integration_enterprise_test.go

Copilot AI review requested due to automatic review settings July 29, 2026 15:47

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.

Warning

  • Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated no new comments.

Files excluded by content exclusion policy (1)
  • changes/41470-python-script-only-followups

@RachelElysia RachelElysia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the tests too!

@cdcme
cdcme merged commit a442d7a into main Jul 30, 2026
58 checks passed
@cdcme
cdcme deleted the fix-41470-follow-on branch July 30, 2026 18:40
cdcme added a commit that referenced this pull request Jul 30, 2026
…rm (#50254)

**Related issue:** Resolves #50106

Cherry-picks only the #50106 slice from #50143 (merged to `main`) into
the 4.90 RC. `.py` script-only packages now accept
`setup_experience_platform` (`darwin`/`linux`), matching `.sh` —
previously `AllowedSetupExperiencePlatformsForExtension` returned `nil`
for `.py`, so every value was rejected with an empty allowlist
(`allowed: `). This is an `~unreleased` bug (first ships in 4.90.0); the
other five fixes from #50143 remain on `main`.

# Checklist for submitter

## Testing

- [x] Added/updated automated tests

For unreleased bug fixes in a release candidate, one of:

- [x] Confirmed that the fix is not expected to adversely impact load
test results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment