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 9, 2024
1 parent cfec51a commit f509643
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
10 changes: 10 additions & 0 deletions .changeset/cool-rockets-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@spreadshirt/backstage-plugin-s3-viewer-backend': patch
---

Replace some deprecations caused by the removal of the backend-tasks plugin and deprecate old backend system.

The old backend system calls 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
4 changes: 2 additions & 2 deletions plugins/s3-viewer-backend/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
* limitations under the License.
*/

import { getRootLogger } from '@backstage/backend-common';
import { mockServices } from '@backstage/backend-test-utils';
import yn from 'yn';
import { startStandaloneServer } from './service/standaloneServer';

const port = process.env.PLUGIN_PORT ? Number(process.env.PLUGIN_PORT) : 7007;
const enableCors = yn(process.env.PLUGIN_CORS, { default: false });
const logger = getRootLogger();
const logger = mockServices.logger.mock();

startStandaloneServer({ port, enableCors, logger }).catch(err => {
logger.error(err);
Expand Down
4 changes: 4 additions & 0 deletions plugins/s3-viewer-backend/src/service/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,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 f509643

Please sign in to comment.