**Related issue:** Resolves #41470 Adds support for uploading Python (`.py`) script-only software packages — accepted as script-only (the file contents become the install script; advanced options and automatic install follow `.sh`/`.ps1`), assigned the new `py_packages` source, and installable on macOS and Linux hosts across the UI, REST API, and GitOps. Feature branch combining the backend (#48942) and frontend (#48946) sub-PRs. # Checklist for submitter - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. - [x] 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 - [x] Added/updated automated tests - [x] QA'd all new/changed functionality manually <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added support for Python (`.py`) script-only software packages across UI uploads, API/self-service installs, and GitOps parsing. * Python installers now derive metadata correctly and render the proper Python icon, with install eligibility for macOS & Linux. * **Bug Fixes** * Improved installer-script validation and “supported file types” error messages to include `.py` (and consistent handling of related script fields/options). * **Tests** * Expanded unit, integration, and GitOps tests to cover Python package parsing, metadata derivation, platform/host eligibility, and UI rendering. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
31 lines
966 B
TypeScript
31 lines
966 B
TypeScript
import { SoftwareSource } from "./software";
|
|
|
|
export const SETUP_STEP_STATUSES = [
|
|
"pending",
|
|
"running",
|
|
"success",
|
|
"failure",
|
|
"cancelled", // server should be aggregating cancelled installs with failed, check here just in case
|
|
] as const;
|
|
|
|
export type SetupStepStatus = typeof SETUP_STEP_STATUSES[number];
|
|
|
|
/** These type extends onto API returned software steps */
|
|
export const SETUP_STEP_TYPES = [
|
|
"software_install", // API key: software
|
|
"software_script_run", // API key: software, detected via a script package source (see SCRIPT_PACKAGE_SOURCES)
|
|
"script_run", // API key: scripts
|
|
];
|
|
|
|
export type SetupStepType = typeof SETUP_STEP_TYPES[number];
|
|
|
|
export interface ISetupStep {
|
|
name: string | null;
|
|
status: SetupStepStatus;
|
|
type: SetupStepType;
|
|
error?: string | null;
|
|
source?: SoftwareSource; // Software source (e.g., "sh_packages", "ps1_packages", "py_packages", "apps")
|
|
display_name?: string | null;
|
|
icon_url?: string | null;
|
|
}
|