Repository navigation
feat(software-update): auto-update policy: Update Software with Auto-update on keeps the package updated, Turn Off Auto-Update, ON / OFF state CU-17tkuw5zc6q - #2878
Merged
Conversation
…o-update on keeps the package updated on its devices
Contributor
🦩 Flamingo Code ReviewNot reviewed yet. Reviews start when you ask, so the reviewer reads this pull request when it is ready, not when it is opened. When it is ready:
Or comment Updated 2026-10-29 12:38 UTC · workflow run |
…o-update on keeps the package updated on its devices
kirill-567
approved these changes
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ClickUp task: CU-17tkuw5zc6q BE-2: Auto-update policy: model + admin API
BE-2: where the auto-update policy lives, how it is turned on and off, and the AUTO-UPDATE state the UI shows. The trigger that acts on enabled policies (BE-3) comes next.
Policy store
PackageAutoUpdatePolicy(package_auto_update_policies): one row per device and package, unique on(tenantId, machineId, packageManager, packageName), withsoftwareId,enabledandsettings. Indexes for the trigger (tenant_package) and the Software lookups (tenant_software).enable: bulk upsert on that key. Re-enabling updates settings andupdatedBy, keeps the creator, and keeps an earliersoftwareIdwhen the run has none.disableBySoftwareId: oneupdateMultiturns off every enabled policy linked to the Software. Rows stay, so the Software shows OFF.Turning it on
PackageAutoUpdatePolicyService.turnOn: a run with Auto-update on enables the package on its devices withautoUpdate.settings, or the run's update settings when it has none ("Same settings for auto-update").SoftwareBundleOnlineDispatcherandSoftwareScheduleFireDispatcher, only for devices that take the package-update order (the script path cannot run auto-update), before the order goes out.Turning it off and the state
turnOffSoftwareAutoUpdate(softwareId): idempotent, returns the updated Software, unknown softwareId → NOT_FOUND. Orders already sent finish.Software.autoUpdate/SoftwareOnDevice.autoUpdate(SoftwareAutoUpdateStatus): ON while any linked policy is enabled, OFF once all are off, null without policies. One lookup per page:software,softwares: by softwareId;deviceSoftware: by machine and softwareId (that device's state);softwareDevices: by softwareId and machine (each device's state).SoftwareAutoUpdateServiceholds the rules, so the read model (feat(software-cdc): Debezium CDC projection for Fleet software & vulnerabilities CU-17tkuw5tdwn #2651) can apply the same ones.Contract
Additive: optional
softwareId: IDonSoftwarePackageInput/SoftwareSchedulePackageInput, returned onSoftwareBundlePackage/SoftwareSchedulePackage. It links a policy to the Software forautoUpdateand Turn Off. A scheduled bundle passes it to the schedule it creates.Not in this PR
autoUpdateStatusesfilter and facet: they need paging at the source and come with the read model.Consumers
saas-tenant's ai-agent
SoftwareActionMapperhasunmappedTargetPolicy = ERROR. The bump that brings this (and #2849) needsignore = trueforsoftwareId(toPackageInput) andupdateSettings/autoUpdate(toSubmitInput), plus a Federation snapshot update.Testing
PackageAutoUpdatePolicyService, both dispatchers (policy only for order targets),SoftwareAutoUpdateService(state rules, empty page, turn-off),SoftwareBundleServiceTest(softwareId reaches the created schedule),SoftwareInventoryServiceFleetPagingTest(state on the page, NOT_FOUND).PackageAutoUpdatePolicyRepositoryITagainst Mongo: one row per device, re-enable in place, separate packages, turn-off scoped to the Software and idempotent.Change-Set: package-auto-update
Change set
flamingo-stack/package-auto-update: this pull request is the only one in it so far. Another pull request joins by naming this one in aDepends-Online, or by carrying the sameChange-Setline.Linked work
Linked by the
Depends-On/Change-Setlines in these descriptions; this block is maintained by the hub.