Skip to content

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

@HDash

Description

@HDash

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions