Merge pull request #17396 from backstage/rugvip/scaffolder
scaffolder-backend: make alpha options optional
This commit is contained in:
@@ -40,7 +40,7 @@ export const scaffolderConditions: Conditions<{
|
||||
|
||||
// @alpha
|
||||
export const scaffolderPlugin: (
|
||||
options: ScaffolderPluginOptions,
|
||||
options?: ScaffolderPluginOptions | undefined,
|
||||
) => BackendFeature;
|
||||
|
||||
// @alpha
|
||||
|
||||
@@ -67,7 +67,7 @@ class ScaffolderActionsExtensionPointImpl
|
||||
* @alpha
|
||||
*/
|
||||
export const scaffolderPlugin = createBackendPlugin(
|
||||
(options: ScaffolderPluginOptions) => ({
|
||||
(options?: ScaffolderPluginOptions) => ({
|
||||
pluginId: 'scaffolder',
|
||||
register(env) {
|
||||
const actionsExtensions = new ScaffolderActionsExtensionPointImpl();
|
||||
@@ -101,10 +101,10 @@ export const scaffolderPlugin = createBackendPlugin(
|
||||
taskBroker,
|
||||
taskWorkers,
|
||||
additionalTemplateGlobals,
|
||||
} = options;
|
||||
} = options ?? {};
|
||||
const log = loggerToWinstonLogger(logger);
|
||||
|
||||
const actions = options.actions || [
|
||||
const actions = options?.actions || [
|
||||
...actionsExtensions.actions,
|
||||
...createBuiltinActions({
|
||||
integrations: ScmIntegrations.fromConfig(config),
|
||||
|
||||
@@ -70,11 +70,13 @@ export type CreateWorkerOptions = {
|
||||
* @public
|
||||
*/
|
||||
export class TaskWorker {
|
||||
private constructor(private readonly options: TaskWorkerOptions) {}
|
||||
private taskQueue: PQueue;
|
||||
|
||||
private taskQueue: PQueue = new PQueue({
|
||||
concurrency: this.options.concurrentTasksLimit,
|
||||
});
|
||||
private constructor(private readonly options: TaskWorkerOptions) {
|
||||
this.taskQueue = new PQueue({
|
||||
concurrency: options.concurrentTasksLimit,
|
||||
});
|
||||
}
|
||||
|
||||
static async create(options: CreateWorkerOptions): Promise<TaskWorker> {
|
||||
const {
|
||||
|
||||
Reference in New Issue
Block a user