RajLabMSSM / echogithub

echoverse module: Extract data and metadata from GitHub
0 stars 1 forks source link

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

Open HDash opened 16 hours ago

HDash commented 16 hours ago

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 commented 16 hours ago

See PR https://github.com/RajLabMSSM/echogithub/pull/4 for definitive fix