Skip to content

🤖 Fix installer dedupe for software that doesn't have a bundle ID#43385

Closed
iansltx wants to merge 3 commits intomainfrom
fix-uniqueness-constraint-issues-on-software-installers
Closed

🤖 Fix installer dedupe for software that doesn't have a bundle ID#43385
iansltx wants to merge 3 commits intomainfrom
fix-uniqueness-constraint-issues-on-software-installers

Conversation

@iansltx
Copy link
Copy Markdown
Member

@iansltx iansltx commented Apr 10, 2026

Zed + Opus 4.6; prompt below (Android apps were determined not to be affected):

It looks like we aren't properly deduplicating Windows and Linux (e.g. tarball, EXE) package-based installers on add, causing multiple installers to be add-able on top of each other, and deletions of one to reveal the previously uploaded installer rather than going to zero installers.

Diagnose when this issue started and why it happened. Then build a fix that works cross-platform. Looking for instances of CantAddSoftwareConflictMessage in the server-side codebase may help triage this.

This might also be an issue with Android VPP apps; check those too.

Related issue: Resolves #

Checklist for submitter

If some of the following don't apply, delete the relevant line.

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
    See Changes files for more information.

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

  • Timeouts are implemented and retries are limited to avoid infinite loops

  • If paths of existing endpoints are modified without backwards compatibility, checked the frontend/CLI for any necessary changes

Testing

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

  • Confirmed that the fix is not expected to adversely impact load test results
  • Alerted the release DRI if additional load testing is needed

Database migrations

  • Checked schema for all modified table for columns that will auto-update timestamps during migration.
  • Confirmed that updating the timestamps is acceptable, and will not cause unwanted side effects.
  • Ensured the correct collation is explicitly set for character columns (COLLATE utf8mb4_unicode_ci).

New Fleet configuration settings

  • Setting(s) is/are explicitly excluded from GitOps

If you didn't check the box above, follow this checklist for GitOps-enabled settings:

  • Verified that the setting is exported via fleetctl generate-gitops
  • Verified the setting is documented in a separate PR to the GitOps documentation
  • Verified that the setting is cleared on the server if it is not supplied in a YAML file (or that it is documented as being optional)
  • Verified that any relevant UI is disabled when GitOps mode is enabled

fleetd/orbit/Fleet Desktop

  • Verified compatibility with the latest released version of Fleet (see Must rule)
  • If the change applies to only one platform, confirmed that runtime.GOOS is used as needed to isolate changes
  • Verified that fleetd runs on macOS, Linux and Windows
  • Verified auto-update works from the released version of component to the new version (see tools/tuf/test)

Zed + Opus 4.6; prompt below (Android apps were determined not to be affected):

It looks like we aren't properly deduplicating Windows and Linux (e.g. tarball, EXE) package-based installers on add, causing multiple installers to be add-able on top of each other, and deletions of one to reveal the previously uploaded installer rather than going to zero installers.

Diagnose when this issue started and why it happened. Then build a fix that works cross-platform. Looking for instances of `CantAddSoftwareConflictMessage` in the server-side codebase may help triage this.

This might also be an issue with Android VPP apps; check those too.
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 82.14286% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.88%. Comparing base (8509b18) to head (7db4385).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
server/datastore/mysql/software_installers.go 66.66% 2 Missing and 1 partial ⚠️
server/datastore/mysql/in_house_apps.go 89.47% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #43385      +/-   ##
==========================================
- Coverage   66.88%   66.88%   -0.01%     
==========================================
  Files        2590     2590              
  Lines      207649   207674      +25     
  Branches     9278     9279       +1     
==========================================
+ Hits       138892   138906      +14     
- Misses      56122    56131       +9     
- Partials    12635    12637       +2     
Flag Coverage Δ
backend 68.67% <82.14%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

Zed + Opus 4.6; prompt: `TestIntegrationsEnterprise/TestSoftwareInstallerUploadDownloadAndDelete` is failing. Fix either the test if it's wrong or the code if it's wrong.
Zed + Opus 4.6; prompt: Fix failing `TestIntegrationsEnterprise/TestAutomaticPolicies` and `https://github.com/fleetdm/fleet/actions/runs/24220989052/job/70712227718?pr=43385` tests
@iansltx
Copy link
Copy Markdown
Member Author

iansltx commented Apr 10, 2026

Closing this because after a few attempts at fixing the tests the bot doesn't seem to be getting anywhere that isn't breaking other things. Going to take a stab at fixing this by hand later.

@iansltx iansltx closed this Apr 10, 2026
@iansltx iansltx deleted the fix-uniqueness-constraint-issues-on-software-installers branch April 10, 2026 14:34
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.

1 participant