Skip to content

feat(software-update): auto-update trigger: a new catalog version orders the devices that keep the package updated CU-17tkuw5zc6u - #2885

Merged
andrii-flamingo merged 9 commits into
mainfrom
feat/package-auto-update-trigger
Oct 29, 2026
Merged

andrii-flamingo merged 9 commits into
mainfrom
feat/package-auto-update-trigger

Conversation

@andrii-flamingo

@andrii-flamingo andrii-flamingo commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

ClickUp task: CU-17tkuw5zc6u BE-3: Auto-update trigger (Outdated → AUTO order)

The trigger behind auto-update: when the package catalog has a newer version of a package, every device with an enabled policy for it gets an AUTO update order, grouped into one Software Actions job per package and version.

Change

  • PackageAutoUpdateTrigger, run by PackageAutoUpdateTriggerScheduler every 15 minutes (openframe.rmm.software.auto-update.trigger.interval, ShedLock). Per package with enabled policies:
    • the latest version comes from package_catalog (PackageCatalogVersions; brew type picks between formula and cask twins); a package the catalog does not carry (Chocolatey) is skipped;
    • the due devices are those whose lastVersion differs and whose agent takes package-update orders; the rest stay for a later run;
    • one SoftwareActionResult job (kind AUTO_UPDATE, the catalog version, no initiator) with a deterministic id (SoftwareExecutionId.forAutoUpdate), so devices that reach the version later join the same row;
    • dispatchAutoUpdate per settings group under that execution id, then lastVersion is moved (markOrdered).
      A failing package is logged and does not stop the others.
  • PackageAutoUpdatePolicy.lastVersion: set to the catalog version when the policy is turned on (the run itself brings the package there), so auto-update starts from the next release.
  • PackageUpdateDispatchService.dispatchAutoUpdate: like dispatchAdminUpdate, with source AUTO; a policy without settings gets the WAIT / 300 s defaults.

Offline devices, reruns, WAITING, deadline and FORCE come from the existing delivery engine and package-update flow.

Testing

PackageAutoUpdateTriggerTest (new version, up to date, not in catalog, ineligible device, later devices join the job, settings groups), PackageCatalogVersionsTest, PackageAutoUpdatePolicyServiceTest (starting version), PackageUpdateDispatchServiceTest (AUTO source), PackageAutoUpdatePolicyRepositoryIT against Mongo (lastVersion from enable, markOrdered, enabled-only read).

Change-Set: package-auto-update

Change set flamingo-stack/openframe-oss-lib#2885: these pull requests are one change, reviewed together.

  • flamingo-stack/openframe-oss-lib#2885 (this pull request): feat(software-update): auto-update trigger: a new catalog version orders the devices that keep the package updated CU-17tkuw5zc6u · landed
  • …and 3 pull requests not visible

Linked work

  • …and 1 linked item not shown here

Linked by the Depends-On / Change-Set lines in these descriptions; this block is maintained by the hub.

…o-update on keeps the package updated on its devices
…o-update on keeps the package updated on its devices
…log version orders the devices that keep the package updated
…ate-trigger

# Conflicts:
#	openframe-data-mongo-common/src/main/java/com/openframe/data/document/rmm/software/PackageAutoUpdatePolicy.java
#	openframe-data-mongo-sync/src/main/java/com/openframe/data/repository/rmm/CustomPackageAutoUpdatePolicyRepository.java
#	openframe-data-mongo-sync/src/main/java/com/openframe/data/repository/rmm/CustomPackageAutoUpdatePolicyRepositoryImpl.java
#	openframe-data-mongo-sync/src/main/java/com/openframe/data/repository/rmm/PackageAutoUpdatePolicyRepository.java
#	openframe-data-mongo-sync/src/main/java/com/openframe/data/service/rmm/software/PackageAutoUpdatePolicyService.java
#	openframe-data-mongo-sync/src/test/java/com/openframe/data/repository/rmm/PackageAutoUpdatePolicyRepositoryIT.java
#	openframe-data-mongo-sync/src/test/java/com/openframe/data/service/rmm/software/PackageAutoUpdatePolicyServiceTest.java
…ly where its flag is on, with its timing from config
…d devices; no Optional in the catalog lookup, no Optional.get()
kirill-567
kirill-567 previously approved these changes Oct 29, 2026
@andrii-flamingo
andrii-flamingo added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit 1b81a19 Oct 29, 2026
19 checks passed
@andrii-flamingo
andrii-flamingo deleted the feat/package-auto-update-trigger branch October 29, 2026 21:03
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.

2 participants