Repository navigation
feat(cloud): declare projectType on SyncProject - #651
Merged
Merged
Conversation
The v2 projects API already returns `projectType`, and `listAllProjects` and `getProjectDetail` passed it through at runtime, but `SyncProject` did not declare it, so consumers had to widen the type to read it. `syncProjectSchema` now validates the field as an optional plain string, like `projectSchema` in projects.ts, so an unknown or missing type still parses. A non-string value now fails the list, detail, and data app update responses with a 502. Closes #649
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #651 +/- ##
========================================
Coverage 91.23% 91.23%
========================================
Files 233 233
Lines 13506 13506
Branches 3857 3738 -119
========================================
Hits 12322 12322
Misses 1181 1181
Partials 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
@coderabbitai full review |
Contributor
Action performed
|
Contributor
tkislan
marked this pull request as ready for review
November 16, 2026 14:12
m1so
approved these changes
Nov 16, 2026
tkislan
added a commit
to deepnote/vscode-deepnote
that referenced
this pull request
Nov 24, 2026
* chore(deps): bump @deepnote/cloud to 0.5.0 0.5.0 declares projectType on SyncProject (deepnote/deepnote#651), so the publish flow no longer needs its own widened ListedProject type. * chore(deps): bump @deepnote/cloud-sync to 0.4.0 and @deepnote/cli to 0.13.0 Both re-pin @deepnote/cloud 0.5.0, so the lockfile keeps a single copy of it instead of nesting 0.4.0 under cloud-sync, cli and local-runner.
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 #649
listAllProjectsandgetProjectDetailalready return each project'sprojectTypeat runtime through.passthrough(), butSyncProjectdidn't declare it. Consumers had to widen the type to read it; the VS Code extension usesSyncProject & { projectType?: string }to list only data apps.Changes
syncProjectSchemavalidatesprojectTypeas an optional plain string, matchingprojectSchemainprojects.ts. A type this client doesn't know (or a missing one) still parses.SyncProjectdeclaresprojectType?: string.ProjectDetailinherits it.Behavior change
A
projectTypethat is present but not a string now failslistAllProjects,getProjectDetail, andsetDataAppPublishedwith a 502 (Invalid Deepnote response for …). The v2 API spec types the field as a required, non-null string, so real responses aren't affected.setDataAppPublishedvalidates its response after the PATCH, as it already does for every other project field.Tests
In
packages/cloud/src/sync.test.ts:listAllProjectsreports a known type, an unknown type (future-type), and a missing type. Narrowing the schema to the five spec values fails this test.listAllProjectsrejects a numericprojectType. This test fails against the previous schema..projectTypeoff bothSyncProjectandProjectDetail, sopnpm typecheckfails if either type loses the field.