@backstage/plugin-scaffolder-backend 1.5.0-next.1 → 1.6.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,76 @@
1
1
  # @backstage/plugin-scaffolder-backend
2
2
 
3
+ ## 1.6.0-next.0
4
+
5
+ ### Minor Changes
6
+
7
+ - ea2eee9e6a: Add the option for a homepage when using the `github:publish` action
8
+ - 8872cc735d: Fixed a bug in plugin-scaffolder-backend where it ignores the skip migration database options.
9
+
10
+ To use this new implementation you need to create the instance of `DatabaseTaskStore` using the `PluginDatabaseManager` instead of `Knex`;
11
+
12
+ ```
13
+ import { DatabaseManager, getRootLogger, loadBackendConfig } from '@backstage/backend-common';
14
+ import { DatabaseTaskStore } from '@backstage/plugin-scaffolder-backend';
15
+
16
+ const config = await loadBackendConfig({ argv: process.argv, logger: getRootLogger() });
17
+ const databaseManager = DatabaseManager.fromConfig(config, { migrations: { skip: true } });
18
+ const databaseTaskStore = await DatabaseTaskStore.create(databaseManager);
19
+ ```
20
+
21
+ - 1ff817b3f0: add entity metadata to the template info type
22
+
23
+ ### Patch Changes
24
+
25
+ - bf5e9030eb: Updated dependency `msw` to `^0.45.0`.
26
+ - 2df9955f4a: Removed the depreacated `publish:file` action, use the template editor to test templates instead.
27
+ - ef9ab322de: Minor API signatures cleanup
28
+ - Updated dependencies
29
+ - @backstage/backend-common@0.15.1-next.0
30
+ - @backstage/plugin-catalog-backend@1.3.2-next.0
31
+ - @backstage/backend-plugin-api@0.1.2-next.0
32
+ - @backstage/catalog-client@1.0.5-next.0
33
+ - @backstage/integration@1.3.1-next.0
34
+ - @backstage/plugin-scaffolder-common@1.2.0-next.0
35
+ - @backstage/plugin-catalog-node@1.0.2-next.0
36
+
37
+ ## 1.5.0
38
+
39
+ ### Minor Changes
40
+
41
+ - c4b452e16a: Starting the implementation of the Wizard page for the `next` scaffolder plugin
42
+ - 593dea6710: Add support for Basic Auth for Bitbucket Server.
43
+ - 3b7930b3e5: Add support for Bearer Authorization header / token-based auth at Git commands.
44
+ - 3f1316f1c5: User Bearer Authorization header at Git commands with token-based auth at Bitbucket Server.
45
+ - eeff5046ae: Updated `publish:gitlab:merge-request` action to allow commit updates and deletes
46
+ - 692d5d3405: Added `reviewers` and `teamReviewers` parameters to `publish:github:pull-request` action to add reviewers on the pull request created by the action
47
+
48
+ ### Patch Changes
49
+
50
+ - fc8a5f797b: Add a `publish:gerrit:review` scaffolder action
51
+ - c971afbf21: The `publish:file` action has been deprecated in favor of testing templates using the template editor instead. Note that this action is not and was never been installed by default.
52
+ - b10b6c4aa4: Fix issue on Windows where templated files where not properly skipped as intended.
53
+ - 56e1b4b89c: Fixed typos in alpha types.
54
+ - dad0f65494: Fail gracefully if an invalid `Authorization` header is passed to `POST /v2/tasks`
55
+ - 014b3b7776: Add missing `res.end()` in scaffolder backend `EventStream` usage
56
+ - Updated dependencies
57
+ - @backstage/backend-common@0.15.0
58
+ - @backstage/backend-plugin-api@0.1.1
59
+ - @backstage/plugin-catalog-node@1.0.1
60
+ - @backstage/integration@1.3.0
61
+ - @backstage/plugin-catalog-backend@1.3.1
62
+
63
+ ## 1.5.0-next.2
64
+
65
+ ### Minor Changes
66
+
67
+ - 692d5d3405: Added `reviewers` and `teamReviewers` parameters to `publish:github:pull-request` action to add reviewers on the pull request created by the action
68
+
69
+ ### Patch Changes
70
+
71
+ - Updated dependencies
72
+ - @backstage/plugin-catalog-backend@1.3.1-next.2
73
+
3
74
  ## 1.5.0-next.1
4
75
 
5
76
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-backend",
3
- "version": "1.5.0-next.1",
3
+ "version": "1.6.0-next.0",
4
4
  "main": "../dist/index.cjs.js",
5
5
  "types": "../dist/index.alpha.d.ts"
6
6
  }
@@ -6,7 +6,7 @@
6
6
 
7
7
  /// <reference types="node" />
8
8
 
9
- import { BackendRegistrable } from '@backstage/backend-plugin-api';
9
+ import { BackendFeature } from '@backstage/backend-plugin-api';
10
10
  import { CatalogApi } from '@backstage/catalog-client';
11
11
  import { CatalogProcessor } from '@backstage/plugin-catalog-backend';
12
12
  import { CatalogProcessorEmit } from '@backstage/plugin-catalog-backend';
@@ -21,6 +21,7 @@ import { Knex } from 'knex';
21
21
  import { LocationSpec } from '@backstage/plugin-catalog-backend';
22
22
  import { Logger } from 'winston';
23
23
  import { Observable } from '@backstage/types';
24
+ import { Octokit } from 'octokit';
24
25
  import { PluginDatabaseManager } from '@backstage/backend-common';
25
26
  import { Schema } from 'jsonschema';
26
27
  import { ScmIntegrationRegistry } from '@backstage/integration';
@@ -263,6 +264,7 @@ export declare function createGithubRepoCreateAction(options: {
263
264
  }): TemplateAction< {
264
265
  repoUrl: string;
265
266
  description?: string | undefined;
267
+ homepage?: string | undefined;
266
268
  access?: string | undefined;
267
269
  deleteBranchOnMerge?: boolean | undefined;
268
270
  gitAuthorName?: string | undefined;
@@ -408,21 +410,6 @@ enableLFS?: boolean | undefined;
408
410
  token?: string | undefined;
409
411
  }>;
410
412
 
411
- /**
412
- * This task is useful for local development and testing of both the scaffolder
413
- * and scaffolder templates.
414
- *
415
- * @remarks
416
- *
417
- * This action is not installed by default and should not be installed in
418
- * production, as it writes the files to the local filesystem of the scaffolder.
419
- *
420
- * @public
421
- */
422
- export declare function createPublishFileAction(): TemplateAction< {
423
- path: string;
424
- }>;
425
-
426
413
  /**
427
414
  * Creates a new action that initializes a git repository of the content in the workspace
428
415
  * and publishes it to a Gerrit instance.
@@ -470,6 +457,7 @@ export declare function createPublishGithubAction(options: {
470
457
  }): TemplateAction< {
471
458
  repoUrl: string;
472
459
  description?: string | undefined;
460
+ homepage?: string | undefined;
473
461
  access?: string | undefined;
474
462
  defaultBranch?: string | undefined;
475
463
  protectDefaultBranch?: boolean | undefined;
@@ -513,6 +501,8 @@ draft?: boolean | undefined;
513
501
  targetPath?: string | undefined;
514
502
  sourcePath?: string | undefined;
515
503
  token?: string | undefined;
504
+ reviewers?: string[] | undefined;
505
+ teamReviewers?: string[] | undefined;
516
506
  }>;
517
507
 
518
508
  /**
@@ -615,6 +605,8 @@ export declare interface CurrentClaimedTask {
615
605
  export declare class DatabaseTaskStore implements TaskStore {
616
606
  private readonly db;
617
607
  static create(options: DatabaseTaskStoreOptions): Promise<DatabaseTaskStore>;
608
+ private static getClient;
609
+ private static runMigrations;
618
610
  private constructor();
619
611
  list(options: {
620
612
  createdBy?: string;
@@ -625,14 +617,14 @@ export declare class DatabaseTaskStore implements TaskStore {
625
617
  createTask(options: TaskStoreCreateTaskOptions): Promise<TaskStoreCreateTaskResult>;
626
618
  claimTask(): Promise<SerializedTask | undefined>;
627
619
  heartbeatTask(taskId: string): Promise<void>;
628
- listStaleTasks({ timeoutS }: {
620
+ listStaleTasks(options: {
629
621
  timeoutS: number;
630
622
  }): Promise<{
631
623
  tasks: {
632
624
  taskId: string;
633
625
  }[];
634
626
  }>;
635
- completeTask({ taskId, status, eventBody, }: {
627
+ completeTask(options: {
636
628
  taskId: string;
637
629
  status: TaskStatus;
638
630
  eventBody: JsonObject;
@@ -640,7 +632,7 @@ export declare class DatabaseTaskStore implements TaskStore {
640
632
  emitLogEvent(options: TaskStoreEmitOptions<{
641
633
  message: string;
642
634
  } & JsonObject>): Promise<void>;
643
- listEvents({ taskId, after, }: TaskStoreListEventsOptions): Promise<{
635
+ listEvents(options: TaskStoreListEventsOptions): Promise<{
644
636
  events: SerializedTaskEvent[];
645
637
  }>;
646
638
  }
@@ -651,7 +643,7 @@ export declare class DatabaseTaskStore implements TaskStore {
651
643
  * @public
652
644
  */
653
645
  export declare type DatabaseTaskStoreOptions = {
654
- database: Knex;
646
+ database: PluginDatabaseManager | Knex;
655
647
  };
656
648
 
657
649
  /**
@@ -667,7 +659,7 @@ export declare const executeShellCommand: (options: RunCommandOptions) => Promis
667
659
  *
668
660
  * @public
669
661
  */
670
- export declare function fetchContents({ reader, integrations, baseUrl, fetchUrl, outputPath, }: {
662
+ export declare function fetchContents(options: {
671
663
  reader: UrlReader;
672
664
  integrations: ScmIntegrations;
673
665
  baseUrl?: string;
@@ -676,14 +668,14 @@ export declare function fetchContents({ reader, integrations, baseUrl, fetchUrl,
676
668
  }): Promise<void>;
677
669
 
678
670
  /** @public */
679
- export declare interface OctokitWithPullRequestPluginClient {
671
+ export declare type OctokitWithPullRequestPluginClient = Octokit & {
680
672
  createPullRequest(options: createPullRequest.Options): Promise<{
681
673
  data: {
682
674
  html_url: string;
683
675
  number: number;
684
676
  };
685
677
  } | null>;
686
- }
678
+ };
687
679
 
688
680
  /**
689
681
  * RouterOptions
@@ -718,7 +710,7 @@ export declare type RunCommandOptions = {
718
710
  * @alpha
719
711
  * Registers the ScaffolderEntitiesProcessor with the catalog processing extension point.
720
712
  */
721
- export declare const scaffolderCatalogModule: (option: unknown) => BackendRegistrable;
713
+ export declare const scaffolderCatalogModule: (options?: unknown) => BackendFeature;
722
714
 
723
715
  /** @public */
724
716
  export declare class ScaffolderEntitiesProcessor implements CatalogProcessor {
@@ -6,7 +6,7 @@
6
6
 
7
7
  /// <reference types="node" />
8
8
 
9
- import { BackendRegistrable } from '@backstage/backend-plugin-api';
9
+ import { BackendFeature } from '@backstage/backend-plugin-api';
10
10
  import { CatalogApi } from '@backstage/catalog-client';
11
11
  import { CatalogProcessor } from '@backstage/plugin-catalog-backend';
12
12
  import { CatalogProcessorEmit } from '@backstage/plugin-catalog-backend';
@@ -21,6 +21,7 @@ import { Knex } from 'knex';
21
21
  import { LocationSpec } from '@backstage/plugin-catalog-backend';
22
22
  import { Logger } from 'winston';
23
23
  import { Observable } from '@backstage/types';
24
+ import { Octokit } from 'octokit';
24
25
  import { PluginDatabaseManager } from '@backstage/backend-common';
25
26
  import { Schema } from 'jsonschema';
26
27
  import { ScmIntegrationRegistry } from '@backstage/integration';
@@ -263,6 +264,7 @@ export declare function createGithubRepoCreateAction(options: {
263
264
  }): TemplateAction< {
264
265
  repoUrl: string;
265
266
  description?: string | undefined;
267
+ homepage?: string | undefined;
266
268
  access?: string | undefined;
267
269
  deleteBranchOnMerge?: boolean | undefined;
268
270
  gitAuthorName?: string | undefined;
@@ -408,21 +410,6 @@ enableLFS?: boolean | undefined;
408
410
  token?: string | undefined;
409
411
  }>;
410
412
 
411
- /**
412
- * This task is useful for local development and testing of both the scaffolder
413
- * and scaffolder templates.
414
- *
415
- * @remarks
416
- *
417
- * This action is not installed by default and should not be installed in
418
- * production, as it writes the files to the local filesystem of the scaffolder.
419
- *
420
- * @public
421
- */
422
- export declare function createPublishFileAction(): TemplateAction< {
423
- path: string;
424
- }>;
425
-
426
413
  /**
427
414
  * Creates a new action that initializes a git repository of the content in the workspace
428
415
  * and publishes it to a Gerrit instance.
@@ -470,6 +457,7 @@ export declare function createPublishGithubAction(options: {
470
457
  }): TemplateAction< {
471
458
  repoUrl: string;
472
459
  description?: string | undefined;
460
+ homepage?: string | undefined;
473
461
  access?: string | undefined;
474
462
  defaultBranch?: string | undefined;
475
463
  protectDefaultBranch?: boolean | undefined;
@@ -513,6 +501,8 @@ draft?: boolean | undefined;
513
501
  targetPath?: string | undefined;
514
502
  sourcePath?: string | undefined;
515
503
  token?: string | undefined;
504
+ reviewers?: string[] | undefined;
505
+ teamReviewers?: string[] | undefined;
516
506
  }>;
517
507
 
518
508
  /**
@@ -615,6 +605,8 @@ export declare interface CurrentClaimedTask {
615
605
  export declare class DatabaseTaskStore implements TaskStore {
616
606
  private readonly db;
617
607
  static create(options: DatabaseTaskStoreOptions): Promise<DatabaseTaskStore>;
608
+ private static getClient;
609
+ private static runMigrations;
618
610
  private constructor();
619
611
  list(options: {
620
612
  createdBy?: string;
@@ -625,14 +617,14 @@ export declare class DatabaseTaskStore implements TaskStore {
625
617
  createTask(options: TaskStoreCreateTaskOptions): Promise<TaskStoreCreateTaskResult>;
626
618
  claimTask(): Promise<SerializedTask | undefined>;
627
619
  heartbeatTask(taskId: string): Promise<void>;
628
- listStaleTasks({ timeoutS }: {
620
+ listStaleTasks(options: {
629
621
  timeoutS: number;
630
622
  }): Promise<{
631
623
  tasks: {
632
624
  taskId: string;
633
625
  }[];
634
626
  }>;
635
- completeTask({ taskId, status, eventBody, }: {
627
+ completeTask(options: {
636
628
  taskId: string;
637
629
  status: TaskStatus;
638
630
  eventBody: JsonObject;
@@ -640,7 +632,7 @@ export declare class DatabaseTaskStore implements TaskStore {
640
632
  emitLogEvent(options: TaskStoreEmitOptions<{
641
633
  message: string;
642
634
  } & JsonObject>): Promise<void>;
643
- listEvents({ taskId, after, }: TaskStoreListEventsOptions): Promise<{
635
+ listEvents(options: TaskStoreListEventsOptions): Promise<{
644
636
  events: SerializedTaskEvent[];
645
637
  }>;
646
638
  }
@@ -651,7 +643,7 @@ export declare class DatabaseTaskStore implements TaskStore {
651
643
  * @public
652
644
  */
653
645
  export declare type DatabaseTaskStoreOptions = {
654
- database: Knex;
646
+ database: PluginDatabaseManager | Knex;
655
647
  };
656
648
 
657
649
  /**
@@ -667,7 +659,7 @@ export declare const executeShellCommand: (options: RunCommandOptions) => Promis
667
659
  *
668
660
  * @public
669
661
  */
670
- export declare function fetchContents({ reader, integrations, baseUrl, fetchUrl, outputPath, }: {
662
+ export declare function fetchContents(options: {
671
663
  reader: UrlReader;
672
664
  integrations: ScmIntegrations;
673
665
  baseUrl?: string;
@@ -676,14 +668,14 @@ export declare function fetchContents({ reader, integrations, baseUrl, fetchUrl,
676
668
  }): Promise<void>;
677
669
 
678
670
  /** @public */
679
- export declare interface OctokitWithPullRequestPluginClient {
671
+ export declare type OctokitWithPullRequestPluginClient = Octokit & {
680
672
  createPullRequest(options: createPullRequest.Options): Promise<{
681
673
  data: {
682
674
  html_url: string;
683
675
  number: number;
684
676
  };
685
677
  } | null>;
686
- }
678
+ };
687
679
 
688
680
  /**
689
681
  * RouterOptions