@backstage/plugin-scaffolder-backend 1.10.0-next.1 → 1.10.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,218 @@
1
1
  # @backstage/plugin-scaffolder-backend
2
2
 
3
+ ## 1.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a6808b67a7: Implement `Required approving review count`, `Restrictions`, and `Required commit signing` support for `publish:github` action
8
+ - 04a2048fb8: Allow custom repository roles to be configured on github repos
9
+ - c0ad7341f7: Add Scaffolder action `catalog:fetch` to get entity by entity reference from catalog
10
+ - b44eb68bcb: This change adds changes to provide examples alongside scaffolder task actions.
11
+
12
+ The `createTemplateAction` function now takes a list of examples e.g.
13
+
14
+ ```typescript
15
+ const actionExamples = [
16
+ {
17
+ description: 'Example 1',
18
+ example: yaml.stringify({
19
+ steps: [
20
+ {
21
+ action: 'test:action',
22
+ id: 'test',
23
+ input: {
24
+ input1: 'value',
25
+ },
26
+ },
27
+ ],
28
+ }),
29
+ },
30
+ ];
31
+
32
+ export function createTestAction() {
33
+ return createTemplateAction({
34
+ id: 'test:action',
35
+ examples: [
36
+ {
37
+ description: 'Example 1',
38
+ examples: actionExamples
39
+ }
40
+ ],
41
+ ...,
42
+ });
43
+ ```
44
+
45
+ These examples can be retrieved later from the api.
46
+
47
+ ```bash
48
+ curl http://localhost:7007/api/scaffolder/v2/actions
49
+ ```
50
+
51
+ ```json
52
+ [
53
+ {
54
+ "id": "test:action",
55
+ "examples": [
56
+ {
57
+ "description": "Example 1",
58
+ "example": "steps:\n - action: test:action\n id: test\n input:\n input1: value\n"
59
+ }
60
+ ],
61
+ "schema": {
62
+ "input": {
63
+ "type": "object",
64
+ "properties": {
65
+ "input1": {
66
+ "title": "Input 1",
67
+ "type": "string"
68
+ }
69
+ }
70
+ }
71
+ }
72
+ }
73
+ ]
74
+ ```
75
+
76
+ - 72d6b9f4e2: Added ability to override the commit message and author details for the `publish:bitbucketServer` action.
77
+ - a69664faee: Add Github repository support for squash merge commit title and message options
78
+
79
+ ### Patch Changes
80
+
81
+ - 2fadff2a25: Change scaffolder task actions to include markdown to demonstrate the new `ActionsPage` markdown feature.
82
+ - ecbec4ec4c: Internal refactor to match new options pattern in the experimental backend system.
83
+ - e4c0240445: Added `catalogFilter` field to OwnerPicker and EntityPicker components to support filtering options by any field(s) of an entity.
84
+
85
+ The `allowedKinds` field has been deprecated. Use `catalogFilter` instead. This field allows users to specify a filter on the shape of [EntityFilterQuery](https://github.com/backstage/backstage/blob/774c42003782121d3d6b2aa5f2865d53370c160e/packages/catalog-client/src/types/api.ts#L74), which can be passed into the CatalogClient. See examples below:
86
+
87
+ - Get all entities of kind `Group`
88
+
89
+ ```yaml
90
+ owner:
91
+ title: Owner
92
+ type: string
93
+ description: Owner of the component
94
+ ui:field: OwnerPicker
95
+ ui:options:
96
+ catalogFilter:
97
+ - kind: Group
98
+ ```
99
+
100
+ - Get entities of kind `Group` and spec.type `team`
101
+ ```yaml
102
+ owner:
103
+ title: Owner
104
+ type: string
105
+ description: Owner of the component
106
+ ui:field: OwnerPicker
107
+ ui:options:
108
+ catalogFilter:
109
+ - kind: Group
110
+ spec.type: team
111
+ ```
112
+
113
+ - 8e06f3cf00: Switched imports of `loggerToWinstonLogger` to `@backstage/backend-common`.
114
+ - Updated dependencies
115
+ - @backstage/backend-plugin-api@0.3.0
116
+ - @backstage/backend-common@0.18.0
117
+ - @backstage/catalog-model@1.1.5
118
+ - @backstage/plugin-scaffolder-common@1.2.4
119
+ - @backstage/catalog-client@1.3.0
120
+ - @backstage/backend-tasks@0.4.1
121
+ - @backstage/plugin-catalog-node@1.3.1
122
+ - @backstage/plugin-catalog-backend@1.7.0
123
+ - @backstage/config@1.0.6
124
+ - @backstage/errors@1.1.4
125
+ - @backstage/integration@1.4.2
126
+ - @backstage/types@1.0.2
127
+ - @backstage/plugin-auth-node@0.2.9
128
+
129
+ ## 1.10.0-next.2
130
+
131
+ ### Patch Changes
132
+
133
+ - 2fadff2a25: Change scaffolder task actions to include markdown to demonstrate the new `ActionsPage` markdown feature.
134
+ - b44eb68bcb: This patch adds changes to provide examples alongside scaffolder task actions.
135
+
136
+ The `createTemplateAction` function now takes a list of examples e.g.
137
+
138
+ ```typescript
139
+ const actionExamples = [
140
+ {
141
+ description: 'Example 1',
142
+ example: yaml.stringify({
143
+ steps: [
144
+ {
145
+ action: 'test:action',
146
+ id: 'test',
147
+ input: {
148
+ input1: 'value',
149
+ },
150
+ },
151
+ ],
152
+ }),
153
+ },
154
+ ];
155
+
156
+ export function createTestAction() {
157
+ return createTemplateAction({
158
+ id: 'test:action',
159
+ examples: [
160
+ {
161
+ description: 'Example 1',
162
+ examples: actionExamples
163
+ }
164
+ ],
165
+ ...,
166
+ });
167
+ ```
168
+
169
+ These examples can be retrieved later from the api.
170
+
171
+ ```bash
172
+ curl http://localhost:7007/api/scaffolder/v2/actions
173
+ ```
174
+
175
+ ```json
176
+ [
177
+ {
178
+ "id": "test:action",
179
+ "examples": [
180
+ {
181
+ "description": "Example 1",
182
+ "example": "steps:\n - action: test:action\n id: test\n input:\n input1: value\n"
183
+ }
184
+ ],
185
+ "schema": {
186
+ "input": {
187
+ "type": "object",
188
+ "properties": {
189
+ "input1": {
190
+ "title": "Input 1",
191
+ "type": "string"
192
+ }
193
+ }
194
+ }
195
+ }
196
+ }
197
+ ]
198
+ ```
199
+
200
+ - 8e06f3cf00: Switched imports of `loggerToWinstonLogger` to `@backstage/backend-common`.
201
+ - Updated dependencies
202
+ - @backstage/backend-plugin-api@0.3.0-next.1
203
+ - @backstage/backend-common@0.18.0-next.1
204
+ - @backstage/backend-tasks@0.4.1-next.1
205
+ - @backstage/catalog-client@1.3.0-next.2
206
+ - @backstage/plugin-catalog-backend@1.7.0-next.2
207
+ - @backstage/plugin-catalog-node@1.3.1-next.2
208
+ - @backstage/plugin-auth-node@0.2.9-next.1
209
+ - @backstage/catalog-model@1.1.5-next.1
210
+ - @backstage/config@1.0.6-next.0
211
+ - @backstage/errors@1.1.4
212
+ - @backstage/integration@1.4.2-next.0
213
+ - @backstage/types@1.0.2
214
+ - @backstage/plugin-scaffolder-common@1.2.4-next.1
215
+
3
216
  ## 1.10.0-next.1
4
217
 
5
218
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-backend",
3
- "version": "1.10.0-next.1",
3
+ "version": "1.10.0",
4
4
  "main": "../dist/index.cjs.js",
5
5
  "types": "../dist/index.alpha.d.ts"
6
6
  }
@@ -150,6 +150,17 @@ message?: string | undefined;
150
150
  listWorkspace?: boolean | undefined;
151
151
  }>;
152
152
 
153
+ /**
154
+ * Returns entity from the catalog by entity reference.
155
+ * @public
156
+ */
157
+ export declare function createFetchCatalogEntityAction(options: {
158
+ catalogClient: CatalogApi;
159
+ }): TemplateAction< {
160
+ entityRef: string;
161
+ optional?: boolean | undefined;
162
+ }>;
163
+
153
164
  /**
154
165
  * Downloads content and places it in the workspace, or optionally
155
166
  * in a subdirectory specified by the 'targetPath' input option.
@@ -299,6 +310,12 @@ users?: string[] | undefined;
299
310
  teams?: string[] | undefined;
300
311
  apps?: string[] | undefined;
301
312
  } | undefined;
313
+ requiredApprovingReviewCount?: number | undefined;
314
+ restrictions?: {
315
+ users: string[];
316
+ teams: string[];
317
+ apps?: string[] | undefined;
318
+ } | undefined;
302
319
  requiredStatusCheckContexts?: string[] | undefined;
303
320
  requireBranchesToBeUpToDate?: boolean | undefined;
304
321
  requiredConversationResolution?: boolean | undefined;
@@ -319,6 +336,7 @@ hasWiki?: boolean | undefined;
319
336
  hasIssues?: boolean | undefined;
320
337
  token?: string | undefined;
321
338
  topics?: string[] | undefined;
339
+ requireCommitSigning?: boolean | undefined;
322
340
  }>;
323
341
 
324
342
  /**
@@ -347,11 +365,18 @@ users?: string[];
347
365
  teams?: string[];
348
366
  apps?: string[];
349
367
  } | undefined;
368
+ requiredApprovingReviewCount?: number | undefined;
369
+ restrictions?: {
370
+ users: string[];
371
+ teams: string[];
372
+ apps?: string[];
373
+ } | undefined;
350
374
  requiredStatusCheckContexts?: string[] | undefined;
351
375
  requireBranchesToBeUpToDate?: boolean | undefined;
352
376
  requiredConversationResolution?: boolean | undefined;
353
377
  sourcePath?: string | undefined;
354
378
  token?: string | undefined;
379
+ requiredCommitSigning?: boolean | undefined;
355
380
  }>;
356
381
 
357
382
  /**
@@ -447,6 +472,9 @@ repoVisibility?: "private" | "public" | undefined;
447
472
  sourcePath?: string | undefined;
448
473
  enableLFS?: boolean | undefined;
449
474
  token?: string | undefined;
475
+ gitCommitMessage?: string | undefined;
476
+ gitAuthorName?: string | undefined;
477
+ gitAuthorEmail?: string | undefined;
450
478
  }>;
451
479
 
452
480
  /**
@@ -517,6 +545,12 @@ users?: string[];
517
545
  teams?: string[];
518
546
  apps?: string[];
519
547
  } | undefined;
548
+ requiredApprovingReviewCount?: number | undefined;
549
+ restrictions?: {
550
+ users: string[];
551
+ teams: string[];
552
+ apps?: string[];
553
+ } | undefined;
520
554
  requireCodeOwnerReviews?: boolean | undefined;
521
555
  dismissStaleReviews?: boolean | undefined;
522
556
  requiredStatusCheckContexts?: string[] | undefined;
@@ -539,6 +573,7 @@ hasWiki?: boolean | undefined;
539
573
  hasIssues?: boolean | undefined;
540
574
  token?: string | undefined;
541
575
  topics?: string[] | undefined;
576
+ requiredCommitSigning?: boolean | undefined;
542
577
  }>;
543
578
 
544
579
  /**
@@ -792,7 +827,7 @@ export declare type RunCommandOptions = {
792
827
  * @alpha
793
828
  * Registers the ScaffolderEntitiesProcessor with the catalog processing extension point.
794
829
  */
795
- export declare const scaffolderCatalogModule: (options?: undefined) => BackendFeature;
830
+ export declare const scaffolderCatalogModule: () => BackendFeature;
796
831
 
797
832
  /** @public */
798
833
  export declare class ScaffolderEntitiesProcessor implements CatalogProcessor {
@@ -1063,6 +1098,10 @@ export declare class TaskWorker {
1063
1098
  export declare type TemplateAction<Input extends JsonObject> = {
1064
1099
  id: string;
1065
1100
  description?: string;
1101
+ examples?: {
1102
+ description: string;
1103
+ example: string;
1104
+ }[];
1066
1105
  supportsDryRun?: boolean;
1067
1106
  schema?: {
1068
1107
  input?: Schema;
@@ -150,6 +150,17 @@ message?: string | undefined;
150
150
  listWorkspace?: boolean | undefined;
151
151
  }>;
152
152
 
153
+ /**
154
+ * Returns entity from the catalog by entity reference.
155
+ * @public
156
+ */
157
+ export declare function createFetchCatalogEntityAction(options: {
158
+ catalogClient: CatalogApi;
159
+ }): TemplateAction< {
160
+ entityRef: string;
161
+ optional?: boolean | undefined;
162
+ }>;
163
+
153
164
  /**
154
165
  * Downloads content and places it in the workspace, or optionally
155
166
  * in a subdirectory specified by the 'targetPath' input option.
@@ -299,6 +310,12 @@ users?: string[] | undefined;
299
310
  teams?: string[] | undefined;
300
311
  apps?: string[] | undefined;
301
312
  } | undefined;
313
+ requiredApprovingReviewCount?: number | undefined;
314
+ restrictions?: {
315
+ users: string[];
316
+ teams: string[];
317
+ apps?: string[] | undefined;
318
+ } | undefined;
302
319
  requiredStatusCheckContexts?: string[] | undefined;
303
320
  requireBranchesToBeUpToDate?: boolean | undefined;
304
321
  requiredConversationResolution?: boolean | undefined;
@@ -319,6 +336,7 @@ hasWiki?: boolean | undefined;
319
336
  hasIssues?: boolean | undefined;
320
337
  token?: string | undefined;
321
338
  topics?: string[] | undefined;
339
+ requireCommitSigning?: boolean | undefined;
322
340
  }>;
323
341
 
324
342
  /**
@@ -347,11 +365,18 @@ users?: string[];
347
365
  teams?: string[];
348
366
  apps?: string[];
349
367
  } | undefined;
368
+ requiredApprovingReviewCount?: number | undefined;
369
+ restrictions?: {
370
+ users: string[];
371
+ teams: string[];
372
+ apps?: string[];
373
+ } | undefined;
350
374
  requiredStatusCheckContexts?: string[] | undefined;
351
375
  requireBranchesToBeUpToDate?: boolean | undefined;
352
376
  requiredConversationResolution?: boolean | undefined;
353
377
  sourcePath?: string | undefined;
354
378
  token?: string | undefined;
379
+ requiredCommitSigning?: boolean | undefined;
355
380
  }>;
356
381
 
357
382
  /**
@@ -447,6 +472,9 @@ repoVisibility?: "private" | "public" | undefined;
447
472
  sourcePath?: string | undefined;
448
473
  enableLFS?: boolean | undefined;
449
474
  token?: string | undefined;
475
+ gitCommitMessage?: string | undefined;
476
+ gitAuthorName?: string | undefined;
477
+ gitAuthorEmail?: string | undefined;
450
478
  }>;
451
479
 
452
480
  /**
@@ -517,6 +545,12 @@ users?: string[];
517
545
  teams?: string[];
518
546
  apps?: string[];
519
547
  } | undefined;
548
+ requiredApprovingReviewCount?: number | undefined;
549
+ restrictions?: {
550
+ users: string[];
551
+ teams: string[];
552
+ apps?: string[];
553
+ } | undefined;
520
554
  requireCodeOwnerReviews?: boolean | undefined;
521
555
  dismissStaleReviews?: boolean | undefined;
522
556
  requiredStatusCheckContexts?: string[] | undefined;
@@ -539,6 +573,7 @@ hasWiki?: boolean | undefined;
539
573
  hasIssues?: boolean | undefined;
540
574
  token?: string | undefined;
541
575
  topics?: string[] | undefined;
576
+ requiredCommitSigning?: boolean | undefined;
542
577
  }>;
543
578
 
544
579
  /**
@@ -1045,6 +1080,10 @@ export declare class TaskWorker {
1045
1080
  export declare type TemplateAction<Input extends JsonObject> = {
1046
1081
  id: string;
1047
1082
  description?: string;
1083
+ examples?: {
1084
+ description: string;
1085
+ example: string;
1086
+ }[];
1048
1087
  supportsDryRun?: boolean;
1049
1088
  schema?: {
1050
1089
  input?: Schema;