diff --git a/frontend/src/interfaces/uiConfig.ts b/frontend/src/interfaces/uiConfig.ts index d696dd3658..dbcb2a2dff 100644 --- a/frontend/src/interfaces/uiConfig.ts +++ b/frontend/src/interfaces/uiConfig.ts @@ -64,7 +64,6 @@ export type UiFlags = { doraMetrics?: boolean; dependentFeatures?: boolean; scheduledConfigurationChanges?: boolean; - featureSearchAPI?: boolean; newStrategyConfiguration?: boolean; incomingWebhooks?: boolean; automatedActions?: boolean; diff --git a/src/lib/__snapshots__/create-config.test.ts.snap b/src/lib/__snapshots__/create-config.test.ts.snap index f819e3f03f..28275df5a3 100644 --- a/src/lib/__snapshots__/create-config.test.ts.snap +++ b/src/lib/__snapshots__/create-config.test.ts.snap @@ -95,7 +95,6 @@ exports[`should create default config 1`] = ` "executiveDashboard": false, "extendedUsageMetrics": false, "extendedUsageMetricsUI": false, - "featureSearchAPI": true, "featureSearchFeedback": false, "featureSearchFeedbackPosting": false, "featuresExportImport": true, diff --git a/src/lib/features/feature-search/feature-search-controller.ts b/src/lib/features/feature-search/feature-search-controller.ts index d364ec618a..5590e12e43 100644 --- a/src/lib/features/feature-search/feature-search-controller.ts +++ b/src/lib/features/feature-search/feature-search-controller.ts @@ -15,7 +15,6 @@ import { searchFeaturesSchema, } from '../../openapi'; import { IAuthRequest } from '../../routes/unleash-types'; -import { InvalidOperationError } from '../../error'; import { FeatureSearchQueryParameters, featureSearchQueryParameters, @@ -75,68 +74,65 @@ export default class FeatureSearchController extends Controller { req: IAuthRequest, res: Response, ): Promise { - if (this.config.flagResolver.isEnabled('featureSearchAPI')) { - const { - query, - project, - type, - tag, - segment, - createdAt, - state, - status, - offset, - limit = '50', - sortOrder, - sortBy, - favoritesFirst, - } = req.query; - const userId = req.user.id; - const normalizedQuery = query - ?.split(',') - .map((query) => query.trim()) - .filter((query) => query); - const normalizedStatus = status - ?.map((tag) => tag.split(':')) - .filter( - (tag) => - tag.length === 2 && - ['enabled', 'disabled'].includes(tag[1]), - ); - const normalizedLimit = - Number(limit) > 0 && Number(limit) <= 100 ? Number(limit) : 25; - const normalizedOffset = Number(offset) > 0 ? Number(offset) : 0; - const normalizedSortBy: string = sortBy ? sortBy : 'createdAt'; - const normalizedSortOrder = - sortOrder === 'asc' || sortOrder === 'desc' ? sortOrder : 'asc'; - const normalizedFavoritesFirst = favoritesFirst === 'true'; - const { features, total } = await this.featureSearchService.search({ - searchParams: normalizedQuery, - project, - type, - userId, - tag, - segment, - state, - createdAt, - status: normalizedStatus, - offset: normalizedOffset, - limit: normalizedLimit, - sortBy: normalizedSortBy, - sortOrder: normalizedSortOrder, - favoritesFirst: normalizedFavoritesFirst, - }); + const { + query, + project, + type, + tag, + segment, + createdAt, + state, + status, + offset, + limit = '50', + sortOrder, + sortBy, + favoritesFirst, + } = req.query; + const userId = req.user.id; + const normalizedQuery = query + ?.split(',') + .map((query) => query.trim()) + .filter((query) => query); + const normalizedStatus = status + ?.map((tag) => tag.split(':')) + .filter( + (tag) => + tag.length === 2 && + ['enabled', 'disabled'].includes(tag[1]), + ); + const normalizedLimit = + Number(limit) > 0 && Number(limit) <= 100 ? Number(limit) : 25; + const normalizedOffset = Number(offset) > 0 ? Number(offset) : 0; + const normalizedSortBy: string = sortBy ? sortBy : 'createdAt'; + const normalizedSortOrder = + sortOrder === 'asc' || sortOrder === 'desc' ? sortOrder : 'asc'; + const normalizedFavoritesFirst = favoritesFirst === 'true'; + const { features, total } = await this.featureSearchService.search({ + searchParams: normalizedQuery, + project, + type, + userId, + tag, + segment, + state, + createdAt, + status: normalizedStatus, + offset: normalizedOffset, + limit: normalizedLimit, + sortBy: normalizedSortBy, + sortOrder: normalizedSortOrder, + favoritesFirst: normalizedFavoritesFirst, + }); - this.openApiService.respondWithValidation( - 200, - res, - searchFeaturesSchema.$id, - serializeDates({ features, total }), - ); - } else { - throw new InvalidOperationError( - 'Feature Search API is not enabled', - ); - } + this.openApiService.respondWithValidation( + 200, + res, + searchFeaturesSchema.$id, + serializeDates({ + features, + total, + }), + ); } } diff --git a/src/lib/features/feature-search/feature.search.e2e.test.ts b/src/lib/features/feature-search/feature.search.e2e.test.ts index b7b2411054..813f35acae 100644 --- a/src/lib/features/feature-search/feature.search.e2e.test.ts +++ b/src/lib/features/feature-search/feature.search.e2e.test.ts @@ -21,7 +21,6 @@ beforeAll(async () => { experimental: { flags: { strictSchemaValidation: true, - featureSearchAPI: true, }, }, }, diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts index a84182cbf9..14d248ed77 100644 --- a/src/lib/types/experimental.ts +++ b/src/lib/types/experimental.ts @@ -27,7 +27,6 @@ export type IFlagKey = | 'filterInvalidClientMetrics' | 'customRootRolesKillSwitch' | 'disableMetrics' - | 'featureSearchAPI' | 'scheduledConfigurationChanges' | 'detectSegmentUsageInChangeRequests' | 'stripClientHeadersOn304' @@ -130,10 +129,6 @@ const flags: IFlags = { process.env.UNLEASH_EXPERIMENTAL_DISABLE_METRICS, false, ), - featureSearchAPI: parseEnvVarBoolean( - process.env.UNLEASH_EXPERIMENTAL_FEATURE_SEARCH_API, - true, - ), scheduledConfigurationChanges: parseEnvVarBoolean( process.env.UNLEASH_EXPERIMENTAL_SCHEDULED_CONFIGURATION_CHANGES, false, diff --git a/src/server-dev.ts b/src/server-dev.ts index f9972953f2..71104d363b 100644 --- a/src/server-dev.ts +++ b/src/server-dev.ts @@ -40,7 +40,6 @@ process.nextTick(async () => { embedProxyFrontend: true, anonymiseEventLog: false, responseTimeWithAppNameKillSwitch: false, - featureSearchAPI: true, stripClientHeadersOn304: true, newStrategyConfiguration: true, stripHeadersOnAPI: true,