Skip to content

Fleet UI: Restore download button for script-only packages - #48909

Merged
RachelElysia merged 1 commit into
mainfrom
48907-script-package-download-button
Jul 7, 2026
Merged

Fleet UI: Restore download button for script-only packages#48909
RachelElysia merged 1 commit into
mainfrom
48907-script-package-download-button

Conversation

@RachelElysia

@RachelElysia RachelElysia commented Jul 7, 2026

Copy link
Copy Markdown
Member

Issue

Closes #48907

Description

  • Bug fix (root cause): Fix custom packages download button #48794 changed the accordion download gate to row.isActive && !isScriptPackage, silently dropping the download button for script-only custom packages. 4.87.1 and the 4.88 RC still show Download + Delete for any custom package (including script-only) via the older SoftwareInstallerCard, and nothing in Added custom software packages do not have the download button available on software details page #48418 or the handbook asks to exclude script packages.
  • Fix: drop the !isScriptPackage clause on SoftwareTitleDetailsPage.tsx so canDownload tracks row.isActive only. Backend (DownloadSoftwareInstaller) already serves the script file from the same object store as .pkg/.msi, so no server change needed.
  • Doc: correct the stale canDownload prop comment that claimed script-only packages have no downloadable file.

Screenshot

  • Download button appears on the software details page for a script-only custom package and downloads the script file
  • Please ignore the "Latest" badge visible in the screenshot — that's addressed in a separate PR currently in review
Screenshot 2026-07-07 at 1 13 11 PM

Testing

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

Summary by CodeRabbit

  • Bug Fixes
    • Download buttons now appear for active package rows more consistently.
    • App Store and Play Store rows continue to hide download options when no installer is available.
  • Documentation
    • Clarified the download-button guidance for supported row types.

#48794 tightened the accordion download gate to `row.isActive &&
!isScriptPackage`, which silently regressed 4.87.1 / 4.88 behavior —
those releases show Download + Delete for any custom package,
including script-only ones. Nothing in #48418 or the handbook asks
to exclude script packages; the backend already serves them from the
same object store.

Drop the `!isScriptPackage` clause so the button reappears for
script-only custom packages. Also correct the stale doc comment on
`canDownload` that claimed script-only packages have no file to
download.

Closes #48907
@RachelElysia
RachelElysia requested a review from a team as a code owner July 7, 2026 20:12
Copilot AI review requested due to automatic review settings July 7, 2026 20:12
@RachelElysia

Copy link
Copy Markdown
Member Author

@claude review

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

Restores the “Download installer” button on the Software title details page for script-only custom packages by adjusting the UI gating logic, and updates the related prop documentation to reflect that script packages do have a downloadable file.

Changes:

  • Allow downloads for active package rows regardless of isScriptPackage (canDownload now tracks row.isActive only).
  • Update LibraryItemAccordion prop docs to remove the incorrect claim that script-only packages have no downloadable file.

Reviewed changes

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

File Description
frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/SoftwareTitleDetailsPage.tsx Removes the !isScriptPackage condition so active script-only packages show the download button.
frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/LibraryItemAccordion/LibraryItemAccordion.tsx Updates canDownload prop comment to align with script-only packages being downloadable.

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

failedPath={statusPath("failed")}
hashSha256={row.isActive ? pkg.hash_sha256 ?? null : null}
canDownload={row.isActive && !isScriptPackage}
canDownload={row.isActive}
@coderabbitai

coderabbitai Bot commented Jul 7, 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: 0089003b-94eb-4281-b255-31fd6b2e089e

📥 Commits

Reviewing files that changed from the base of the PR and between 7b950c6 and f6639ae.

📒 Files selected for processing (2)
  • frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/LibraryItemAccordion/LibraryItemAccordion.tsx
  • frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/SoftwareTitleDetailsPage.tsx

Walkthrough

The change modifies the canDownload condition for package rows in SoftwareTitleDetailsPage so it depends only on row.isActive, removing the previous exclusion for script-only packages. The corresponding inline documentation comment for the canDownload prop in LibraryItemAccordion is also updated to state the download button is disabled only for App Store/Play Store rows, no longer referencing script-only packages.

Changes

File Change
SoftwareTitleDetailsPage.tsx canDownload now evaluated as row.isActive only, dropping the !isScriptPackage condition
LibraryItemAccordion.tsx Updated canDownload prop comment to reflect App Store/Play Store-only exclusion

Related issues

Possibly related PRs

  • fleetdm/fleet#48794: Introduced the canDownload-based wiring for LibraryItemAccordion in SoftwareTitleDetailsPage, including the !isScriptPackage condition that this PR removes.

Suggested labels: bug, frontend, patch

Suggested reviewers: none identified from provided context

🐰 A button once hidden, now shining anew,
Script packages downloadable, back on cue,
One flag removed, one comment refined,
The library accordion, correctly aligned.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: restoring the download button for script-only packages.
Description check ✅ Passed The description includes the issue, root cause, fix, screenshot, and testing details, so it mostly matches the template.
Linked Issues check ✅ Passed The code changes remove the script-package restriction and update the stale comment, matching issue #48907's expected behavior.
Out of Scope Changes check ✅ Passed The PR stays focused on the download-gate fix and related documentation update, with no clear out-of-scope changes.
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 48907-script-package-download-button

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.

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.06%. Comparing base (0b929a1) to head (f6639ae).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main   #48909    +/-   ##
========================================
  Coverage   68.06%   68.06%            
========================================
  Files        3706     3706            
  Lines      234721   234721            
  Branches    12354    12503   +149     
========================================
  Hits       159768   159768            
  Misses      60609    60609            
  Partials    14344    14344            
Flag Coverage Δ
frontend 59.27% <ø> (ø)

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.

@RachelElysia
RachelElysia merged commit 0b9ca60 into main Jul 7, 2026
29 checks passed
@RachelElysia
RachelElysia deleted the 48907-script-package-download-button branch July 7, 2026 20:20
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.

Download button missing for script-only custom packages on software details page

3 participants