From 761de12a0dbae081ee51632bf54fa45cb5f98c7d Mon Sep 17 00:00:00 2001 From: shreyas-goenka <88374338+shreyas-goenka@users.noreply.github.com> Date: Fri, 25 Nov 2022 14:13:15 +0100 Subject: [PATCH] Fix incorrect remote path arg to APIs in windows on bricks sync (#101) Integration tests testing sync on ubuntu are green: Screenshot 2022-11-25 at 2 05 11 PM @fjakobs tested this on windows manually --- cmd/sync/watchdog.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/sync/watchdog.go b/cmd/sync/watchdog.go index 03f8e120..61b08906 100644 --- a/cmd/sync/watchdog.go +++ b/cmd/sync/watchdog.go @@ -44,10 +44,10 @@ const MaxRequestsInFlight = 20 // // The workspace file system backend strips .py from the file name if the python // file is a notebook -func putFile(ctx context.Context, path string, content io.Reader) error { +func putFile(ctx context.Context, remotePath string, content io.Reader) error { wsc := project.Get(ctx).WorkspacesClient() // workspace mkdirs is idempotent - err := wsc.Workspace.MkdirsByPath(ctx, filepath.Dir(path)) + err := wsc.Workspace.MkdirsByPath(ctx, path.Dir(remotePath)) if err != nil { return fmt.Errorf("could not mkdir to put file: %s", err) } @@ -57,7 +57,7 @@ func putFile(ctx context.Context, path string, content io.Reader) error { } apiPath := fmt.Sprintf( "/api/2.0/workspace-files/import-file/%s?overwrite=true", - strings.TrimLeft(path, "/")) + strings.TrimLeft(remotePath, "/")) return apiClient.Do(ctx, http.MethodPost, apiPath, content, nil) }