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

[Fleet] /bulk_unenroll response matches other bulk action APIs #95571

Merged
merged 13 commits into from
Mar 26, 2021

Conversation

jfsiii
Copy link
Contributor

@jfsiii jfsiii commented Mar 26, 2021

Summary

/agents/bulk_unenroll should return a response with a result for each agent given; including invalid or missing ids. It currently returns an empty object. #90437

TS type diff for response

- // eslint-disable-next-line @typescript-eslint/no-empty-interface
- export interface PostBulkAgentUnenrollResponse {}
+ export type PostBulkAgentUnenrollResponse = Record<
+   Agent['id'],
+   {
+     success: boolean;
+     error?: string;
+   }
+ >;

Checklist

@jfsiii jfsiii requested a review from a team as a code owner March 26, 2021 18:42
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Mar 26, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@jfsiii jfsiii self-assigned this Mar 26, 2021
@jfsiii jfsiii added auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes v7.13.0 v8.0.0 labels Mar 26, 2021
@jfsiii jfsiii requested review from jen-huang and nchaulet March 26, 2021 18:43
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.

🚀

@jfsiii jfsiii enabled auto-merge (squash) March 26, 2021 20:50
@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / general / Chrome X-Pack UI Functional Tests.x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alerts_list·ts.Actions and Triggers app alerts list should unmute single alert

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 2 times on tracked branches: https://github.com/elastic/kibana/issues/95590

[00:00:00]       │
[00:00:00]         └-: Actions and Triggers app
[00:00:00]           └-> "before all" hook in "Actions and Triggers app"
[00:00:36]           └-: alerts list
[00:00:36]             └-> "before all" hook for "should display alerts in alphabetical order"
[00:00:36]             └-> "before all" hook for "should display alerts in alphabetical order"
[00:00:36]               │ debg navigating to triggersActions url: http://localhost:61171/app/management/insightsAndAlerting/triggersActions
[00:00:36]               │ debg navigate to: http://localhost:61171/app/management/insightsAndAlerting/triggersActions
[00:00:36]               │ debg browser[INFO] http://localhost:61171/app/management/insightsAndAlerting/triggersActions?_t=1616789657025 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:00:36]               │
[00:00:36]               │ debg browser[INFO] http://localhost:61171/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:00:36]               │ debg ... sleep(700) start
[00:00:37]               │ debg ... sleep(700) end
[00:00:37]               │ debg returned from get, calling refresh
[00:00:37]               │ERROR browser[SEVERE] http://localhost:61171/41584/bundles/core/core.entry.js 12:150329 TypeError: Failed to fetch
[00:00:37]               │          at fetch_Fetch.fetchResponse (http://localhost:61171/41584/bundles/core/core.entry.js:6:29862)
[00:00:37]               │          at async http://localhost:61171/41584/bundles/core/core.entry.js:6:27759
[00:00:37]               │          at async http://localhost:61171/41584/bundles/core/core.entry.js:6:27665
[00:00:37]               │ debg browser[INFO] http://localhost:61171/app/management/insightsAndAlerting/triggersActions?_t=1616789657025 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:00:37]               │
[00:00:37]               │ debg browser[INFO] http://localhost:61171/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:00:37]               │ debg currentUrl = http://localhost:61171/app/management/insightsAndAlerting/triggersActions
[00:00:37]               │          appUrl = http://localhost:61171/app/management/insightsAndAlerting/triggersActions
[00:00:37]               │ debg TestSubjects.find(kibanaChrome)
[00:00:37]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:00:39]               │ debg ... sleep(501) start
[00:00:39]               │ debg ... sleep(501) end
[00:00:39]               │ debg in navigateTo url = http://localhost:61171/app/management/insightsAndAlerting/triggersActions/rules
[00:00:39]               │ debg --- retry.try error: URL changed, waiting for it to settle
[00:00:40]               │ debg ... sleep(501) start
[00:00:40]               │ debg ... sleep(501) end
[00:00:40]               │ debg in navigateTo url = http://localhost:61171/app/management/insightsAndAlerting/triggersActions/rules
[00:00:40]               │ debg TestSubjects.exists(statusPageContainer)
[00:00:40]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:00:43]               │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:00:43]               │ debg TestSubjects.click(rulesTab)
[00:00:43]               │ debg Find.clickByCssSelector('[data-test-subj="rulesTab"]') with timeout=10000
[00:00:43]               │ debg Find.findByCssSelector('[data-test-subj="rulesTab"]') with timeout=10000
[00:00:43]             └-> should display alerts in alphabetical order
[00:00:43]               └-> "before each" hook: global before each for "should display alerts in alphabetical order"
[00:00:50]               │ debg TestSubjects.click(rulesTab)
[00:00:50]               │ debg Find.clickByCssSelector('[data-test-subj="rulesTab"]') with timeout=10000
[00:00:50]               │ debg Find.findByCssSelector('[data-test-subj="rulesTab"]') with timeout=10000
[00:00:50]               │ debg TestSubjects.find(alertSearchField)
[00:00:50]               │ debg Find.findByCssSelector('[data-test-subj="alertSearchField"]') with timeout=10000
[00:00:51]               │ debg Find.findByCssSelector('.euiBasicTable[data-test-subj="alertsList"]:not(.euiBasicTable-loading)') with timeout=10000
[00:00:51]               │ debg Find.findByCssSelector('[data-test-subj="alertsList"] table') with timeout=10000
[00:00:52]               └- ✓ pass  (8.3s) "Actions and Triggers app alerts list should display alerts in alphabetical order"
[00:00:52]             └-> "after each" hook for "should display alerts in alphabetical order"
[00:00:53]             └-> should search for alert
[00:00:53]               └-> "before each" hook: global before each for "should search for alert"
[00:00:55]               │ debg TestSubjects.click(rulesTab)
[00:00:55]               │ debg Find.clickByCssSelector('[data-test-subj="rulesTab"]') with timeout=10000
[00:00:55]               │ debg Find.findByCssSelector('[data-test-subj="rulesTab"]') with timeout=10000
[00:00:55]               │ debg TestSubjects.find(alertSearchField)
[00:00:55]               │ debg Find.findByCssSelector('[data-test-subj="alertSearchField"]') with timeout=10000
[00:00:56]               │ debg Find.findByCssSelector('.euiBasicTable[data-test-subj="alertsList"]:not(.euiBasicTable-loading)') with timeout=10000
[00:00:56]               │ debg Find.findByCssSelector('[data-test-subj="alertsList"] table') with timeout=10000
[00:00:56]               └- ✓ pass  (3.6s) "Actions and Triggers app alerts list should search for alert"
[00:00:56]             └-> "after each" hook for "should search for alert"
[00:00:57]               │ proc [kibana]   log   [20:14:37.903] [error][plugins][taskManager] Task alerting:test.noop "e2064d70-8e6f-11eb-beb1-db68fb0ae23d" failed: Error: Saved object [alert/e16dde00-8e6f-11eb-beb1-db68fb0ae23d] not found
[00:00:58]             └-> should search for tags
[00:00:58]               └-> "before each" hook: global before each for "should search for tags"
[00:01:00]               │ debg TestSubjects.click(rulesTab)
[00:01:00]               │ debg Find.clickByCssSelector('[data-test-subj="rulesTab"]') with timeout=10000
[00:01:00]               │ debg Find.findByCssSelector('[data-test-subj="rulesTab"]') with timeout=10000
[00:01:00]               │ debg TestSubjects.find(alertSearchField)
[00:01:00]               │ debg Find.findByCssSelector('[data-test-subj="alertSearchField"]') with timeout=10000
[00:01:02]               │ debg Find.findByCssSelector('.euiBasicTable[data-test-subj="alertsList"]:not(.euiBasicTable-loading)') with timeout=10000
[00:01:02]               │ debg Find.findByCssSelector('[data-test-subj="alertsList"] table') with timeout=10000
[00:01:02]               └- ✓ pass  (4.0s) "Actions and Triggers app alerts list should search for tags"
[00:01:02]             └-> "after each" hook for "should search for tags"
[00:01:04]             └-> should display an empty list when search did not return any alerts
[00:01:04]               └-> "before each" hook: global before each for "should display an empty list when search did not return any alerts"
[00:01:06]               │ debg TestSubjects.click(rulesTab)
[00:01:06]               │ debg Find.clickByCssSelector('[data-test-subj="rulesTab"]') with timeout=10000
[00:01:06]               │ debg Find.findByCssSelector('[data-test-subj="rulesTab"]') with timeout=10000
[00:01:06]               │ debg TestSubjects.find(alertSearchField)
[00:01:06]               │ debg Find.findByCssSelector('[data-test-subj="alertSearchField"]') with timeout=10000
[00:01:07]               │ debg Find.findByCssSelector('.euiBasicTable[data-test-subj="alertsList"]:not(.euiBasicTable-loading)') with timeout=10000
[00:01:07]               │ debg Find.findByCssSelector('[data-test-subj="alertsList"] table') with timeout=10000
[00:01:07]               └- ✓ pass  (3.6s) "Actions and Triggers app alerts list should display an empty list when search did not return any alerts"
[00:01:07]             └-> "after each" hook for "should display an empty list when search did not return any alerts"
[00:01:09]             └-> should disable single alert
[00:01:09]               └-> "before each" hook: global before each for "should disable single alert"
[00:01:11]               │ debg TestSubjects.click(rulesTab)
[00:01:11]               │ debg Find.clickByCssSelector('[data-test-subj="rulesTab"]') with timeout=10000
[00:01:11]               │ debg Find.findByCssSelector('[data-test-subj="rulesTab"]') with timeout=10000
[00:01:11]               │ debg TestSubjects.find(alertSearchField)
[00:01:11]               │ debg Find.findByCssSelector('[data-test-subj="alertSearchField"]') with timeout=10000
[00:01:12]               │ debg Find.findByCssSelector('.euiBasicTable[data-test-subj="alertsList"]:not(.euiBasicTable-loading)') with timeout=10000
[00:01:12]               │ debg TestSubjects.click(collapsedItemActions)
[00:01:12]               │ debg Find.clickByCssSelector('[data-test-subj="collapsedItemActions"]') with timeout=10000
[00:01:12]               │ debg Find.findByCssSelector('[data-test-subj="collapsedItemActions"]') with timeout=10000
[00:01:13]               │ debg TestSubjects.find(disableSwitch)
[00:01:13]               │ debg Find.findByCssSelector('[data-test-subj="disableSwitch"]') with timeout=10000
[00:01:13]               │ debg TestSubjects.find(disableSwitch)
[00:01:13]               │ debg Find.findByCssSelector('[data-test-subj="disableSwitch"]') with timeout=10000
[00:01:13]               │ debg TestSubjects.find(alertSearchField)
[00:01:13]               │ debg Find.findByCssSelector('[data-test-subj="alertSearchField"]') with timeout=10000
[00:01:13]               │ debg Find.findByCssSelector('.euiBasicTable[data-test-subj="alertsList"]:not(.euiBasicTable-loading)') with timeout=10000
[00:01:13]               │ debg TestSubjects.click(collapsedItemActions)
[00:01:13]               │ debg Find.clickByCssSelector('[data-test-subj="collapsedItemActions"]') with timeout=10000
[00:01:13]               │ debg Find.findByCssSelector('[data-test-subj="collapsedItemActions"]') with timeout=10000
[00:01:13]               │ debg TestSubjects.find(disableSwitch)
[00:01:13]               │ debg Find.findByCssSelector('[data-test-subj="disableSwitch"]') with timeout=10000
[00:01:13]               └- ✓ pass  (4.2s) "Actions and Triggers app alerts list should disable single alert"
[00:01:13]             └-> "after each" hook for "should disable single alert"
[00:01:14]             └-> should re-enable single alert
[00:01:14]               └-> "before each" hook: global before each for "should re-enable single alert"
[00:01:16]               │ debg TestSubjects.click(rulesTab)
[00:01:16]               │ debg Find.clickByCssSelector('[data-test-subj="rulesTab"]') with timeout=10000
[00:01:16]               │ debg Find.findByCssSelector('[data-test-subj="rulesTab"]') with timeout=10000
[00:01:16]               │ debg TestSubjects.find(alertSearchField)
[00:01:16]               │ debg Find.findByCssSelector('[data-test-subj="alertSearchField"]') with timeout=10000
[00:01:17]               │ debg Find.findByCssSelector('.euiBasicTable[data-test-subj="alertsList"]:not(.euiBasicTable-loading)') with timeout=10000
[00:01:18]               │ debg TestSubjects.click(collapsedItemActions)
[00:01:18]               │ debg Find.clickByCssSelector('[data-test-subj="collapsedItemActions"]') with timeout=10000
[00:01:18]               │ debg Find.findByCssSelector('[data-test-subj="collapsedItemActions"]') with timeout=10000
[00:01:18]               │ debg TestSubjects.find(disableSwitch)
[00:01:18]               │ debg Find.findByCssSelector('[data-test-subj="disableSwitch"]') with timeout=10000
[00:01:18]               │ debg TestSubjects.find(disableSwitch)
[00:01:18]               │ debg Find.findByCssSelector('[data-test-subj="disableSwitch"]') with timeout=10000
[00:01:18]               │ debg TestSubjects.find(alertSearchField)
[00:01:18]               │ debg Find.findByCssSelector('[data-test-subj="alertSearchField"]') with timeout=10000
[00:01:18]               │ debg Find.findByCssSelector('.euiBasicTable[data-test-subj="alertsList"]:not(.euiBasicTable-loading)') with timeout=10000
[00:01:18]               │ debg TestSubjects.click(collapsedItemActions)
[00:01:18]               │ debg Find.clickByCssSelector('[data-test-subj="collapsedItemActions"]') with timeout=10000
[00:01:18]               │ debg Find.findByCssSelector('[data-test-subj="collapsedItemActions"]') with timeout=10000
[00:01:18]               │ debg TestSubjects.find(disableSwitch)
[00:01:18]               │ debg Find.findByCssSelector('[data-test-subj="disableSwitch"]') with timeout=10000
[00:01:18]               │ debg TestSubjects.find(disableSwitch)
[00:01:18]               │ debg Find.findByCssSelector('[data-test-subj="disableSwitch"]') with timeout=10000
[00:01:18]               │ debg TestSubjects.find(alertSearchField)
[00:01:18]               │ debg Find.findByCssSelector('[data-test-subj="alertSearchField"]') with timeout=10000
[00:01:19]               │ debg Find.findByCssSelector('.euiBasicTable[data-test-subj="alertsList"]:not(.euiBasicTable-loading)') with timeout=10000
[00:01:19]               │ debg TestSubjects.click(collapsedItemActions)
[00:01:19]               │ debg Find.clickByCssSelector('[data-test-subj="collapsedItemActions"]') with timeout=10000
[00:01:19]               │ debg Find.findByCssSelector('[data-test-subj="collapsedItemActions"]') with timeout=10000
[00:01:19]               │ debg TestSubjects.find(disableSwitch)
[00:01:19]               │ debg Find.findByCssSelector('[data-test-subj="disableSwitch"]') with timeout=10000
[00:01:19]               └- ✓ pass  (4.8s) "Actions and Triggers app alerts list should re-enable single alert"
[00:01:19]             └-> "after each" hook for "should re-enable single alert"
[00:01:19]             └-> should mute single alert
[00:01:19]               └-> "before each" hook: global before each for "should mute single alert"
[00:01:19]               │ERROR browser[SEVERE] http://localhost:61171/api/alerts/alert/ee13a130-8e6f-11eb-beb1-db68fb0ae23d/_enable - Failed to load resource: the server responded with a status of 404 (Not Found)
[00:01:19]               │ debg browser[INFO] http://localhost:61171/41584/bundles/core/core.entry.js 12:151257 "Detected an unhandled Promise rejection.
[00:01:19]               │      Error: Not Found"
[00:01:19]               │ERROR browser[SEVERE] http://localhost:61171/41584/bundles/core/core.entry.js 5:2514 
[00:01:21]               │ debg TestSubjects.click(rulesTab)
[00:01:21]               │ debg Find.clickByCssSelector('[data-test-subj="rulesTab"]') with timeout=10000
[00:01:21]               │ debg Find.findByCssSelector('[data-test-subj="rulesTab"]') with timeout=10000
[00:01:21]               │ debg TestSubjects.find(alertSearchField)
[00:01:21]               │ debg Find.findByCssSelector('[data-test-subj="alertSearchField"]') with timeout=10000
[00:01:22]               │ debg Find.findByCssSelector('.euiBasicTable[data-test-subj="alertsList"]:not(.euiBasicTable-loading)') with timeout=10000
[00:01:22]               │ debg TestSubjects.click(collapsedItemActions)
[00:01:22]               │ debg Find.clickByCssSelector('[data-test-subj="collapsedItemActions"]') with timeout=10000
[00:01:22]               │ debg Find.findByCssSelector('[data-test-subj="collapsedItemActions"]') with timeout=10000
[00:01:23]               │ debg TestSubjects.find(muteSwitch)
[00:01:23]               │ debg Find.findByCssSelector('[data-test-subj="muteSwitch"]') with timeout=10000
[00:01:23]               │ debg TestSubjects.find(muteSwitch)
[00:01:23]               │ debg Find.findByCssSelector('[data-test-subj="muteSwitch"]') with timeout=10000
[00:01:23]               │ debg TestSubjects.find(alertSearchField)
[00:01:23]               │ debg Find.findByCssSelector('[data-test-subj="alertSearchField"]') with timeout=10000
[00:01:23]               │ debg Find.findByCssSelector('.euiBasicTable[data-test-subj="alertsList"]:not(.euiBasicTable-loading)') with timeout=10000
[00:01:23]               │ debg TestSubjects.click(collapsedItemActions)
[00:01:23]               │ debg Find.clickByCssSelector('[data-test-subj="collapsedItemActions"]') with timeout=10000
[00:01:23]               │ debg Find.findByCssSelector('[data-test-subj="collapsedItemActions"]') with timeout=10000
[00:01:23]               │ debg TestSubjects.find(muteSwitch)
[00:01:23]               │ debg Find.findByCssSelector('[data-test-subj="muteSwitch"]') with timeout=10000
[00:01:23]               └- ✓ pass  (4.1s) "Actions and Triggers app alerts list should mute single alert"
[00:01:23]             └-> "after each" hook for "should mute single alert"
[00:01:24]               │ proc [kibana]   log   [20:15:04.898] [error][plugins][taskManager] Task alerting:test.noop "f1b0ec30-8e6f-11eb-beb1-db68fb0ae23d" failed: Error: Saved object [alert/f1196720-8e6f-11eb-beb1-db68fb0ae23d] not found
[00:01:25]             └-> should unmute single alert
[00:01:25]               └-> "before each" hook: global before each for "should unmute single alert"
[00:01:27]               │ debg TestSubjects.click(rulesTab)
[00:01:27]               │ debg Find.clickByCssSelector('[data-test-subj="rulesTab"]') with timeout=10000
[00:01:27]               │ debg Find.findByCssSelector('[data-test-subj="rulesTab"]') with timeout=10000
[00:01:27]               │ debg TestSubjects.find(alertSearchField)
[00:01:27]               │ debg Find.findByCssSelector('[data-test-subj="alertSearchField"]') with timeout=10000
[00:01:28]               │ debg Find.findByCssSelector('.euiBasicTable[data-test-subj="alertsList"]:not(.euiBasicTable-loading)') with timeout=10000
[00:01:29]               │ debg TestSubjects.click(collapsedItemActions)
[00:01:29]               │ debg Find.clickByCssSelector('[data-test-subj="collapsedItemActions"]') with timeout=10000
[00:01:29]               │ debg Find.findByCssSelector('[data-test-subj="collapsedItemActions"]') with timeout=10000
[00:01:29]               │ debg TestSubjects.find(muteSwitch)
[00:01:29]               │ debg Find.findByCssSelector('[data-test-subj="muteSwitch"]') with timeout=10000
[00:01:29]               │ debg TestSubjects.find(muteSwitch)
[00:01:29]               │ debg Find.findByCssSelector('[data-test-subj="muteSwitch"]') with timeout=10000
[00:01:29]               │ debg TestSubjects.find(alertSearchField)
[00:01:29]               │ debg Find.findByCssSelector('[data-test-subj="alertSearchField"]') with timeout=10000
[00:01:29]               │ debg Find.findByCssSelector('.euiBasicTable[data-test-subj="alertsList"]:not(.euiBasicTable-loading)') with timeout=10000
[00:01:29]               │ debg TestSubjects.click(collapsedItemActions)
[00:01:29]               │ debg Find.clickByCssSelector('[data-test-subj="collapsedItemActions"]') with timeout=10000
[00:01:29]               │ debg Find.findByCssSelector('[data-test-subj="collapsedItemActions"]') with timeout=10000
[00:01:29]               │ debg TestSubjects.find(muteSwitch)
[00:01:29]               │ debg Find.findByCssSelector('[data-test-subj="muteSwitch"]') with timeout=10000
[00:01:39]               │ info Taking screenshot "/dev/shm/workspace/parallel/17/kibana/x-pack/test/functional/screenshots/failure/Actions and Triggers app alerts list should unmute single alert.png"
[00:01:39]               │ info Current URL is: http://localhost:61171/app/management/insightsAndAlerting/triggersActions/rules
[00:01:39]               │ info Saving page source to: /dev/shm/workspace/parallel/17/kibana/x-pack/test/functional/failure_debug/html/Actions and Triggers app alerts list should unmute single alert.html
[00:01:39]               └- ✖ fail: Actions and Triggers app alerts list should unmute single alert
[00:01:39]               │      TimeoutError: Waiting for element to be located By(css selector, [data-test-subj="muteSwitch"])
[00:01:39]               │ Wait timed out after 10020ms
[00:01:39]               │       at /dev/shm/workspace/parallel/17/kibana/node_modules/selenium-webdriver/lib/webdriver.js:842:17
[00:01:39]               │       at runMicrotasks (<anonymous>)
[00:01:39]               │       at processTicksAndRejections (internal/process/task_queues.js:93:5)
[00:01:39]               │ 
[00:01:39]               │ 

Stack Trace

TimeoutError: Waiting for element to be located By(css selector, [data-test-subj="muteSwitch"])
Wait timed out after 10020ms
    at /dev/shm/workspace/parallel/17/kibana/node_modules/selenium-webdriver/lib/webdriver.js:842:17
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  remoteStacktrace: ''
}

Metrics [docs]

✅ unchanged

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

cc @jfsiii

@jfsiii jfsiii merged commit 7f15931 into elastic:master Mar 26, 2021
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 26, 2021
…ic#95571)

## Summary
`/agents/bulk_unenroll` should return a response with a result for each agent given; including invalid or missing ids. It currently returns an empty object. elastic#90437


[TS type diff for response](https://github.com/jfsiii/kibana/blob/dd34e4c5ef9266a9c5162e33ca0efb4affd9b25b/x-pack/plugins/fleet/common/types/rest_spec/agent.ts#L124-L130)

```diff
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
- export interface PostBulkAgentUnenrollResponse {}
+ export type PostBulkAgentUnenrollResponse = Record<
+   Agent['id'],
+   {
+     success: boolean;
+     error?: string;
+   }
+ >;
```

### 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
@kibanamachine
Copy link
Contributor

💚 Backport successful

7.x / #95593

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Mar 26, 2021
… (#95593)

## Summary
`/agents/bulk_unenroll` should return a response with a result for each agent given; including invalid or missing ids. It currently returns an empty object. #90437


[TS type diff for response](https://github.com/jfsiii/kibana/blob/dd34e4c5ef9266a9c5162e33ca0efb4affd9b25b/x-pack/plugins/fleet/common/types/rest_spec/agent.ts#L124-L130)

```diff
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
- export interface PostBulkAgentUnenrollResponse {}
+ export type PostBulkAgentUnenrollResponse = Record<
+   Agent['id'],
+   {
+     success: boolean;
+     error?: string;
+   }
+ >;
```

### 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

Co-authored-by: John Schulz <john.schulz@elastic.co>
@jfsiii jfsiii deleted the bulk-unenroll-response-change branch April 6, 2021 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants