Add experimental support for large file upload.#6018
Conversation
Approval status: pending
|
Integration test reportCommit: 24741c4
13 interesting tests: 5 flaky, 4 RECOVERED, 4 SKIP
Top 23 slowest tests (at least 2 minutes):
|
Reworks the `fs` command's UC Volumes filer (also used by bundle library uploads) to run on the new `sdk-go/files/v2` client instead of hand-rolled Files API calls plus a separate CLI-side multipart upload engine. `files/v2` is not published to the Go proxy yet, so it is vendored under `libs/tmp/` along with the two unpublished sibling modules it needs (`auth` and `options`); the published `sdk-go/core` module stays a normal dependency. The only edits to the vendored copy are the import-path rewrite and two fixes to the generated client (see below). `libs/tmp/README.md` records the copy and the swap-and-delete steps for when the module is published. The filer now delegates upload, download, listing, mkdir, delete, and stat to `files/v2`, which brings its own multipart/resumable engine. The CLI's own `libs/upload` engine is therefore removed. `DATABRICKS_EXPERIMENTAL_MULTIPART_UPLOAD` still gates whether large Volumes uploads are split into parts, but now selects multipart-vs-single-shot within files/v2 rather than a separate engine. This pull request and its description were written by Isaac. Co-authored-by: Isaac
a392fc5 to
39fe347
Compare
The sdk-go files/v2 client and its auth/options/core dependencies are now published to the Databricks Go proxy, so the temporary in-repo copy under libs/tmp is no longer needed. Replaces it with real module dependencies (files v0.0.0-dev.1, auth v0.0.0-dev, options v0.0.0-dev, core bumped to v0.0.1-dev), rewrites the filer and fs command imports from github.com/databricks/cli/libs/tmp/... back to github.com/databricks/sdk-go/..., and removes libs/tmp along with its carve-outs in .golangci.yaml, tools/check_deadcode.py, and .github/OWNERS. The two local fixes that had been applied to the vendored generated client (empty response bodies and HTTP method casing) are fixed upstream in the published version, so nothing is lost. This pull request and its description were written by Isaac. Co-authored-by: Isaac
The configCredentials adapter reported a hardcoded "databricks-cli" as its credentials name, which the files/v2 client folds into the User-Agent. Report the config's actual resolved auth type (pat, oauth-m2m, azure-cli, ...) instead. The CLI resolves auth when it builds the workspace client, so AuthType is set before the filer is created. This pull request and its description were written by Isaac. Co-authored-by: Isaac
a637d98 to
cb8b260
Compare
The files/v2 client validates the credential name at construction and rejects an empty value with an "invalid value for \"auth\"" error. configCredentials.Name returned cfg.AuthType, which is empty when auth has not been resolved (as in the bundle/libraries UC Volumes filer tests that build a bare config), breaking task test across all platforms. Co-authored-by: Isaac
What
The
fscommand's UC Volumes filer now runs on thesdk-go/files/v2client instead of hand-written Files API calls. The filer is shared, so bundle library uploads to Volumes go through the same path.files/v2brings its own multipart/resumable upload engine.DATABRICKS_EXPERIMENTAL_MULTIPART_UPLOADgates whether large Volumes uploads are split into parts; it selects multipart-vs-single-shot withinfiles/v2. Default behavior (single-shot PUT) is unchanged.The CLI takes on four new direct dependencies:
github.com/databricks/sdk-go/files(v0.0.0-dev.1),.../authand.../options(v0.0.0-dev), and.../corebumped tov0.0.1-dev. These are-devpre-release versions; a follow-up should move to stable tags once sdk-go cuts them.Notable in the diff
libs/filer/files_client.gois rewritten onto*files.Client. Error mapping keys off the HTTP status (via ahttpStatushelper) rather than the SDK's canonicalcodes.Code, because the Files API reports "path already exists" as 409, which the SDK maps tocodes.Aborted(notcodes.AlreadyExists).libs/filer/files_client_auth.goadapts the CLI's resolvedconfig.Configinto theauth.Credentialsthe client expects, signing a request withconfig.Authenticateand reusing those headers instead of re-reading a profile. Its credentials name is the config's resolved auth type (pat,oauth-m2m, ...).NewFilesClientgains actxparameter, threaded through its callers.fsandbundle/libraries, so bundle Volumes uploads are affected.go.mod/NOTICEgain the new sdk-go modules as direct dependencies.libs/testservernow models "409 when creating a directory over an existing file," which the fake previously did not; this closes the gap that let aMkdirerror-mapping regression through.Out of scope
files/v2only backs the UC Volumes path.This pull request and its description were written by Isaac.