Cancelling the running task (executing of a scaffolder template)

Signed-off-by: Bogdan Nechyporenko <bnechyporenko@bol.com>
This commit is contained in:
Bogdan Nechyporenko
2023-03-09 15:40:47 +01:00
parent cec2e622d6
commit e27ddc36da
597 changed files with 6911 additions and 1680 deletions
+5 -1
View File
@@ -18,7 +18,11 @@ Settings for local development:
- Name: Backstage (or your custom app name)
- Redirect URI: `http://localhost:7007/api/auth/gitlab/handler/frame`
- Scopes: `read_api` and `read_user`
- Scopes: `read_user` for sign-in. If you also need ID tokens (e.g. if you are
using the Kubernetes plugin and have clusters with `authProvider: oidc` and
[`oidcTokenProvider:
gitlab`](https://backstage.io/docs/features/kubernetes/configuration/#clustersoidctokenprovider-optional)),
add the `openid` scope.
## Configuration
+3 -2
View File
@@ -160,8 +160,9 @@ auth:
audience: ${AUTH_OKTA_AUDIENCE}
```
The following values are supported out-of-the-box by the frontend: `google`, `microsoft`,
`okta`, `onelogin`.
The following values are supported out-of-the-box by the frontend: `gitlab` (the
application whose `clientId` is used by the auth provider should be granted the
`openid` scope), `google`, `microsoft`, `okta`, `onelogin`.
Take note that `oidcTokenProvider` is just the issuer for the token, you can use any
of these with an OIDC enabled cluster, like using `microsoft` as the issuer for a EKS
@@ -58,6 +58,10 @@ It shouldn't take too long, and you'll have a success screen!
If it fails, you'll be able to click on each section to get the log from the
step that failed which can be helpful in debugging.
You can also cancel the running process. Once you clicked on button "Cancel", the abort signal
will be sent to a task and all next steps won't be executed. The current step will be cancelled
only if it supports it.
![Templating failed](../../assets/software-templates/failed.png)
## View Component in Catalog
@@ -71,7 +71,7 @@ You can also choose to define your custom action using JSON schema instead of `z
```ts title="With JSON Schema"
import { createTemplateAction } from '@backstage/plugin-scaffolder-node';
import fs from 'fs-extra';
import { writeFile } from 'fs';
export const createNewFileAction = () => {
return createTemplateAction<{ contents: string; filename: string }>({
@@ -95,9 +95,12 @@ export const createNewFileAction = () => {
},
},
async handler(ctx) {
await fs.outputFile(
const { signal } = ctx;
await writeFile(
`${ctx.workspacePath}/${ctx.input.filename}`,
ctx.input.contents,
{ signal },
_ => {},
);
},
});
+1 -1
View File
@@ -153,7 +153,7 @@ Backstage as _the_ platform:
percentage of engineers is below 50%. Most engineers actually use Backstage on
a daily basis.
Again, any feedback is appreciated. Please use the Edit button at the top of the
Again, any feedback is appreciated. Please use the Edit button at the bottom of the
page to make a suggestion.
_**Note!** It might be tempting to try to optimize Backstage usage and
File diff suppressed because it is too large Load Diff