@backstage/plugin-scaffolder-backend 1.12.0-next.1 → 1.12.0-next.2
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 +18 -0
- package/README.md +1 -1
- package/alpha/package.json +1 -1
- package/dist/alpha.cjs.js +15 -11
- package/dist/alpha.cjs.js.map +1 -1
- package/dist/index.cjs.js +15 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/package.json +9 -9
package/dist/index.cjs.js
CHANGED
|
@@ -256,7 +256,7 @@ function createCatalogWriteAction() {
|
|
|
256
256
|
input: zod.z.object({
|
|
257
257
|
filePath: zod.z.string().optional().describe("Defaults to catalog-info.yaml"),
|
|
258
258
|
// TODO: this should reference an zod entity validator if it existed.
|
|
259
|
-
entity: zod.z.object({}).describe(
|
|
259
|
+
entity: zod.z.object({}).passthrough().describe(
|
|
260
260
|
"You can provide the same values used in the Entity schema."
|
|
261
261
|
)
|
|
262
262
|
})
|
|
@@ -3486,11 +3486,12 @@ const defaultClientFactory = async ({
|
|
|
3486
3486
|
...{ throttle: { enabled: false } }
|
|
3487
3487
|
});
|
|
3488
3488
|
};
|
|
3489
|
-
const createPublishGithubPullRequestAction = ({
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3489
|
+
const createPublishGithubPullRequestAction = (options) => {
|
|
3490
|
+
const {
|
|
3491
|
+
integrations,
|
|
3492
|
+
githubCredentialsProvider,
|
|
3493
|
+
clientFactory = defaultClientFactory
|
|
3494
|
+
} = options;
|
|
3494
3495
|
return pluginScaffolderNode.createTemplateAction({
|
|
3495
3496
|
id: "publish:github:pull-request",
|
|
3496
3497
|
schema: {
|
|
@@ -4386,7 +4387,8 @@ class DatabaseTaskStore {
|
|
|
4386
4387
|
});
|
|
4387
4388
|
return { events };
|
|
4388
4389
|
}
|
|
4389
|
-
async shutdownTask(
|
|
4390
|
+
async shutdownTask(options) {
|
|
4391
|
+
const { taskId } = options;
|
|
4390
4392
|
const message = `This task was marked as stale as it exceeded its timeout`;
|
|
4391
4393
|
const statusStepEvents = (await this.listEvents({ taskId })).events.filter(
|
|
4392
4394
|
({ body }) => body == null ? void 0 : body.stepId
|
|
@@ -5191,13 +5193,12 @@ async function findTemplate(options) {
|
|
|
5191
5193
|
function isSupportedTemplate(entity) {
|
|
5192
5194
|
return entity.apiVersion === "scaffolder.backstage.io/v1beta3";
|
|
5193
5195
|
}
|
|
5194
|
-
function buildDefaultIdentityClient({
|
|
5195
|
-
logger
|
|
5196
|
-
}) {
|
|
5196
|
+
function buildDefaultIdentityClient(options) {
|
|
5197
5197
|
return {
|
|
5198
5198
|
getIdentity: async ({ request }) => {
|
|
5199
5199
|
var _a;
|
|
5200
5200
|
const header = request.headers.authorization;
|
|
5201
|
+
const { logger } = options;
|
|
5201
5202
|
if (!header) {
|
|
5202
5203
|
return void 0;
|
|
5203
5204
|
}
|
|
@@ -5217,6 +5218,9 @@ function buildDefaultIdentityClient({
|
|
|
5217
5218
|
if (typeof sub !== "string") {
|
|
5218
5219
|
throw new TypeError("Expected string sub claim");
|
|
5219
5220
|
}
|
|
5221
|
+
if (sub === "backstage-server") {
|
|
5222
|
+
return void 0;
|
|
5223
|
+
}
|
|
5220
5224
|
catalogModel.parseEntityRef(sub);
|
|
5221
5225
|
return {
|
|
5222
5226
|
identity: {
|
|
@@ -5250,7 +5254,7 @@ async function createRouter(options) {
|
|
|
5250
5254
|
additionalTemplateGlobals
|
|
5251
5255
|
} = options;
|
|
5252
5256
|
const logger = parentLogger.child({ plugin: "scaffolder" });
|
|
5253
|
-
const identity = options.identity || buildDefaultIdentityClient(
|
|
5257
|
+
const identity = options.identity || buildDefaultIdentityClient(options);
|
|
5254
5258
|
const workingDirectory = await getWorkingDirectory(config, logger);
|
|
5255
5259
|
const integrations = integration.ScmIntegrations.fromConfig(config);
|
|
5256
5260
|
let taskBroker;
|