Skip to content

call_oss_index doesn't run without token #72

Description

@sierrajohnson

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.

Image

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.

  1. 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)
    }
  1. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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