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_files fails to find target branch even if it exists #5

Closed
HDash opened this issue Dec 3, 2024 · 2 comments
Closed

github_files fails to find target branch even if it exists #5

HDash opened this issue Dec 3, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@HDash
Copy link
Contributor

HDash commented Dec 3, 2024

1. Bug description

github_branches only checks the first 100 results returned from GitHub API when querying for branches. If the user's target branch is not in the first 100 results, the function misses out on retrieving an existing branch. As a result, github_files returns no files.

Expected behaviour

Search through all API results in batches (100 at a time, max limit per query) until either the target branch is found, or until end of query is reached in github_branches -> Find appropriate branch -> Fetch appropriate files

2. Reproducible example

Code

echogithub::github_files(owner = "monarch-initiative",
                         repo = "mondo", 
                         query = "src/ontology/mappings/")

master branch does exist!! ^^

Console output

Searching for all branches in: monarch-initiative/mondo
WARNING: 0 matching branches found. Returning NULL.

Data

--

3. Session info

(Add output of the R function utils::sessionInfo() below. This helps us assess version/OS conflicts which could be causing bugs.)

Not relevant

@HDash HDash added the bug Something isn't working label Dec 3, 2024
@HDash
Copy link
Contributor Author

HDash commented Dec 3, 2024

See PR #4 for definitive fix

@bschilder
Copy link
Member

Thanks for this @HDash !

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

No branches or pull requests

2 participants