-
Notifications
You must be signed in to change notification settings - Fork 188
[8.17] (backport #9562) fix: scheduled upgrade details state #9666
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
Merged
+1,145
−304
Conversation
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
* 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/actions/handlers/handler_action_upgrade_test.go # internal/pkg/agent/application/application.go # internal/pkg/agent/application/application_test.go # internal/pkg/agent/application/coordinator/coordinator.go # internal/pkg/agent/application/coordinator/coordinator_test.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 |
8 tasks
ffa313c
to
96872c2
Compare
|
💚 Build Succeeded
History
|
pkoutsovasilis
approved these changes
Sep 1, 2025
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.
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.