@backstage/plugin-scaffolder-backend 1.9.0-next.2 → 1.9.0-next.3

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,31 @@
1
1
  # @backstage/plugin-scaffolder-backend
2
2
 
3
+ ## 1.9.0-next.3
4
+
5
+ ### Minor Changes
6
+
7
+ - 0053d07bee: Update the `github:publish` action to allow passing wether to dismiss stale reviews on the protected default branch.
8
+
9
+ ### Patch Changes
10
+
11
+ - 935b66a646: Change step output template examples to use square bracket syntax.
12
+ - b05dcd5530: Move the `zod` dependency to a version that does not collide with other libraries
13
+ - 309f2daca4: Updated dependency `esbuild` to `^0.16.0`.
14
+ - Updated dependencies
15
+ - @backstage/plugin-catalog-backend@1.6.0-next.3
16
+ - @backstage/backend-tasks@0.4.0-next.3
17
+ - @backstage/backend-common@0.17.0-next.3
18
+ - @backstage/backend-plugin-api@0.2.0-next.3
19
+ - @backstage/catalog-client@1.2.0-next.1
20
+ - @backstage/catalog-model@1.1.4-next.1
21
+ - @backstage/config@1.0.5-next.1
22
+ - @backstage/errors@1.1.4-next.1
23
+ - @backstage/integration@1.4.1-next.1
24
+ - @backstage/types@1.0.2-next.1
25
+ - @backstage/plugin-auth-node@0.2.8-next.3
26
+ - @backstage/plugin-catalog-node@1.3.0-next.3
27
+ - @backstage/plugin-scaffolder-common@1.2.3-next.1
28
+
3
29
  ## 1.9.0-next.2
4
30
 
5
31
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-backend",
3
- "version": "1.9.0-next.2",
3
+ "version": "1.9.0-next.3",
4
4
  "main": "../dist/index.cjs.js",
5
5
  "types": "../dist/index.alpha.d.ts"
6
6
  }
@@ -335,6 +335,7 @@ gitCommitMessage?: string | undefined;
335
335
  gitAuthorName?: string | undefined;
336
336
  gitAuthorEmail?: string | undefined;
337
337
  requireCodeOwnerReviews?: boolean | undefined;
338
+ dismissStaleReviews?: boolean | undefined;
338
339
  bypassPullRequestAllowances?: {
339
340
  users?: string[];
340
341
  teams?: string[];
@@ -508,6 +509,7 @@ teams?: string[];
508
509
  apps?: string[];
509
510
  } | undefined;
510
511
  requireCodeOwnerReviews?: boolean | undefined;
512
+ dismissStaleReviews?: boolean | undefined;
511
513
  requiredStatusCheckContexts?: string[] | undefined;
512
514
  requireBranchesToBeUpToDate?: boolean | undefined;
513
515
  repoVisibility?: "internal" | "private" | "public" | undefined;
@@ -335,6 +335,7 @@ gitCommitMessage?: string | undefined;
335
335
  gitAuthorName?: string | undefined;
336
336
  gitAuthorEmail?: string | undefined;
337
337
  requireCodeOwnerReviews?: boolean | undefined;
338
+ dismissStaleReviews?: boolean | undefined;
338
339
  bypassPullRequestAllowances?: {
339
340
  users?: string[];
340
341
  teams?: string[];
@@ -508,6 +509,7 @@ teams?: string[];
508
509
  apps?: string[];
509
510
  } | undefined;
510
511
  requireCodeOwnerReviews?: boolean | undefined;
512
+ dismissStaleReviews?: boolean | undefined;
511
513
  requiredStatusCheckContexts?: string[] | undefined;
512
514
  requireBranchesToBeUpToDate?: boolean | undefined;
513
515
  repoVisibility?: "internal" | "private" | "public" | undefined;
package/dist/index.cjs.js CHANGED
@@ -999,7 +999,8 @@ const enableBranchProtectionOnDefaultRepoBranch = async ({
999
999
  requiredStatusCheckContexts = [],
1000
1000
  requireBranchesToBeUpToDate = true,
1001
1001
  defaultBranch = "master",
1002
- enforceAdmins = true
1002
+ enforceAdmins = true,
1003
+ dismissStaleReviews = false
1003
1004
  }) => {
1004
1005
  const tryOnce = async () => {
1005
1006
  try {
@@ -1019,7 +1020,8 @@ const enableBranchProtectionOnDefaultRepoBranch = async ({
1019
1020
  required_pull_request_reviews: {
1020
1021
  required_approving_review_count: 1,
1021
1022
  require_code_owner_reviews: requireCodeOwnerReviews,
1022
- bypass_pull_request_allowances: bypassPullRequestAllowances
1023
+ bypass_pull_request_allowances: bypassPullRequestAllowances,
1024
+ dismiss_stale_reviews: dismissStaleReviews
1023
1025
  }
1024
1026
  });
1025
1027
  } catch (e) {
@@ -1186,7 +1188,7 @@ async function createGithubRepoWithCollaboratorsAndTopics(client, repo, owner, r
1186
1188
  }
1187
1189
  return newRepo;
1188
1190
  }
1189
- async function initRepoPushAndProtect(remoteUrl, password, workspacePath, sourcePath, defaultBranch, protectDefaultBranch, protectEnforceAdmins, owner, client, repo, requireCodeOwnerReviews, bypassPullRequestAllowances, requiredStatusCheckContexts, requireBranchesToBeUpToDate, config, logger, gitCommitMessage, gitAuthorName, gitAuthorEmail) {
1191
+ async function initRepoPushAndProtect(remoteUrl, password, workspacePath, sourcePath, defaultBranch, protectDefaultBranch, protectEnforceAdmins, owner, client, repo, requireCodeOwnerReviews, bypassPullRequestAllowances, requiredStatusCheckContexts, requireBranchesToBeUpToDate, config, logger, gitCommitMessage, gitAuthorName, gitAuthorEmail, dismissStaleReviews) {
1190
1192
  const gitAuthorInfo = {
1191
1193
  name: gitAuthorName ? gitAuthorName : config.getOptionalString("scaffolder.defaultAuthor.name"),
1192
1194
  email: gitAuthorEmail ? gitAuthorEmail : config.getOptionalString("scaffolder.defaultAuthor.email")
@@ -1216,7 +1218,8 @@ async function initRepoPushAndProtect(remoteUrl, password, workspacePath, source
1216
1218
  requireCodeOwnerReviews,
1217
1219
  requiredStatusCheckContexts,
1218
1220
  requireBranchesToBeUpToDate,
1219
- enforceAdmins: protectEnforceAdmins
1221
+ enforceAdmins: protectEnforceAdmins,
1222
+ dismissStaleReviews
1220
1223
  });
1221
1224
  } catch (e) {
1222
1225
  errors.assertError(e);
@@ -1398,6 +1401,11 @@ const requireCodeOwnerReviews = {
1398
1401
  description: "Require an approved review in PR including files with a designated Code Owner",
1399
1402
  type: "boolean"
1400
1403
  };
1404
+ const dismissStaleReviews = {
1405
+ title: "Dismiss Stale Reviews",
1406
+ description: "New reviewable commits pushed to a matching branch will dismiss pull request review approvals.",
1407
+ type: "boolean"
1408
+ };
1401
1409
  const requiredStatusCheckContexts = {
1402
1410
  title: "Required Status Check Contexts",
1403
1411
  description: "The list of status checks to require in order to merge into this branch",
@@ -1648,6 +1656,7 @@ function createGithubRepoPushAction(options) {
1648
1656
  properties: {
1649
1657
  repoUrl: repoUrl,
1650
1658
  requireCodeOwnerReviews: requireCodeOwnerReviews,
1659
+ dismissStaleReviews: dismissStaleReviews,
1651
1660
  requiredStatusCheckContexts: requiredStatusCheckContexts,
1652
1661
  bypassPullRequestAllowances: bypassPullRequestAllowances,
1653
1662
  requireBranchesToBeUpToDate: requireBranchesToBeUpToDate,
@@ -1679,6 +1688,7 @@ function createGithubRepoPushAction(options) {
1679
1688
  gitAuthorName,
1680
1689
  gitAuthorEmail,
1681
1690
  requireCodeOwnerReviews = false,
1691
+ dismissStaleReviews = false,
1682
1692
  bypassPullRequestAllowances,
1683
1693
  requiredStatusCheckContexts = [],
1684
1694
  requireBranchesToBeUpToDate = true,
@@ -1717,7 +1727,8 @@ function createGithubRepoPushAction(options) {
1717
1727
  ctx.logger,
1718
1728
  gitCommitMessage,
1719
1729
  gitAuthorName,
1720
- gitAuthorEmail
1730
+ gitAuthorEmail,
1731
+ dismissStaleReviews
1721
1732
  );
1722
1733
  ctx.output("remoteUrl", remoteUrl);
1723
1734
  ctx.output("repoContentsUrl", repoContentsUrl);
@@ -2931,6 +2942,7 @@ function createPublishGithubAction(options) {
2931
2942
  access: access,
2932
2943
  bypassPullRequestAllowances: bypassPullRequestAllowances,
2933
2944
  requireCodeOwnerReviews: requireCodeOwnerReviews,
2945
+ dismissStaleReviews: dismissStaleReviews,
2934
2946
  requiredStatusCheckContexts: requiredStatusCheckContexts,
2935
2947
  requireBranchesToBeUpToDate: requireBranchesToBeUpToDate,
2936
2948
  repoVisibility: repoVisibility,
@@ -2966,6 +2978,7 @@ function createPublishGithubAction(options) {
2966
2978
  homepage,
2967
2979
  access,
2968
2980
  requireCodeOwnerReviews = false,
2981
+ dismissStaleReviews = false,
2969
2982
  bypassPullRequestAllowances,
2970
2983
  requiredStatusCheckContexts = [],
2971
2984
  requireBranchesToBeUpToDate = true,
@@ -3034,7 +3047,8 @@ function createPublishGithubAction(options) {
3034
3047
  ctx.logger,
3035
3048
  gitCommitMessage,
3036
3049
  gitAuthorName,
3037
- gitAuthorEmail
3050
+ gitAuthorEmail,
3051
+ dismissStaleReviews
3038
3052
  );
3039
3053
  ctx.output("remoteUrl", remoteUrl);
3040
3054
  ctx.output("repoContentsUrl", repoContentsUrl);