@backstage/plugin-scaffolder-backend 1.9.0-next.3 → 1.9.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,58 @@
1
1
  # @backstage/plugin-scaffolder-backend
2
2
 
3
+ ## 1.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a20a0ea698: Added `requiredConversationResolution` template option to `github:repo:create`, `github:repo:push` and `publish:github`
8
+ - b32005e98a: Deprecated the `taskWorkers` option in RouterOptions in favor of `concurrentTasksLimit` which sets the limit of concurrent tasks in a single TaskWorker
9
+
10
+ TaskWorker can now run multiple (defaults to 10) tasks concurrently using the `concurrentTasksLimit` option available in both `RouterOptions` and `CreateWorkerOptions`.
11
+
12
+ To use the option to create a TaskWorker:
13
+
14
+ ```diff
15
+ const worker = await TaskWorker.create({
16
+ taskBroker,
17
+ actionRegistry,
18
+ integrations,
19
+ logger,
20
+ workingDirectory,
21
+ additionalTemplateFilters,
22
+ + concurrentTasksLimit: 10 // (1 to Infinity)
23
+ });
24
+ ```
25
+
26
+ - fc51bd8aa0: Add support for disabling Github repository wiki, issues and projects
27
+ - 0053d07bee: Update the `github:publish` action to allow passing wether to dismiss stale reviews on the protected default branch.
28
+
29
+ ### Patch Changes
30
+
31
+ - cb716004ef: Internal refactor to improve tests
32
+ - 935b66a646: Change step output template examples to use square bracket syntax.
33
+ - 884d749b14: Refactored to use `coreServices` from `@backstage/backend-plugin-api`.
34
+ - b05dcd5530: Move the `zod` dependency to a version that does not collide with other libraries
35
+ - 26404430bc: Use Json types from @backstage/types
36
+ - b07ccffad0: Backend now returns 'ui:options' value from template metadata, it can be used by all your custom scaffolder components.
37
+ - 309f2daca4: Updated dependency `esbuild` to `^0.16.0`.
38
+ - 3280711113: Updated dependency `msw` to `^0.49.0`.
39
+ - 19356df560: Updated dependency `zen-observable` to `^0.9.0`.
40
+ - c3fa90e184: Updated dependency `zen-observable` to `^0.10.0`.
41
+ - Updated dependencies
42
+ - @backstage/plugin-catalog-backend@1.6.0
43
+ - @backstage/catalog-client@1.2.0
44
+ - @backstage/backend-common@0.17.0
45
+ - @backstage/plugin-catalog-node@1.3.0
46
+ - @backstage/backend-tasks@0.4.0
47
+ - @backstage/errors@1.1.4
48
+ - @backstage/backend-plugin-api@0.2.0
49
+ - @backstage/integration@1.4.1
50
+ - @backstage/plugin-auth-node@0.2.8
51
+ - @backstage/types@1.0.2
52
+ - @backstage/catalog-model@1.1.4
53
+ - @backstage/config@1.0.5
54
+ - @backstage/plugin-scaffolder-common@1.2.3
55
+
3
56
  ## 1.9.0-next.3
4
57
 
5
58
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-backend",
3
- "version": "1.9.0-next.3",
3
+ "version": "1.9.0",
4
4
  "main": "../dist/index.cjs.js",
5
5
  "types": "../dist/index.alpha.d.ts"
6
6
  }
@@ -299,6 +299,7 @@ apps?: string[] | undefined;
299
299
  } | undefined;
300
300
  requiredStatusCheckContexts?: string[] | undefined;
301
301
  requireBranchesToBeUpToDate?: boolean | undefined;
302
+ requiredConversationResolution?: boolean | undefined;
302
303
  repoVisibility?: "internal" | "private" | "public" | undefined;
303
304
  collaborators?: ({
304
305
  user: string;
@@ -311,6 +312,9 @@ access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
311
312
  username: string;
312
313
  access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
313
314
  })[] | undefined;
315
+ hasProjects?: boolean | undefined;
316
+ hasWiki?: boolean | undefined;
317
+ hasIssues?: boolean | undefined;
314
318
  token?: string | undefined;
315
319
  topics?: string[] | undefined;
316
320
  }>;
@@ -343,6 +347,7 @@ apps?: string[];
343
347
  } | undefined;
344
348
  requiredStatusCheckContexts?: string[] | undefined;
345
349
  requireBranchesToBeUpToDate?: boolean | undefined;
350
+ requiredConversationResolution?: boolean | undefined;
346
351
  sourcePath?: string | undefined;
347
352
  token?: string | undefined;
348
353
  }>;
@@ -512,6 +517,7 @@ requireCodeOwnerReviews?: boolean | undefined;
512
517
  dismissStaleReviews?: boolean | undefined;
513
518
  requiredStatusCheckContexts?: string[] | undefined;
514
519
  requireBranchesToBeUpToDate?: boolean | undefined;
520
+ requiredConversationResolution?: boolean | undefined;
515
521
  repoVisibility?: "internal" | "private" | "public" | undefined;
516
522
  collaborators?: ({
517
523
  user: string;
@@ -524,6 +530,9 @@ access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
524
530
  username: string;
525
531
  access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
526
532
  })[] | undefined;
533
+ hasProjects?: boolean | undefined;
534
+ hasWiki?: boolean | undefined;
535
+ hasIssues?: boolean | undefined;
527
536
  token?: string | undefined;
528
537
  topics?: string[] | undefined;
529
538
  }>;
@@ -299,6 +299,7 @@ apps?: string[] | undefined;
299
299
  } | undefined;
300
300
  requiredStatusCheckContexts?: string[] | undefined;
301
301
  requireBranchesToBeUpToDate?: boolean | undefined;
302
+ requiredConversationResolution?: boolean | undefined;
302
303
  repoVisibility?: "internal" | "private" | "public" | undefined;
303
304
  collaborators?: ({
304
305
  user: string;
@@ -311,6 +312,9 @@ access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
311
312
  username: string;
312
313
  access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
313
314
  })[] | undefined;
315
+ hasProjects?: boolean | undefined;
316
+ hasWiki?: boolean | undefined;
317
+ hasIssues?: boolean | undefined;
314
318
  token?: string | undefined;
315
319
  topics?: string[] | undefined;
316
320
  }>;
@@ -343,6 +347,7 @@ apps?: string[];
343
347
  } | undefined;
344
348
  requiredStatusCheckContexts?: string[] | undefined;
345
349
  requireBranchesToBeUpToDate?: boolean | undefined;
350
+ requiredConversationResolution?: boolean | undefined;
346
351
  sourcePath?: string | undefined;
347
352
  token?: string | undefined;
348
353
  }>;
@@ -512,6 +517,7 @@ requireCodeOwnerReviews?: boolean | undefined;
512
517
  dismissStaleReviews?: boolean | undefined;
513
518
  requiredStatusCheckContexts?: string[] | undefined;
514
519
  requireBranchesToBeUpToDate?: boolean | undefined;
520
+ requiredConversationResolution?: boolean | undefined;
515
521
  repoVisibility?: "internal" | "private" | "public" | undefined;
516
522
  collaborators?: ({
517
523
  user: string;
@@ -524,6 +530,9 @@ access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
524
530
  username: string;
525
531
  access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
526
532
  })[] | undefined;
533
+ hasProjects?: boolean | undefined;
534
+ hasWiki?: boolean | undefined;
535
+ hasIssues?: boolean | undefined;
527
536
  token?: string | undefined;
528
537
  topics?: string[] | undefined;
529
538
  }>;
package/dist/index.cjs.js CHANGED
@@ -998,6 +998,7 @@ const enableBranchProtectionOnDefaultRepoBranch = async ({
998
998
  bypassPullRequestAllowances,
999
999
  requiredStatusCheckContexts = [],
1000
1000
  requireBranchesToBeUpToDate = true,
1001
+ requiredConversationResolution = false,
1001
1002
  defaultBranch = "master",
1002
1003
  enforceAdmins = true,
1003
1004
  dismissStaleReviews = false
@@ -1022,7 +1023,8 @@ const enableBranchProtectionOnDefaultRepoBranch = async ({
1022
1023
  require_code_owner_reviews: requireCodeOwnerReviews,
1023
1024
  bypass_pull_request_allowances: bypassPullRequestAllowances,
1024
1025
  dismiss_stale_reviews: dismissStaleReviews
1025
- }
1026
+ },
1027
+ required_conversation_resolution: requiredConversationResolution
1026
1028
  });
1027
1029
  } catch (e) {
1028
1030
  errors.assertError(e);
@@ -1088,7 +1090,7 @@ async function getOctokitOptions(options) {
1088
1090
  previews: ["nebula-preview"]
1089
1091
  };
1090
1092
  }
1091
- async function createGithubRepoWithCollaboratorsAndTopics(client, repo, owner, repoVisibility, description, homepage, deleteBranchOnMerge, allowMergeCommit, allowSquashMerge, allowRebaseMerge, allowAutoMerge, access, collaborators, topics, logger) {
1093
+ async function createGithubRepoWithCollaboratorsAndTopics(client, repo, owner, repoVisibility, description, homepage, deleteBranchOnMerge, allowMergeCommit, allowSquashMerge, allowRebaseMerge, allowAutoMerge, access, collaborators, hasProjects, hasWiki, hasIssues, topics, logger) {
1092
1094
  const user = await client.rest.users.getByUsername({
1093
1095
  username: owner
1094
1096
  });
@@ -1103,7 +1105,10 @@ async function createGithubRepoWithCollaboratorsAndTopics(client, repo, owner, r
1103
1105
  allow_squash_merge: allowSquashMerge,
1104
1106
  allow_rebase_merge: allowRebaseMerge,
1105
1107
  allow_auto_merge: allowAutoMerge,
1106
- homepage
1108
+ homepage,
1109
+ has_projects: hasProjects,
1110
+ has_wiki: hasWiki,
1111
+ has_issues: hasIssues
1107
1112
  }) : client.rest.repos.createForAuthenticatedUser({
1108
1113
  name: repo,
1109
1114
  private: repoVisibility === "private",
@@ -1113,7 +1118,10 @@ async function createGithubRepoWithCollaboratorsAndTopics(client, repo, owner, r
1113
1118
  allow_squash_merge: allowSquashMerge,
1114
1119
  allow_rebase_merge: allowRebaseMerge,
1115
1120
  allow_auto_merge: allowAutoMerge,
1116
- homepage
1121
+ homepage,
1122
+ has_projects: hasProjects,
1123
+ has_wiki: hasWiki,
1124
+ has_issues: hasIssues
1117
1125
  });
1118
1126
  let newRepo;
1119
1127
  try {
@@ -1188,7 +1196,7 @@ async function createGithubRepoWithCollaboratorsAndTopics(client, repo, owner, r
1188
1196
  }
1189
1197
  return newRepo;
1190
1198
  }
1191
- async function initRepoPushAndProtect(remoteUrl, password, workspacePath, sourcePath, defaultBranch, protectDefaultBranch, protectEnforceAdmins, owner, client, repo, requireCodeOwnerReviews, bypassPullRequestAllowances, requiredStatusCheckContexts, requireBranchesToBeUpToDate, config, logger, gitCommitMessage, gitAuthorName, gitAuthorEmail, dismissStaleReviews) {
1199
+ async function initRepoPushAndProtect(remoteUrl, password, workspacePath, sourcePath, defaultBranch, protectDefaultBranch, protectEnforceAdmins, owner, client, repo, requireCodeOwnerReviews, bypassPullRequestAllowances, requiredStatusCheckContexts, requireBranchesToBeUpToDate, requiredConversationResolution, config, logger, gitCommitMessage, gitAuthorName, gitAuthorEmail, dismissStaleReviews) {
1192
1200
  const gitAuthorInfo = {
1193
1201
  name: gitAuthorName ? gitAuthorName : config.getOptionalString("scaffolder.defaultAuthor.name"),
1194
1202
  email: gitAuthorEmail ? gitAuthorEmail : config.getOptionalString("scaffolder.defaultAuthor.email")
@@ -1218,6 +1226,7 @@ async function initRepoPushAndProtect(remoteUrl, password, workspacePath, source
1218
1226
  requireCodeOwnerReviews,
1219
1227
  requiredStatusCheckContexts,
1220
1228
  requireBranchesToBeUpToDate,
1229
+ requiredConversationResolution,
1221
1230
  enforceAdmins: protectEnforceAdmins,
1222
1231
  dismissStaleReviews
1223
1232
  });
@@ -1419,6 +1428,11 @@ const requireBranchesToBeUpToDate = {
1419
1428
  description: `Require branches to be up to date before merging. The default value is 'true'`,
1420
1429
  type: "boolean"
1421
1430
  };
1431
+ const requiredConversationResolution = {
1432
+ title: "Required Conversation Resolution",
1433
+ description: "Requires all conversations on code to be resolved before a pull request can be merged into this branch",
1434
+ type: "boolean"
1435
+ };
1422
1436
  const repoVisibility = {
1423
1437
  title: "Repository Visibility",
1424
1438
  type: "string",
@@ -1485,6 +1499,21 @@ const collaborators = {
1485
1499
  oneOf: [{ required: ["user"] }, { required: ["team"] }]
1486
1500
  }
1487
1501
  };
1502
+ const hasProjects = {
1503
+ title: "Enable projects",
1504
+ type: "boolean",
1505
+ description: `Enable projects for the repository. The default value is 'true' unless the organization has disabled repository projects`
1506
+ };
1507
+ const hasWiki = {
1508
+ title: "Enable the wiki",
1509
+ type: "boolean",
1510
+ description: `Enable the wiki for the repository. The default value is 'true'`
1511
+ };
1512
+ const hasIssues = {
1513
+ title: "Enable issues",
1514
+ type: "boolean",
1515
+ description: `Enable issues for the repository. The default value is 'true'`
1516
+ };
1488
1517
  const token = {
1489
1518
  title: "Authentication Token",
1490
1519
  type: "string",
@@ -1576,6 +1605,7 @@ function createGithubRepoCreateAction(options) {
1576
1605
  bypassPullRequestAllowances: bypassPullRequestAllowances,
1577
1606
  requiredStatusCheckContexts: requiredStatusCheckContexts,
1578
1607
  requireBranchesToBeUpToDate: requireBranchesToBeUpToDate,
1608
+ requiredConversationResolution: requiredConversationResolution,
1579
1609
  repoVisibility: repoVisibility,
1580
1610
  deleteBranchOnMerge: deleteBranchOnMerge,
1581
1611
  allowMergeCommit: allowMergeCommit,
@@ -1583,6 +1613,9 @@ function createGithubRepoCreateAction(options) {
1583
1613
  allowRebaseMerge: allowRebaseMerge,
1584
1614
  allowAutoMerge: allowAutoMerge,
1585
1615
  collaborators: collaborators,
1616
+ hasProjects: hasProjects,
1617
+ hasWiki: hasWiki,
1618
+ hasIssues: hasIssues,
1586
1619
  token: token,
1587
1620
  topics: topics
1588
1621
  }
@@ -1608,6 +1641,9 @@ function createGithubRepoCreateAction(options) {
1608
1641
  allowRebaseMerge = true,
1609
1642
  allowAutoMerge = false,
1610
1643
  collaborators,
1644
+ hasProjects = void 0,
1645
+ hasWiki = void 0,
1646
+ hasIssues = void 0,
1611
1647
  topics,
1612
1648
  token: providedToken
1613
1649
  } = ctx.input;
@@ -1636,6 +1672,9 @@ function createGithubRepoCreateAction(options) {
1636
1672
  allowAutoMerge,
1637
1673
  access,
1638
1674
  collaborators,
1675
+ hasProjects,
1676
+ hasWiki,
1677
+ hasIssues,
1639
1678
  topics,
1640
1679
  ctx.logger
1641
1680
  );
@@ -1660,6 +1699,7 @@ function createGithubRepoPushAction(options) {
1660
1699
  requiredStatusCheckContexts: requiredStatusCheckContexts,
1661
1700
  bypassPullRequestAllowances: bypassPullRequestAllowances,
1662
1701
  requireBranchesToBeUpToDate: requireBranchesToBeUpToDate,
1702
+ requiredConversationResolution: requiredConversationResolution,
1663
1703
  defaultBranch: defaultBranch,
1664
1704
  protectDefaultBranch: protectDefaultBranch,
1665
1705
  protectEnforceAdmins: protectEnforceAdmins,
@@ -1692,6 +1732,7 @@ function createGithubRepoPushAction(options) {
1692
1732
  bypassPullRequestAllowances,
1693
1733
  requiredStatusCheckContexts = [],
1694
1734
  requireBranchesToBeUpToDate = true,
1735
+ requiredConversationResolution = false,
1695
1736
  token: providedToken
1696
1737
  } = ctx.input;
1697
1738
  const { owner, repo } = parseRepoUrl(repoUrl, integrations);
@@ -1723,6 +1764,7 @@ function createGithubRepoPushAction(options) {
1723
1764
  bypassPullRequestAllowances,
1724
1765
  requiredStatusCheckContexts,
1725
1766
  requireBranchesToBeUpToDate,
1767
+ requiredConversationResolution,
1726
1768
  config,
1727
1769
  ctx.logger,
1728
1770
  gitCommitMessage,
@@ -2945,6 +2987,7 @@ function createPublishGithubAction(options) {
2945
2987
  dismissStaleReviews: dismissStaleReviews,
2946
2988
  requiredStatusCheckContexts: requiredStatusCheckContexts,
2947
2989
  requireBranchesToBeUpToDate: requireBranchesToBeUpToDate,
2990
+ requiredConversationResolution: requiredConversationResolution,
2948
2991
  repoVisibility: repoVisibility,
2949
2992
  defaultBranch: defaultBranch,
2950
2993
  protectDefaultBranch: protectDefaultBranch,
@@ -2959,6 +3002,9 @@ function createPublishGithubAction(options) {
2959
3002
  allowAutoMerge: allowAutoMerge,
2960
3003
  sourcePath: sourcePath,
2961
3004
  collaborators: collaborators,
3005
+ hasProjects: hasProjects,
3006
+ hasWiki: hasWiki,
3007
+ hasIssues: hasIssues,
2962
3008
  token: token,
2963
3009
  topics: topics
2964
3010
  }
@@ -2982,6 +3028,7 @@ function createPublishGithubAction(options) {
2982
3028
  bypassPullRequestAllowances,
2983
3029
  requiredStatusCheckContexts = [],
2984
3030
  requireBranchesToBeUpToDate = true,
3031
+ requiredConversationResolution = false,
2985
3032
  repoVisibility = "private",
2986
3033
  defaultBranch = "master",
2987
3034
  protectDefaultBranch = true,
@@ -2995,6 +3042,9 @@ function createPublishGithubAction(options) {
2995
3042
  allowRebaseMerge = true,
2996
3043
  allowAutoMerge = false,
2997
3044
  collaborators,
3045
+ hasProjects = void 0,
3046
+ hasWiki = void 0,
3047
+ hasIssues = void 0,
2998
3048
  topics,
2999
3049
  token: providedToken
3000
3050
  } = ctx.input;
@@ -3023,6 +3073,9 @@ function createPublishGithubAction(options) {
3023
3073
  allowAutoMerge,
3024
3074
  access,
3025
3075
  collaborators,
3076
+ hasProjects,
3077
+ hasWiki,
3078
+ hasIssues,
3026
3079
  topics,
3027
3080
  ctx.logger
3028
3081
  );
@@ -3043,6 +3096,7 @@ function createPublishGithubAction(options) {
3043
3096
  bypassPullRequestAllowances,
3044
3097
  requiredStatusCheckContexts,
3045
3098
  requireBranchesToBeUpToDate,
3099
+ requiredConversationResolution,
3046
3100
  config,
3047
3101
  ctx.logger,
3048
3102
  gitCommitMessage,
@@ -4951,6 +5005,7 @@ async function createRouter(options) {
4951
5005
  res.json({
4952
5006
  title: (_b = template.metadata.title) != null ? _b : template.metadata.name,
4953
5007
  description: template.metadata.description,
5008
+ "ui:options": template.metadata["ui:options"],
4954
5009
  steps: parameters.map((schema) => {
4955
5010
  var _a2;
4956
5011
  return {