Conversation
<!-- Add the related story/sub-task/bug number, like Resolves #123, or remove if NA --> **Related issue:** Resolves #38768 ## Testing - [x] Added/updated automated tests - [ ] Where appropriate, [automated tests simulate multiple hosts and test for host isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing) (updates to one hosts's records do not affect another) - [x] QA'd all new/changed functionality manually
<!-- Add the related story/sub-task/bug number, like Resolves #123, or remove if NA --> **Related issue:** Resolves #38770 Resolves #38771 Resolves #38769 # Checklist for submitter If some of the following don't apply, delete the relevant line. - [x] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) ## Testing - [x] Added/updated automated tests - [x] Where appropriate, [automated tests simulate multiple hosts and test for host isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing) (updates to one hosts's records do not affect another) - [x] QA'd all new/changed functionality manually
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #40038 +/- ##
========================================
Coverage 66.31% 66.32%
========================================
Files 2453 2455 +2
Lines 196616 196904 +288
Branches 8590 8620 +30
========================================
+ Hits 130384 130590 +206
- Misses 54420 54482 +62
- Partials 11812 11832 +20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| st.upgrade_code, | ||
| COALESCE(sthc.hosts_count, 0) AS hosts_count, | ||
| MAX(sthc.updated_at) AS counts_updated_at, | ||
| COUNT(si.id) as software_installers_count, |
There was a problem hiding this comment.
The LEFT JOIN software_installers si ON si.title_id = st.id AND %s condition below on line 68 only filters by global_or_team_id, but doesn't include AND si.is_active = TRUE. With multiple cached FMA versions, I think COUNT(si.id) as software_installers_count here on 60 might return >1.
| s.lastActivityMatches(fleet.ActivityEditedAppStoreApp{}.ActivityName(), fmt.Sprintf(`{"app_store_id":"adam_vpp_app_1", "auto_update_enabled":false, "platform":"ipados", "self_service":false, "software_display_name":"Updated Display Name", "software_icon_url":null, "software_title":"vpp1", "software_title_id":%d, "team_id":%d, "team_name":"%s"}`, vppApp.TitleID, team.ID, team.Name), 0) | ||
| } | ||
|
|
||
| func (s *integrationEnterpriseTestSuite) TestFMAVersionRollback() { |
There was a problem hiding this comment.
The test plan says, "Make sure that statuses (table under the package name on the software title details) are tied to the version (package) that is selected via GitOps. If a package is changed, numbers will go to 0."
The architecture here guarantees this, since each version is a separate software_installers row with its own ID, and GetSummaryHostSoftwareInstalls is scoped by that ID, but TestFMAVersionRollback doesn't explicitly verify it.
E.g., you might create a host_software_installs record for version A, switch to version B, then assert the status summary for the active installer shows all zeros, just to
cover this directly and protect against regressions.
Related issue: Resolves #31919
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/oree/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)Testing