-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Fleet] Fix incorrect count of agents in bulk actions #175318
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
/ci |
616245c
to
322e6c3
Compare
@elasticmachine merge upstream |
Pinging @elastic/fleet (Team:Fleet) |
x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx
Outdated
Show resolved
Hide resolved
Looks good, great to see the tests. Added some small suggestions. |
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: cc @criamico |
Fixes elastic#171914 ## Summary Fix a small issue occurring when there are inactive agents, both regular and managed. Another PR with some refactoring for this component will follow. ### Repro steps - Enroll fleet server on fleet-server-policy - make sure to have two inactive fleet server agents on this policy as well - Enroll ~20 agents with horde and make them inactive - Make fleet server policy "managed" - Select "inactive" in the status filter - Click on "Select agents on all pages" - The bulk actions shouldn't report negative actions. If the count is 0, the actions will appear disabled #### Before ![Screenshot 2024-01-22 at 15 59 42](https://github.com/elastic/kibana/assets/16084106/cb8c6c80-b23f-4415-af2a-b4de8ae387f6) #### After ![Screenshot 2024-01-24 at 15 53 53](https://github.com/elastic/kibana/assets/16084106/6b020016-6171-43d7-bc12-685bf01b7989) ### Checklist - [ ] [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 - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed --------- Co-authored-by: Kibana Machine <[email protected]> (cherry picked from commit f2fb3ee)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
#175527) # Backport This will backport the following commits from `main` to `8.12`: - [[Fleet] Fix incorrect count of agents in bulk actions (#175318)](#175318) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Cristina Amico","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-01-25T11:29:25Z","message":"[Fleet] Fix incorrect count of agents in bulk actions (#175318)\n\nFixes https://github.com/elastic/kibana/issues/171914\r\n\r\n## Summary\r\nFix a small issue occurring when there are inactive agents, both regular\r\nand managed.\r\n\r\nAnother PR with some refactoring for this component will follow.\r\n\r\n### Repro steps\r\n\r\n- Enroll fleet server on fleet-server-policy - make sure to have two\r\ninactive fleet server agents on this policy as well\r\n- Enroll ~20 agents with horde and make them inactive\r\n- Make fleet server policy \"managed\"\r\n- Select \"inactive\" in the status filter\r\n- Click on \"Select agents on all pages\"\r\n- The bulk actions shouldn't report negative actions. If the count is 0,\r\nthe actions will appear disabled\r\n\r\n#### Before\r\n![Screenshot 2024-01-22 at 15 59\r\n42](https://github.com/elastic/kibana/assets/16084106/cb8c6c80-b23f-4415-af2a-b4de8ae387f6)\r\n\r\n#### After\r\n![Screenshot 2024-01-24 at 15 53\r\n53](https://github.com/elastic/kibana/assets/16084106/6b020016-6171-43d7-bc12-685bf01b7989)\r\n\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"f2fb3ee768f62aca11a6b3adae0514e1b1f56fcd","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Fleet","backport:prev-minor","v8.13.0"],"title":"[Fleet] Fix incorrect count of agents in bulk actions","number":175318,"url":"https://github.com/elastic/kibana/pull/175318","mergeCommit":{"message":"[Fleet] Fix incorrect count of agents in bulk actions (#175318)\n\nFixes https://github.com/elastic/kibana/issues/171914\r\n\r\n## Summary\r\nFix a small issue occurring when there are inactive agents, both regular\r\nand managed.\r\n\r\nAnother PR with some refactoring for this component will follow.\r\n\r\n### Repro steps\r\n\r\n- Enroll fleet server on fleet-server-policy - make sure to have two\r\ninactive fleet server agents on this policy as well\r\n- Enroll ~20 agents with horde and make them inactive\r\n- Make fleet server policy \"managed\"\r\n- Select \"inactive\" in the status filter\r\n- Click on \"Select agents on all pages\"\r\n- The bulk actions shouldn't report negative actions. If the count is 0,\r\nthe actions will appear disabled\r\n\r\n#### Before\r\n![Screenshot 2024-01-22 at 15 59\r\n42](https://github.com/elastic/kibana/assets/16084106/cb8c6c80-b23f-4415-af2a-b4de8ae387f6)\r\n\r\n#### After\r\n![Screenshot 2024-01-24 at 15 53\r\n53](https://github.com/elastic/kibana/assets/16084106/6b020016-6171-43d7-bc12-685bf01b7989)\r\n\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"f2fb3ee768f62aca11a6b3adae0514e1b1f56fcd"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.13.0","branchLabelMappingKey":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/175318","number":175318,"mergeCommit":{"message":"[Fleet] Fix incorrect count of agents in bulk actions (#175318)\n\nFixes https://github.com/elastic/kibana/issues/171914\r\n\r\n## Summary\r\nFix a small issue occurring when there are inactive agents, both regular\r\nand managed.\r\n\r\nAnother PR with some refactoring for this component will follow.\r\n\r\n### Repro steps\r\n\r\n- Enroll fleet server on fleet-server-policy - make sure to have two\r\ninactive fleet server agents on this policy as well\r\n- Enroll ~20 agents with horde and make them inactive\r\n- Make fleet server policy \"managed\"\r\n- Select \"inactive\" in the status filter\r\n- Click on \"Select agents on all pages\"\r\n- The bulk actions shouldn't report negative actions. If the count is 0,\r\nthe actions will appear disabled\r\n\r\n#### Before\r\n![Screenshot 2024-01-22 at 15 59\r\n42](https://github.com/elastic/kibana/assets/16084106/cb8c6c80-b23f-4415-af2a-b4de8ae387f6)\r\n\r\n#### After\r\n![Screenshot 2024-01-24 at 15 53\r\n53](https://github.com/elastic/kibana/assets/16084106/6b020016-6171-43d7-bc12-685bf01b7989)\r\n\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"f2fb3ee768f62aca11a6b3adae0514e1b1f56fcd"}}]}] BACKPORT--> Co-authored-by: Cristina Amico <[email protected]>
Closes #131153 Follow up of #175318 ## Summary Extract the main logic for agentList component in a separate hook. ### Checklist - [ ] [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 - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed --------- Co-authored-by: Kibana Machine <[email protected]>
Patch for #171914 ## Summary In #175318 I had disabled the bulk actions when the count was incorrect (negative). This was not a good idea, since some of those actions could still be applied (like unenrolling) even if the shown count is not correct. Here I'm removing that check. ### Checklist - [ ] [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 Co-authored-by: Kibana Machine <[email protected]>
Patch for elastic#171914 ## Summary In elastic#175318 I had disabled the bulk actions when the count was incorrect (negative). This was not a good idea, since some of those actions could still be applied (like unenrolling) even if the shown count is not correct. Here I'm removing that check. ### Checklist - [ ] [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 Co-authored-by: Kibana Machine <[email protected]> (cherry picked from commit b620110)
…176512) # Backport This will backport the following commits from `main` to `8.12`: - [[Fleet] Allow back previously disabled bulk actions (#176485)](#176485) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Cristina Amico","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-02-08T14:59:23Z","message":"[Fleet] Allow back previously disabled bulk actions (#176485)\n\nPatch for https://github.com/elastic/kibana/issues/171914\r\n\r\n## Summary\r\nIn #175318 I had disabled the bulk\r\nactions when the count was incorrect (negative). This was not a good\r\nidea, since some of those actions could still be applied (like\r\nunenrolling) even if the shown count is not correct. Here I'm removing\r\nthat check.\r\n\r\n\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"b62011026850bf968a90c403cae11c453c4e9130","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","backport:prev-minor","v8.13.0"],"title":"[Fleet] Allow back previously disabled bulk actions","number":176485,"url":"https://github.com/elastic/kibana/pull/176485","mergeCommit":{"message":"[Fleet] Allow back previously disabled bulk actions (#176485)\n\nPatch for https://github.com/elastic/kibana/issues/171914\r\n\r\n## Summary\r\nIn #175318 I had disabled the bulk\r\nactions when the count was incorrect (negative). This was not a good\r\nidea, since some of those actions could still be applied (like\r\nunenrolling) even if the shown count is not correct. Here I'm removing\r\nthat check.\r\n\r\n\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"b62011026850bf968a90c403cae11c453c4e9130"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.13.0","branchLabelMappingKey":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/176485","number":176485,"mergeCommit":{"message":"[Fleet] Allow back previously disabled bulk actions (#176485)\n\nPatch for https://github.com/elastic/kibana/issues/171914\r\n\r\n## Summary\r\nIn #175318 I had disabled the bulk\r\nactions when the count was incorrect (negative). This was not a good\r\nidea, since some of those actions could still be applied (like\r\nunenrolling) even if the shown count is not correct. Here I'm removing\r\nthat check.\r\n\r\n\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"b62011026850bf968a90c403cae11c453c4e9130"}}]}] BACKPORT--> Co-authored-by: Cristina Amico <[email protected]>
Fixes elastic#171914 ## Summary Fix a small issue occurring when there are inactive agents, both regular and managed. Another PR with some refactoring for this component will follow. ### Repro steps - Enroll fleet server on fleet-server-policy - make sure to have two inactive fleet server agents on this policy as well - Enroll ~20 agents with horde and make them inactive - Make fleet server policy "managed" - Select "inactive" in the status filter - Click on "Select agents on all pages" - The bulk actions shouldn't report negative actions. If the count is 0, the actions will appear disabled #### Before ![Screenshot 2024-01-22 at 15 59 42](https://github.com/elastic/kibana/assets/16084106/cb8c6c80-b23f-4415-af2a-b4de8ae387f6) #### After ![Screenshot 2024-01-24 at 15 53 53](https://github.com/elastic/kibana/assets/16084106/6b020016-6171-43d7-bc12-685bf01b7989) ### Checklist - [ ] [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 - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed --------- Co-authored-by: Kibana Machine <[email protected]>
Closes elastic#131153 Follow up of elastic#175318 ## Summary Extract the main logic for agentList component in a separate hook. ### Checklist - [ ] [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 - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed --------- Co-authored-by: Kibana Machine <[email protected]>
Patch for elastic#171914 ## Summary In elastic#175318 I had disabled the bulk actions when the count was incorrect (negative). This was not a good idea, since some of those actions could still be applied (like unenrolling) even if the shown count is not correct. Here I'm removing that check. ### Checklist - [ ] [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 Co-authored-by: Kibana Machine <[email protected]>
Closes elastic#131153 Follow up of elastic#175318 ## Summary Extract the main logic for agentList component in a separate hook. ### Checklist - [ ] [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 - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed --------- Co-authored-by: Kibana Machine <[email protected]>
Patch for elastic#171914 ## Summary In elastic#175318 I had disabled the bulk actions when the count was incorrect (negative). This was not a good idea, since some of those actions could still be applied (like unenrolling) even if the shown count is not correct. Here I'm removing that check. ### Checklist - [ ] [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 Co-authored-by: Kibana Machine <[email protected]>
Fixes #171914
Summary
Fix a small issue occurring when there are inactive agents, both regular and managed.
Another PR with some refactoring for this component will follow.
Repro steps
Before
After
Checklist