Skip to content

Commit

Permalink
Update documentation and remove old backend system
Browse files Browse the repository at this point in the history
Apart from removing the old backend system, the old
test suite has been also cleaned up. Instead, the new example app
will be used instead.
  • Loading branch information
ivangonzalezacuna committed Oct 18, 2024
1 parent 7fc3ecc commit 5b89c04
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 530 deletions.
6 changes: 6 additions & 0 deletions .changeset/serious-students-protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@spreadshirt/backstage-plugin-s3-viewer': patch
'@spreadshirt/backstage-plugin-s3-viewer-backend': patch
---

Fix yarn add command in the documentation
7 changes: 7 additions & 0 deletions .changeset/sixty-paws-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@spreadshirt/backstage-plugin-s3-viewer-backend': minor
---

**BREAKING**: Removed old backend system methods and test suite, which was already deprecated and not maintained. A proper solution will be provided later on.

To install the plugin refer to the [updated documentation](https://github.com/spreadshirt/backstage-plugin-s3/tree/main/plugins/s3-viewer#getting-started)
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
"private": true,
"workspaces": {
"packages": [
"packages/**",
"plugins/**"
]
},
"scripts": {
"dev": "yarn workspaces foreach -A --include backend --include app --parallel -v -i run start",
"tsc": "tsc",
"tsc:full": "backstage-cli repo clean && tsc --skipLibCheck false --incremental false",
"build:backend": "yarn workspace backend build",
Expand Down
58 changes: 1 addition & 57 deletions plugins/s3-viewer-backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,63 +14,7 @@ It also includes a permission integration, to restrict access to certain data wi

## Getting started

> :warning: **This setup is deprecated and will be removed in a future release. Please, use the [new backend system instead](#new-backend-system).**
To get started, follow these steps:

1. Install the plugin by running this command:
```bash
# From your Backstage root directory
yarn add --cwd packages/backend @spreadshirt/backstage-plugin-s3-viewer-backend
```

2. Create a file in `src/plugins/s3.ts` and add a reference to it in `src/index.ts`:
```typescript
// In packages/backend/src/plugins/s3.ts
import { S3Builder } from '@spreadshirt/backstage-plugin-s3-viewer-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';
export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
const { router } = await S3Builder.createBuilder({
auth: env.auth,
config: env.config,
logger: env.logger,
scheduler: env.scheduler,
discovery: env.discovery,
permissions: env.permissions,
httpAuth: env.httpAuth,
}).build();
return router;
}
```
```diff
diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts
index f2b14b2..2c64f47 100644
--- a/packages/backend/src/index.ts
+++ b/packages/backend/src/index.ts
@@ -22,6 +22,7 @@ import { Config } from '@backstage/config';
import app from './plugins/app';
+import s3 from './plugins/s3';
import scaffolder from './plugins/scaffolder';
@@ -56,6 +57,7 @@ async function main() {
const authEnv = useHotMemoize(module, () => createEnv('auth'));
+ const s3Env = useHotMemoize(module, () => createEnv('s3'));
const proxyEnv = useHotMemoize(module, () => createEnv('proxy'));
@@ -63,6 +65,7 @@ async function main() {
const apiRouter = Router();
apiRouter.use('/catalog', await catalog(catalogEnv));
+ apiRouter.use('/s3-viewer', await s3(s3Env));
apiRouter.use('/scaffolder', await scaffolder(scaffolderEnv));
```
3. Add the configuration in the `app-config.yaml` file. This is explained in detail in the next section.
## New backend system
The plugin also supports the [new backend system](https://backstage.io/docs/backend-system/). If you want to use the plugin add the following line in the `src/index.ts`:
If you want to use the plugin add the following line in the `src/index.ts`:

```typescript
// In packages/backend/src/index.ts
Expand Down
2 changes: 0 additions & 2 deletions plugins/s3-viewer-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@
"dependencies": {
"@aws-crypto/sha256-browser": "^5.2.0",
"@aws-sdk/client-s3": "^3.360.0",
"@backstage/backend-common": "^0.25.0",
"@backstage/backend-defaults": "^0.5.2",
"@backstage/backend-plugin-api": "^1.0.1",
"@backstage/backend-tasks": "^0.6.1",
"@backstage/config": "^1.2.0",
"@backstage/errors": "^1.2.4",
"@backstage/plugin-auth-node": "^0.5.3",
Expand Down
33 changes: 0 additions & 33 deletions plugins/s3-viewer-backend/src/run.ts

This file was deleted.

80 changes: 0 additions & 80 deletions plugins/s3-viewer-backend/src/service/router.test.ts

This file was deleted.

88 changes: 0 additions & 88 deletions plugins/s3-viewer-backend/src/service/router.ts

This file was deleted.

83 changes: 0 additions & 83 deletions plugins/s3-viewer-backend/src/service/standaloneServer.ts

This file was deleted.

Loading

0 comments on commit 5b89c04

Please sign in to comment.