Skip to content

Commit

Permalink
Merge pull request #27171 from backstage/patch-release-pr-27159-27170
Browse files Browse the repository at this point in the history
Patch release of #27159, #27170
  • Loading branch information
benjdlambert authored Oct 16, 2024
2 parents 3ae2f1e + c5eafe3 commit 743cec4
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "root",
"version": "1.32.0",
"version": "1.32.1",
"private": true,
"repository": {
"type": "git",
Expand Down
7 changes: 7 additions & 0 deletions packages/backend-legacy/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# example-backend-legacy

## 0.2.104

### Patch Changes

- Updated dependencies
- @backstage/plugin-scaffolder-backend@1.26.1

## 0.2.103

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/backend-legacy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "example-backend-legacy",
"version": "0.2.103",
"version": "0.2.104",
"backstage": {
"role": "backend"
},
Expand Down
7 changes: 7 additions & 0 deletions packages/backend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# example-backend

## 0.0.32

### Patch Changes

- Updated dependencies
- @backstage/plugin-scaffolder-backend@1.26.1

## 0.0.31

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "example-backend",
"version": "0.0.31",
"version": "0.0.32",
"backstage": {
"role": "backend"
},
Expand Down
7 changes: 7 additions & 0 deletions plugins/scaffolder-backend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @backstage/plugin-scaffolder-backend

## 1.26.1

### Patch Changes

- d90f47f: Fix tasks listing with postgres
- 9bbfd90: Fix issue with token not being available because it's now non-enumerable

## 1.26.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion plugins/scaffolder-backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@backstage/plugin-scaffolder-backend",
"version": "1.26.0",
"version": "1.26.1",
"description": "The Backstage backend plugin that helps you create new things",
"backstage": {
"role": "backend-plugin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ export class DatabaseTaskStore implements TaskStore {
queryBuilder.whereIn('status', [...new Set(arr)]);
}

const countQuery = queryBuilder.clone();
countQuery.count('tasks.id', { as: 'count' });

if (order) {
order.forEach(f => {
queryBuilder.orderBy(f.field, f.order);
Expand All @@ -221,9 +224,6 @@ export class DatabaseTaskStore implements TaskStore {
queryBuilder.orderBy('created_at', 'desc');
}

const countQuery = queryBuilder.clone();
countQuery.count('tasks.id', { as: 'count' });

if (pagination?.limit !== undefined) {
queryBuilder.limit(pagination.limit);
}
Expand Down
7 changes: 6 additions & 1 deletion plugins/scaffolder-backend/src/service/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ export async function createRouter(
});

const credentials = await httpAuth.credentials(req);

await checkPermission({
credentials,
permissions: [taskCreatePermission],
Expand Down Expand Up @@ -563,7 +564,11 @@ export async function createRouter(
const secrets: InternalTaskSecrets = {
...req.body.secrets,
backstageToken: token,
__initiatorCredentials: JSON.stringify(credentials),
__initiatorCredentials: JSON.stringify({
...credentials,
// credentials.token is nonenumerable and will not be serialized, so we need to add it explicitly
token: (credentials as any).token,
}),
};

const result = await taskBroker.dispatch({
Expand Down

0 comments on commit 743cec4

Please sign in to comment.