diff --git a/.changeset/tiny-squids-accept.md b/.changeset/tiny-squids-accept.md index bbf0498f44..e488c35197 100644 --- a/.changeset/tiny-squids-accept.md +++ b/.changeset/tiny-squids-accept.md @@ -1,5 +1,5 @@ --- -'@backstage/plugin-search-backend-module-techdocs': minor +'@backstage/plugin-search-backend-module-techdocs': patch --- -**BREAKING:** Moved `schedule` & `collators` settings from module options into app-config for the new backend system. You can now pass in a `TaskScheduleDefinitionConfig` through the `search.techdocs.schedule` configuration key & configure the `TechDocsCollatorFactory` with the key `search.techdocs.collators`. +**BREAKING:** Moved `schedule` & `collators` settings from module options into app-config for the new backend system. You can now pass in a `TaskScheduleDefinitionConfig` through the `search.collators.techdocs.schedule` configuration key & configure the `TechDocsCollatorFactory` with the key `search.collators.techdocs`. diff --git a/.changeset/tiny-squids-deny.md b/.changeset/tiny-squids-deny.md index 09da08cc42..28de9903e9 100644 --- a/.changeset/tiny-squids-deny.md +++ b/.changeset/tiny-squids-deny.md @@ -1,5 +1,5 @@ --- -'@backstage/plugin-search-backend-module-explore': minor +'@backstage/plugin-search-backend-module-explore': patch --- -**BREAKING:** Moved `schedule` from module options into app-config for the new backend system. You can now pass in a `TaskScheduleDefinitionConfig` through the `search.explore.schedule` configuration key. +Breaking change for the alpha export moved `schedule` from module options into app-config for the new backend system. You can now pass in a `TaskScheduleDefinitionConfig` through the `search.collators.explore.schedule` configuration key. diff --git a/.changeset/tiny-squids-undecide.md b/.changeset/tiny-squids-undecide.md new file mode 100644 index 0000000000..91a047f966 --- /dev/null +++ b/.changeset/tiny-squids-undecide.md @@ -0,0 +1,5 @@ +--- +'@backstage/permission-backend': patch +--- + +Refactor backend plugin creation parameter from callback to object. diff --git a/plugins/search-backend-module-explore/config.d.ts b/plugins/search-backend-module-explore/config.d.ts index a9f60632ae..4401f7a8bf 100644 --- a/plugins/search-backend-module-explore/config.d.ts +++ b/plugins/search-backend-module-explore/config.d.ts @@ -18,8 +18,10 @@ import { TaskScheduleDefinitionConfig } from '@backstage/backend-tasks'; export interface Config { search?: { - explore?: { - schedule?: TaskScheduleDefinitionConfig; + collators?: { + explore?: { + schedule?: TaskScheduleDefinitionConfig; + }; }; }; } diff --git a/plugins/search-backend-module-explore/src/alpha.ts b/plugins/search-backend-module-explore/src/alpha.ts index b60bed66ae..403699e2cb 100644 --- a/plugins/search-backend-module-explore/src/alpha.ts +++ b/plugins/search-backend-module-explore/src/alpha.ts @@ -61,9 +61,9 @@ export const searchModuleExploreCollator = createBackendModule({ initialDelay: { seconds: 3 }, }; - const schedule = config.has('search.explore.schedule') + const schedule = config.has('search.collators.explore.schedule') ? readTaskScheduleDefinitionFromConfig( - config.getConfig('search.explore.schedule'), + config.getConfig('search.collators.explore.schedule'), ) : defaultSchedule; diff --git a/plugins/search-backend-module-techdocs/config.d.ts b/plugins/search-backend-module-techdocs/config.d.ts index 03431a5de5..80e47e3254 100644 --- a/plugins/search-backend-module-techdocs/config.d.ts +++ b/plugins/search-backend-module-techdocs/config.d.ts @@ -18,9 +18,9 @@ import { TaskScheduleDefinitionConfig } from '@backstage/backend-tasks'; export interface Config { search?: { - techdocs?: { - schedule?: TaskScheduleDefinitionConfig; - collators?: { + collators?: { + techdocs?: { + schedule?: TaskScheduleDefinitionConfig; locationTemplate?: string; parallelismLimit?: number; legacyPathCasing?: boolean; diff --git a/plugins/search-backend-module-techdocs/src/alpha.ts b/plugins/search-backend-module-techdocs/src/alpha.ts index de2800bf81..bb084ddfd9 100644 --- a/plugins/search-backend-module-techdocs/src/alpha.ts +++ b/plugins/search-backend-module-techdocs/src/alpha.ts @@ -62,9 +62,9 @@ export const searchModuleTechDocsCollator = createBackendModule({ initialDelay: { seconds: 3 }, }; - const schedule = config.has('search.explore.schedule') + const schedule = config.has('search.collators.techdocs.schedule') ? readTaskScheduleDefinitionFromConfig( - config.getConfig('search.explore.schedule'), + config.getConfig('search.collators.techdocs.schedule'), ) : defaultSchedule; diff --git a/plugins/search-backend-module-techdocs/src/collators/DefaultTechDocsCollatorFactory.test.ts b/plugins/search-backend-module-techdocs/src/collators/DefaultTechDocsCollatorFactory.test.ts index ac03178925..2e85a64f4e 100644 --- a/plugins/search-backend-module-techdocs/src/collators/DefaultTechDocsCollatorFactory.test.ts +++ b/plugins/search-backend-module-techdocs/src/collators/DefaultTechDocsCollatorFactory.test.ts @@ -217,7 +217,7 @@ describe('DefaultTechDocsCollatorFactory', () => { // Only 1 entity with TechDocs configured multiplied by 3 pages. expect(documents).toHaveLength(3); - expect(_config.get('search.techdocs.collators.parallelismLimit')).toEqual( + expect(_config.get('search.collators.techdocs.parallelismLimit')).toEqual( 1, ); }); diff --git a/plugins/search-backend-module-techdocs/src/collators/DefaultTechDocsCollatorFactory.ts b/plugins/search-backend-module-techdocs/src/collators/DefaultTechDocsCollatorFactory.ts index 0925b93300..051dc93189 100644 --- a/plugins/search-backend-module-techdocs/src/collators/DefaultTechDocsCollatorFactory.ts +++ b/plugins/search-backend-module-techdocs/src/collators/DefaultTechDocsCollatorFactory.ts @@ -105,10 +105,10 @@ export class DefaultTechDocsCollatorFactory implements DocumentCollatorFactory { 'techdocs.legacyUseCaseSensitiveTripletPaths', ) || false; const locationTemplate = config.getOptionalString( - 'search.techdocs.collators.locationTemplate', + 'search.collators.techdocs.locationTemplate', ); const parallelismLimit = config.getOptionalNumber( - 'search.techdocs.collators.parallelismLimit', + 'search.collators.techdocs.parallelismLimit', ); return new DefaultTechDocsCollatorFactory({ ...options,