@backstage/plugin-scaffolder-backend 0.0.0-nightly-20220713025014 → 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 +14 -10
- package/alpha/package.json +1 -1
- package/dist/index.alpha.d.ts +7 -6
- package/dist/index.beta.d.ts +7 -6
- package/dist/index.cjs.js +17 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +7 -6
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder-backend
|
|
2
2
|
|
|
3
|
-
## 0.0.0-nightly-
|
|
3
|
+
## 0.0.0-nightly-20220714025131
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -11,6 +11,7 @@
|
|
|
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
|
|
|
@@ -19,6 +20,7 @@
|
|
|
19
20
|
- a70869e775: Updated dependency `msw` to `^0.43.0`.
|
|
20
21
|
- 4e9a90e307: Updated dependency `luxon` to `^3.0.0`.
|
|
21
22
|
- 72622d9143: Updated dependency `yaml` to `^2.0.0`.
|
|
23
|
+
- 8006d0f9bf: Updated dependency `msw` to `^0.44.0`.
|
|
22
24
|
- 679b32172e: Updated dependency `knex` to `^2.0.0`.
|
|
23
25
|
- 511f49ee43: Updated dependency `octokit` to `^2.0.0`.
|
|
24
26
|
- 735853353b: Updated dependency `@octokit/webhooks` to `^10.0.0`.
|
|
@@ -31,16 +33,18 @@
|
|
|
31
33
|
- SNYK-JS-PARSEURL-2935947
|
|
32
34
|
- SNYK-JS-PARSEURL-2936249
|
|
33
35
|
|
|
36
|
+
- 945a27fa6a: Add sourcePath option to publish:gerrit action
|
|
37
|
+
- 1764296a68: Allow to create Gerrit project using default owner
|
|
34
38
|
- Updated dependencies
|
|
35
|
-
- @backstage/backend-plugin-api@0.0.0-nightly-
|
|
36
|
-
- @backstage/plugin-catalog-backend@0.0.0-nightly-
|
|
37
|
-
- @backstage/backend-common@0.0.0-nightly-
|
|
38
|
-
- @backstage/catalog-model@0.0.0-nightly-
|
|
39
|
-
- @backstage/plugin-catalog-node@0.0.0-nightly-
|
|
40
|
-
- @backstage/
|
|
41
|
-
- @backstage/
|
|
42
|
-
- @backstage/errors@0.0.0-nightly-
|
|
43
|
-
- @backstage/plugin-scaffolder-common@0.0.0-nightly-
|
|
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
|
|
44
48
|
|
|
45
49
|
## 1.4.0-next.3
|
|
46
50
|
|
package/alpha/package.json
CHANGED
package/dist/index.alpha.d.ts
CHANGED
|
@@ -268,7 +268,7 @@ allowSquashMerge?: boolean | undefined;
|
|
|
268
268
|
allowMergeCommit?: boolean | undefined;
|
|
269
269
|
requireCodeOwnerReviews?: boolean | undefined;
|
|
270
270
|
requiredStatusCheckContexts?: string[] | undefined;
|
|
271
|
-
repoVisibility?: "
|
|
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?: "
|
|
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?: "
|
|
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?: "
|
|
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?: "
|
|
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?: "
|
|
508
|
+
repoVisibility?: "public" | "private" | "internal" | undefined;
|
|
508
509
|
sourcePath?: string | undefined;
|
|
509
510
|
token?: string | undefined;
|
|
510
511
|
gitCommitMessage?: string | undefined;
|
package/dist/index.beta.d.ts
CHANGED
|
@@ -268,7 +268,7 @@ allowSquashMerge?: boolean | undefined;
|
|
|
268
268
|
allowMergeCommit?: boolean | undefined;
|
|
269
269
|
requireCodeOwnerReviews?: boolean | undefined;
|
|
270
270
|
requiredStatusCheckContexts?: string[] | undefined;
|
|
271
|
-
repoVisibility?: "
|
|
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?: "
|
|
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?: "
|
|
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?: "
|
|
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?: "
|
|
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?: "
|
|
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 (
|
|
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,
|
|
2404
|
+
dir: getRepoSourceDirectory(ctx.workspacePath, sourcePath),
|
|
2396
2405
|
remoteUrl,
|
|
2397
2406
|
auth,
|
|
2398
2407
|
defaultBranch,
|