Skip to content

Commit

Permalink
docs(release): frontend plugin 0.8.1 + backend plugin 0.3.1 + adding …
Browse files Browse the repository at this point in the history
…common library

frontend plugin 0.8.1 + backend plugin 0.3.1 + adding common library

Signed-off-by: Tiago Barbosa <tbarbos@hotmail.com>
  • Loading branch information
t1agob committed Jan 26, 2024
1 parent 80902bc commit 2abbd5a
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 57 deletions.
4 changes: 2 additions & 2 deletions docs/advanced/create-service-software-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ By doing so, it enables and configures the PagerDuty Card provided by the fronte
This step is already covered on the `Getting Started` section of the documentation but if you haven't installed the package do it by running the following command from the root folder of your Backstage project.

```bash
yarn add --cwd packages/backend @pagerduty/backstage-plugin-backend # (1)!
yarn add --cwd packages/backend @pagerduty/backstage-plugin-backend @pagerduty/backstage-plugin-common # (1)!
```

1. This command adds `@pagerduty/backstage-plugin-backend` package to the `packages/backend` folder because it is a backend plugin.
1. This command adds `@pagerduty/backstage-plugin-backend` and `@pagerduty/backstage-plugin-common` packages to the `packages/backend` folder because it is a backend plugin.

## Adding the custom action to a Software Template

Expand Down
36 changes: 17 additions & 19 deletions docs/getting-started/backstage.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@
!!! note
The following steps assume you already have a Backstage project created. If that is not the case, follow the [Getting Started](https://backstage.io/docs/getting-started/) guide on Backstage.io to create one or create one by running `npx @backstage/create-app` on your terminal.

To install the PagerDuty plugin into Backstage run the following command from your Backstage root directory.
To install the PagerDuty plugin into Backstage run the following commands from your Backstage root directory.

```bash
yarn add --cwd packages/app @pagerduty/backstage-plugin # (1)!
yarn add --cwd packages/backend @pagerduty/backstage-plugin-backend # (2)!
yarn add --cwd packages/app @pagerduty/backstage-plugin @pagerduty/backstage-plugin-common # (1)!
```

1. This command adds `@pagerduty/backstage-plugin` package to the `packages/app` folder because it is a frontend plugin.
2. This command adds `@pagerduty/backstage-plugin-backend` package to the `packages/backend` folder because it is a backend plugin.
1. This command adds `@pagerduty/backstage-plugin` and `@pagerduty/backstage-plugin-common` packages to the `packages/app` folder because it is a frontend plugin.

```bash
yarn add --cwd packages/backend @pagerduty/backstage-plugin-backend @pagerduty/backstage-plugin-common # (1)!
```

1. This command adds `@pagerduty/backstage-plugin-backend` and `@pagerduty/backstage-plugin-common` packages to the `packages/backend` folder because it is a backend plugin.

**That's it!** Now it's time to add the plugin to Backstage and your services.

Expand Down Expand Up @@ -95,21 +99,15 @@ The PagerDuty plugin requires access to PagerDuty APIs and so we need to configu
This step requires you to use the API token you generated and stored safely in previous steps. If you haven't done so follow the steps in [Generate a General Access REST API Token](/getting-started/pagerduty/#generate-a-general-access-rest-api-token).
In `app-config.yaml` file add the proxy configuration and set the API token:
In `app-config.yaml` file add the following configuration and set the API token:

```yaml
proxy:
...
'/pagerduty':
target: https://api.pagerduty.com
headers:
Authorization: Token token=${PAGERDUTY_TOKEN}
pagerDuty:
apiToken: ${PAGERDUTY_TOKEN}
```

!!! note
Currently the plugin leverages Backstage proxy to call PagerDuty APIs.

**Disclaimer:** There is active work to deprecate and replace the proxy in future versions for added security.
!!! warning
If you were using the plugin **before version 0.8.1** you need to configure a proxy configuration instead. That configuration is now deprecated so use this configuration instead.

## Add the backend plugin to your application

Expand Down Expand Up @@ -148,7 +146,7 @@ async function main() {

### Configure Backend plugin API credentials

The PagerDuty backend plugin exposes local APIs that query PagerDuty APIs without going through the proxy. Therefore it requires access to the API Token used in the previous step.
The PagerDuty backend plugin exposes local APIs that query PagerDuty APIs without going through the Backstage proxy. Therefore it requires access to the API Token used in the previous step.

If you plan to use the backend plugin add the following to your `app-config.yaml` file.

Expand All @@ -157,8 +155,8 @@ pagerDuty:
apiToken: ${PAGERDUTY_TOKEN}
```

!!! note
In future releases this configuration will replace the current configuration on the Backstage proxy and therefore remove the duplicate configuration key.
!!! warning
If you were using the plugin **before version 0.3.1** you need to configure a proxy configuration instead. That configuration is now deprecated so use this configuration instead.

## Test your configuration

Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ The scope for the plugin is quite limited at the time but we are working on brin

- **Frontend plugin** ([bugs](https://github.com/PagerDuty/backstage-plugin/issues/new?assignees=&labels=bug&projects=&template=bug_report.md&title=)) ([feature requests](https://github.com/PagerDuty/backstage-plugin/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.md&title=))
- **Backend plugin** ([bugs](https://github.com/PagerDuty/backstage-plugin-backend/issues/new?assignees=&labels=bug&projects=&template=bug_report.md&title=)) ([feature requests](https://github.com/PagerDuty/backstage-plugin-backend/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.md&title=))
- **Common library** ([bugs](https://github.com/PagerDuty/backstage-plugin-common/issues/new?assignees=&labels=bug&projects=&template=bug_report.md&title=)) ([feature requests](https://github.com/PagerDuty/backstage-plugin-common/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.md&title=))

## Roadmap

Expand Down
2 changes: 1 addition & 1 deletion docs/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ If you are migrating from the PagerDuty plugin that was maintained by Backstage,

```bash
# From your Backstage root directory
yarn add --cwd packages/app @pagerduty/backstage-plugin
yarn add --cwd packages/app @pagerduty/backstage-plugin @pagerduty/backstage-plugin-common
```

3. Replace all occurrences of `@backstage/plugin-pagerduty` with `@pagerduty/backstage-plugin` in your components
Expand Down
27 changes: 27 additions & 0 deletions docs/release-notes/backend.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Release notes for Backend plugin

## > 0.3.1

[GitHub release](https://github.com/PagerDuty/backstage-plugin-backend/releases/tag/0.3.1)

## Summary

This release was aimed at removing the dependency on the Backstage proxy. We have replace it with new REST API endpoints for all operations executed from the frontend plugin that currently interact with the PagerDuty REST API directly. With this change we:

- Removed the dependency on the Backstage proxy
- Improved security by limiting the actions performed on the backend API
- Slightly increase the performance by limiting the data used by the frontend to the essential

**Endpoints added:**

- **/oncall-users** - returns PagerDutyOnCallUsersResponse with list of users oncall
- **/services** - uses integration_key and returns PagerDutyServiceResponse with PagerDuty service information
- **/services/:serviceId** - returns PagerDutyServiceResponse with PagerDuty service information
- **/services/:serviceId/change-events** - returns PagerDutyChangeEventsResponse with list of last 5 change events for the defined service
- **/services/:serviceId/incidents** - returns PagerDutyIncidentsResponse with list of incidents for the defined service

With this change, the proxy configuration on `app-config.yaml` is no longer required.

### Changes

- feat: migrate apis to backend
- build(deps): Bump follow-redirects from 1.15.3 to 1.15.4

## > 0.2.1

[GitHub release](https://github.com/PagerDuty/backstage-plugin-backend/releases/tag/0.2.1)
Expand Down
17 changes: 17 additions & 0 deletions docs/release-notes/frontend.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Release notes for Frontend plugin

## > 0.8.1

[GitHub release](https://github.com/PagerDuty/backstage-plugin/releases/tag/0.8.1)

### Summary

This minor release moves the direct REST API calls from the frontend component to the backend. Instead of leveraging the Backstage proxy to make direct API calls to PagerDuty the calls are made to the backend plugin instead.

This removes the dependency on the proxy and prevents other plugins from using the PagerDuty proxy configuration to call PagerDuty APIs directly for other purposes which raises few security concerns.

Therefore the proxy configuration for PagerDuty on app-config.yaml is no longer required and is in-fact deprecated.

### Changes

- feat: migrate api calls
- chore(deps): bump follow-redirects from 1.15.3 to 1.15.4

## > 0.7.4

[GitHub release](https://github.com/PagerDuty/backstage-plugin/releases/tag/0.7.4)
Expand Down
34 changes: 0 additions & 34 deletions docs/security.md

This file was deleted.

1 change: 0 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ nav:
- Enable read-only mode: advanced/enable-read-only-mode.md
- Create an homepage component: advanced/homepage-component.md
- Create PagerDuty service with Software Templates: advanced/create-service-software-template.md
- Security: security.md
- Migration: migration.md
- Community: community.md
- Release Notes:
Expand Down

0 comments on commit 2abbd5a

Please sign in to comment.