Skip to content

Commit

Permalink
Fix some deprecations and deprecate old backend system
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangonzalezacuna committed Sep 10, 2024
1 parent aad8768 commit df23e04
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .changeset/cool-rockets-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@spreadshirt/backstage-plugin-s3-viewer-backend': patch
---

Replace some deprecations caused by the removal of the backend-tasks plugin and deprecate old backend system.
Please, remove any usage of `RouterOptions` and `createRouter`.

The old backend system methods will be completely removed in the next release, so none of the deprecations
caused by these functions are going to be addressed.

More info about this process [in this issue](https://github.com/backstage/community-plugins/issues/1176).
6 changes: 4 additions & 2 deletions plugins/s3-viewer-backend/config.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TaskScheduleDefinitionConfig } from '@backstage/backend-tasks';
import { SchedulerServiceTaskScheduleDefinitionConfig } from '@backstage/backend-plugin-api';

/** Configuration for the S3 Viewer plugin */
export interface Config {
Expand All @@ -7,7 +7,9 @@ export interface Config {
* If defined, it sets the schedule used to refresh the list of buckets
* @visibility backend
* */
bucketRefreshSchedule: TaskScheduleDefinitionConfig | undefined;
bucketRefreshSchedule:
| SchedulerServiceTaskScheduleDefinitionConfig
| undefined;

/** @visibility backend */
bucketLocatorMethods: Array<
Expand Down
8 changes: 8 additions & 0 deletions plugins/s3-viewer-backend/src/service/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ import {
PolicyDecision,
} from '@backstage/plugin-permission-common';

/**
* @deprecated Use the new backend system instead
* @public
*/
export interface RouterOptions {
logger: LoggerService;
config: RootConfigService;
Expand All @@ -45,6 +49,10 @@ export interface RouterOptions {
httpAuth?: HttpAuthService;
}

/**
* @deprecated Use the new backend system instead
* @public
*/
export async function createRouter(
options: RouterOptions,
): Promise<express.Router> {
Expand Down

0 comments on commit df23e04

Please sign in to comment.