[Rule Migrations] Add Prerelease flag for integrations (#212206)

## Summary

This adds the flag to include prerelease integrations in the
packageClient used to fetch integrations for the Rule Migration RAG
This commit is contained in:
Marius Iversen 2025-02-24 14:01:03 +01:00 committed by GitHub
parent 2b621eef9b
commit d2c8984d67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,13 +19,17 @@ const RETURNED_INTEGRATIONS = 5 as const;
*/
export class RuleMigrationsDataIntegrationsClient extends RuleMigrationsDataBaseClient {
async getIntegrationPackages(): Promise<PackageList | undefined> {
return this.dependencies.packageService?.asInternalUser.getPackages();
return this.dependencies.packageService?.asInternalUser.getPackages({
prerelease: true,
});
}
/** Indexes an array of integrations to be used with ELSER semantic search queries */
async populate(): Promise<void> {
const index = await this.getIndexName();
const packages = await this.dependencies.packageService?.asInternalUser.getPackages();
const packages = await this.dependencies.packageService?.asInternalUser.getPackages({
prerelease: true,
});
if (packages) {
const ragIntegrations = packages.map<RuleMigrationIntegration>((pkg) => ({
title: pkg.title,