question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

catalog via github-discovery using a github app defaults to raw reading (unauthenticated)

See original GitHub issue

When using github-discovery type, and having a github app for credentials - fetching the catalog-info.yaml files from each repo default to fetching via github raw (raw.githubusercontent.com) with no authentication.

This means internal or private repos do not work. Similar issue noted here https://github.com/backstage/backstage/issues/1525 and fixed in https://github.com/backstage/backstage/pull/1560 …but I wonder if this bug is related to using a github app instead of a GITHUB_TOKEN?

Expected Behavior

github-discovery should fetch the catalog-info.yaml files in each repository via the github API using authentication.

Current Behavior

backstage successfully gets a complete list of repos and starts iterating over them, however it fetches each repo using raw github contents, example log entry:

{"type":"plugin","plugin":"catalog","service":"backstage","entity":"location:default/generated-5a8887d861a79f609d66ec8c4ba365c72436ff67","level":"warn","message":"Unable to read url, NotFoundError: https://github.com/example-org/example-private-repo/blob/main/catalog-info.yaml could not be read as https://raw.githubusercontent.com/example-org/example-private-repo/main/catalog-info.yaml, 404 Not Found"}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
vschettino-asimovcommented, Apr 13, 2022

Is it possible we had a regression on this one? GitHub App Auth is working fine here (e.g. creating PRs for new projects) but fails to load an existing catalog-info.yaml:

NotFoundError: Unable to read url, NotFoundError: https://github.com/org/repo/tree/main/catalog-info.yaml could not be read as https://raw.githubusercontent.com/org/repo/main/catalog-info.yaml, 404 Not Found

I doubled checked the URL and the credentials as well.

2reactions
frebencommented, Aug 11, 2021

Not really. See https://github.com/backstage/backstage/pull/6787 for a proposed fix!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Catalog] Support importing private GitHub repositories #1525
Have some official way to import catalog spec files from a private GitHub repo. Possible Implementation. The GitHub official API does allow ...
Read more >
Authenticating with GitHub Apps
Generating a private key · In the upper-right corner of any page, click your profile photo, then click Settings. · In the left...
Read more >
Identifying and authorizing users for GitHub Apps
When your GitHub App acts on behalf of a user, it performs user-to-server requests. These requests must be authorized with a user's access...
Read more >
Identifying and authorizing users for GitHub Apps
When your GitHub App acts on behalf of a user, it performs user-to-server requests. These requests must be authorized with a user's access...
Read more >
Permissions required for GitHub Apps
About GitHub App permissions. GitHub Apps are created with a set of permissions. Permissions define what resources the GitHub App can access via...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found