Repository navigation
fix(cloud-sync): drop CLI flag hints from library messages - #579
Merged
tkislan merged 9 commits intoOct 20, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #579 +/- ##
==========================================
+ Coverage 90.47% 90.49% +0.02%
==========================================
Files 216 217 +1
Lines 12619 12650 +31
Branches 3534 3542 +8
==========================================
+ Hits 11417 11448 +31
Misses 1199 1199
Partials 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
tkislan
changed the base branch from
main
to
tomaskislan/blu-6512-deepnote-publish-deletes-the-live-copy-of-a-file-over-100
October 14, 2026 10:49
Base automatically changed from
tomaskislan/blu-6512-deepnote-publish-deletes-the-live-copy-of-a-file-over-100
to
main
October 14, 2026 11:35
publishApp and syncWorkspace told library callers to pass CLI flags (--no-sync-root, --prune, --url) or named them (--path, --all-files). Callers have no flags; they need syncRoot: false, prune: true or baseUrl. The library now ends those messages before the hint and marks the condition in a field instead: - PublishError (and PublishMirrorError) carry an optional PublishErrorCode: 'sync-root-unusable' | 'project-not-in-sync-root'. - The kept-deleted-files warning event carries code 'deleted-files-kept'. - The pruned and missing-in-cloud outcome details no longer mention --prune. - The --path, --all-files and --url wording becomes neutral. `deepnote publish` and `deepnote sync` add the same hints back, so their stdout, stderr and -o json output are unchanged except for the three neutral strings (target path, working-file transfer limit, API URL). Closes #578 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VEcD7PPguvSkpmDm77ADFa
…late
Alongside the codes, the library now says which option resolves each
condition, as an OptionHint ({ option: 'syncRoot', value: false } or
{ option: 'prune', value: true }):
- PublishError.hint, derived from its code
- the deleted-files-kept warning event
- the missing-in-cloud outcome kept because prune is off
The CLI maps a hint to its flag in one place (cliFlagFor) and builds the
same messages as before from it. `deepnote sync` no longer infers the
--prune hint from its own option, and drops the hint from the outcomes
it prints, so `-o json` output is unchanged.
PUBLISH_ERROR_HINTS is `as const satisfies`, PublishError.hint is the exact PublishErrorHint (exported), cliFlagFor returns the literal flag for the hint's option, and the CLI's publish sentences take the flag of their own code. Output is unchanged. Trim code comments that restated the code. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VEcD7PPguvSkpmDm77ADFa
ProjectSyncOutcome is no longer the `-o json` shape: the CLI strips `hint` and folds its flag into `detail`. The keptDeletedFilesHint doc spoke of several hints for one sentence. The other three comments restated the code or the OptionHint and PublishErrorHint contracts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VEcD7PPguvSkpmDm77ADFa
tkislan
force-pushed
the
tomaskislan/blu-6511-cloud-sync-messages-no-cli-flags
branch
from
October 14, 2026 11:55
dd89f7a to
43fbae7
Compare
…docs The deleted-files-kept warning is now its own SyncEvent member with a required prune hint, and ProjectSyncOutcome.hint is the prune hint only. A syncRoot hint on either carrier no longer compiles, so the CLI drops its `event.hint` guard and the test for a warning with a code but no hint, a shape the library cannot emit. Correct the docs that overstated behavior: pruning a missing-in-cloud project whose path a live project reuses only drops its manifest record; pushing an edited kept file raises a working-files-changed conflict rather than restoring it; PublishMirrorError is rethrown only while the folder is resolved and reported as mirror-incomplete while updating it. Drop comments that restated the code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VEcD7PPguvSkpmDm77ADFa
The large.bin outcome row and the different-workspace refusal row passed a copy of the reworded library message through the mocked syncWorkspace and expected it back, so they could not catch the library returning to the old flag wording; the cloud-sync tests cover that. The existing 'boom' and 'an Error' rows already cover pass-through, and the large.bin row gave it.each a second test named "renders a 'error' outcome as its progress line". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VEcD7PPguvSkpmDm77ADFa
rejects.toThrow('<string>') passes whenever the thrown message contains the
string, so a flag hint appended to the refusal (for example "Pass --url to
fix.") went unnoticed. toThrow(new Error(...)) requires the exact message.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEcD7PPguvSkpmDm77ADFa
Contributor
Author
|
@coderabbitai full review |
Contributor
✅ Action performedFull review finished. |
Contributor
tkislan
marked this pull request as ready for review
October 19, 2026 11:46
m1so
approved these changes
Oct 20, 2026
tkislan
deleted the
tomaskislan/blu-6511-cloud-sync-messages-no-cli-flags
branch
October 20, 2026 13:35
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.
Closes #578
Summary
publishAppandsyncWorkspacein@deepnote/cloud-syncreturned or threw messages that told the caller to pass CLI flags (--no-sync-root,--prune,--url) or named them (--path,--all-files). A library caller has no flags; they set options such assyncRoot: false,prune: trueorbaseUrl.The library now ends those messages before the hint, marks the condition with a typed
code, and returns the option change that resolves it as a structuredOptionHint.deepnote publishanddeepnote synctranslate each hint into its flag, so the CLI keeps recommending the same arguments.Changes
@deepnote/cloud-synccodepublishAppcannot use the sync folder (for example, the sync manifest cannot be read)PublishError, reasoninvalid-input'sync-root-unusable'PublishError.hint:syncRoot: falsepublishAppgets an explicitsyncRootwhose manifest does not track the project, or whose project directory is missingPublishError, reasoninvalid-input'project-not-in-sync-root'PublishError.hint:syncRoot: falsesyncWorkspacewithallFilesand withoutprunekeeps working files that were deleted in Deepnotewarningevent'deleted-files-kept'hint:prune: truesyncWorkspacefinds a tracked project that is gone from the cloud, withpruneoff, and keeps the local copymissing-in-cloudproject outcomeno longer in the cloud; kept locallyhint:prune: truepruneon, and the local copy is removedprunedproject outcomeno longer in the cloud; removed locallyA hint names a property of the options object of the call that reported it, and the value that resolves the condition. The library never names a CLI flag.
PublishErrorCode('sync-root-unusable' | 'project-not-in-sync-root'),OptionHint({ option: 'syncRoot'; value: false } | { option: 'prune'; value: true }), andPublishErrorHint, the type ofPublishError.hintfor a given code.PublishErrortakes an optional thirdcodeargument and deriveshintfrom it.PublishMirrorError's constructor is now(message: string, code?: PublishErrorCode); it no longer acceptsError'soptionsargument.publishAppcopiescodewhen it rethrows.warningSyncEventgains optionalcodeandhint, andProjectSyncOutcomegains an optionalhint.main.filesDownloaded/filesUploadedJSDoc now saysallFilesinstead of--all-files, and the README has a new "Messages and CLI hints" section.deepnoteCLIcliFlagForinpackages/cli/src/utils/option-hint.tsis the only place option names become flags.publishappends a sentence built from the hint's flag to the error before reporting it. Exit codes are unchanged.syncfolds the hint into the project outcome'sdetailand drops thehintkey, so the-o jsondocument keeps its shape and key order. The kept-files warning gets its extra sentence only when the event carries a hint.syncno longer infers the--prunehint from its own option. When--prunekeeps a local copy because a current cloud project uses the same path, the outcome carries no hint and the CLI adds none, as before.CLI output: before and after
Stdout, stderr and
-o jsonare the same as onmain, except for the three messages under What differs frommain.What stays the same
The library no longer emits these flags, so the CLI adds them back from the hint.
<error>stands for the library's message.deepnote publish<error> Pass --no-sync-root to publish without updating the workspace.deepnote publish --sync-root <dir><dir>does not track the projectThe sync manifest at <dir>/.deepnote-sync.json does not track project p1. Sync the workspace first, or pass --no-sync-root to publish without updating it.deepnote publish --sync-root <dir>Alpha, but that directory is missingThe sync manifest at <dir>/.deepnote-sync.json tracks project p1 in Alpha, but that directory does not exist. Sync the workspace first, or pass --no-sync-root to publish without updating it.deepnote sync --all-files1 file in "Alpha" deleted in Deepnote but kept locally: a.txt. Run sync --prune to remove them; pushing an edited copy restores that file in Deepnote.deepnote sync? missing Team/Alpha — no longer in the cloud; kept locally (use --prune to remove)deepnote sync --prune✕ pruned Team/Alpha — no longer in the cloud; removed locally (--prune)deepnote sync --prune? missing Team/Alpha — no longer in the cloud; kept local path used by a current cloud projectWhat differs from
mainThree messages no longer name a flag, and the CLI does not add one back.
deepnote publish --path elsewhere/x_deepnote_static--path must be _deepnote_static or a directory below itTarget path must be _deepnote_static or a directory below itdeepnote sync --all-filesProject file "x" exceeds the 100 MiB --all-files limit.Project file "x" exceeds the 100 MiB working-file transfer limit.deepnote sync --pruneThe API token or --url may point to a different workspace…The API token or API URL may point to a different workspace…The first one is less specific for CLI users than before: it no longer points at
--path.🤖 Generated with Claude Code
https://claude.ai/code/session_01VEcD7PPguvSkpmDm77ADFa
Summary by CodeRabbit
--prunecan remove locally kept projects or files, and when pruning has already occurred.