-
Notifications
You must be signed in to change notification settings - Fork 188
[9.1] (backport #9562) fix: scheduled upgrade details state #9670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* fix: persisting and reporting of upgrade details * ci: align and extend dispatcher unit-tests * ci: update coordinator and application new signatures in unit-tests * ci: add integration tests for scheduled upgrade details * doc: add changelog fragment * doc: reword existing and add more comments in code * feat: change queuedUpgradeActions inside dispatchCancelActions to have values of struct{} * fix: remove redundant continue * fix: dedupe upgrade actions from fleetgateway actions, handle correctly the expiration of retried stored actions, and update upgrade details on retries (cherry picked from commit ff80471) # Conflicts: # internal/pkg/agent/application/application.go # internal/pkg/agent/application/coordinator/coordinator.go # internal/pkg/agent/cmd/run.go
Cherry-pick of ff80471 has failed:
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
|
What does this PR do?
This PR fixes how Elastic Agent persists and reports upgrade details across check-ins, restarts, cancellations, and expired scheduled upgrade actions.
Specifically:
Coordinator
is initialized with the correct upgrade details, either from the upgrade marker file or queued Fleet actions.ActionDispatcher
logic to:nil
when an upgrade action is dispatched without an error.testing/integration/ess/scheduled_upgrade_details_test.go
to verify that scheduled upgrade details are:All the new business logic is captured by 95ab857 (+234 -126 lines changed) and cabe8c7 (+174 -20 lines changed)
Why is it important?
Previously, scheduled upgrade details could be lost or incorrectly reported:
These inconsistencies caused confusion in Fleet UI and sometimes left users unable to perform upgrades.
With this fix, users now get a consistent and accurate view of upcoming, active, or failed upgrades across the entire Agent lifecycle.
Checklist
./changelog/fragments
using the changelog toolDisruptive User Impact
None expected. This change only improves correctness of reported upgrade details.
Users upgrading to this version will see more consistent and reliable upgrade state reporting in Fleet.
How to test this PR locally
AGENT_PACKAGE_VERSION=9.1.1 EXTERNAL=true SNAPSHOT=true PLATFORMS="linux/arm64" PACKAGES="tar.gz" mage package
(ty @ycombinator for the proposal)Screen.Recording.2025-08-26.at.5.12.03.PM.mov
Also I tested the approach mentioned here to force update an agent and everything is reflected correctly to the upgrade details
Screen.Recording.2025-08-27.at.12.42.49.AM.mov
(PS: For the needs of the videos above I compiled this PR with pseudo prior version 9.1.1)
Related issues
This is an automatic backport of pull request fix: scheduled upgrade details state #9562 done by Mergify.