@backstage/plugin-scaffolder-backend 0.0.0-nightly-20220711024820 → 0.0.0-nightly-20220714025131

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,6 +1,6 @@
1
1
  # @backstage/plugin-scaffolder-backend
2
2
 
3
- ## 0.0.0-nightly-20220711024820
3
+ ## 0.0.0-nightly-20220714025131
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -11,13 +11,16 @@
11
11
  ### Patch Changes
12
12
 
13
13
  - 801d606909: Improve error messaging when passing in malformed auth
14
+ - 089d846962: Fix issues with optional directories and files
14
15
  - ea6dcb84a4: Don't resolve symlinks, treat them as binary files and copy them as-is
15
16
  - af02f54483: new setUserAsOwner flag for publish:gitlab action
16
17
 
17
18
  The field default is `false`. When true it will use the token configured in the gitlab integration for the matching host, to try and set the user logged in via `repoUrlPicker` `requestUserCredentials` OAuth flow as owner of the repository created in GitLab.
18
19
 
19
20
  - a70869e775: Updated dependency `msw` to `^0.43.0`.
21
+ - 4e9a90e307: Updated dependency `luxon` to `^3.0.0`.
20
22
  - 72622d9143: Updated dependency `yaml` to `^2.0.0`.
23
+ - 8006d0f9bf: Updated dependency `msw` to `^0.44.0`.
21
24
  - 679b32172e: Updated dependency `knex` to `^2.0.0`.
22
25
  - 511f49ee43: Updated dependency `octokit` to `^2.0.0`.
23
26
  - 735853353b: Updated dependency `@octokit/webhooks` to `^10.0.0`.
@@ -30,16 +33,45 @@
30
33
  - SNYK-JS-PARSEURL-2935947
31
34
  - SNYK-JS-PARSEURL-2936249
32
35
 
36
+ - 945a27fa6a: Add sourcePath option to publish:gerrit action
37
+ - 1764296a68: Allow to create Gerrit project using default owner
33
38
  - Updated dependencies
34
- - @backstage/backend-plugin-api@0.0.0-nightly-20220711024820
35
- - @backstage/backend-common@0.0.0-nightly-20220711024820
36
- - @backstage/plugin-catalog-backend@0.0.0-nightly-20220711024820
37
- - @backstage/catalog-model@0.0.0-nightly-20220711024820
38
- - @backstage/plugin-catalog-node@0.0.0-nightly-20220711024820
39
- - @backstage/catalog-client@0.0.0-nightly-20220711024820
40
- - @backstage/integration@0.0.0-nightly-20220711024820
41
- - @backstage/errors@0.0.0-nightly-20220711024820
42
- - @backstage/plugin-scaffolder-common@0.0.0-nightly-20220711024820
39
+ - @backstage/backend-plugin-api@0.0.0-nightly-20220714025131
40
+ - @backstage/plugin-catalog-backend@0.0.0-nightly-20220714025131
41
+ - @backstage/backend-common@0.0.0-nightly-20220714025131
42
+ - @backstage/catalog-model@0.0.0-nightly-20220714025131
43
+ - @backstage/plugin-catalog-node@0.0.0-nightly-20220714025131
44
+ - @backstage/integration@0.0.0-nightly-20220714025131
45
+ - @backstage/catalog-client@0.0.0-nightly-20220714025131
46
+ - @backstage/errors@0.0.0-nightly-20220714025131
47
+ - @backstage/plugin-scaffolder-common@0.0.0-nightly-20220714025131
48
+
49
+ ## 1.4.0-next.3
50
+
51
+ ### Minor Changes
52
+
53
+ - 91c1d12123: Export experimental `scaffolderCatalogExtension` for the new backend system. This export is not considered stable and should not be used in production.
54
+
55
+ ### Patch Changes
56
+
57
+ - ea6dcb84a4: Don't resolve symlinks, treat them as binary files and copy them as-is
58
+ - af02f54483: new setUserAsOwner flag for publish:gitlab action
59
+
60
+ The field default is `false`. When true it will use the token configured in the gitlab integration for the matching host, to try and set the user logged in via `repoUrlPicker` `requestUserCredentials` OAuth flow as owner of the repository created in GitLab.
61
+
62
+ - a70869e775: Updated dependency `msw` to `^0.43.0`.
63
+ - 4e9a90e307: Updated dependency `luxon` to `^3.0.0`.
64
+ - 72622d9143: Updated dependency `yaml` to `^2.0.0`.
65
+ - 511f49ee43: Updated dependency `octokit` to `^2.0.0`.
66
+ - 735853353b: Updated dependency `@octokit/webhooks` to `^10.0.0`.
67
+ - Updated dependencies
68
+ - @backstage/backend-plugin-api@0.1.0-next.0
69
+ - @backstage/plugin-catalog-backend@1.3.0-next.3
70
+ - @backstage/plugin-catalog-node@1.0.0-next.0
71
+ - @backstage/backend-common@0.14.1-next.3
72
+ - @backstage/catalog-client@1.0.4-next.2
73
+ - @backstage/integration@1.2.2-next.3
74
+ - @backstage/catalog-model@1.1.0-next.3
43
75
 
44
76
  ## 1.4.0-next.2
45
77
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-backend",
3
- "version": "0.0.0-nightly-20220711024820",
3
+ "version": "0.0.0-nightly-20220714025131",
4
4
  "main": "../dist/index.cjs.js",
5
5
  "types": "../dist/index.alpha.d.ts"
6
6
  }
@@ -268,7 +268,7 @@ allowSquashMerge?: boolean | undefined;
268
268
  allowMergeCommit?: boolean | undefined;
269
269
  requireCodeOwnerReviews?: boolean | undefined;
270
270
  requiredStatusCheckContexts?: string[] | undefined;
271
- repoVisibility?: "private" | "public" | "internal" | undefined;
271
+ repoVisibility?: "public" | "private" | "internal" | undefined;
272
272
  collaborators?: ({
273
273
  user: string;
274
274
  access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
@@ -359,7 +359,7 @@ export declare function createPublishBitbucketAction(options: {
359
359
  repoUrl: string;
360
360
  description?: string | undefined;
361
361
  defaultBranch?: string | undefined;
362
- repoVisibility?: "private" | "public" | undefined;
362
+ repoVisibility?: "public" | "private" | undefined;
363
363
  sourcePath?: string | undefined;
364
364
  enableLFS?: boolean | undefined;
365
365
  token?: string | undefined;
@@ -380,7 +380,7 @@ export declare function createPublishBitbucketCloudAction(options: {
380
380
  repoUrl: string;
381
381
  description?: string | undefined;
382
382
  defaultBranch?: string | undefined;
383
- repoVisibility?: "private" | "public" | undefined;
383
+ repoVisibility?: "public" | "private" | undefined;
384
384
  sourcePath?: string | undefined;
385
385
  token?: string | undefined;
386
386
  }>;
@@ -397,7 +397,7 @@ export declare function createPublishBitbucketServerAction(options: {
397
397
  repoUrl: string;
398
398
  description?: string | undefined;
399
399
  defaultBranch?: string | undefined;
400
- repoVisibility?: "private" | "public" | undefined;
400
+ repoVisibility?: "public" | "private" | undefined;
401
401
  sourcePath?: string | undefined;
402
402
  enableLFS?: boolean | undefined;
403
403
  token?: string | undefined;
@@ -433,6 +433,7 @@ defaultBranch?: string | undefined;
433
433
  gitCommitMessage?: string | undefined;
434
434
  gitAuthorName?: string | undefined;
435
435
  gitAuthorEmail?: string | undefined;
436
+ sourcePath?: string | undefined;
436
437
  }>;
437
438
 
438
439
  /**
@@ -461,7 +462,7 @@ allowMergeCommit?: boolean | undefined;
461
462
  sourcePath?: string | undefined;
462
463
  requireCodeOwnerReviews?: boolean | undefined;
463
464
  requiredStatusCheckContexts?: string[] | undefined;
464
- repoVisibility?: "private" | "public" | "internal" | undefined;
465
+ repoVisibility?: "public" | "private" | "internal" | undefined;
465
466
  collaborators?: ({
466
467
  user: string;
467
468
  access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
@@ -504,7 +505,7 @@ export declare function createPublishGitlabAction(options: {
504
505
  }): TemplateAction< {
505
506
  repoUrl: string;
506
507
  defaultBranch?: string | undefined;
507
- repoVisibility?: "private" | "public" | "internal" | undefined;
508
+ repoVisibility?: "public" | "private" | "internal" | undefined;
508
509
  sourcePath?: string | undefined;
509
510
  token?: string | undefined;
510
511
  gitCommitMessage?: string | undefined;
@@ -268,7 +268,7 @@ allowSquashMerge?: boolean | undefined;
268
268
  allowMergeCommit?: boolean | undefined;
269
269
  requireCodeOwnerReviews?: boolean | undefined;
270
270
  requiredStatusCheckContexts?: string[] | undefined;
271
- repoVisibility?: "private" | "public" | "internal" | undefined;
271
+ repoVisibility?: "public" | "private" | "internal" | undefined;
272
272
  collaborators?: ({
273
273
  user: string;
274
274
  access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
@@ -359,7 +359,7 @@ export declare function createPublishBitbucketAction(options: {
359
359
  repoUrl: string;
360
360
  description?: string | undefined;
361
361
  defaultBranch?: string | undefined;
362
- repoVisibility?: "private" | "public" | undefined;
362
+ repoVisibility?: "public" | "private" | undefined;
363
363
  sourcePath?: string | undefined;
364
364
  enableLFS?: boolean | undefined;
365
365
  token?: string | undefined;
@@ -380,7 +380,7 @@ export declare function createPublishBitbucketCloudAction(options: {
380
380
  repoUrl: string;
381
381
  description?: string | undefined;
382
382
  defaultBranch?: string | undefined;
383
- repoVisibility?: "private" | "public" | undefined;
383
+ repoVisibility?: "public" | "private" | undefined;
384
384
  sourcePath?: string | undefined;
385
385
  token?: string | undefined;
386
386
  }>;
@@ -397,7 +397,7 @@ export declare function createPublishBitbucketServerAction(options: {
397
397
  repoUrl: string;
398
398
  description?: string | undefined;
399
399
  defaultBranch?: string | undefined;
400
- repoVisibility?: "private" | "public" | undefined;
400
+ repoVisibility?: "public" | "private" | undefined;
401
401
  sourcePath?: string | undefined;
402
402
  enableLFS?: boolean | undefined;
403
403
  token?: string | undefined;
@@ -433,6 +433,7 @@ defaultBranch?: string | undefined;
433
433
  gitCommitMessage?: string | undefined;
434
434
  gitAuthorName?: string | undefined;
435
435
  gitAuthorEmail?: string | undefined;
436
+ sourcePath?: string | undefined;
436
437
  }>;
437
438
 
438
439
  /**
@@ -461,7 +462,7 @@ allowMergeCommit?: boolean | undefined;
461
462
  sourcePath?: string | undefined;
462
463
  requireCodeOwnerReviews?: boolean | undefined;
463
464
  requiredStatusCheckContexts?: string[] | undefined;
464
- repoVisibility?: "private" | "public" | "internal" | undefined;
465
+ repoVisibility?: "public" | "private" | "internal" | undefined;
465
466
  collaborators?: ({
466
467
  user: string;
467
468
  access: 'pull' | 'push' | 'admin' | 'maintain' | 'triage';
@@ -504,7 +505,7 @@ export declare function createPublishGitlabAction(options: {
504
505
  }): TemplateAction< {
505
506
  repoUrl: string;
506
507
  defaultBranch?: string | undefined;
507
- repoVisibility?: "private" | "public" | "internal" | undefined;
508
+ repoVisibility?: "public" | "private" | "internal" | undefined;
508
509
  sourcePath?: string | undefined;
509
510
  token?: string | undefined;
510
511
  gitCommitMessage?: string | undefined;
package/dist/index.cjs.js CHANGED
@@ -561,8 +561,11 @@ function createFetchTemplateAction(options) {
561
561
  if (renderFilename) {
562
562
  localOutputPath = renderTemplate(localOutputPath, context);
563
563
  }
564
+ if (containsSkippedContent(localOutputPath)) {
565
+ continue;
566
+ }
564
567
  const outputPath = backendCommon.resolveSafeChildPath(outputDir, localOutputPath);
565
- if (outputDir === outputPath) {
568
+ if (fs__default["default"].existsSync(outputPath)) {
566
569
  continue;
567
570
  }
568
571
  if (!renderContents && !extension) {
@@ -589,6 +592,9 @@ function createFetchTemplateAction(options) {
589
592
  }
590
593
  });
591
594
  }
595
+ function containsSkippedContent(localOutputPath) {
596
+ return localOutputPath === "" || path__default["default"].isAbsolute(localOutputPath) || localOutputPath.includes(`${path__default["default"].sep}${path__default["default"].sep}`);
597
+ }
592
598
 
593
599
  const createFilesystemDeleteAction = () => {
594
600
  return createTemplateAction({
@@ -729,7 +735,7 @@ const parseRepoUrl = (repoUrl, integrations) => {
729
735
  throw new errors.InputError(`Invalid repo URL passed to publisher: ${repoUrl}, missing project`);
730
736
  }
731
737
  } else {
732
- if (!owner) {
738
+ if (!owner && type !== "gerrit") {
733
739
  throw new errors.InputError(`Invalid repo URL passed to publisher: ${repoUrl}, missing owner`);
734
740
  }
735
741
  }
@@ -2282,7 +2288,7 @@ const createGerritProject = async (config, options) => {
2282
2288
  body: JSON.stringify({
2283
2289
  parent,
2284
2290
  description,
2285
- owners: [owner],
2291
+ owners: owner ? [owner] : [],
2286
2292
  create_empty_commit: false
2287
2293
  }),
2288
2294
  headers: {
@@ -2339,6 +2345,11 @@ function createPublishGerritAction(options) {
2339
2345
  title: "Default Author Email",
2340
2346
  type: "string",
2341
2347
  description: `Sets the default author email for the commit.`
2348
+ },
2349
+ sourcePath: {
2350
+ title: "Source Path",
2351
+ type: "string",
2352
+ description: `Path within the workspace that will be used as the repository root. If omitted, the entire workspace will be published as the repository.`
2342
2353
  }
2343
2354
  }
2344
2355
  },
@@ -2363,16 +2374,14 @@ function createPublishGerritAction(options) {
2363
2374
  defaultBranch = "master",
2364
2375
  gitAuthorName,
2365
2376
  gitAuthorEmail,
2366
- gitCommitMessage = "initial commit"
2377
+ gitCommitMessage = "initial commit",
2378
+ sourcePath
2367
2379
  } = ctx.input;
2368
2380
  const { repo, host, owner, workspace } = parseRepoUrl(repoUrl, integrations);
2369
2381
  const integrationConfig = integrations.gerrit.byHost(host);
2370
2382
  if (!integrationConfig) {
2371
2383
  throw new errors.InputError(`No matching integration configuration for host ${host}, please check your integrations config`);
2372
2384
  }
2373
- if (!owner) {
2374
- throw new errors.InputError(`Invalid URL provider was included in the repo URL to create ${ctx.input.repoUrl}, missing owner`);
2375
- }
2376
2385
  if (!workspace) {
2377
2386
  throw new errors.InputError(`Invalid URL provider was included in the repo URL to create ${ctx.input.repoUrl}, missing workspace`);
2378
2387
  }
@@ -2392,7 +2401,7 @@ function createPublishGerritAction(options) {
2392
2401
  };
2393
2402
  const remoteUrl = `${integrationConfig.config.cloneUrl}/a/${repo}`;
2394
2403
  await initRepoAndPush({
2395
- dir: getRepoSourceDirectory(ctx.workspacePath, void 0),
2404
+ dir: getRepoSourceDirectory(ctx.workspacePath, sourcePath),
2396
2405
  remoteUrl,
2397
2406
  auth,
2398
2407
  defaultBranch,