AxisCommunications / backstage-plugins

Backstage Plugins Created by Axis Communications
MIT License
32 stars 17 forks source link

Issue with Jira-dashboard plugin #200

Open reynierpupo-tomtom opened 1 month ago

reynierpupo-tomtom commented 1 month ago

Please do not disclose security vulnerabilities as issues. See our security policy for responsible disclosures.

Describe the bug

I have configured everything described in the readme file. Now trying to render the logged in user tasks but I get an error from the backend plugin

image

To reproduce

Please provide as much context as possible and describe the reproduction steps that someone else can follow to recreate the issue on their own.

A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps. Bugs without steps will not be addressed until they can be reproduced.

Steps to reproduce the behavior:

  1. Set up '...'
  2. Do this '...'
  3. See error

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

Additional context

Add any other context about the problem here.

anicke commented 1 month ago

Some questions:

anicke commented 1 month ago

I just realised that the instruction for the old backend system is incorrect. The "createRouter" function also needs the "coreServices.userInfo" as an argument.

   import { createRouter } from '@axis-backstage/plugin-jira-dashboard-backend';
   import { Router } from 'express';
   import { PluginEnvironment } from '../types';

   export default async function createPlugin(
     env: PluginEnvironment,
   ): Promise<Router> {
     return await createRouter({
       logger: env.logger,
       config: env.config,
       discovery: env.discovery,
       identity: env.identity,
       tokenManager: env.tokenManager,
       **userInfo: coreServices.userInfo**     // Is this available in the old "PluginEnvironment"?
     });
   }
reynierpupo-tomtom commented 1 month ago

I just realised that the instruction for the old backend system is incorrect. The "createRouter" function also needs the "coreServices.userInfo" as an argument.

import { createRouter } from '@axis-backstage/plugin-jira-dashboard-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';

export default async function createPlugin(
  env: PluginEnvironment,
): Promise<Router> {
  return await createRouter({
    logger: env.logger,
    config: env.config,
    discovery: env.discovery,
    identity: env.identity,
    tokenManager: env.tokenManager,
    **userInfo: coreServices.userInfo**     // Is this available in the old "PluginEnvironment"?
  });
}

Thanks @anicke , It's available, will try to provide it also.