IQSS / dataverse-client-r

R Client for Dataverse Repositories

Home Page:https://iqss.github.io/dataverse-client-r

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expired API token for R check

kuriwaki opened this issue · comments

The CRAN checks started failing because 2021-12-30 was the token expiration date (https://cran.r-project.org/web/checks/check_results_dataverse.html as of 2022-01-01). I got a request from CRAN to fix by 2022-01-15.

I can easily replace the yaml with an API I generate from my account. But the demo dataverse (https://demo.dataverse.org/dataverse/dataverse-client-r > Edit > Permissions) has an user role @dataverse-client-r-readonly that I believe @wibeasley created. Not sure yet the best way to replace this.

Error: The API token expired on `2021-12-30`, so the tests would probably fail. Please regenerate a new token and update `inst/constants.yml`
  Execution halted

Four things come to mind

  1. Yes, I agree with you about the cause of the problem. I added that assertion so the error message would be more clear about why the tests failed, and how to fix the situation. In the short-term, I'm happy to regenerate the token, update the yaml, and push the results.

  2. You're right that I created that account, and it uses my email. In the long-term, I'm happy to regenerate the token whenever you need it. Alternatively, it may make sense to transfer that account to your email. Whatever you prefer.

  3. For CRAN tests, the token is no longer necessary (since the CRAN tests stopped hitting the demo server, #96). So the current version of tests/testthat.R should be further complicated. If it it's on CRAN, the check for the expired token will be skipped. The internal for testthat::skip_on_cran() is simple enough to pull out. I'll work on that now and submit a PR for you.

    testthat::skip_on_cran
    # function () 
    # {
    #     skip_if(on_cran(), "On CRAN")
    # }
    
    testthat:::on_cran
    # function () 
    # !identical(Sys.getenv("NOT_CRAN"), "true")
  4. If for some reason it's best to check the token expiration on CRAN's machines, I suggest regenerating the token before every CRAN submission.

Thank you @wibeasley. Agree with your change for item 3 (and 6b818e9), since the individual tests get skipped on CRAN. And thanks for regenerating the token. The short-term solution on 1 sounds good for now. Please feel free to merge #111 when it is ready.