Giter Site home page Giter Site logo

Comments (10)

awanlin avatar awanlin commented on June 2, 2024 1

Awesome! Glad everything is working for you now. Really appreciate your patience as we worked to sort this out.

from backstage.

prasoon-pxc avatar prasoon-pxc commented on June 2, 2024

After adding backend.add(import('@backstage/plugin-auth-backend-module-github-provider')); in packages/backend/src/index.ts , it's not giving above error but now getting below:

image

from backstage.

prasoon-pxc avatar prasoon-pxc commented on June 2, 2024

I am able to solve above error after adding below lines in my app-config.yaml, But these things are not documented well in backstage docs, because I am setting up new backstage from scratch and I should not need to add this line explicitly
backend.add(import('@backstage/plugin-auth-backend-module-github-provider'));

app-config.yaml

auth:
 # see https://backstage.io/docs/auth/ to learn about auth providers
 environment: development
 providers:
   github:
     development:
       clientId: ${AUTH_GITHUB_CLIENT_ID}
       clientSecret: ${AUTH_GITHUB_CLIENT_SECRET}
     #below lines are extra in new backend system
       signIn:
         resolvers:
           - resolver: usernameMatchingUserEntityName

from backstage.

awanlin avatar awanlin commented on June 2, 2024

Hi @prasoon-pxc, sorry you've had issues and the docs haven't been to helpful. We are actively working on that: #24195

Any new instances of Backstage will use the new backend system by default as of the 1.24.0 release from a few months ago. This means that you do need to add backend.add(import('@backstage/plugin-auth-backend-module-github-provider')); to your backend index.ts file and also add the signIn.resolvers details in your config.

from backstage.

prasoon-pxc avatar prasoon-pxc commented on June 2, 2024

No problem, But I am wondering if that is the case with Github-org data doc as well because I am also getting problem on automating ingesting github users to backstage, I am looking more into it and will check if there is some document issue there as well :-)

from backstage.

awanlin avatar awanlin commented on June 2, 2024

Yes, that page needs to be updated as well. The migration guide here might help you in the mean time: https://backstage.io/docs/backend-system/building-backends/migrating#the-catalog-plugin:~:text=GithubMultiOrgEntityProvider%20and%20GithubOrgEntityProvider

from backstage.

prasoon-pxc avatar prasoon-pxc commented on June 2, 2024

@awanlin , I tried to add changes what is mentioned in above doc, but it's still not working.

Added github-org package:

yarn --cwd packages/backend add @backstage/plugin-catalog-backend-module-github-org


packages/backend/src/index.ts

backend.add(import('@backstage/plugin-catalog-backend-module-github/alpha'));
backend.add(import('@backstage/plugin-catalog-backend-module-github-org'));

Apart from the above steps, I have used this doc to install required things.

My catalog.ts file looks like this:

packages/backend/src/plugins/catalog.ts

import { CatalogBuilder } from '@backstage/plugin-catalog-backend';
import { ScaffolderEntitiesProcessor } from '@backstage/plugin-catalog-backend-module-scaffolder-entity-model';
import { Router } from 'express';
import { PluginEnvironment } from '../types';

import { GitHubOrgEntityProvider } from '@backstage/plugin-catalog-backend-module-github';

export default async function createPlugin(
  env: PluginEnvironment,
): Promise<Router> {
  const builder = await CatalogBuilder.create(env);

   //Added GITHUB ORG

   builder.addEntityProvider(
    GitHubOrgEntityProvider.fromConfig(env.config, {
      id: 'production',
      orgUrl: 'https://github.com/my-org',
      logger: env.logger,
      schedule: env.scheduler.createScheduledTaskRunner({
        frequency: { minutes: 60 },
        timeout: { minutes: 15 },
      }),
    }),
  );

  builder.addProcessor(new ScaffolderEntitiesProcessor());
  const { processingEngine, router } = await builder.build();
  await processingEngine.start();
  return router;
}

Also, added github integration using Github-App
app-config.yaml

integrations:
  github:
    - host: github.com
      apps:
        - $include: my-githubapp.yaml

from backstage.

prasoon-pxc avatar prasoon-pxc commented on June 2, 2024

==Tried updated doc to configure it, did below steps:

I have setup Github-integration with github app using this doc also provide required permissions for Github-app to ingest users and teams

After that added below package:

yarn --cwd packages/backend add @backstage/plugin-catalog-backend-module-github-org

added below line in packages/backend/src/index-tx

backend.add(import('@backstage/plugin-catalog-backend-module-github-org'));

app-config.yaml

integrations:
  github:
    - host: github.com
      apps:
        - $include: my-big-org.yaml

from backstage.

awanlin avatar awanlin commented on June 2, 2024

One of the items missing in my PR to updated the docs which you might be missing too is that you need to make sure to schedule it:

catalog:
  providers: 
    githubOrg:
      id: production
      githubUrl: https://github.com
      orgs: ['Org1', 'Org2']
      schedule:
        frequency: PT1H
        timeout: PT50M

I've updated my PR to have this as well

from backstage.

prasoon-pxc avatar prasoon-pxc commented on June 2, 2024

@awanlin , thanks for update, indeed that was missing. Now, working as expected.

from backstage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.