Auto-update cron uses manifest scripts instead of active custom (YAML) scripts
Related to #38504.
Fleet versions
- Discovered: unreleased (#38504 / PR #48293)
- Reproduced: unreleased
Web browser and operating system: N/A (server-side)
π₯ Actual behavior
When the auto-update cron downloads a new version, it uses the manifest's install and uninstall scripts. If an admin set custom scripts through GitOps YAML, the new version loses them and uses the manifest scripts instead.
π οΈ Expected behavior
To be decided by Product Design. The story spec doesn't say which scripts an auto-downloaded version should use. See the open question in the comments.
π§βπ» Steps to reproduce
These steps:
-
[ ] Have been confirmed to consistently lead to reproduction in multiple Fleet instances.
-
[x] Describe the workflow that led to the error, but have not yet been reproduced in multiple Fleet instances.
- Add a Fleet-maintained app (for example, Chrome) through GitOps with custom install and uninstall scripts and
version: ""(Latest). Apply withfleetctl gitops. - Confirm the active installer uses the custom scripts.
- Publish a newer version upstream. In dev, point
FLEET_DEV_MAINTAINED_APPS_BASE_URLat a manifest with a higher version. - Run the cron:
fleetctl trigger --name maintained_apps_auto_update. - Check the new active version's scripts. They're the manifest scripts, not the custom ones.
π―οΈ More info (optional)
This is unspecified behavior, not a regression. An earlier rollback story's design notes describe carrying custom scripts forward, but those predate the cron and aren't part of this story's spec.
One option, pending PD's decision: if the active installer uses custom scripts, carry them forward to the new version. Otherwise use the new version's manifest scripts. Either way, store the active scripts so a later rollback replays them.
@marko-lisica opening this for tracking, but when the auto-update cron downloads a new FMA version for a title whose active installer used custom (YAML) scripts, what scripts should the new version get, the manifest's, or the previously-active custom ones?
Edge cases :
| Case | Result |
|---|---|
| EC1: Delete with no pin | β 204, no error on missing pin row |
| EC2: Major-version pin (^8) | β Β ^8Β pin row deleted on FMA removal |
| EC3: Re-add after delete | β No stale pin after re-adding |
| EC4: Multi-team isolation | β Only deleted team's pin removed; other team untouched |
| EC5: GitOps delete | β Pin cleaned up when gitops removes FMA from YAML |
β Verified Fixed in RC (PR #48350)
Fix confirmed:
- Backend carries forward custom scripts during auto-updates if they differ from manifest
- Integration test proves custom scripts survive version updates
- Code change: `ee/server/service/maintained_apps_auto_update.go` lines 286-313
Behavior:
- β Custom install/uninstall scripts preserved on auto-update
- β Falls back to manifest if scripts match (no customization)
- β Tested with `TestFMAAutoUpdateCron` Section E
Custom scripts lost, Auto-update finds its path, YAML preserved.
In cloud city's glow, Scripts adapt, evolve, and flow, Fleet's progress on show.