From fce6cf86f4b2b4bee044dea46beeb8e7ec92cd03 Mon Sep 17 00:00:00 2001 From: Kyle Pollich Date: Thu, 9 Feb 2023 16:41:15 -0500 Subject: [PATCH] [Fleet] Fix max 20 installed integrations returned from Fleet API (#150780) ## Summary Fix an (old) bug where Fleet's "list packages" API endpoint would only ever return 20 installed integrations at most. I haven't included a test case here because I'm not sure we have 20 test packages that can reasonably be installed at the same time. Also feels like an arbitrary number to introduce a "lists all packages even if there are more N" test case. Open to feedback on testing. ## Before 23 installed integrations, only 20 in UI ![image](https://user-images.githubusercontent.com/6766512/217930020-f6dafe56-191a-48c0-acb4-c567810a6dad.png) ![image](https://user-images.githubusercontent.com/6766512/217930126-441e78a8-d484-4c5d-b5df-00179d930e4a.png) ## After 23 installed integrations, 23 in UI ![image](https://user-images.githubusercontent.com/6766512/217930384-21506d77-7244-42c1-93bd-97025a8ec86e.png) (cherry picked from commit e7209f52a91170ce3e53d2bd27bafaecf6195d54) --- x-pack/plugins/fleet/server/services/epm/packages/get.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x-pack/plugins/fleet/server/services/epm/packages/get.ts b/x-pack/plugins/fleet/server/services/epm/packages/get.ts index 8776ca6014e55..d0be81b4f2ae8 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/get.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/get.ts @@ -12,6 +12,7 @@ import type { Logger } from '@kbn/core/server'; import { installationStatuses, PACKAGE_POLICY_SAVED_OBJECT_TYPE, + SO_SEARCH_LIMIT, } from '../../../../common/constants'; import { isPackageLimited } from '../../../../common/services'; import type { PackageUsageStats, PackagePolicySOAttributes } from '../../../../common/types'; @@ -127,6 +128,7 @@ export async function getPackageSavedObjects( return savedObjectsClient.find({ ...(options || {}), type: PACKAGES_SAVED_OBJECT_TYPE, + perPage: SO_SEARCH_LIMIT, }); }