Skip to content

Fleet UI: Multi-package add-conflict error copy (#49309)#49336

Open
RachelElysia wants to merge 2 commits into
feat/28108-multiple-custom-packagesfrom
49309-multi-package-error-messages
Open

Fleet UI: Multi-package add-conflict error copy (#49309)#49336
RachelElysia wants to merge 2 commits into
feat/28108-multiple-custom-packagesfrom
49309-multi-package-error-messages

Conversation

@RachelElysia

@RachelElysia RachelElysia commented Jul 15, 2026

Copy link
Copy Markdown
Member

Issue

Resolves #49309.

Description

The frontend collapses every backend "already ..." conflict into the generic "installer available" flash, wiping the FMA / VPP / package-limit specificity from the design. This routes each backend message to its design-specific copy (title + fleet bolded), and handles the "different file type" error at the two Custom Package callsites by prepending the title from form context.

Also plumbs the software title through SoftwareTitleDetailsPageAddPackageModal so the multi-package modal can produce the same design copy.

Screenrecording

Screenshot 2026-07-15 at 7 31 43 AM

Testing

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

…fic error copy

The frontend was collapsing every "already ..." backend conflict into the
generic "installer available" flash. Match on the specific tail of each
backend message (FMA / VPP / software package / 10-package limit) and
render the design copy with the software title and fleet name bolded.
Handle the "different file type" error at the callsite so we can prepend
the title from form context, and plumb the title into the Software title
Add-package modal.
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.28571% with 3 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (feat/28108-multiple-custom-packages@f29ecfa). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...ge/SoftwareCustomPackage/SoftwareCustomPackage.tsx 0.00% 1 Missing ⚠️
.../SoftwareAddPage/SoftwareCustomPackage/helpers.tsx 75.00% 1 Missing ⚠️
...tleDetailsPage/AddPackageModal/AddPackageModal.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                          Coverage Diff                           @@
##             feat/28108-multiple-custom-packages   #49336   +/-   ##
======================================================================
  Coverage                                       ?   65.73%           
======================================================================
  Files                                          ?     3768           
  Lines                                          ?   239429           
  Branches                                       ?    12725           
======================================================================
  Hits                                           ?   157387           
  Misses                                         ?    67220           
  Partials                                       ?    14822           
Flag Coverage Δ
frontend 59.96% <89.28%> (?)

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

Copy link
Copy Markdown
Member Author

Quick pass — mostly clean, a few small notes. Feature-branch base so nothing here is release-critical.

Should fix

  • frontend/pages/SoftwarePage/SoftwareAddPage/SoftwareCustomPackage/SoftwareCustomPackage.tsx:167 — the softwareTitle arg being passed to getErrorMessage is formData.software?.name, which is the File name (e.g. Zoom-6.4.pkg), not the software title. If formatDifferentFileTypeMessage ever fires here, the flash will bold the filename instead of the title. In practice the "different file type" error is only emitted by UpdateSoftwareInstaller (backend ee/server/service/software_installers.go:524) — SoftwareCustomPackage calls UploadSoftwareInstaller, which can't hit it — so this is dead defensive code today. Two options: (1) drop the arg here entirely and let it fall through, or (2) add a comment explaining why the filename is acceptable if you want to keep the safety net. AddPackageModal is doing the right thing already since it plumbs the real title.

Nit

  • frontend/pages/SoftwarePage/SoftwareAddPage/helpers.tsx:26 — six sequential regex match()es for the same string is fine and readable, but if this grows again consider a [{ pattern, render }] table. Not blocking.
  • helpers.tsx:66limitMatch extracts the count as a string via (\d+) and drops it back into JSX unchanged. Works, but a Number(limitMatch[2]) would document intent (and let TS catch a future regex tweak that broke the digit constraint). Nit.
  • formatDifferentFileTypeMessage uses msg.includes(...) while the "already" formatters anchor with ^. Using includes is slightly more permissive — likely fine because the sentinel string is distinctive, but worth being aware of if another error message ever quotes this string.

Nice

  • Test coverage on formatAlreadyAvailableInstallMessage is thorough — FMA / VPP / package / limit / two legacy forms / prefix-stripped / null / empty. Good defensive net for the regex refactor.
  • Keeping the legacy SoftwareInstaller "X" already exists with fleet "Y" fallback rather than deleting it is the right call — that string is still emitted by alreadyExists(...).WithTeamName(...) in the mysql layer per the code comment.

@RachelElysia RachelElysia marked this pull request as ready for review July 15, 2026 14:54
@RachelElysia RachelElysia requested a review from a team as a code owner July 15, 2026 14:54
@RachelElysia RachelElysia linked an issue Jul 15, 2026 that may be closed by this pull request
2 tasks
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.

Multiple packages: error messages don't match design

2 participants