roadiehq / backstage-plugin-github-pull-requests Goto Github PK
View Code? Open in Web Editor NEWView and interact with GitHub Pull Requests on Backstage
Home Page: https://roadie.io/backstage/plugins/github-pull-requests
View and interact with GitHub Pull Requests on Backstage
Home Page: https://roadie.io/backstage/plugins/github-pull-requests
I have tried to add this to our instance of backstage in local and getting this error :
index.esm.js?9424:formatted:112 Uncaught Error: No ApiProvider available in react context
at useApiHolder (index.esm.js?9424:formatted:112)
at useApi (index.esm.js?9424:formatted:119)
at usePullRequestsStatistics (index.esm.js?8287:274)
at PullRequestsStats (index.esm.js?8287:317)
Does it need any additional config to be added or does it expect any other plugin to be installed already ?
Right now, this plugin is depend on GitHub authentication, which is not something I am planning on using.
I would like this plugin to use the GitHub integration credentials (PAT for example) instead of relaying on the auth method.
When trying to navigate to the Pull Requests tab, the page crashes with the following error/stacktrace:
Uncaught TypeError: Cannot read property 'metadata' of undefined
at isGithubPullRequestsAvailable (index.esm.js?b593:396)
at Router (index.esm.js?b593:400)
at renderWithHooks (react-dom.development.js?9f10:14804)
at mountIndeterminateComponent (react-dom.development.js?9f10:17483)
at beginWork (react-dom.development.js?9f10:18597)
at HTMLUnknownElement.callCallback (react-dom.development.js?9f10:189)
at Object.invokeGuardedCallbackDev (react-dom.development.js?9f10:238)
at invokeGuardedCallback (react-dom.development.js?9f10:293)
at beginWork$1 (react-dom.development.js?9f10:23204)
at performUnitOfWork (react-dom.development.js?9f10:22158)
react-dom.development.js?9f10:19528 The above error occurred in the <Router> component:
in Router (created by RoutableExtension(Router))
in RoutableExtension(Router) (created by Extension(Component))
in Suspense (created by Extension(Component))
in Extension(Component) (at EntityPage.tsx:124)
in article (created by Content)
in Content (created by RoutedTabs)
in RoutedTabs (created by EntityLayout)
in div (created by Page)
in ThemeProvider (created by Page)
in Page (created by EntityLayout)
in EntityLayout (at EntityPage.tsx:118)
in EntitySwitch (at EntityPage.tsx:154)
in EntitySwitch (at EntityPage.tsx:272)
in Outlet (created by CatalogEntityPage)
in EntityLoaderProvider (created by CatalogEntityPage)
in CatalogEntityPage (created by RoutableExtension(CatalogEntityPage))
in RoutableExtension(CatalogEntityPage) (created by Extension(Component))
in Suspense (created by Extension(Component))
in Extension(Component) (at App.tsx:72)
in Route (at App.tsx:72)
in FlatRoutes (at App.tsx:69)
in div (created by SidebarPage)
in SidebarPage (at App.tsx:67)
in Route (created by AppRouter)
in Routes (created by AppRouter)
in SignInPageWrapper (created by AppRouter)
in Router (created by BrowserRouter)
in BrowserRouter (created by AppRouter)
in AppRouter (at App.tsx:66)
in RoutingProvider (created by Provider)
in CssBaseline (created by WithStyles(CssBaseline))
in WithStyles(CssBaseline) (created by AppThemeProvider)
in ThemeProvider (created by AppThemeProvider)
in AppThemeProvider (created by Provider)
in AppContextProvider (created by Provider)
in ApiProvider (created by Provider)
in Provider (at App.tsx:63)
in App (at src/index.tsx:6)
Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries.
logCapturedError @ react-dom.development.js?9f10:19528
scheduler.development.js?2f5b:178 Uncaught TypeError: Cannot read property 'metadata' of undefined
at isGithubPullRequestsAvailable (index.esm.js?b593:396)
at Router (index.esm.js?b593:400)
at renderWithHooks (react-dom.development.js?9f10:14804)
at mountIndeterminateComponent (react-dom.development.js?9f10:17483)
at beginWork (react-dom.development.js?9f10:18597)
at HTMLUnknownElement.callCallback (react-dom.development.js?9f10:189)
at Object.invokeGuardedCallbackDev (react-dom.development.js?9f10:238)
at invokeGuardedCallback (react-dom.development.js?9f10:293)
at beginWork$1 (react-dom.development.js?9f10:23204)
at performUnitOfWork (react-dom.development.js?9f10:22158)
Plugin should work as expected and show PRs.
Plugin displays a white page.
Use this plugin with the latest Backstage release and navigate to the Pull Requests tab.
Latest backstage release:
https://github.com/backstage/backstage/releases/tag/release-2021-05-27
N/A
All table headings have the same format, in particular having the same color.
Super trivial, but I happened to notice that the table header words "ID" and "CREATOR" are in a slightly different color than the others. When light mode, they are normally black text but these two are dark grey. When dark mode, they are normally white text but these two are light grey.
It seems the table generator wraps <Box>
around the values for those columns when displaying the rows, I wonder if that somehow affects the header as well.
@roadiehq/[email protected]
master
(backstage/backstage@0451ac9)yarn tsc
compiles
yarn tsc
gives 4 errors:
$ yarn tsc
yarn run v1.22.10
$ tsc
node_modules/@roadiehq/backstage-plugin-github-pull-requests/src/index.ts:25:8 - error TS2307: Cannot find module './plugin' or its corresponding type declarations.
25 } from './plugin';
~~~~~~~~~~
node_modules/@roadiehq/backstage-plugin-github-pull-requests/src/index.ts:26:15 - error TS2307: Cannot find module './api' or its corresponding type declarations.
26 export * from './api';
~~~~~~~
node_modules/@roadiehq/backstage-plugin-github-pull-requests/src/index.ts:37:8 - error TS2307: Cannot find module './components/Router' or its corresponding type declarations.
37 } from './components/Router';
~~~~~~~~~~~~~~~~~~~~~
node_modules/@roadiehq/backstage-plugin-github-pull-requests/src/index.ts:43:8 - error TS2307: Cannot find module './components/PullRequestsStatsCard' or its corresponding type declarations.
43 } from './components/PullRequestsStatsCard';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 4 errors.
error Command failed with exit code 2.
A difference I saw - with 0.6.4 the npm module's package.json
has the following at the top :
"main": "dist/index.esm.js",
"types": "dist/index.d.ts",
With 0.7.5 it is:
"main": "src/index.ts",
"types": "src/index.ts"
npx @backstage/create-app
yarn install && yarn tsc
I was upgrading from 0.6.4 to 0.7.5 after the backstage release today.
Latest versions of backstage: cli, core, plugins etc
Page renders
Page not rendering, with the console error: Error: No ApiProvider available in react context
n/a
component/x/pull-requests
Hi, i was wondering if there is any plan to add a Widget to this plugin to be able to integrate it into the backstage catalog plugin.
I want to have it as an tab inside the catalog view.
Thanks!
The PullRequestsStatsCard
should use the github.com/project-slug
to display the relevant statistics. Currently, the PullRequestsPage
and it's PullRequestsTable
components use an entity's defined github.com/project-slug
however the stats card actually uses the location where the entity is defined.
For example, I temporarily defined an entity on my local file system for testing, loading it using the locations
in app-config.yaml
. In this entity I identified a real github.com/project-slug
. When viewing the entity, the pull requests table displays properly, but the status card is empty as it seems to believe there are no PRs.
Similarly, I tried putting an entity in one repo called repoA
, but defining the entity's slug as a DIFFERENT repo called repoB
. Doing this results in the same - I see the pull request stats card displaying for repoA
, but the pull requests TABLE is for repoB
.
Ideally, they should be sourced from the slug. (personal opinion)
I believe the usePullRequestsStatistics hook needs to be updated to lookup the annotation on the entity, rather than the source location of the entity which is the same way the table does it?
This would help define consistent information for more complex configurations where it may not be that every single entity is always in the same repo as the code it represents.
I wasn't sure if this was an enhancement (to change the current method) or a bug (to ensure the two components use the same data. ๐
When viewing pull request statistics on a very small repo, the mathematic calculations don't fully work.
Obtain PR statistics for any repo, regardless if it has a lot of PRs or none. In my use case of 2 open PRs and none closed/merged, I'd assume the average time to close should still be able to be calculated, but the merged to closed ratio instead of being NaN% should default to 0%.
On a new repo I have, the homepage widget is broken. I tested with no PRs, one, and two, and the maths just expects that I've merged at least one. But it seems to be dividing by zero, thus resulting in NaN.
Likely should get some test cases in there where the number results back from the GitHub API would have the varying numbers 0 open, 0 closed / 5 open, 0 closed / 5 open, 15 closed, that sort of thing.
We are trying to override the Support Button config to point to custom slack channel rather than backstage.
This feature is available in the latest version of @backstage/[email protected]
This change has already been made in your repo but not been released yet.
I should be able to download version 0.6.5 from npm registry
only version 0.6.4 available.
I'm getting warning about duplicate packages and outdated dependencies.
Added the RoadieHQ/backstage-plugin-github-pull-requests version 0.6.2 via npm manager.
After the Github SSO login, I expect the PR details to be displayed from my private repo. The GITHUB_TOKEN that is set here to be accepted by the plugin
integrations:
github:
- host: github.com
apiBaseUrl: https://api.github.com
token:
$env: GITHUB_TOKEN
It allowed to SSO into Github but the plugin doesn't accept the github token. The result of this is I get a 404 Not found and it seems it is passing some sort of an authentication key which is not mine or not set in the GITHUB_TOKEN
integrations:
github:
- host: github.com
apiBaseUrl: https://api.github.com
token:
$env: GITHUB_TOKEN
catalog:
rules:
- allow: [Component, API, Group, User, Template, Location]
locations:
- type: file
target: /app/catalog-info.yaml
processors:
githubOrg:
providers:
- target: https://github.com
token:
$env: GITHUB_TOKEN
scaffolder:
github:
token:
$env: GITHUB_TOKEN
visibility: private # or 'internal' or 'private'
auth:
providers:
github:
development:
clientId:
$env: AUTH_GITHUB_CLIENT_ID
clientSecret:
$env: AUTH_GITHUB_CLIENT_SECRET`
This doesn't let me use any of the Github PR related features.
First of all, thank you so much for creating this plugin and making it open source!
As you can see in the picture I stumbled into an issue when using the plugin while I has configured backstage to use another font (Poppins).
So steps to reproduce:
Reported by a user:
I tried out the pull requests plugin the other day. Worked fine for public repo's but couldn't get it to read private ones. I'm not sure if this is because I created a github oauth app under my username and not my orgs. Have you tried reading from private repos?
Please try to reproduce. If it doesn't work, please ensure the PRs plugin can read from private repos.
On the pull request table, there are three very nice filter buttons to show open, closed, or all pull requests. However, when you pick the "all", you can't actually tell which category the PRs fall into.
As an equivalent to the GitHub interface, when viewing all PRs without looking at status, the icon indicates the PR is either green or purple:
Suggest showing an icon according to the status would be great, but even just a simple column with the status could be useful as well.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.