@backstage/plugin-scaffolder-backend 1.1.0 → 1.2.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/dist/index.d.ts CHANGED
@@ -67,6 +67,7 @@ declare type SerializedTask = {
67
67
  status: TaskStatus;
68
68
  createdAt: string;
69
69
  lastHeartbeatAt?: string;
70
+ createdBy?: string;
70
71
  secrets?: TaskSecrets;
71
72
  };
72
73
  /**
@@ -112,6 +113,7 @@ declare type TaskBrokerDispatchResult = {
112
113
  declare type TaskBrokerDispatchOptions = {
113
114
  spec: TaskSpec;
114
115
  secrets?: TaskSecrets;
116
+ createdBy?: string;
115
117
  };
116
118
  /**
117
119
  * Task
@@ -121,6 +123,7 @@ declare type TaskBrokerDispatchOptions = {
121
123
  interface TaskContext {
122
124
  spec: TaskSpec;
123
125
  secrets?: TaskSecrets;
126
+ createdBy?: string;
124
127
  done: boolean;
125
128
  emitLog(message: string, logMetadata?: JsonObject): Promise<void>;
126
129
  complete(result: TaskCompletionState, metadata?: JsonObject): Promise<void>;
@@ -169,6 +172,7 @@ declare type TaskStoreListEventsOptions = {
169
172
  */
170
173
  declare type TaskStoreCreateTaskOptions = {
171
174
  spec: TaskSpec;
175
+ createdBy?: string;
172
176
  secrets?: TaskSecrets;
173
177
  };
174
178
  /**
@@ -366,16 +370,58 @@ declare function createPublishAzureAction(options: {
366
370
  defaultBranch?: string | undefined;
367
371
  sourcePath?: string | undefined;
368
372
  token?: string | undefined;
373
+ gitCommitMessage?: string | undefined;
374
+ gitAuthorName?: string | undefined;
375
+ gitAuthorEmail?: string | undefined;
369
376
  }>;
370
377
 
371
378
  /**
372
379
  * Creates a new action that initializes a git repository of the content in the workspace
373
380
  * and publishes it to Bitbucket.
374
381
  * @public
382
+ * @deprecated in favor of createPublishBitbucketCloudAction and createPublishBitbucketServerAction
375
383
  */
376
384
  declare function createPublishBitbucketAction(options: {
377
385
  integrations: ScmIntegrationRegistry;
378
386
  config: Config;
387
+ }): TemplateAction<{
388
+ repoUrl: string;
389
+ description?: string | undefined;
390
+ defaultBranch?: string | undefined;
391
+ repoVisibility?: "private" | "public" | undefined;
392
+ sourcePath?: string | undefined;
393
+ enableLFS?: boolean | undefined;
394
+ token?: string | undefined;
395
+ gitCommitMessage?: string | undefined;
396
+ gitAuthorName?: string | undefined;
397
+ gitAuthorEmail?: string | undefined;
398
+ }>;
399
+
400
+ /**
401
+ * Creates a new action that initializes a git repository of the content in the workspace
402
+ * and publishes it to Bitbucket Cloud.
403
+ * @public
404
+ */
405
+ declare function createPublishBitbucketCloudAction(options: {
406
+ integrations: ScmIntegrationRegistry;
407
+ config: Config;
408
+ }): TemplateAction<{
409
+ repoUrl: string;
410
+ description?: string | undefined;
411
+ defaultBranch?: string | undefined;
412
+ repoVisibility?: "private" | "public" | undefined;
413
+ sourcePath?: string | undefined;
414
+ token?: string | undefined;
415
+ }>;
416
+
417
+ /**
418
+ * Creates a new action that initializes a git repository of the content in the workspace
419
+ * and publishes it to Bitbucket Server.
420
+ * @public
421
+ */
422
+ declare function createPublishBitbucketServerAction(options: {
423
+ integrations: ScmIntegrationRegistry;
424
+ config: Config;
379
425
  }): TemplateAction<{
380
426
  repoUrl: string;
381
427
  description?: string | undefined;
@@ -417,11 +463,15 @@ declare function createPublishGithubAction(options: {
417
463
  access?: string | undefined;
418
464
  defaultBranch?: string | undefined;
419
465
  deleteBranchOnMerge?: boolean | undefined;
466
+ gitCommitMessage?: string | undefined;
467
+ gitAuthorName?: string | undefined;
468
+ gitAuthorEmail?: string | undefined;
420
469
  allowRebaseMerge?: boolean | undefined;
421
470
  allowSquashMerge?: boolean | undefined;
422
471
  allowMergeCommit?: boolean | undefined;
423
472
  sourcePath?: string | undefined;
424
473
  requireCodeOwnerReviews?: boolean | undefined;
474
+ requiredStatusCheckContexts?: string[] | undefined;
425
475
  repoVisibility?: "internal" | "private" | "public" | undefined;
426
476
  collaborators?: {
427
477
  username: string;
@@ -663,6 +713,7 @@ declare class TaskManager implements TaskContext {
663
713
  private constructor();
664
714
  get spec(): _backstage_plugin_scaffolder_common.TaskSpecV1beta3;
665
715
  get secrets(): TaskSecrets | undefined;
716
+ get createdBy(): string | undefined;
666
717
  getWorkspaceName(): Promise<string>;
667
718
  get done(): boolean;
668
719
  emitLog(message: string, logMetadata?: JsonObject): Promise<void>;
@@ -687,6 +738,10 @@ interface CurrentClaimedTask {
687
738
  * The secrets that are stored with the task.
688
739
  */
689
740
  secrets?: TaskSecrets;
741
+ /**
742
+ * The creator of the task.
743
+ */
744
+ createdBy?: string;
690
745
  }
691
746
 
692
747
  /**
@@ -745,4 +800,4 @@ declare class ScaffolderEntitiesProcessor implements CatalogProcessor {
745
800
  postProcessEntity(entity: Entity, _location: LocationSpec, emit: CatalogProcessorEmit): Promise<Entity>;
746
801
  }
747
802
 
748
- export { ActionContext, CreateBuiltInActionsOptions, CreateGithubPullRequestActionOptions, CreateGithubPullRequestClientFactoryInput, CreateWorkerOptions, CurrentClaimedTask, DatabaseTaskStore, DatabaseTaskStoreOptions, OctokitWithPullRequestPluginClient, RouterOptions, RunCommandOptions, ScaffolderEntitiesProcessor, SerializedTask, SerializedTaskEvent, TaskBroker, TaskBrokerDispatchOptions, TaskBrokerDispatchResult, TaskCompletionState, TaskContext, TaskEventType, TaskManager, TaskSecrets, TaskStatus, TaskStore, TaskStoreCreateTaskOptions, TaskStoreCreateTaskResult, TaskStoreEmitOptions, TaskStoreListEventsOptions, TaskWorker, TemplateAction, TemplateActionRegistry, TemplateFilter, createBuiltinActions, createCatalogRegisterAction, createCatalogWriteAction, createDebugLogAction, createFetchPlainAction, createFetchTemplateAction, createFilesystemDeleteAction, createFilesystemRenameAction, createGithubActionsDispatchAction, createGithubIssuesLabelAction, createGithubWebhookAction, createPublishAzureAction, createPublishBitbucketAction, createPublishFileAction, createPublishGithubAction, createPublishGithubPullRequestAction, createPublishGitlabAction, createPublishGitlabMergeRequestAction, createRouter, createTemplateAction, executeShellCommand, fetchContents };
803
+ export { ActionContext, CreateBuiltInActionsOptions, CreateGithubPullRequestActionOptions, CreateGithubPullRequestClientFactoryInput, CreateWorkerOptions, CurrentClaimedTask, DatabaseTaskStore, DatabaseTaskStoreOptions, OctokitWithPullRequestPluginClient, RouterOptions, RunCommandOptions, ScaffolderEntitiesProcessor, SerializedTask, SerializedTaskEvent, TaskBroker, TaskBrokerDispatchOptions, TaskBrokerDispatchResult, TaskCompletionState, TaskContext, TaskEventType, TaskManager, TaskSecrets, TaskStatus, TaskStore, TaskStoreCreateTaskOptions, TaskStoreCreateTaskResult, TaskStoreEmitOptions, TaskStoreListEventsOptions, TaskWorker, TemplateAction, TemplateActionRegistry, TemplateFilter, createBuiltinActions, createCatalogRegisterAction, createCatalogWriteAction, createDebugLogAction, createFetchPlainAction, createFetchTemplateAction, createFilesystemDeleteAction, createFilesystemRenameAction, createGithubActionsDispatchAction, createGithubIssuesLabelAction, createGithubWebhookAction, createPublishAzureAction, createPublishBitbucketAction, createPublishBitbucketCloudAction, createPublishBitbucketServerAction, createPublishFileAction, createPublishGithubAction, createPublishGithubPullRequestAction, createPublishGitlabAction, createPublishGitlabMergeRequestAction, createRouter, createTemplateAction, executeShellCommand, fetchContents };
@@ -0,0 +1,38 @@
1
+ /*
2
+ * Copyright 2020 The Backstage Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ // @ts-check
18
+
19
+ /**
20
+ * @param {import('knex').Knex} knex
21
+ */
22
+ exports.up = async function up(knex) {
23
+ await knex.schema.alterTable('tasks', table => {
24
+ table
25
+ .text('created_by')
26
+ .nullable()
27
+ .comment('An entityRef of the user who created the task');
28
+ });
29
+ };
30
+
31
+ /**
32
+ * @param {import('knex').Knex} knex
33
+ */
34
+ exports.down = async function down(knex) {
35
+ await knex.schema.alterTable('tasks', table => {
36
+ table.dropColumn('created_by');
37
+ });
38
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-backend",
3
3
  "description": "The Backstage backend plugin that helps you create new things",
4
- "version": "1.1.0",
4
+ "version": "1.2.0",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -34,14 +34,14 @@
34
34
  "build:assets": "node scripts/build-nunjucks.js"
35
35
  },
36
36
  "dependencies": {
37
- "@backstage/backend-common": "^0.13.2",
38
- "@backstage/catalog-client": "^1.0.1",
39
- "@backstage/catalog-model": "^1.0.1",
40
- "@backstage/config": "^1.0.0",
37
+ "@backstage/backend-common": "^0.13.3",
38
+ "@backstage/catalog-client": "^1.0.2",
39
+ "@backstage/catalog-model": "^1.0.2",
40
+ "@backstage/config": "^1.0.1",
41
41
  "@backstage/errors": "^1.0.0",
42
- "@backstage/integration": "^1.1.0",
43
- "@backstage/plugin-catalog-backend": "^1.1.0",
44
- "@backstage/plugin-scaffolder-common": "^1.0.1",
42
+ "@backstage/integration": "^1.2.0",
43
+ "@backstage/plugin-catalog-backend": "^1.1.2",
44
+ "@backstage/plugin-scaffolder-common": "^1.1.0",
45
45
  "@backstage/types": "^1.0.0",
46
46
  "@gitbeaker/core": "^35.6.0",
47
47
  "@gitbeaker/node": "^35.1.0",
@@ -53,7 +53,7 @@
53
53
  "cors": "^2.8.5",
54
54
  "express": "^4.17.1",
55
55
  "express-promise-router": "^4.1.0",
56
- "fs-extra": "10.0.1",
56
+ "fs-extra": "10.1.0",
57
57
  "git-url-parse": "^11.6.0",
58
58
  "globby": "^11.0.0",
59
59
  "isbinaryfile": "^5.0.0",
@@ -74,8 +74,8 @@
74
74
  "zen-observable": "^0.8.15"
75
75
  },
76
76
  "devDependencies": {
77
- "@backstage/backend-test-utils": "^0.1.23",
78
- "@backstage/cli": "^0.17.0",
77
+ "@backstage/backend-test-utils": "^0.1.24",
78
+ "@backstage/cli": "^0.17.1",
79
79
  "@types/command-exists": "^1.2.0",
80
80
  "@types/fs-extra": "^9.0.1",
81
81
  "@types/git-url-parse": "^9.0.0",
@@ -97,5 +97,5 @@
97
97
  "assets"
98
98
  ],
99
99
  "configSchema": "config.d.ts",
100
- "gitHead": "e0e44c433319711c2fb8b175db411a621f7aaec2"
100
+ "gitHead": "96323f280ba32ee526c5b151cda42260aee927c9"
101
101
  }