Skip to content

Conversation

@nealrichardson
Copy link
Collaborator

Intent

Remove prefix argument to connect() and just use CONNECT_API_KEY and CONNECT_SERVER env vars like everything else does. Also moves some validation tests for connect() to the unit tests, and tamp down on some of the spurious messaging that was confusing when we were looking at the integration tests in the last PR.

Fixes #476

Approach

Delete stuff, move stuff, read code, run tests.

Checklist

  • Does this change update NEWS.md (referencing the connected issue if necessary)?
  • Does this change need documentation? Have you run devtools::document()?

@nealrichardson nealrichardson changed the title Test 1 removal refactor: remove prefix from connect() and just use the usual env vars Oct 28, 2025
) {
if (is.null(api_key) || is.na(api_key) || nchar(api_key) == 0) {
if (
missing(token) && is.null(api_key) || is.na(api_key) || nchar(api_key) == 0
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this missing(token) bit because it seemed odd that we would validate the API key if instead we were going to use the token. Seemed like we were relying on the fact that there happens to be a CONNECT_API_KEY set on Connect always. But maybe I misunderstood: do you need an API key in order to exchange the token?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm — I think this is the case, I think you need the API key to exchange the token (see that a client is created on line 1015).

However, token exchange only ever happens on Connect and we always have the CONNECT_SERVER environment variable there, so… I think this is a moot point and probably fine.

@@ -1 +1 @@
test_conn_1 <- connect(prefix = "TEST_1")
client <- connect()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took the opportunity to rename all of these in the integration tests to be client.

Copy link
Collaborator

@toph-allen toph-allen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! I think it's unlikely that customers used this functionality, but do you think we should list it in NEWS.md as a breaking change? I'll let you use your judgment on that; this can merge whatever your decision there.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: Update tests and docs to use standard env vars

3 participants