Describe the bug
Any time you run a function that relies on call_oss_index without a token, it errors.
To Reproduce
Looks like this is currently failing in the tests for this package. For example, run audit_description() with no arguments in a repo with no OSSINDEX secrets.
Expected behavior
From reading the documentation, I would expect this to run, or if it fails it would be after the check_status_code. If it's not possible to run without tokens anymore, I'd recommend updating the readme and other documentation.
Desktop (please complete the following information):
- OS: windows
- R Version: 4.5.0
- oysteR Version 0.1.4
Additional context
Experimenting with the code a little, I think a couple changes would be needed.
- Something like this so that token doesn't get reassigned to NA.
get_token = function(token, verbose = TRUE) {
if (is.null(token)) {
user = Sys.getenv("OSSINDEX_USER", NA)
tokencode = Sys.getenv("OSSINDEX_TOKEN", NA)
if (!is.na(user) && !is.na(tokencode)) {
token = list(user = user, token = tokencode)
}
- I don't quite understand how the code should work without a token, but something would also need to change in the httr calls in
call_oss_index
Describe the bug
Any time you run a function that relies on
call_oss_indexwithout a token, it errors.To Reproduce
Looks like this is currently failing in the tests for this package. For example, run
audit_description()with no arguments in a repo with no OSSINDEX secrets.Expected behavior
From reading the documentation, I would expect this to run, or if it fails it would be after the
check_status_code. If it's not possible to run without tokens anymore, I'd recommend updating the readme and other documentation.Desktop (please complete the following information):
Additional context
Experimenting with the code a little, I think a couple changes would be needed.
call_oss_index