@backstage/plugin-scaffolder-backend 1.10.0-next.2 → 1.10.1
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 +138 -0
- package/alpha/package.json +1 -1
- package/dist/index.alpha.d.ts +36 -1
- package/dist/index.beta.d.ts +35 -0
- package/dist/index.cjs.js +249 -89
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +35 -0
- package/package.json +14 -14
package/dist/index.cjs.js
CHANGED
|
@@ -82,14 +82,14 @@ const createTemplateAction = (templateAction) => {
|
|
|
82
82
|
return templateAction;
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
-
const id$
|
|
86
|
-
const examples$
|
|
85
|
+
const id$3 = "catalog:register";
|
|
86
|
+
const examples$3 = [
|
|
87
87
|
{
|
|
88
88
|
description: "Register with the catalog",
|
|
89
89
|
example: yaml__default["default"].stringify({
|
|
90
90
|
steps: [
|
|
91
91
|
{
|
|
92
|
-
action: id$
|
|
92
|
+
action: id$3,
|
|
93
93
|
id: "register-with-catalog",
|
|
94
94
|
name: "Register with the catalog",
|
|
95
95
|
input: {
|
|
@@ -103,9 +103,9 @@ const examples$2 = [
|
|
|
103
103
|
function createCatalogRegisterAction(options) {
|
|
104
104
|
const { catalogClient, integrations } = options;
|
|
105
105
|
return createTemplateAction({
|
|
106
|
-
id: id$
|
|
106
|
+
id: id$3,
|
|
107
107
|
description: "Registers entities from a catalog descriptor file in the workspace into the software catalog.",
|
|
108
|
-
examples: examples$
|
|
108
|
+
examples: examples$3,
|
|
109
109
|
schema: {
|
|
110
110
|
input: {
|
|
111
111
|
oneOf: [
|
|
@@ -223,14 +223,14 @@ function createCatalogRegisterAction(options) {
|
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
const id$
|
|
227
|
-
const examples$
|
|
226
|
+
const id$2 = "catalog:write";
|
|
227
|
+
const examples$2 = [
|
|
228
228
|
{
|
|
229
229
|
description: "Write a catalog yaml file",
|
|
230
230
|
example: yaml__namespace.stringify({
|
|
231
231
|
steps: [
|
|
232
232
|
{
|
|
233
|
-
action: id$
|
|
233
|
+
action: id$2,
|
|
234
234
|
id: "create-catalog-info-file",
|
|
235
235
|
name: "Create catalog file",
|
|
236
236
|
input: {
|
|
@@ -255,9 +255,9 @@ const examples$1 = [
|
|
|
255
255
|
];
|
|
256
256
|
function createCatalogWriteAction() {
|
|
257
257
|
return createTemplateAction({
|
|
258
|
-
id: id$
|
|
258
|
+
id: id$2,
|
|
259
259
|
description: "Writes the catalog-info.yaml for your template",
|
|
260
|
-
examples: examples$
|
|
260
|
+
examples: examples$2,
|
|
261
261
|
schema: {
|
|
262
262
|
input: {
|
|
263
263
|
type: "object",
|
|
@@ -288,6 +288,76 @@ function createCatalogWriteAction() {
|
|
|
288
288
|
});
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
+
const id$1 = "catalog:fetch";
|
|
292
|
+
const examples$1 = [
|
|
293
|
+
{
|
|
294
|
+
description: "Fetch entity by reference",
|
|
295
|
+
example: yaml__default["default"].stringify({
|
|
296
|
+
steps: [
|
|
297
|
+
{
|
|
298
|
+
action: id$1,
|
|
299
|
+
id: "fetch",
|
|
300
|
+
name: "Fetch catalog entity",
|
|
301
|
+
input: {
|
|
302
|
+
entityRef: "component:default/name"
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
]
|
|
306
|
+
})
|
|
307
|
+
}
|
|
308
|
+
];
|
|
309
|
+
function createFetchCatalogEntityAction(options) {
|
|
310
|
+
const { catalogClient } = options;
|
|
311
|
+
return createTemplateAction({
|
|
312
|
+
id: id$1,
|
|
313
|
+
description: "Returns entity from the catalog by entity reference",
|
|
314
|
+
examples: examples$1,
|
|
315
|
+
schema: {
|
|
316
|
+
input: {
|
|
317
|
+
required: ["entityRef"],
|
|
318
|
+
type: "object",
|
|
319
|
+
properties: {
|
|
320
|
+
entityRef: {
|
|
321
|
+
type: "string",
|
|
322
|
+
title: "Entity reference",
|
|
323
|
+
description: "Entity reference of the entity to get"
|
|
324
|
+
},
|
|
325
|
+
optional: {
|
|
326
|
+
title: "Optional",
|
|
327
|
+
description: "Permit the entity to optionally exist. Default: false",
|
|
328
|
+
type: "boolean"
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
output: {
|
|
333
|
+
type: "object",
|
|
334
|
+
properties: {
|
|
335
|
+
entity: {
|
|
336
|
+
title: "Entity found by the entity reference",
|
|
337
|
+
type: "object",
|
|
338
|
+
description: "Object containing same values used in the Entity schema."
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
async handler(ctx) {
|
|
344
|
+
var _a;
|
|
345
|
+
const { entityRef, optional } = ctx.input;
|
|
346
|
+
let entity;
|
|
347
|
+
try {
|
|
348
|
+
entity = await catalogClient.getEntityByRef(entityRef, {
|
|
349
|
+
token: (_a = ctx.secrets) == null ? void 0 : _a.backstageToken
|
|
350
|
+
});
|
|
351
|
+
} catch (e) {
|
|
352
|
+
if (!optional) {
|
|
353
|
+
throw e;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
ctx.output("entity", entity != null ? entity : null);
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
|
|
291
361
|
const id = "debug:log";
|
|
292
362
|
const examples = [
|
|
293
363
|
{
|
|
@@ -1081,12 +1151,15 @@ const enableBranchProtectionOnDefaultRepoBranch = async ({
|
|
|
1081
1151
|
logger,
|
|
1082
1152
|
requireCodeOwnerReviews,
|
|
1083
1153
|
bypassPullRequestAllowances,
|
|
1154
|
+
requiredApprovingReviewCount,
|
|
1155
|
+
restrictions,
|
|
1084
1156
|
requiredStatusCheckContexts = [],
|
|
1085
1157
|
requireBranchesToBeUpToDate = true,
|
|
1086
1158
|
requiredConversationResolution = false,
|
|
1087
1159
|
defaultBranch = "master",
|
|
1088
1160
|
enforceAdmins = true,
|
|
1089
|
-
dismissStaleReviews = false
|
|
1161
|
+
dismissStaleReviews = false,
|
|
1162
|
+
requiredCommitSigning = false
|
|
1090
1163
|
}) => {
|
|
1091
1164
|
const tryOnce = async () => {
|
|
1092
1165
|
try {
|
|
@@ -1108,16 +1181,23 @@ const enableBranchProtectionOnDefaultRepoBranch = async ({
|
|
|
1108
1181
|
strict: requireBranchesToBeUpToDate,
|
|
1109
1182
|
contexts: requiredStatusCheckContexts
|
|
1110
1183
|
},
|
|
1111
|
-
restrictions: null,
|
|
1184
|
+
restrictions: restrictions != null ? restrictions : null,
|
|
1112
1185
|
enforce_admins: enforceAdmins,
|
|
1113
1186
|
required_pull_request_reviews: {
|
|
1114
|
-
required_approving_review_count:
|
|
1187
|
+
required_approving_review_count: requiredApprovingReviewCount,
|
|
1115
1188
|
require_code_owner_reviews: requireCodeOwnerReviews,
|
|
1116
1189
|
bypass_pull_request_allowances: bypassPullRequestAllowances,
|
|
1117
1190
|
dismiss_stale_reviews: dismissStaleReviews
|
|
1118
1191
|
},
|
|
1119
1192
|
required_conversation_resolution: requiredConversationResolution
|
|
1120
1193
|
});
|
|
1194
|
+
if (requiredCommitSigning) {
|
|
1195
|
+
await client.rest.repos.createCommitSignatureProtection({
|
|
1196
|
+
owner,
|
|
1197
|
+
repo: repoName,
|
|
1198
|
+
branch: defaultBranch
|
|
1199
|
+
});
|
|
1200
|
+
}
|
|
1121
1201
|
} catch (e) {
|
|
1122
1202
|
errors.assertError(e);
|
|
1123
1203
|
if (e.message.includes(
|
|
@@ -1293,7 +1373,7 @@ async function createGithubRepoWithCollaboratorsAndTopics(client, repo, owner, r
|
|
|
1293
1373
|
}
|
|
1294
1374
|
return newRepo;
|
|
1295
1375
|
}
|
|
1296
|
-
async function initRepoPushAndProtect(remoteUrl, password, workspacePath, sourcePath, defaultBranch, protectDefaultBranch, protectEnforceAdmins, owner, client, repo, requireCodeOwnerReviews, bypassPullRequestAllowances, requiredStatusCheckContexts, requireBranchesToBeUpToDate, requiredConversationResolution, config, logger, gitCommitMessage, gitAuthorName, gitAuthorEmail, dismissStaleReviews) {
|
|
1376
|
+
async function initRepoPushAndProtect(remoteUrl, password, workspacePath, sourcePath, defaultBranch, protectDefaultBranch, protectEnforceAdmins, owner, client, repo, requireCodeOwnerReviews, bypassPullRequestAllowances, requiredApprovingReviewCount, restrictions, requiredStatusCheckContexts, requireBranchesToBeUpToDate, requiredConversationResolution, config, logger, gitCommitMessage, gitAuthorName, gitAuthorEmail, dismissStaleReviews, requiredCommitSigning) {
|
|
1297
1377
|
const gitAuthorInfo = {
|
|
1298
1378
|
name: gitAuthorName ? gitAuthorName : config.getOptionalString("scaffolder.defaultAuthor.name"),
|
|
1299
1379
|
email: gitAuthorEmail ? gitAuthorEmail : config.getOptionalString("scaffolder.defaultAuthor.email")
|
|
@@ -1320,12 +1400,15 @@ async function initRepoPushAndProtect(remoteUrl, password, workspacePath, source
|
|
|
1320
1400
|
logger,
|
|
1321
1401
|
defaultBranch,
|
|
1322
1402
|
bypassPullRequestAllowances,
|
|
1403
|
+
requiredApprovingReviewCount,
|
|
1404
|
+
restrictions,
|
|
1323
1405
|
requireCodeOwnerReviews,
|
|
1324
1406
|
requiredStatusCheckContexts,
|
|
1325
1407
|
requireBranchesToBeUpToDate,
|
|
1326
1408
|
requiredConversationResolution,
|
|
1327
1409
|
enforceAdmins: protectEnforceAdmins,
|
|
1328
|
-
dismissStaleReviews
|
|
1410
|
+
dismissStaleReviews,
|
|
1411
|
+
requiredCommitSigning
|
|
1329
1412
|
});
|
|
1330
1413
|
} catch (e) {
|
|
1331
1414
|
errors.assertError(e);
|
|
@@ -1683,6 +1766,42 @@ const sourcePath = {
|
|
|
1683
1766
|
description: "Path within the workspace that will be used as the repository root. If omitted, the entire workspace will be published as the repository.",
|
|
1684
1767
|
type: "string"
|
|
1685
1768
|
};
|
|
1769
|
+
const requiredApprovingReviewCount = {
|
|
1770
|
+
title: "Required approving review count",
|
|
1771
|
+
type: "number",
|
|
1772
|
+
description: `Specify the number of reviewers required to approve pull requests. Use a number between 1 and 6 or 0 to not require reviewers. Defaults to 1.`
|
|
1773
|
+
};
|
|
1774
|
+
const restrictions = {
|
|
1775
|
+
title: "Restrict who can push to the protected branch",
|
|
1776
|
+
description: "Restrict who can push to the protected branch. User, app, and team restrictions are only available for organization-owned repositories.",
|
|
1777
|
+
type: "object",
|
|
1778
|
+
additionalProperties: false,
|
|
1779
|
+
properties: {
|
|
1780
|
+
apps: {
|
|
1781
|
+
type: "array",
|
|
1782
|
+
items: {
|
|
1783
|
+
type: "string"
|
|
1784
|
+
}
|
|
1785
|
+
},
|
|
1786
|
+
users: {
|
|
1787
|
+
type: "array",
|
|
1788
|
+
items: {
|
|
1789
|
+
type: "string"
|
|
1790
|
+
}
|
|
1791
|
+
},
|
|
1792
|
+
teams: {
|
|
1793
|
+
type: "array",
|
|
1794
|
+
items: {
|
|
1795
|
+
type: "string"
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
};
|
|
1800
|
+
const requiredCommitSigning = {
|
|
1801
|
+
title: "Require commit signing",
|
|
1802
|
+
type: "boolean",
|
|
1803
|
+
description: `Require commit signing so that you must sign commits on this branch.`
|
|
1804
|
+
};
|
|
1686
1805
|
|
|
1687
1806
|
const remoteUrl = {
|
|
1688
1807
|
title: "A URL to the repository with the provider",
|
|
@@ -1709,6 +1828,8 @@ function createGithubRepoCreateAction(options) {
|
|
|
1709
1828
|
access: access,
|
|
1710
1829
|
requireCodeOwnerReviews: requireCodeOwnerReviews,
|
|
1711
1830
|
bypassPullRequestAllowances: bypassPullRequestAllowances,
|
|
1831
|
+
requiredApprovingReviewCount: requiredApprovingReviewCount,
|
|
1832
|
+
restrictions: restrictions,
|
|
1712
1833
|
requiredStatusCheckContexts: requiredStatusCheckContexts,
|
|
1713
1834
|
requireBranchesToBeUpToDate: requireBranchesToBeUpToDate,
|
|
1714
1835
|
requiredConversationResolution: requiredConversationResolution,
|
|
@@ -1725,7 +1846,8 @@ function createGithubRepoCreateAction(options) {
|
|
|
1725
1846
|
hasWiki: hasWiki,
|
|
1726
1847
|
hasIssues: hasIssues,
|
|
1727
1848
|
token: token,
|
|
1728
|
-
topics: topics
|
|
1849
|
+
topics: topics,
|
|
1850
|
+
requiredCommitSigning: requiredCommitSigning
|
|
1729
1851
|
}
|
|
1730
1852
|
},
|
|
1731
1853
|
output: {
|
|
@@ -1810,6 +1932,8 @@ function createGithubRepoPushAction(options) {
|
|
|
1810
1932
|
dismissStaleReviews: dismissStaleReviews,
|
|
1811
1933
|
requiredStatusCheckContexts: requiredStatusCheckContexts,
|
|
1812
1934
|
bypassPullRequestAllowances: bypassPullRequestAllowances,
|
|
1935
|
+
requiredApprovingReviewCount: requiredApprovingReviewCount,
|
|
1936
|
+
restrictions: restrictions,
|
|
1813
1937
|
requireBranchesToBeUpToDate: requireBranchesToBeUpToDate,
|
|
1814
1938
|
requiredConversationResolution: requiredConversationResolution,
|
|
1815
1939
|
defaultBranch: defaultBranch,
|
|
@@ -1819,7 +1943,8 @@ function createGithubRepoPushAction(options) {
|
|
|
1819
1943
|
gitAuthorName: gitAuthorName,
|
|
1820
1944
|
gitAuthorEmail: gitAuthorEmail,
|
|
1821
1945
|
sourcePath: sourcePath,
|
|
1822
|
-
token: token
|
|
1946
|
+
token: token,
|
|
1947
|
+
requiredCommitSigning: requiredCommitSigning
|
|
1823
1948
|
}
|
|
1824
1949
|
},
|
|
1825
1950
|
output: {
|
|
@@ -1842,10 +1967,13 @@ function createGithubRepoPushAction(options) {
|
|
|
1842
1967
|
requireCodeOwnerReviews = false,
|
|
1843
1968
|
dismissStaleReviews = false,
|
|
1844
1969
|
bypassPullRequestAllowances,
|
|
1970
|
+
requiredApprovingReviewCount = 1,
|
|
1971
|
+
restrictions,
|
|
1845
1972
|
requiredStatusCheckContexts = [],
|
|
1846
1973
|
requireBranchesToBeUpToDate = true,
|
|
1847
1974
|
requiredConversationResolution = false,
|
|
1848
|
-
token: providedToken
|
|
1975
|
+
token: providedToken,
|
|
1976
|
+
requiredCommitSigning = false
|
|
1849
1977
|
} = ctx.input;
|
|
1850
1978
|
const { owner, repo } = parseRepoUrl(repoUrl, integrations);
|
|
1851
1979
|
if (!owner) {
|
|
@@ -1874,6 +2002,8 @@ function createGithubRepoPushAction(options) {
|
|
|
1874
2002
|
repo,
|
|
1875
2003
|
requireCodeOwnerReviews,
|
|
1876
2004
|
bypassPullRequestAllowances,
|
|
2005
|
+
requiredApprovingReviewCount,
|
|
2006
|
+
restrictions,
|
|
1877
2007
|
requiredStatusCheckContexts,
|
|
1878
2008
|
requireBranchesToBeUpToDate,
|
|
1879
2009
|
requiredConversationResolution,
|
|
@@ -1882,7 +2012,8 @@ function createGithubRepoPushAction(options) {
|
|
|
1882
2012
|
gitCommitMessage,
|
|
1883
2013
|
gitAuthorName,
|
|
1884
2014
|
gitAuthorEmail,
|
|
1885
|
-
dismissStaleReviews
|
|
2015
|
+
dismissStaleReviews,
|
|
2016
|
+
requiredCommitSigning
|
|
1886
2017
|
);
|
|
1887
2018
|
ctx.output("remoteUrl", remoteUrl);
|
|
1888
2019
|
ctx.output("repoContentsUrl", repoContentsUrl);
|
|
@@ -2734,6 +2865,21 @@ function createPublishBitbucketServerAction(options) {
|
|
|
2734
2865
|
title: "Authentication Token",
|
|
2735
2866
|
type: "string",
|
|
2736
2867
|
description: "The token to use for authorization to BitBucket Server"
|
|
2868
|
+
},
|
|
2869
|
+
gitCommitMessage: {
|
|
2870
|
+
title: "Git Commit Message",
|
|
2871
|
+
type: "string",
|
|
2872
|
+
description: `Sets the commit message on the repository. The default value is 'initial commit'`
|
|
2873
|
+
},
|
|
2874
|
+
gitAuthorName: {
|
|
2875
|
+
title: "Author Name",
|
|
2876
|
+
type: "string",
|
|
2877
|
+
description: `Sets the author name for the commit. The default value is 'Scaffolder'`
|
|
2878
|
+
},
|
|
2879
|
+
gitAuthorEmail: {
|
|
2880
|
+
title: "Author Email",
|
|
2881
|
+
type: "string",
|
|
2882
|
+
description: `Sets the author email for the commit.`
|
|
2737
2883
|
}
|
|
2738
2884
|
}
|
|
2739
2885
|
},
|
|
@@ -2758,7 +2904,10 @@ function createPublishBitbucketServerAction(options) {
|
|
|
2758
2904
|
description,
|
|
2759
2905
|
defaultBranch = "master",
|
|
2760
2906
|
repoVisibility = "private",
|
|
2761
|
-
enableLFS = false
|
|
2907
|
+
enableLFS = false,
|
|
2908
|
+
gitCommitMessage = "initial commit",
|
|
2909
|
+
gitAuthorName,
|
|
2910
|
+
gitAuthorEmail
|
|
2762
2911
|
} = ctx.input;
|
|
2763
2912
|
const { project, repo, host } = parseRepoUrl(repoUrl, integrations);
|
|
2764
2913
|
if (!project) {
|
|
@@ -2795,8 +2944,8 @@ function createPublishBitbucketServerAction(options) {
|
|
|
2795
2944
|
apiBaseUrl
|
|
2796
2945
|
});
|
|
2797
2946
|
const gitAuthorInfo = {
|
|
2798
|
-
name: config.getOptionalString("scaffolder.defaultAuthor.name"),
|
|
2799
|
-
email: config.getOptionalString("scaffolder.defaultAuthor.email")
|
|
2947
|
+
name: gitAuthorName ? gitAuthorName : config.getOptionalString("scaffolder.defaultAuthor.name"),
|
|
2948
|
+
email: gitAuthorEmail ? gitAuthorEmail : config.getOptionalString("scaffolder.defaultAuthor.email")
|
|
2800
2949
|
};
|
|
2801
2950
|
const auth = authConfig.token ? {
|
|
2802
2951
|
token
|
|
@@ -2810,9 +2959,7 @@ function createPublishBitbucketServerAction(options) {
|
|
|
2810
2959
|
auth,
|
|
2811
2960
|
defaultBranch,
|
|
2812
2961
|
logger: ctx.logger,
|
|
2813
|
-
commitMessage: config.getOptionalString(
|
|
2814
|
-
"scaffolder.defaultCommitMessage"
|
|
2815
|
-
),
|
|
2962
|
+
commitMessage: gitCommitMessage ? gitCommitMessage : config.getOptionalString("scaffolder.defaultCommitMessage"),
|
|
2816
2963
|
gitAuthorInfo
|
|
2817
2964
|
});
|
|
2818
2965
|
if (enableLFS) {
|
|
@@ -3095,6 +3242,8 @@ function createPublishGithubAction(options) {
|
|
|
3095
3242
|
homepage: homepage,
|
|
3096
3243
|
access: access,
|
|
3097
3244
|
bypassPullRequestAllowances: bypassPullRequestAllowances,
|
|
3245
|
+
requiredApprovingReviewCount: requiredApprovingReviewCount,
|
|
3246
|
+
restrictions: restrictions,
|
|
3098
3247
|
requireCodeOwnerReviews: requireCodeOwnerReviews,
|
|
3099
3248
|
dismissStaleReviews: dismissStaleReviews,
|
|
3100
3249
|
requiredStatusCheckContexts: requiredStatusCheckContexts,
|
|
@@ -3120,7 +3269,8 @@ function createPublishGithubAction(options) {
|
|
|
3120
3269
|
hasWiki: hasWiki,
|
|
3121
3270
|
hasIssues: hasIssues,
|
|
3122
3271
|
token: token,
|
|
3123
|
-
topics: topics
|
|
3272
|
+
topics: topics,
|
|
3273
|
+
requiredCommitSigning: requiredCommitSigning
|
|
3124
3274
|
}
|
|
3125
3275
|
},
|
|
3126
3276
|
output: {
|
|
@@ -3140,6 +3290,8 @@ function createPublishGithubAction(options) {
|
|
|
3140
3290
|
requireCodeOwnerReviews = false,
|
|
3141
3291
|
dismissStaleReviews = false,
|
|
3142
3292
|
bypassPullRequestAllowances,
|
|
3293
|
+
requiredApprovingReviewCount = 1,
|
|
3294
|
+
restrictions,
|
|
3143
3295
|
requiredStatusCheckContexts = [],
|
|
3144
3296
|
requireBranchesToBeUpToDate = true,
|
|
3145
3297
|
requiredConversationResolution = false,
|
|
@@ -3162,7 +3314,8 @@ function createPublishGithubAction(options) {
|
|
|
3162
3314
|
hasWiki = void 0,
|
|
3163
3315
|
hasIssues = void 0,
|
|
3164
3316
|
topics,
|
|
3165
|
-
token: providedToken
|
|
3317
|
+
token: providedToken,
|
|
3318
|
+
requiredCommitSigning = false
|
|
3166
3319
|
} = ctx.input;
|
|
3167
3320
|
const octokitOptions = await getOctokitOptions({
|
|
3168
3321
|
integrations,
|
|
@@ -3212,6 +3365,8 @@ function createPublishGithubAction(options) {
|
|
|
3212
3365
|
repo,
|
|
3213
3366
|
requireCodeOwnerReviews,
|
|
3214
3367
|
bypassPullRequestAllowances,
|
|
3368
|
+
requiredApprovingReviewCount,
|
|
3369
|
+
restrictions,
|
|
3215
3370
|
requiredStatusCheckContexts,
|
|
3216
3371
|
requireBranchesToBeUpToDate,
|
|
3217
3372
|
requiredConversationResolution,
|
|
@@ -3220,7 +3375,8 @@ function createPublishGithubAction(options) {
|
|
|
3220
3375
|
gitCommitMessage,
|
|
3221
3376
|
gitAuthorName,
|
|
3222
3377
|
gitAuthorEmail,
|
|
3223
|
-
dismissStaleReviews
|
|
3378
|
+
dismissStaleReviews,
|
|
3379
|
+
requiredCommitSigning
|
|
3224
3380
|
);
|
|
3225
3381
|
ctx.output("remoteUrl", remoteUrl);
|
|
3226
3382
|
ctx.output("repoContentsUrl", repoContentsUrl);
|
|
@@ -3931,6 +4087,7 @@ const createBuiltinActions = (options) => {
|
|
|
3931
4087
|
}),
|
|
3932
4088
|
createDebugLogAction(),
|
|
3933
4089
|
createCatalogRegisterAction({ catalogClient, integrations }),
|
|
4090
|
+
createFetchCatalogEntityAction({ catalogClient }),
|
|
3934
4091
|
createCatalogWriteAction(),
|
|
3935
4092
|
createFilesystemDeleteAction(),
|
|
3936
4093
|
createFilesystemRenameAction(),
|
|
@@ -5507,71 +5664,73 @@ _actions = new WeakMap();
|
|
|
5507
5664
|
const scaffolderActionsExtensionPoint = backendPluginApi.createExtensionPoint({
|
|
5508
5665
|
id: "scaffolder.actions"
|
|
5509
5666
|
});
|
|
5510
|
-
const scaffolderPlugin = backendPluginApi.createBackendPlugin(
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5667
|
+
const scaffolderPlugin = backendPluginApi.createBackendPlugin(
|
|
5668
|
+
(options) => ({
|
|
5669
|
+
id: "scaffolder",
|
|
5670
|
+
register(env) {
|
|
5671
|
+
const actionsExtensions = new ScaffolderActionsExtensionPointImpl();
|
|
5672
|
+
env.registerExtensionPoint(
|
|
5673
|
+
scaffolderActionsExtensionPoint,
|
|
5674
|
+
actionsExtensions
|
|
5675
|
+
);
|
|
5676
|
+
env.registerInit({
|
|
5677
|
+
deps: {
|
|
5678
|
+
logger: backendPluginApi.coreServices.logger,
|
|
5679
|
+
config: backendPluginApi.coreServices.config,
|
|
5680
|
+
reader: backendPluginApi.coreServices.urlReader,
|
|
5681
|
+
permissions: backendPluginApi.coreServices.permissions,
|
|
5682
|
+
database: backendPluginApi.coreServices.database,
|
|
5683
|
+
httpRouter: backendPluginApi.coreServices.httpRouter,
|
|
5684
|
+
catalogClient: pluginCatalogNode.catalogServiceRef
|
|
5685
|
+
},
|
|
5686
|
+
async init({
|
|
5687
|
+
logger,
|
|
5688
|
+
config,
|
|
5689
|
+
reader,
|
|
5690
|
+
database,
|
|
5691
|
+
httpRouter,
|
|
5692
|
+
catalogClient
|
|
5693
|
+
}) {
|
|
5694
|
+
const {
|
|
5695
|
+
additionalTemplateFilters,
|
|
5696
|
+
taskBroker,
|
|
5697
|
+
taskWorkers,
|
|
5698
|
+
additionalTemplateGlobals
|
|
5699
|
+
} = options;
|
|
5700
|
+
const log = backendCommon.loggerToWinstonLogger(logger);
|
|
5701
|
+
const actions = options.actions || [
|
|
5702
|
+
...actionsExtensions.actions,
|
|
5703
|
+
...createBuiltinActions({
|
|
5704
|
+
integrations: integration.ScmIntegrations.fromConfig(config),
|
|
5705
|
+
catalogClient,
|
|
5706
|
+
reader,
|
|
5707
|
+
config,
|
|
5708
|
+
additionalTemplateFilters,
|
|
5709
|
+
additionalTemplateGlobals
|
|
5710
|
+
})
|
|
5711
|
+
];
|
|
5712
|
+
const actionIds = actions.map((action) => action.id).join(", ");
|
|
5713
|
+
log.info(
|
|
5714
|
+
`Starting scaffolder with the following actions enabled ${actionIds}`
|
|
5715
|
+
);
|
|
5716
|
+
const router = await createRouter({
|
|
5717
|
+
logger: log,
|
|
5718
|
+
config,
|
|
5719
|
+
database,
|
|
5547
5720
|
catalogClient,
|
|
5548
5721
|
reader,
|
|
5549
|
-
|
|
5722
|
+
actions,
|
|
5723
|
+
taskBroker,
|
|
5724
|
+
taskWorkers,
|
|
5550
5725
|
additionalTemplateFilters,
|
|
5551
5726
|
additionalTemplateGlobals
|
|
5552
|
-
})
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
logger: log,
|
|
5560
|
-
config,
|
|
5561
|
-
database,
|
|
5562
|
-
catalogClient,
|
|
5563
|
-
reader,
|
|
5564
|
-
actions,
|
|
5565
|
-
taskBroker,
|
|
5566
|
-
taskWorkers,
|
|
5567
|
-
additionalTemplateFilters,
|
|
5568
|
-
additionalTemplateGlobals
|
|
5569
|
-
});
|
|
5570
|
-
httpRouter.use(router);
|
|
5571
|
-
}
|
|
5572
|
-
});
|
|
5573
|
-
}
|
|
5574
|
-
});
|
|
5727
|
+
});
|
|
5728
|
+
httpRouter.use(router);
|
|
5729
|
+
}
|
|
5730
|
+
});
|
|
5731
|
+
}
|
|
5732
|
+
})
|
|
5733
|
+
);
|
|
5575
5734
|
|
|
5576
5735
|
exports.DatabaseTaskStore = DatabaseTaskStore;
|
|
5577
5736
|
exports.ScaffolderEntitiesProcessor = ScaffolderEntitiesProcessor;
|
|
@@ -5582,6 +5741,7 @@ exports.createBuiltinActions = createBuiltinActions;
|
|
|
5582
5741
|
exports.createCatalogRegisterAction = createCatalogRegisterAction;
|
|
5583
5742
|
exports.createCatalogWriteAction = createCatalogWriteAction;
|
|
5584
5743
|
exports.createDebugLogAction = createDebugLogAction;
|
|
5744
|
+
exports.createFetchCatalogEntityAction = createFetchCatalogEntityAction;
|
|
5585
5745
|
exports.createFetchPlainAction = createFetchPlainAction;
|
|
5586
5746
|
exports.createFetchTemplateAction = createFetchTemplateAction;
|
|
5587
5747
|
exports.createFilesystemDeleteAction = createFilesystemDeleteAction;
|