Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devcontainers backend plugin: update code/documentation to account for Backstage's 'New Backend System' #93

Open
Parkreiner opened this issue Mar 26, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@Parkreiner
Copy link
Collaborator

Parkreiner commented Mar 26, 2024

The current code/documentation for the backend devcontainers plugin is based on Backstage's previous backend system. But recently, they've rolled out a New Backend System

I don't think we'll actually need to make any changes to the processor class itself, but we do want to make sure that:

  1. The class follows any new patterns for exports
  2. The documentation is updated to walk somebody through adding the devcontainers plugin for the old/classic backend system, and the new one
@coder-labeler coder-labeler bot added the documentation Improvements or additions to documentation label Mar 26, 2024
@Parkreiner Parkreiner changed the title Devcontainers backend plugin: Update code/documentation to account for Backstage's New Backend System Devcontainers backend plugin: update code/documentation to account for Backstage's 'New Backend System' Mar 26, 2024
@SuperCoolAlan
Copy link

I've gotten started on testing out this migration. Importing the backend plugin was not too difficult following https://backstage.io/docs/backend-system/building-backends/migrating/. That was until I reached incompatible dependencies during build time. I'll continue on to see if I can figure out what's giving me issues during the build.

@ipe4647
Copy link

ipe4647 commented Nov 11, 2024

This is working with the new backend system:

# packages/backend/src/index.ts

...
import { createBackendModule } from '@backstage/backend-plugin-api';
import { DevcontainersProcessor } from '@coder/backstage-plugin-devcontainers-backend';
import { loggerToWinstonLogger } from '@backstage/backend-common';

const backend = createBackend();
....

export const catalogModuleDevcontainersProcessor = createBackendModule({
    pluginId: 'catalog',
    moduleId: 'devcontainers-processor',
    register(env) {
      env.registerInit({
        deps: {
          catalog: catalogProcessingExtensionPoint,
          logger: coreServices.logger,
          urlReader: coreServices.urlReader,
        },
        async init({ catalog, logger, urlReader }) {
          catalog.addProcessor(new DevcontainersProcessor(urlReader, {
            tagName: "devcontainers",
            logger: loggerToWinstonLogger(logger)
          }));
        },
      });
    },
  });
backend.add(catalogModuleDevcontainersProcessor);

...

backend.start();

I don't know how long will it work since backstage/backend-common is deprecated.

This is running every 2 minutes. It would be nice if we can increase this. Maybe processing loop ties in: https://backstage.io/docs/features/software-catalog/configuration/#processing-interval

@ipe4647
Copy link

ipe4647 commented Nov 12, 2024

Confirming that processingInterval changes the frequency of processing in the new backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants