cynkra / fledge

Wings for your R packages: Streamline the process of versioning R packages and updating NEWS
https://fledge.cynkra.com
188 stars 11 forks source link

get_main_branch() always running get_main_branch_config() even when it shouldn't #768

Open D3SL opened 7 months ago

D3SL commented 7 months ago

Related to #767 , and how I found it. For some reason get_main_branch() is always running get_main_branch_config() even when it shouldn't because the tests on line 83 (remote %in% remote_list$name) and 85 (length(remote_main)) succeed.

There's 2 possibilities I can think of. The first is there's a build time issue leading to the tests failing in the function but working when the same lines of code are run interactively, or for some other reason the function isn't ending at the return() call and because the implied "else" clause isn't in an explicit else{} section get_main_branch_config() keeps getting run.

Parallel to all that length() is as in #767 not a good test for dataframes.

maelle commented 5 months ago

Do you want to tackle this next? :innocent:

maelle commented 5 months ago

why do you think/see the function is running? because of the bug you've now fixed?

maelle commented 5 months ago

what I find more problematic is that if the "origin" branch doesn't exist, get_main_branch_remote() will error. (I ran get_main_branch_remote("bla") to try). so that should probably be made more robust.