@backstage/plugin-scaffolder-backend 0.18.0-next.0 → 1.0.1-next.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 +76 -0
- package/dist/index.cjs.js +75 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +62 -4
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,81 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder-backend
|
|
2
2
|
|
|
3
|
+
## 1.0.1-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/catalog-model@1.0.1-next.0
|
|
9
|
+
- @backstage/plugin-catalog-backend@1.0.1-next.0
|
|
10
|
+
- @backstage/backend-common@0.13.2-next.0
|
|
11
|
+
- @backstage/integration@1.0.1-next.0
|
|
12
|
+
- @backstage/catalog-client@1.0.1-next.0
|
|
13
|
+
- @backstage/plugin-scaffolder-common@1.0.1-next.0
|
|
14
|
+
|
|
15
|
+
## 1.0.0
|
|
16
|
+
|
|
17
|
+
### Major Changes
|
|
18
|
+
|
|
19
|
+
- b58c70c223: This package has been promoted to v1.0! To understand how this change affects the package, please check out our [versioning policy](https://backstage.io/docs/overview/versioning-policy).
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- 765639f98c: Added new `github:issues:label` action to apply labels to issues, and also output `pullRequestNumber` from `publish:github:pull-request`.
|
|
24
|
+
- efc73db10c: Use `better-sqlite3` instead of `@vscode/sqlite3`
|
|
25
|
+
- c8475ab3bb: Adding some documentation for exported things
|
|
26
|
+
- f24ef7864e: Minor typo fixes
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
- @backstage/plugin-catalog-backend@1.0.0
|
|
29
|
+
- @backstage/backend-common@0.13.1
|
|
30
|
+
- @backstage/catalog-model@1.0.0
|
|
31
|
+
- @backstage/plugin-scaffolder-common@1.0.0
|
|
32
|
+
- @backstage/integration@1.0.0
|
|
33
|
+
- @backstage/catalog-client@1.0.0
|
|
34
|
+
- @backstage/config@1.0.0
|
|
35
|
+
- @backstage/errors@1.0.0
|
|
36
|
+
- @backstage/types@1.0.0
|
|
37
|
+
|
|
38
|
+
## 0.18.0
|
|
39
|
+
|
|
40
|
+
### Minor Changes
|
|
41
|
+
|
|
42
|
+
- 310e905998: The following deprecations are now breaking and have been removed:
|
|
43
|
+
|
|
44
|
+
- **BREAKING**: Support for `backstage.io/v1beta2` Software Templates has been removed. Please migrate your legacy templates to the new `scaffolder.backstage.io/v1beta3` `apiVersion` by following the [migration guide](https://backstage.io/docs/features/software-templates/migrating-from-v1beta2-to-v1beta3)
|
|
45
|
+
|
|
46
|
+
- **BREAKING**: Removed the deprecated `TemplateMetadata`. Please use `TemplateInfo` instead.
|
|
47
|
+
|
|
48
|
+
- **BREAKING**: Removed the deprecated `context.baseUrl`. It's now available on `context.templateInfo.baseUrl`.
|
|
49
|
+
|
|
50
|
+
- **BREAKING**: Removed the deprecated `DispatchResult`, use `TaskBrokerDispatchResult` instead.
|
|
51
|
+
|
|
52
|
+
- **BREAKING**: Removed the deprecated `runCommand`, use `executeShellCommond` instead.
|
|
53
|
+
|
|
54
|
+
- **BREAKING**: Removed the deprecated `Status` in favour of `TaskStatus` instead.
|
|
55
|
+
|
|
56
|
+
- **BREAKING**: Removed the deprecated `TaskState` in favour of `CurrentClaimedTask` instead.
|
|
57
|
+
|
|
58
|
+
- f9c7bdd899: **BREAKING**:
|
|
59
|
+
|
|
60
|
+
- Removed the `createFetchCookiecutterAction` export, please use the `@backstage/plugin-scaffolder-backend-module-cookiecutter` package explicitly (see [its README](https://github.com/backstage/backstage/tree/master/plugins/scaffolder-backend-module-cookiecutter) for installation instructions).
|
|
61
|
+
- Removed the `containerRunner` argument from the types `RouterOptions` (as used by `createRouter`) and `CreateBuiltInActionsOptions` (as used by `createBuiltinActions`).
|
|
62
|
+
|
|
63
|
+
- 5afbd16d43: **BREAKING**: Removed the previously deprecated `OctokitProvider` class.
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- ab7cd7d70e: Do some groundwork for supporting the `better-sqlite3` driver, to maybe eventually replace `@vscode/sqlite3` (#9912)
|
|
68
|
+
- 8122e27717: Updating documentation for supporting `apiVersion: scaffolder.backstage.io/v1beta3`
|
|
69
|
+
- e0a69ba49f: build(deps): bump `fs-extra` from 9.1.0 to 10.0.1
|
|
70
|
+
- 3c2bc73901: Use `setupRequestMockHandlers` from `@backstage/backend-test-utils`
|
|
71
|
+
- 458d16869c: Allow passing more repo configuration for `publish:github` action
|
|
72
|
+
- Updated dependencies
|
|
73
|
+
- @backstage/backend-common@0.13.0
|
|
74
|
+
- @backstage/plugin-catalog-backend@0.24.0
|
|
75
|
+
- @backstage/plugin-scaffolder-common@0.3.0
|
|
76
|
+
- @backstage/catalog-model@0.13.0
|
|
77
|
+
- @backstage/catalog-client@0.9.0
|
|
78
|
+
|
|
3
79
|
## 0.18.0-next.0
|
|
4
80
|
|
|
5
81
|
### Minor Changes
|
package/dist/index.cjs.js
CHANGED
|
@@ -1553,6 +1553,11 @@ const createPublishGithubPullRequestAction = ({
|
|
|
1553
1553
|
type: "string",
|
|
1554
1554
|
title: "Pull Request URL",
|
|
1555
1555
|
description: "Link to the pull request in Github"
|
|
1556
|
+
},
|
|
1557
|
+
pullRequestNumber: {
|
|
1558
|
+
type: "number",
|
|
1559
|
+
title: "Pull Request Number",
|
|
1560
|
+
description: "The pull request number"
|
|
1556
1561
|
}
|
|
1557
1562
|
}
|
|
1558
1563
|
}
|
|
@@ -1619,6 +1624,7 @@ const createPublishGithubPullRequestAction = ({
|
|
|
1619
1624
|
throw new GithubResponseError("null response from Github");
|
|
1620
1625
|
}
|
|
1621
1626
|
ctx.output("remoteUrl", response.data.html_url);
|
|
1627
|
+
ctx.output("pullRequestNumber", response.data.number);
|
|
1622
1628
|
} catch (e) {
|
|
1623
1629
|
throw new GithubResponseError("Pull request creation failed", e);
|
|
1624
1630
|
}
|
|
@@ -2038,6 +2044,70 @@ function createGithubWebhookAction(options) {
|
|
|
2038
2044
|
});
|
|
2039
2045
|
}
|
|
2040
2046
|
|
|
2047
|
+
function createGithubIssuesLabelAction(options) {
|
|
2048
|
+
const { integrations, githubCredentialsProvider } = options;
|
|
2049
|
+
return createTemplateAction({
|
|
2050
|
+
id: "github:issues:label",
|
|
2051
|
+
description: "Adds labels to a pull request or issue on GitHub.",
|
|
2052
|
+
schema: {
|
|
2053
|
+
input: {
|
|
2054
|
+
type: "object",
|
|
2055
|
+
required: ["repoUrl", "number", "labels"],
|
|
2056
|
+
properties: {
|
|
2057
|
+
repoUrl: {
|
|
2058
|
+
title: "Repository Location",
|
|
2059
|
+
description: `Accepts the format 'github.com?repo=reponame&owner=owner' where 'reponame' is the repository name and 'owner' is an organization or username`,
|
|
2060
|
+
type: "string"
|
|
2061
|
+
},
|
|
2062
|
+
number: {
|
|
2063
|
+
title: "Pull Request or issue number",
|
|
2064
|
+
description: "The pull request or issue number to add labels to",
|
|
2065
|
+
type: "number"
|
|
2066
|
+
},
|
|
2067
|
+
labels: {
|
|
2068
|
+
title: "Labels",
|
|
2069
|
+
description: "The labels to add to the pull request or issue",
|
|
2070
|
+
type: "array",
|
|
2071
|
+
items: {
|
|
2072
|
+
type: "string"
|
|
2073
|
+
}
|
|
2074
|
+
},
|
|
2075
|
+
token: {
|
|
2076
|
+
title: "Authentication Token",
|
|
2077
|
+
type: "string",
|
|
2078
|
+
description: "The GITHUB_TOKEN to use for authorization to GitHub"
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
},
|
|
2083
|
+
async handler(ctx) {
|
|
2084
|
+
const { repoUrl, number, labels, token: providedToken } = ctx.input;
|
|
2085
|
+
const { owner, repo } = parseRepoUrl(repoUrl, integrations);
|
|
2086
|
+
ctx.logger.info(`Adding labels to ${number} issue on repo ${repo}`);
|
|
2087
|
+
if (!owner) {
|
|
2088
|
+
throw new errors.InputError("Invalid repository owner provided in repoUrl");
|
|
2089
|
+
}
|
|
2090
|
+
const client = new octokit.Octokit(await getOctokitOptions({
|
|
2091
|
+
integrations,
|
|
2092
|
+
credentialsProvider: githubCredentialsProvider,
|
|
2093
|
+
repoUrl,
|
|
2094
|
+
token: providedToken
|
|
2095
|
+
}));
|
|
2096
|
+
try {
|
|
2097
|
+
await client.rest.issues.addLabels({
|
|
2098
|
+
owner,
|
|
2099
|
+
repo,
|
|
2100
|
+
issue_number: number,
|
|
2101
|
+
labels
|
|
2102
|
+
});
|
|
2103
|
+
} catch (e) {
|
|
2104
|
+
errors.assertError(e);
|
|
2105
|
+
ctx.logger.warn(`Failed: adding labels to issue: '${number}' on repo: '${repo}', ${e.message}`);
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
});
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2041
2111
|
const createBuiltinActions = (options) => {
|
|
2042
2112
|
const {
|
|
2043
2113
|
reader,
|
|
@@ -2093,6 +2163,10 @@ const createBuiltinActions = (options) => {
|
|
|
2093
2163
|
createGithubWebhookAction({
|
|
2094
2164
|
integrations,
|
|
2095
2165
|
githubCredentialsProvider
|
|
2166
|
+
}),
|
|
2167
|
+
createGithubIssuesLabelAction({
|
|
2168
|
+
integrations,
|
|
2169
|
+
githubCredentialsProvider
|
|
2096
2170
|
})
|
|
2097
2171
|
];
|
|
2098
2172
|
return actions;
|
|
@@ -2950,6 +3024,7 @@ exports.createFetchTemplateAction = createFetchTemplateAction;
|
|
|
2950
3024
|
exports.createFilesystemDeleteAction = createFilesystemDeleteAction;
|
|
2951
3025
|
exports.createFilesystemRenameAction = createFilesystemRenameAction;
|
|
2952
3026
|
exports.createGithubActionsDispatchAction = createGithubActionsDispatchAction;
|
|
3027
|
+
exports.createGithubIssuesLabelAction = createGithubIssuesLabelAction;
|
|
2953
3028
|
exports.createGithubWebhookAction = createGithubWebhookAction;
|
|
2954
3029
|
exports.createPublishAzureAction = createPublishAzureAction;
|
|
2955
3030
|
exports.createPublishBitbucketAction = createPublishBitbucketAction;
|