Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify workspace reachability through HTTP client #882

Merged
merged 4 commits into from
Oct 29, 2021

Conversation

nfx
Copy link
Contributor

@nfx nfx commented Oct 29, 2021

  • WorkspacesAPI.WaitForRunning used to check if workspace is reachable through net.Dial on TCP level, though this scenario ignored HTTPS proxies, which are common for enterprise setup.
  • mws.Workspace now gets workspace_url computed in accordance to Accounts API endpoint used from a single place in WorkspacesAPI.Read, if there's no workspace_url returned in the response, which allows fully unit testing the verification flow.
  • added DatabricksClient.ClientForHost to talk to just created workspace with the same authentication parameters.

This fixes #874

@nfx nfx requested review from pietern and alexott October 29, 2021 14:28
@nfx nfx added this to the v0.3.10 milestone Oct 29, 2021
Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

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

LGTM from a cursory look. I only touched the parts dealing with hostname synthesis based off the account console hostname.

@codecov
Copy link

codecov bot commented Oct 29, 2021

Codecov Report

Merging #882 (bd7df75) into master (b1976a3) will decrease coverage by 0.15%.
The diff coverage is 54.90%.

❗ Current head bd7df75 differs from pull request most recent head a6effac. Consider uploading reports for the commit a6effac to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #882      +/-   ##
==========================================
- Coverage   83.80%   83.65%   -0.16%     
==========================================
  Files          92       92              
  Lines        8233     8258      +25     
==========================================
+ Hits         6900     6908       +8     
- Misses        842      859      +17     
  Partials      491      491              
Impacted Files Coverage Δ
common/client.go 76.23% <0.00%> (-8.01%) ⬇️
common/version.go 100.00% <ø> (ø)
mws/resource_workspace.go 80.22% <85.71%> (+1.61%) ⬆️
common/http.go 86.59% <100.00%> (+0.14%) ⬆️

Copy link
Contributor

@alexott alexott left a comment

Choose a reason for hiding this comment

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

lgtm

nfx added 4 commits October 29, 2021 18:06
* `WorkspacesAPI.WaitForRunning` used to check if workspace is reachable through `net.Dial` on TCP level, though this scenario ignored HTTPS proxies, which are common for enterprise setup.
* `mws.Workspace` now gets `workspace_url` computed in accordance to Accounts API endpoint used from a single place in `WorkspacesAPI.Read`, if there's no `workspace_url` returned in the response, which allows fully unit testing the verification flow.
* added `DatabricksClient.ClientForHost` to talk to just created workspace with the same authentication parameters.

This fixes #874
Also made test surface smaller
@nfx nfx force-pushed the workspace-probe-through-proxy branch from bd7df75 to a6effac Compare October 29, 2021 16:06
@nfx nfx merged commit 756baba into master Oct 29, 2021
@nfx nfx deleted the workspace-probe-through-proxy branch October 29, 2021 16:11
@nfx nfx mentioned this pull request Oct 29, 2021
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.

DBX Workspace error (no such host found) on retry
3 participants