ginolhac / upnews

Display news and update outdated github R packages
Other
25 stars 2 forks source link

GitHub API error #5

Closed ginolhac closed 6 years ago

ginolhac commented 6 years ago

from https://twitter.com/frod_san/status/1061740769176928257

Hey @Pakillo

could you please try the latest commit and test the debug = TRUE option to see the repos that are fetched?

upnews::upnews(debug = TRUE)
debug:
                    bifag                   bs2site                     callr                       cli 
  "ginolhac/bifag/master"  "koncina/bs2site/master"      "r-lib/callr/master"        "r-lib/cli/master" 
                   cliapp                      desc                  filelock                      glue 
    "r-lib/cliapp/master"       "r-lib/desc/master"   "r-lib/filelock/master"   "tidyverse/glue/master" 
                     iosp                  pkgbuild                pkginstall                   pkgload 
       "koncina/iosp/dev"   "r-lib/pkgbuild/master" "r-lib/pkginstall/master"    "r-lib/pkgload/master" 
                 progress                 rcmdcheck                     rlang                    unilur 
  "r-lib/progress/master"  "r-lib/rcmdcheck/master"  "tidyverse/rlang/master"   "koncina/unilur/master" 
                    withr 
     "r-lib/withr/master" 
ginolhac commented 6 years ago

surely related to #4

Pakillo commented 6 years ago

Thanks for looking into it @ginolhac .

This is my output. Maybe some pkg here doesn't even exist anymore...

upnews::upnews(debug = TRUE)
#> debug:
#>                         addinmanager                             climates 
#>    "csgillespie/addinmanager/master"        "jjvanderwal/climates/master" 
#>                              docthis                             dtupdate 
#>           "mdlincoln/docthis/master"           "hrbrmstr/dtupdate/master" 
#>                          functionMap                            gganimate 
#>     "mangothecat/functionMap/master"         "thomasp85/gganimate/master" 
#>                                 ggkm                           ggplot2bdc 
#>                "sachsmc/ggkm/master"   "briandconnelly/ggplot2bdc/master" 
#>                        ggpomological                              ggthemr 
#>     "gadenbuie/ggpomological/master"             "cttobin/ggthemr/master" 
#>                                gramr                           hrbraddins 
#>          "ropenscilabs/gramr/master"         "hrbrmstr/hrbraddins/master" 
#>                              meetupr                                namer 
#>             "rladies/meetupr/master"             "lockedata/namer/master" 
#>                       packagemetrics                               papaja 
#> "ropenscilabs/packagemetrics/master"                 "crsh/papaja/master" 
#>                                 phyr                             plotflow 
#>               "daijiang/phyr/master"            "trinker/plotflow/master" 
#>                                provR                            rastermap 
#>             "ProvTools/provR/master"            "hadley/rastermap/master" 
#>                           regexplain                               remake 
#>        "gadenbuie/regexplain/master"             "richfitz/remake/master" 
#>                               remedy                                 rfna 
#>          "ThinkR-open/remedy/master"             "ropensci/floras/master" 
#>                            rphylopic                                 rSDM 
#>            "sckott/rphylopic/master"               "Pakillo/rSDM/2ca5a85" 
#>                                 rWMS                           RWordPress 
#>              "davesteps/rWMS/master"         "duncantl/RWordPress/master" 
#>                       scholarnetwork                           slopegraph 
#> "pablobarbera/scholarnetwork/master"           "leeper/slopegraph/master" 
#>                        snippetsaddin                               stackr 
#>  "sfr/RStudio-Addin-Snippets/master"                "lshep/stackr/master" 
#>                            tidyshiny                            tinydensR 
#>       "MangoTheCat/tidyshiny/master"          "bearloga/tinydensR/master" 
#>                               upnews                       wordcountaddin 
#>             "ginolhac/upnews/master"   "benmarwick/wordcountaddin/master" 
#>                              WrapRmd                               XMLRPC 
#>              "tjmahr/WrapRmd/master"             "duncantl/XMLRPC/master" 
#>                           youngmetro 
#>     "aaronbaggett/youngmetro/master"
#> fetching distant sha1
#> Error in gh("GET /repos/:owner/:repo/git/refs/heads/:ref", owner = rep$user, : GitHub API error (404): 404 Not Found
#>   Not Found

Created on 2018-11-12 by the reprex package (v0.2.1)

ginolhac commented 6 years ago

thanks! indeed you have Pakillo/rSDM/2ca5a85 as I told you on twitter, I realized that the ref becomes the commit sha1. And that messes up quite a few things. I need to figure out how to fetch the branch name from a commit sha1, but using the github API. Works fine with git

$ git name-rev --name-only d490355
master~1

I will let you know when it is working, also I found some other mistakes that deserve a fix too. Thanks again for your interest in my little project ;) much appreciated

ginolhac commented 6 years ago

I think that should work now, commit as ref as check for their branch of origin as described here: https://stackoverflow.com/a/23970412/1395352

could you please give a try?

ginolhac commented 6 years ago

pretty sure this is fixed now, closing