Skip to content

feat: update GitHub issues API to support fetching issues by repository host#8135

Open
sonikro wants to merge 1 commit into
backstage:mainfrom
sonikro:main
Open

feat: update GitHub issues API to support fetching issues by repository host#8135
sonikro wants to merge 1 commit into
backstage:mainfrom
sonikro:main

Conversation

@sonikro
Copy link
Copy Markdown

@sonikro sonikro commented Mar 17, 2026

Hey, I just made a Pull Request!

Problem

  1. Not all groups are (github groups), some are manually created groups and they don't have locations that are valid URLs. WHen this is the case, the application crashes when trying to parse the hostname from the URL.
  2. A Group can own Github Repositories across multiple github hosts

By moving the hostname discovery from the Group to the Repo (and splitting the query into one per github host) we solve both problems.

This allows groups that are not synced from Github to still use the plugin + adds a new feature that allows you to see all of your issues across multiple github instances.

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

@backstage-goalie
Copy link
Copy Markdown
Contributor

backstage-goalie Bot commented Mar 17, 2026

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage-community/plugin-github-issues workspaces/github/plugins/github-issues minor v1.0.0

@backstage-goalie
Copy link
Copy Markdown
Contributor

Thanks for the contribution!
All commits need to be DCO signed before they are reviewed. Please refer to the the DCO section in CONTRIBUTING.md or the DCO status for more info.

@sonikro sonikro force-pushed the main branch 2 times, most recently from 268569c to 743dad7 Compare March 17, 2026 17:24
…sitory host

Signed-off-by: Jonathan Nagayoshi <jonathan@nagayoshi.com.br>
@sonikro sonikro changed the title refactor: update GitHub issues API to support fetching issues by repository host feat: update GitHub issues API to support fetching issues by repository host Mar 17, 2026
@sonikro sonikro marked this pull request as ready for review March 17, 2026 17:33
@sonikro sonikro requested a review from a team as a code owner March 17, 2026 17:33
@sonikro sonikro requested a review from vinzscam March 17, 2026 17:33
@github-actions
Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions Bot added the stale label Apr 16, 2026
@github-actions github-actions Bot closed this Apr 30, 2026
@awanlin
Copy link
Copy Markdown
Contributor

awanlin commented May 11, 2026

Hi @sonikro, sorry this closed on you, I was starting a review on this two weeks ago but seems I didn't hit submit but when I did just now I seem to have lost my comments. I'll try and review this again in the next few days.

@awanlin awanlin reopened this May 11, 2026
@awanlin
Copy link
Copy Markdown
Contributor

awanlin commented May 11, 2026

Hi @hopehadfield and @Fortune-Ndlovu, this PR existed first, any chance we can consolidate the work done in #9105 here? I have not looked at the newer PR myself I just could remember reviewing a PR that did the same thing already when I found I didn't submit my review here.

Copy link
Copy Markdown
Contributor

@Fortune-Ndlovu Fortune-Ndlovu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @sonikro, nice work on the multi-host support! I took a close look at this PR and I think the architectural change (grouping repos by host at the API layer) is the right approach.

One thing I noticed though, this PR removes the getHostnameFromEntity call from useGetIssuesByRepoFromGithub.ts, but there's still a call to getHostnameFromEntity in useEntityGithubRepositories.ts where the repository list is built. That's actually the call site that crashes for file: type source-locations it throws TypeError: Invalid URL before the repos ever reach the API layer.

I opened #9105 which fixes getHostnameFromEntity itself to handle file: type locations. Happy to consolidate that fix into this PR if that's easier for the maintainers. The two changes are complementary:

  • This PR (#8135): Refactors the API to support multi-host and removes the hostname param from fetchIssuesByRepoFromGithub
  • #9105: Fixes getHostnameFromEntity so it doesn't throw on file: type source-locations (which is what actually causes the crash)

Without the getHostnameFromEntity fix, entities with file: source-locations will still crash in useEntityGithubRepositories before the repos reach your new multi-host grouping logic.

Let me know how you'd like to proceed. I can push the getHostnameFromEntity fix to this branch, or we can merge them separately.

cc: @awanlin @hopehadfield

@github-actions github-actions Bot removed the stale label May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants