Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github-discovery should only output repositories with relevant files #4730

Closed
nirga opened this issue Feb 28, 2021 · 2 comments · Fixed by #4737
Closed

github-discovery should only output repositories with relevant files #4730

nirga opened this issue Feb 28, 2021 · 2 comments · Fixed by #4737
Labels
bug Something isn't working

Comments

@nirga
Copy link
Contributor

nirga commented Feb 28, 2021

Currently the way github-discovery is implemented is that it outputs all repositories that match a certain pattern, and leave it to a lower level to find the relevant catalog file within that repo. This causes a weird behavior if for example the following pattern is given:

locations:
    - type: github-discovery
      target: https://github.com/backstage/*mkdocs/blob/master/catalog.yaml

And only some of the repos with mkdocs in their name contain a catalog.yaml file. All repos will be outputted, which will cause an error to be thrown for those repos where catalog.yaml file doesn't exist.

Expected Behavior

Only relevant repos matching the entire filepattern should be outputted.

Current Behavior

Errors are thrown when reading repositories that partially match the file pattern.

Possible Solution

Steps to Reproduce

Context

Your Environment

  • NodeJS Version (v12):
  • Operating System and Version (e.g. Ubuntu 14.04):
  • Browser Information:
@nirga nirga added the bug Something isn't working label Feb 28, 2021
@freben
Copy link
Member

freben commented Feb 28, 2021

Hm i wonder if we should really mix the repo and file concerns. It would make sense to emit the locations with presence: 'optional' instead. That makes it so that the next iteration doesn't strictly require that something actually exists on the given path.

@nirga
Copy link
Contributor Author

nirga commented Mar 1, 2021

I like that! I didn't like mixing the concerns as well. Creating a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants