Skip to content
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

added restart upgrade action #166154

Merged
merged 14 commits into from
Sep 18, 2023
Merged

Conversation

juliaElastic
Copy link
Contributor

@juliaElastic juliaElastic commented Sep 11, 2023

Summary

Ready to review, tests are WIP

Resolves #135539

For agents in Updating state, adding a Restart upgrade action, which uses the force flag on the API to bypass the updating check. For single agent, the action is only added if the agent has started upgrade for more than 2 hours (see discussion in issue)
For bulk selection, the action appears if all selected agents are in updating state.

To verify:

  • Start local es, kibana, fleet server (can be docker)
  • Enroll agents with horde
  • update agent docs with the queries below to simulate stuck in updating for more than 2 hours (modify the query to target specific agents)
  • bulk select agents and check that Restart upgrade action is visible, and it triggers another upgrade with force flag only on the agents stuck in updating
    • when calling the bulk_upgrade API, the UI adds the updating condition to the query / or includes only those agent ids that are stuck in updating, depending on query or manual selection
curl -sk -XPOST --user elastic:changeme -H 'content-type:application/json' \
http://localhost:9200/_security/role/fleet_superuser -d '
   {
      "indices": [
            {
               "names": [".fleet*",".kibana*"],
               "privileges": ["all"],
               "allow_restricted_indices": true
            }
      ]
   }'

curl -sk -XPOST --user elastic:changeme -H 'content-type:application/json' \
http://localhost:9200/_security/user/fleet_superuser -d '
   {
      "password": "password",
      "roles": ["superuser", "fleet_superuser"]
   }'

    curl -sk -XPOST --user fleet_superuser:password -H 'content-type:application/json' \
    -H'x-elastic-product-origin:fleet' \
    http://localhost:9200/.fleet-agents/_update_by_query -d '
    {
       "script": {
         "source": "ctx._source.upgrade_started_at = \"2023-09-13T11:26:23Z\"",
         "lang": "painless"
       },
       "query": {
         "exists": {
           "field": "tags"
         }
       }
     }'

Agent details action:

image

Agent list, bulk action:

image

Agent list, single agent action:

image

Agent details callout:
image

Select all agents on first page, restart upgrade modal shows only those that are stuck in upgrading:
image

Select all agents on all pages, restart upgrade modal shows only those that are stuck upgrading, with an extra api call to get the count:
image

Checklist

@juliaElastic juliaElastic added release_note:feature Makes this part of the condensed release notes v8.11.0 labels Sep 11, 2023
@juliaElastic juliaElastic self-assigned this Sep 11, 2023
@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@juliaElastic juliaElastic marked this pull request as ready for review September 13, 2023 14:28
@juliaElastic juliaElastic requested a review from a team as a code owner September 13, 2023 14:28
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Sep 14, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #18 / serverless observability UI Cases list "before all" hook in "Cases list"

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.2MB 1.2MB +4.1KB

Page load bundle

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

id before after diff
fleet 142.8KB 143.0KB +261.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @juliaElastic

@nchaulet nchaulet self-requested a review September 18, 2023 11:14
Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

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

Code LGTM 🚀

@juliaElastic juliaElastic merged commit 9e46146 into elastic:main Sep 18, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:feature Makes this part of the condensed release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet] Allow users to force running an upgrade again from the UI
6 participants