-
Notifications
You must be signed in to change notification settings - Fork 127
Use filer when running generate on DBR #4159
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
Conversation
|
Commit: 56da42f
23 interesting tests: 17 KNOWN, 4 RECOVERED, 1 SKIP, 1 FAIL
Top 17 slowest tests (at least 2 minutes):
|
| // This function ensures the correct filer is used based on the runtime environment. | ||
| func NewOutputFiler(ctx context.Context, w *databricks.WorkspaceClient, outputDir string) (Filer, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is specific to DBR, can you move to libs/dbr?
| func testContext(t *testing.T) context.Context { | ||
| m := mocks.NewMockWorkspaceClient(t) | ||
| ctx := cmdctx.SetWorkspaceClient(context.Background(), m.WorkspaceClient) | ||
| return dbr.DetectRuntime(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This evaluates differently on DBR and non-DBR. If for testing purposes, can it be fixed?
pietern
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR uncovered another issue on DBR. Blocking merge.
|
This approach is no longer needed. We need to add a parser for the DBR version instead. |
Changes
Updates
bundle generateto use the filer abstraction for writing files instead of direct filesystem operations. This fixes thedatabricks bundle generate --bindcommand when run on DBR.In a follow-up, we can consider adding support for using FUSE instead if the DBR version is appropriate (16.4+, 2+ on serverless). I verfied that FUSE works now and gives the expected semantics necessary to write notebooks. Actually using FUSE is out of scope for this PR.
Note: Because we use BundleRootPath as the root of the file, there is a small regression where people will not be able to generate outside their bundle root (but still in their sync root).
In general generate is only meant to be run in a single bundle and is not support to create resources that are shared across bundles, so I've kept this in and am not using SyncRoot as the root of the filer (which would involve a slight refactor).
Tests
filer.NewOutputFilercovering local, DBR with non-workspace path, and DBR with workspace path scenarios