Adjust to review

Signed-off-by: Philipp Hugenroth <philipph@spotify.com>
This commit is contained in:
Philipp Hugenroth
2023-08-14 14:21:48 +02:00
parent 6694e79ab3
commit 0d6ddc62d8
9 changed files with 23 additions and 16 deletions
+2 -2
View File
@@ -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`.
+2 -2
View File
@@ -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.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/permission-backend': patch
---
Refactor backend plugin creation parameter from callback to object.
+4 -2
View File
@@ -18,8 +18,10 @@ import { TaskScheduleDefinitionConfig } from '@backstage/backend-tasks';
export interface Config {
search?: {
explore?: {
schedule?: TaskScheduleDefinitionConfig;
collators?: {
explore?: {
schedule?: TaskScheduleDefinitionConfig;
};
};
};
}
@@ -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;
+3 -3
View File
@@ -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;
@@ -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;
@@ -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,
);
});
@@ -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,