Feature Suggestion
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)
Possible Implementation
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?
https://github.com/RoadieHQ/backstage-plugin-github-pull-requests/blob/main/src/components/usePullRequestsStatistics.ts
Context
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. ๐