Repository navigation
feat(cloud): sync a local folder with Deepnote Cloud - #601
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## tomaskislan/blu-6518-store-the-deepnote-api-token-in-env-and-resolve-it-for #601 +/- ##
============================================================================================================
Coverage 38% 38%
============================================================================================================
Files 825 826 +1
Lines 41273 41425 +152
Branches 9087 9114 +27
============================================================================================================
+ Hits 15837 15984 +147
- Misses 23348 23350 +2
- Partials 2088 2091 +3
🚀 New features to boost your workflow:
|
Adds "Deepnote: Sync with Deepnote Cloud", run from the Command Palette or the Deepnote explorer title bar. It calls `syncWorkspace` from `@deepnote/cloud-sync` once to pull projects changed in Deepnote, push projects changed locally, and ask Override or Skip for each conflict, then reports the counts. - The command offers the workspace's synced folders, or a folder from a dialog, which syncs the nearest sync root at or above it. - It refuses a folder outside the open workspace folders, or one that contains or is inside another synced folder. The nested check passes `exclude: null` to `findFiles`, because any other value keeps `files.exclude` applied and can hide a nested manifest. - A first sync asks before downloading every project, and unsaved Deepnote notebooks must be saved first. - One sync runs at a time. The summary is not awaited, so leaving it on screen does not block the next sync. - `getToken` and `getOrPromptToken` take an optional `syncRoot`, which stops the `.env` lookup there. Every sync of a folder, the first included, then reads `DEEPNOTE_TOKEN` only from that folder's `.env`, as `deepnote sync` does, instead of from a `.env` above it until the manifest exists. Closes #597
The "Save and Sync" check only looked at notebook documents. A .deepnote file reopened with Reopen Editor With > Text Editor is a text document, so its unsaved edits were skipped. A pull then wrote the cloud version under the dirty buffer, and choosing Overwrite in the "content of the file is newer" dialog made the next sync push the pre-pull text back, undoing the cloud change. Dirty text documents with the file scheme and a .deepnote path now go through the same save-and-recheck flow. The scheme check leaves out notebook cells, which carry the notebook's .deepnote path under their own scheme.
tkislan
force-pushed
the
tomaskislan/blu-6519-sync-a-local-folder-with-deepnote-cloud-from-the-extension
branch
from
November 4, 2026 11:23
980d76e to
948b57d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@coderabbitai ignore
Summary
Adds "Deepnote: Sync with Deepnote Cloud", run from the Command Palette or the sync button in the Deepnote explorer title bar. It calls
syncWorkspacefrom@deepnote/cloud-synconce: projects changed in Deepnote are pulled, projects changed locally are pushed, and each conflict gets an Override or Skip prompt. A summary of the counts follows..deepnote-sync.json) and then "Choose another folder…". With no synced folders, it opens a folder dialog. A folder chosen inside a sync root syncs that root.exclude: nulltoworkspace.findFiles, because any other value keepsfiles.excludeapplied and can hide a nested manifest.cloud-changed-after-local-edit,changed-on-both-sidesanduntracked-local-directoryeach get a modal with one override button and "Skip". Dismissing the modal skips.IDeepnoteApiTokenService.getTokenandgetOrPromptTokentake an optionalsyncRoot, which stops the.envlookup there. The command passes the folder being synced, so every sync of a folder, the first included, readsDEEPNOTE_TOKENonly from that folder's.env, asdeepnote syncdoes. Calls without the argument behave as before.Closes #597
Stacked on #563 (BLU-6518, the token service), so it targets that branch. Merge #563 first.
Deviations from the issue
/,D:\), the overlap check skips the parent lookup. Without the guard, such a folder's own manifest would make every sync after the first fail as "overlaps itself". The issue doesn't mention this case.Verification
npm run typecheck,npm run lint(no findings in the changed files),npm run formatandnpm run spell-checkall pass.npm test: 2991 passing, 0 failing. Themain-based baseline was 2958.syncRootfrom the token lookup,exclude: undefined, swapped override labels, awaiting the summary, and a flag not cleared after a throw.Not verified
syncWorkspaceis replaced by a stub in the tests. The round trip, the Cursor check and the public docs PR in the issue's "Manual follow-up" are not done./only, and the new unit tests compare raw paths, so they may fail on Windows. CI runs on Ubuntu..envabove the folder overrides the saved token, although sync ignores that.env.vscode-vfs) workspace, the first-sync confirmation appears before the token service refuses the non-local folder.