Fix gitops not updating FMA installer - #50000
Conversation
…rsion Fleet-maintained app installers are matched by their shortened version string, but the installer filename and install script carry the full build number. When a new build reuses a version string (the version resolver falls back to the base version until release notes publish), the GitOps/batch write path treated it as already cached and took a scripts-only update: it rewrote the install script to the new build while leaving the filename and stored bytes on the old build, so the script referenced a package that was never downloaded. HasFMAInstallerVersion now returns whether the version exists and that row's storage hash. The batch path treats a build as cached only when both the version and hash match, otherwise it downloads and fully upserts the new build; the datastore skip-insert probe matches storage_id too so a rebuild is upserted rather than script-only updated. Auto-update behavior is unchanged.
Datastore test covers HasFMAInstallerVersion returning the cached version's storage hash and being team-scoped. Integration test re-applies a Fleet- maintained app rebuilt under the same version string (new bytes, filename, and install script) and asserts the installer's filename, hash, and script all advance together. Extends the FMA test harness with a per-state install script and per-request installer lookup so a rebuild can vary those fields.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #50000 +/- ##
==========================================
- Coverage 67.99% 67.97% -0.03%
==========================================
Files 3924 3922 -2
Lines 250120 250043 -77
Branches 13330 13319 -11
==========================================
- Hits 170072 169958 -114
- Misses 64747 64781 +34
- Partials 15301 15304 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (11)
WalkthroughFMA installer cache checks now return and compare the cached installer storage ID with the payload hash. Batch persistence also includes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ast-grep (0.44.1)server/service/integration_enterprise_test.goast-grep timed out on this file 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. Comment |
|
Happy 50000th pull request/issue 🥳 |
Related issue: Resolves #49811
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), 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
Added/updated automated tests
Where appropriate, automated tests simulate multiple hosts and test for host isolation (updates to one hosts's records do not affect another)
QA'd all new/changed functionality manually
Summary by CodeRabbit