Skip to content

Comments

FMA version rollback#40038

Open
jahzielv wants to merge 10 commits intomainfrom
31919-rollback
Open

FMA version rollback#40038
jahzielv wants to merge 10 commits intomainfrom
31919-rollback

Conversation

@jahzielv
Copy link
Member

@jahzielv jahzielv commented Feb 18, 2026

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/ 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)

Testing

jkatz01 and others added 8 commits February 9, 2026 17:37
<!-- 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
@jahzielv jahzielv marked this pull request as ready for review February 18, 2026 17:57
@jahzielv jahzielv requested review from a team as code owners February 18, 2026 17:57
@fleetdm fleetdm deleted a comment from coderabbitai bot Feb 18, 2026
@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 65.50725% with 119 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.32%. Comparing base (0130848) to head (1a84cf6).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...ePage/components/forms/PackageForm/PackageForm.tsx 0.00% 37 Missing ⚠️
server/datastore/mysql/software_installers.go 70.70% 18 Missing and 11 partials ⚠️
server/datastore/mysql/software_titles.go 82.55% 8 Missing and 7 partials ⚠️
...mponents/forms/SoftwareVppForm/SoftwareVppForm.tsx 0.00% 9 Missing ⚠️
ee/server/service/software_installers.go 66.66% 4 Missing and 2 partials ⚠️
...tions/tables/20260218175704_FMAActiveInstallers.go 66.66% 4 Missing and 2 partials ⚠️
frontend/hooks/useSoftwareInstallerMeta.ts 42.85% 4 Missing ⚠️
...lsPage/FleetAppDetailsForm/FleetAppDetailsForm.tsx 0.00% 4 Missing ⚠️
frontend/components/FileDetails/FileDetails.tsx 25.00% 3 Missing ⚠️
server/mdm/maintainedapps/sync.go 87.50% 2 Missing and 1 partial ⚠️
... and 2 more
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     
Flag Coverage Δ
backend 68.13% <76.07%> (+0.01%) ⬆️
frontend 54.15% <35.55%> (-0.03%) ⬇️

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.

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

Rollback Fleet-maintained apps to previous version via GitOps

4 participants