Skip to content

Commit

Permalink
chore: make the deprecation message consistent for all plugins (#2596)
Browse files Browse the repository at this point in the history
chore: make the deprecation message consistent

Signed-off-by: Kashish Mittal <[email protected]>
  • Loading branch information
04kash authored Dec 6, 2024
1 parent f341d3d commit b10490c
Show file tree
Hide file tree
Showing 45 changed files with 45 additions and 836 deletions.
140 changes: 1 addition & 139 deletions plugins/3scale-backend/README.md
Original file line number Diff line number Diff line change
@@ -1,142 +1,4 @@
# ❗DEPRECATED❗

This package has been deprecated.
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-3scale-backend` instead.

Please use the **[@backstage-community/plugin-3scale-backend](https://www.npmjs.com/package/@backstage-community/plugin-3scale-backend)** package instead.

# 3scale Backstage provider

The 3scale Backstage provider plugin synchronizes the 3scale content into the [Backstage](https://backstage.io/) catalog.

## For administrators

### Installation

Run the following command to install the 3scale Backstage provider plugin:

```console
yarn workspace backend add @janus-idp/backstage-plugin-3scale-backend
```

### Configuration

3scale Backstage provider allows configuration of one or multiple providers using the `app-config.yaml` configuration file of Backstage.

#### Legacy Backend Procedure

1. Use a `threeScaleApiEntity` marker to start configuring the `app-config.yaml` file of Backstage:

```yaml title="app-config.yaml"
catalog:
providers:
threeScaleApiEntity:
dev:
baseUrl: https://<TENANT>-admin.3scale.net
accessToken: <ACCESS_TOKEN>
schedule: # optional; same options as in TaskScheduleDefinition
# supports cron, ISO duration, "human duration" as used in code
frequency: { minutes: 30 }
# supports ISO duration, "human duration" as used in code
timeout: { minutes: 3 }
```
2. If installing into the _legacy_ backend, configure the scheduler for the entity provider using one of the following methods:
- **Method 1**: If the scheduler is configured inside the `app-config.yaml` using the schedule config key mentioned previously, add the following code to `packages/backend/src/plugins/catalog.ts` file:

```ts title="packages/backend/src/plugins/catalog.ts"
/* highlight-add-next-line */
import { ThreeScaleApiEntityProvider } from '@janus-idp/backstage-plugin-3scale-backend';
export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
const builder = await CatalogBuilder.create(env);
/* ... other processors and/or providers ... */
/* highlight-add-start */
builder.addEntityProvider(
ThreeScaleApiEntityProvider.fromConfig(env.config, {
logger: env.logger,
scheduler: env.scheduler,
}),
);
/* highlight-add-end */
const { processingEngine, router } = await builder.build();
await processingEngine.start();
return router;
}
```

***

**NOTE**

If you have made any changes to the schedule in the `app-config.yaml` file, then restart to apply the changes.

***

- **Method 2**: Add a schedule directly inside the `packages/backend/src/plugins/catalog.ts` file as follows:

```ts title="packages/backend/src/plugins/catalog.ts"
/* highlight-add-next-line */
import { ThreeScaleApiEntityProvider } from '@janus-idp/backstage-plugin-3scale-backend';
export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
const builder = await CatalogBuilder.create(env);
/* ... other processors and/or providers ... */
/* highlight-add-start */
builder.addEntityProvider(
ThreeScaleApiEntityProvider.fromConfig(env.config, {
logger: env.logger,
schedule: env.scheduler.createScheduledTaskRunner({
frequency: { minutes: 30 },
timeout: { minutes: 3 },
}),
}),
);
/* highlight-add-end */
const { processingEngine, router } = await builder.build();
await processingEngine.start();
return router;
}
```

***

**NOTE**

If both the `schedule` (hard-coded schedule) and `scheduler` (`app-config.yaml` schedule) option are provided in the `packages/backend/src/plugins/catalog.ts`, the `scheduler` option takes precedence. However, if the schedule inside the `app-config.yaml` file is not configured, then the `schedule` option is used.

***

#### New Backend Procedure

1. If installing into the new backend system, make the same configurations to the `app=config.yaml` as in the [Legacy Backend Installation Procedure](#legacy-backend-installation-procedure). Make sure to configure the schedule inside the `app-config.yaml` file. The default schedule is a frequency of 30 minutes and a timeout of 3 minutes.
2. Add the following code to the `packages/backend/src/index.ts` file:

```ts title="packages/backend/src/index.ts"
const backend = createBackend();
/* highlight-add-next-line */
backend.add(import('@janus-idp/backstage-plugin-3scale-backend/alpha'));
backend.start();
```

### Troubleshooting

When you start your Backstage application, you can see some log lines as follows:

```log
[1] 2023-02-13T15:26:09.356Z catalog info Discovered ApiEntity API type=plugin target=ThreeScaleApiEntityProvider:dev
[1] 2023-02-13T15:26:09.423Z catalog info Discovered ApiEntity Red Hat Event (DEV, v1.2.0) type=plugin target=ThreeScaleApiEntityProvider:dev
[1] 2023-02-13T15:26:09.620Z catalog info Discovered ApiEntity Red Hat Event (TEST, v1.1.0) type=plugin target=ThreeScaleApiEntityProvider:dev
[1] 2023-02-13T15:26:09.819Z catalog info Discovered ApiEntity Red Hat Event (PROD, v1.1.0) type=plugin target=ThreeScaleApiEntityProvider:dev
[1] 2023-02-13T15:26:09.819Z catalog info Applying the mutation with 3 entities type=plugin target=ThreeScaleApiEntityProvider:dev
```
115 changes: 1 addition & 114 deletions plugins/acr/README.md
Original file line number Diff line number Diff line change
@@ -1,117 +1,4 @@
# ❗DEPRECATED❗

This package has been deprecated.
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-acr` instead.

Please use the **[@backstage-community/plugin-acr](https://www.npmjs.com/package/@backstage-community/plugin-acr)** package instead.

# Azure Container Registry plugin for Backstage

The Azure Container Registry (ACR) plugin displays information about your container images available in the Azure Container Registry.

## For administrators

### Installing and configuring the ACR plugin

1. Run the following command to install the ACR plugin:

```bash
yarn workspace app add @janus-idp/backstage-plugin-acr
```

1. Set the proxy to the desired ACR server in the `app-config.yaml` file as follows:

```yaml
# app-config.yaml
proxy:
endpoints:
'/acr/api':
target: 'https://mycontainerregistry.azurecr.io/acr/v1/'
credentials: require
changeOrigin: true
headers:
# If you use Bearer Token for authorization, please replace the 'Basic' with 'Bearer' in the following line.
Authorization: 'Basic ${ACR_AUTH_TOKEN}'
# Change to "false" in case of using self hosted artifactory instance with a self-signed certificate
secure: true
```
> [!NOTE]
> The value inside each route is either a simple URL string, or an object on the format accepted by [http-proxy-middleware](https://www.npmjs.com/package/http-proxy-middleware). Additionally, it has an optional `credentials` key which can have the following values:
>
> - `require`: Callers must provide Backstage user or service credentials with each request. The credentials are not forwarded to the proxy target. This is the **default**.
> - `forward`: Callers must provide Backstage user or service credentials with each request, and those credentials are forwarded to the proxy target.
> - `dangerously-allow-unauthenticated`: No Backstage credentials are required to access this proxy target. The target can still apply its own credentials checks, but the proxy will not help block non-Backstage-blessed callers. If you also add allowedHeaders: ['Authorization'] to an endpoint configuration, then the Backstage token (if provided) WILL be forwarded.
>
> Note that if you have `backend.auth.dangerouslyDisableDefaultAuthPolicy` set to true, the credentials value does not apply; the proxy will behave as if all endpoints were set to dangerously-allow-unauthenticated.

1. Set the authorization using one of the following options:

- Basic authorization:

- Navigate to the ACR portal and go to the **Access Keys** tab.
- Retrieve the username and password of the Admin user and use the [Basic Auth Header Generator tool](https://www.debugbear.com/basic-auth-header-generator) or run `echo printf '<username>:<password>' | base64` in a terminal to convert the credentials into a basic token.
- Set the generated token as `ACR_AUTH_TOKEN` in environment variables.

- OAuth2: - Generate bearer access token using the process described in Authenticate with an Azure Container Registry.

- One method is to generate a bearer token using your basic authorization token, i.e.

```bash
curl --location 'https://<yourregistry>.azurecr.io/oauth2/token?scope=repository%3A*%3A*&service=<yourregistry>.azurecr.io' \
--header 'Authorization: Basic <basic_token>'
```

- Set the generated token as `ACR_AUTH_TOKEN` in environment variables. Make sure to replace the `Basic` in the `app-config.yaml` with `Bearer`

1. Enable an additional tab on the entity view page using the `packages/app/src/components/catalog/EntityPage.tsx` file as follows:

```tsx title="packages/app/src/components/catalog/EntityPage.tsx"
/* highlight-add-start */
import { AcrPage, isAcrAvailable } from '@janus-idp/backstage-plugin-acr';
/* highlight-add-end */
const serviceEntityPage = (
<EntityLayout>
// ...
{/* highlight-add-start */}
<EntityLayout.Route
if={e => Boolean(isAcrAvailable(e))}
path="/acr"
title="ACR"
>
<AcrPage />
</EntityLayout.Route>
{/* highlight-add-end */}
</EntityLayout>
);
```

1. Annotate your entity using the following annotations:

```yaml
metadata:
annotations:
'azure-container-registry/repository-name': `<REPOSITORY-NAME>',
```
## For users
### Using the ACR plugin in Backstage
ACR is a front-end plugin that enables you to view information about the container images from your Azure Container Registry in Backstage.
#### Prerequisites
- Your Backstage application is installed and running.
- You have installed the ACR plugin. For installation instructions, see [Installing and configuring the ACR plugin](#installing-and-configuring-the-acr-plugin).
#### Procedure
1. Open your Backstage application and select a component from the Catalog page.
1. Go to the **ACR** tab.
![acr-tab](./images/acr-plugin-user1.png)
The **ACR** tab in the Backstage UI contains a list of container images and related information, such as **TAG**, **CREATED**, **LAST MODIFIED**, and **MANIFEST**.
2 changes: 1 addition & 1 deletion plugins/analytics-module-matomo/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Deprecated
# ❗DEPRECATED❗

This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-analytics-module-matomo` instead.
2 changes: 1 addition & 1 deletion plugins/analytics-provider-segment/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Deprecated
# ❗DEPRECATED❗

This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-analytics-provider-segment` instead.
15 changes: 1 addition & 14 deletions plugins/argocd-common/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
# ❗DEPRECATED❗

This package has been deprecated.
This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-redhat-argocd-common` instead.

Please use the **[@backstage-community/plugin-redhat-argocd-common](https://www.npmjs.com/package/@backstage-community/plugin-redhat-argocd-common)** package instead.

# argocd-common

Welcome to the argocd-common plugin!

This plugin contains common utilities for the argocd plugin.

# Argo CD plugin for Backstage

The Argocd plugin displays the information about your argocd applications in your Backstage application.

For more information about Argocd plugin, see the [Argocd plugin documentation](https://github.com/janus-idp/backstage-plugins/tree/main/plugins/argocd) on GitHub.
Loading

0 comments on commit b10490c

Please sign in to comment.