Skip to content

[Fleet] Report automatic upgrade status in UI#215069

Merged
Supplementing merged 46 commits into
elastic:mainfrom
Supplementing:enhancement-report-automatic-upgrade-status
Apr 7, 2025
Merged

[Fleet] Report automatic upgrade status in UI#215069
Supplementing merged 46 commits into
elastic:mainfrom
Supplementing:enhancement-report-automatic-upgrade-status

Conversation

@Supplementing
Copy link
Copy Markdown
Contributor

@Supplementing Supplementing commented Mar 18, 2025

Closes 4718

Summary

  • After much discussion, updated to not show percentages but be very similar to existing upgrade text, but with an icon/tooltip letting the user know it was created from an automatic upgrade. Also applied to completed actions.
  • Made policyId persistent in newly created actions in order to streamline accessing the upgrade modal from agent activity
  • Added is_automatic field to ActionStatus type by retrieving from the source doc in getActions
  • Updated audit log to show if the action was created by the user or from the auto-upgrade functionality
  • Updated badging on table to show retry attempts
  • Added manage auto-upgrade button to agent activity actions created by automatic upgrades
  • Updated check in automatic_upgrade_task to only consider active agents in order to resolve an issue where uninstalled agents could affect the upgrade of new ones.
  • Reworked rounding functionality when percentages or counts of agents to upgrade were over or under where they should be. Rounding is now done in a way such that no agents get left behind, and we dont try to upgrade more than exist.
  • Added new test coverage for the rounding functionality, the new active vs inactive agents check, as well as ensuring the manage auto-upgrades button always renders.

Simplified UI with tooltip and button to quickly access auto-upgrade settings for the policy the action belongs to:
image

Updated tooltip to let the user know that rounding is in place:
image

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines

Identify risks

N/A

@Supplementing
Copy link
Copy Markdown
Contributor Author

/ci

kibanamachine and others added 2 commits March 28, 2025 07:44
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/fleet --include-path /api/dashboards --update'
@Supplementing Supplementing marked this pull request as ready for review March 28, 2025 16:58
@Supplementing Supplementing requested a review from a team as a code owner March 28, 2025 16:58
@Supplementing Supplementing added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:Fleet Team label for Observability Data Collection Fleet team labels Mar 28, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/fleet (Team:Fleet)

@Supplementing
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@Supplementing
Copy link
Copy Markdown
Contributor Author

Supplementing commented Apr 2, 2025

Can you reproduce this? If not I can double check, but I think that happened consistently.

Sent you a direct message, but yes I can reproduce, seems to be a minor flaw in the way we are calculating upgrading vs not in that modal. May not be a blocker here, but we either need to get it added to this PR, or track it separately.

@jillguyonnet
Copy link
Copy Markdown
Member

Looking real good!

Quick UX question: is there a reason we only show the Manage auto-upgrade agents and Learn more buttons for in-progress actions?

@Supplementing
Copy link
Copy Markdown
Contributor Author

Supplementing commented Apr 4, 2025

Quick UX question: is there a reason we only show the Manage auto-upgrade agents and Learn more buttons for in-progress actions?

No real reason other than that was in the original scope/mockup. Learn more is existing, it was just moved from the top of the action to a button per @sileschristian recommendation. I can add them for parity if you think it makes sense? Its a very trivial change as the actions have everything we need to conditionally render them. Though, i do wonder if the manage button is needed on already completed items, managing them at that point is kind of a moot point, no?

@sileschristian
Copy link
Copy Markdown

Quick UX question: is there a reason we only show the Manage auto-upgrade agents and Learn more buttons for in-progress actions?

No real reason other than that was in the original scope/mockup. Learn more is existing, it was just moved from the top of the action to a button per @sileschristian recommendation. I can add them for parity if you think it makes sense? Its a very trivial change as the actions have everything we need to conditionally render them. Though, i do wonder if the manage button is needed on already completed items, managing them at that point is kind of a moot point, no?

I would keep the Manage auto-upgrade agents in case the user needs to change something. What's the URL behind the Learn more?

…completed on status column (to be moved to another issue)
@Supplementing
Copy link
Copy Markdown
Contributor Author

Supplementing commented Apr 4, 2025

I would keep the Manage auto-upgrade agents in case the user needs to change something. What's the URL behind the Learn more?

https://www.elastic.co/guide/en/fleet/current/upgrade-elastic-agent.html is where it links. I dont know if we need it on already complete items though?

juliaElastic added a commit that referenced this pull request Apr 7, 2025
… fix agent fetcher (#217024)

## Summary

Filter out inactive agents in auto upgrade status API - this fixes
uninstalled agents incorrectly included in the % calculation.

For example with 10 active and 5 uninstalled agents, the percentages are
lower than expected.
<img width="1787" alt="image"
src="https://github.com/user-attachments/assets/bd0ebcea-88c5-40d0-b982-f605e83b4eb8"
/>

After the change, the 5 uninstalled agents are not included:
<img width="1778" alt="image"
src="https://github.com/user-attachments/assets/72349902-bbb8-4adb-a69e-8dbfc92ad89e"
/>

The other fix is related to the auto upgrade logic:
#215069 (comment)

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
Copy link
Copy Markdown
Contributor

@juliaElastic juliaElastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jillguyonnet
Copy link
Copy Markdown
Member

https://www.elastic.co/guide/en/fleet/current/upgrade-elastic-agent.html is where it links. I dont know if we need it on already complete items though?

As a note, this may need to be updated when we have public facing documentation for automatic upgrades.

Copy link
Copy Markdown
Member

@jillguyonnet jillguyonnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work on this, LGTM 🚀

@Supplementing
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@Supplementing
Copy link
Copy Markdown
Contributor Author

Supplementing commented Apr 7, 2025

@kilfoyle If you want to peek at the copy here now that you're back!

@Supplementing Supplementing merged commit a46e811 into elastic:main Apr 7, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fleet 1.7MB 1.7MB +3.4KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
fleet 162.3KB 162.4KB +54.0B

History

baileycash-elastic pushed a commit to baileycash-elastic/kibana that referenced this pull request Apr 7, 2025
Closes
[4718](elastic/ingest-dev#4718)

## Summary 


- After much discussion, updated to not show percentages but be very
similar to existing upgrade text, but with an icon/tooltip letting the
user know it was created from an automatic upgrade. Also applied to
completed actions.
- Made `policyId` persistent in newly created actions in order to
streamline accessing the upgrade modal from agent activity
- Added `is_automatic` field to `ActionStatus` type by retrieving from
the source doc in `getActions`
- Updated audit log to show if the action was created by the user or
from the auto-upgrade functionality
 - Updated badging on table to show retry attempts
- Added `manage auto-upgrade` button to agent activity actions created
by automatic upgrades
- Updated check in `automatic_upgrade_task` to only consider active
agents in order to resolve an issue where uninstalled agents could
affect the upgrade of new ones.
- Reworked rounding functionality when percentages or counts of agents
to upgrade were over or under where they should be. Rounding is now done
in a way such that no agents get left behind, and we dont try to upgrade
more than exist.
- Added new test coverage for the rounding functionality, the new active
vs inactive agents check, as well as ensuring the manage auto-upgrades
button always renders.

Simplified UI with tooltip and button to quickly access auto-upgrade
settings for the policy the action belongs to:

![image](https://github.com/user-attachments/assets/44205322-d6ca-40fb-bfb3-c1f26132418b)

Updated tooltip to let the user know that rounding is in place:

![image](https://github.com/user-attachments/assets/0d62688e-6d48-4c0a-9b03-a77deb814f1e)

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

N/A

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
juliaElastic pushed a commit to juliaElastic/kibana that referenced this pull request Apr 8, 2025
Closes
[4718](elastic/ingest-dev#4718)

- After much discussion, updated to not show percentages but be very
similar to existing upgrade text, but with an icon/tooltip letting the
user know it was created from an automatic upgrade. Also applied to
completed actions.
- Made `policyId` persistent in newly created actions in order to
streamline accessing the upgrade modal from agent activity
- Added `is_automatic` field to `ActionStatus` type by retrieving from
the source doc in `getActions`
- Updated audit log to show if the action was created by the user or
from the auto-upgrade functionality
 - Updated badging on table to show retry attempts
- Added `manage auto-upgrade` button to agent activity actions created
by automatic upgrades
- Updated check in `automatic_upgrade_task` to only consider active
agents in order to resolve an issue where uninstalled agents could
affect the upgrade of new ones.
- Reworked rounding functionality when percentages or counts of agents
to upgrade were over or under where they should be. Rounding is now done
in a way such that no agents get left behind, and we dont try to upgrade
more than exist.
- Added new test coverage for the rounding functionality, the new active
vs inactive agents check, as well as ensuring the manage auto-upgrades
button always renders.

Simplified UI with tooltip and button to quickly access auto-upgrade
settings for the policy the action belongs to:

![image](https://github.com/user-attachments/assets/44205322-d6ca-40fb-bfb3-c1f26132418b)

Updated tooltip to let the user know that rounding is in place:

![image](https://github.com/user-attachments/assets/0d62688e-6d48-4c0a-9b03-a77deb814f1e)

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

N/A

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants