RSC-Labs / backstage-highlights-plugin

Backstage Highlights Plugin is configurable and customizable plugin for viewing the most important information about your entity.
Mozilla Public License 2.0
5 stars 1 forks source link

Migrate plugin to New Backend System #4

Closed joariasl closed 1 month ago

joariasl commented 3 months ago

Backstage release a New Backend System that is ready for production use.

The recommendation is all plugins and deployments to migrate to the new system.

https://backstage.io/docs/backend-system/building-plugins-and-modules/migrating

radoslaw-sz commented 3 months ago

hi @joariasl - I cannot promise I will do it soon - I have unfortunately some other priorities, but I am open for pull requests.

radoslaw-sz commented 2 months ago

hi @joariasl - new backend system is (I hope) supported in version 0.3.0. Please kindly check.

nia-potato commented 2 months ago

i can test this after https://github.com/RSC-Labs/backstage-highlights-plugin/issues/5 is closed @radoslaw-sz

joariasl commented 2 months ago

It doesn't work properly if you don't return a BackendFeature with createBackendPlugin of '@backstage/backend-plugin-api'

Reference: https://github.com/backstage/community-plugins/blob/main/workspaces/badges/plugins/badges-backend/src/plugin.ts

radoslaw-sz commented 2 months ago

hi @joariasl - hmm that's strange, the code follows the code which you pasted. I am using createBackendPlugin etc. What do you mean by BackendFeature? I did not find such term anywhere. Did you maybe try to use this newest version with your Backstage application? What exactly issue do you encounter now?

nia-potato commented 2 months ago

new backend is working for me after just adding backend.add(import('@rsc-labs/backstage-highlights-plugin-backend'));

radoslaw-sz commented 2 months ago

thanks @nia-potato for the feedback! @joariasl - could you please check again?

radoslaw-sz commented 1 month ago

hi @joariasl - kindly reminder. I have a plan to close this issue :)

joariasl commented 1 month ago

My issue has an additional different problem.

I applied the next configuration

  1. Install FrontEnd plugin
    yarn --cwd packages/app add @rsc-labs/backstage-highlights-plugin
  2. Configure FrontEnd in packages/app/src/components/catalog/EntityPage.tsx with
    import { EntityHighlightsCard } from '@rsc-labs/backstage-highlights-plugin';

    and

    const overviewContent = (
    /* ... */
      <Grid item md={12} xs={12}>
        <EntityHighlightsCard />
      </Grid>
    /* ... */
    );
  3. Install BackEnd plugin
    yarn --cwd packages/backend add @rsc-labs/backstage-highlights-plugin-backend
  4. Configure BackEnd in packages/backend/src/index.ts with
    // Highlights plugin
    backend.add(import('@rsc-labs/backstage-highlights-plugin-backend'));
  5. Configure highlights.github in my case. (I can't configure this parameter using authentication with a GitHub App)

But I receive this error from the path */fetchCommits

image

I found that is related from my configuration using an application authentication config instead of a personal access token for GitHub.

    integrations:
      # github:
      #   - host: github.com
      #     token: ${GITHUB_TOKEN}
      github:
        - host: github.com
          apps:
            - $include: github-app-config.yaml

with github-app-config.yaml created from

  github-app-config.yaml: |-
    appId: ${GITHUB_APP_ID}
    clientId: ${AUTH_GITHUB_CLIENT_ID}
    clientSecret: ${AUTH_GITHUB_CLIENT_SECRET}
    webhookSecret: ${AUTH_WEBHOOK_SECRET}
    privateKey: |-
      ${GITHUB_APP_PRIVATE_KEY_SECRET}

The plugin is not compatible with this type of configuration to authenticate to GitHub. I can't validate the update util create a personal access token for highlights only.

joariasl commented 1 month ago

🚀 It's working properly using a personal access token in the New Backend System for the version @rsc-labs/backstage-highlights-plugin-backend@^0.3.0

    highlights:
      github:
        token: ${HIGHLIGHTS_AUTH_GITHUB_TOKEN}

Note: GitHub Application authentication method looks not supported by Highlights plugin

radoslaw-sz commented 1 month ago

hi @joariasl - thank you for check! Indeed, GitHub App authentication is not supported - there is already issues raised for this: https://github.com/RSC-Labs/backstage-highlights-plugin/issues/2. Unfortunately, I do not have plan for support this in a near future.

radoslaw-sz commented 1 month ago

hi @joariasl - I am closing this issue as (from my understanding) it is resolved. Please kindly reopen if needed.