fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Auto-update cron uses manifest scripts instead of active custom (YAML) scripts

Open cdcme opened this issue 5 months ago β€’ 4 comments

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.

  1. Add a Fleet-maintained app (for example, Chrome) through GitOps with custom install and uninstall scripts and version: "" (Latest). Apply with fleetctl gitops.
  2. Confirm the active installer uses the custom scripts.
  3. Publish a newer version upstream. In dev, point FLEET_DEV_MAINTAINED_APPS_BASE_URL at a manifest with a higher version.
  4. Run the cron: fleetctl trigger --name maintained_apps_auto_update.
  5. 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.

cdcme avatar Jun 25 '26 19:06 cdcme

@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?

cdcme avatar Jun 25 '26 19:06 cdcme

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

Brajim20 avatar Jul 02 '26 17:07 Brajim20

βœ… 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

Brajim20 avatar Jul 05 '26 17:07 Brajim20

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.

fleet-release avatar Jul 15 '26 18:07 fleet-release