Skip to content

fix(cli): stop re-updating unchanged TailorDB types on deploy#1792

Closed
dqn wants to merge 1 commit into
mainfrom
fix/tailordb-noop-diff
Closed

fix(cli): stop re-updating unchanged TailorDB types on deploy#1792
dqn wants to merge 1 commit into
mainfrom
fix/tailordb-noop-diff

Conversation

@dqn

@dqn dqn commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

deploy marked every TailorDB type as an update on every run — even with no
local changes — because the platform now returns optionalOnCreate: false
explicitly while locally generated manifests omit the flag; the type diff now
treats the explicit false as unset, like other known platform defaults.

Before / After

Re-deploying an unchanged project:

TailorDB plan
Before ~ update for every type in the workspace, on every run
After no TailorDB type changes

The platform now returns `optionalOnCreate: false` explicitly on every
field config, while locally generated manifests omit the flag. The type
diff treated this as a change, so every deploy re-applied every type in
the workspace. Normalize `optionalOnCreate: false` to unset at compare
time, matching how other known platform defaults are handled.
@changeset-bot

changeset-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 574b7eb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@tailor-platform/sdk Patch
@tailor-platform/create-sdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@tailor-platform/create-sdk@574b7eb
pnpm add https://pkg.pr.new/@tailor-platform/eslint-plugin-sdk@574b7eb
pnpm add https://pkg.pr.new/@tailor-platform/sdk@574b7eb

commit: 574b7eb

@github-actions

Copy link
Copy Markdown

Code Metrics Report (packages/sdk)

main (d3b5f14) #1792 (e929a58) +/-
Coverage 74.4% 74.4% -0.1%
Code to Test Ratio 1:0.4 1:0.4 +0.0
Details
  |                    | main (d3b5f14) | #1792 (e929a58) |  +/-  |
  |--------------------|----------------|-----------------|-------|
- | Coverage           |          74.4% |           74.4% | -0.1% |
  |   Files            |            454 |             454 |     0 |
  |   Lines            |          16897 |           16901 |    +4 |
+ |   Covered          |          12582 |           12584 |    +2 |
+ | Code to Test Ratio |          1:0.4 |           1:0.4 |  +0.0 |
  |   Code             |         113176 |          113240 |   +64 |
+ |   Test             |          52461 |           52519 |   +58 |

Code coverage of files in pull request scope (88.0% → 87.7%)

Files Coverage +/- Status
packages/sdk/src/cli/commands/deploy/tailordb/index.ts 87.7% -0.3% modified

SDK Configure Bundle Size

main (d3b5f14) #1792 (e929a58) +/-
configure-index-size 32.17KB 32.17KB 0KB
dependency-chunks-size 29.88KB 29.88KB 0KB
total-bundle-size 62.05KB 62.05KB 0KB

Runtime Performance

main (d3b5f14) #1792 (e929a58) +/-
Generate Median 2,854ms 2,929ms 75ms
Generate Max 2,908ms 2,953ms 45ms
Apply Build Median 2,896ms 2,976ms 80ms
Apply Build Max 2,906ms 2,998ms 92ms

Type Performance (instantiations)

main (d3b5f14) #1792 (e929a58) +/-
tailordb-basic 42,869 42,869 0
tailordb-optional 4,451 4,451 0
tailordb-relation 6,220 6,220 0
tailordb-validate 753 753 0
tailordb-hooks 5,279 5,279 0
tailordb-object 12,547 12,547 0
tailordb-enum 1,486 1,486 0
resolver-basic 9,252 9,252 0
resolver-nested 26,119 26,119 0
resolver-array 18,059 18,059 0
executor-schedule 4,310 4,310 0
executor-webhook 949 949 0
executor-record 6,762 6,762 0
executor-resolver 4,090 4,090 0
executor-operation-function 937 937 0
executor-operation-gql 945 945 0
executor-operation-webhook 956 956 0
executor-operation-workflow 1,798 1,798 0

Reported by octocov

@dqn
dqn marked this pull request as ready for review July 16, 2026 19:03
@dqn
dqn requested a review from a team as a code owner July 16, 2026 19:03
@dqn
dqn requested a review from toiroakr July 16, 2026 19:03

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📖 Docs Quality & Consistency Check

✅ Docs are consistent with the implementation and contain no user-facing internal-detail leaks.

Checked areas:

  • CLI deploy command documentation (packages/sdk/docs/cli/application.md) - Plan output format and update/create/delete symbols remain accurate
  • TailorDB service documentation (packages/sdk/docs/services/tailordb.md) - No changes needed; field definitions are unaffected
  • Changeset (tailordb-noop-type-updates.md) - Correctly describes the bug fix as a patch-level change from the user's perspective
  • AGENTS.md - No updates required; only mentions deploy in passing
  • Example code (example/) - Not affected by this internal change
  • No optionalOnCreate references in user-facing docs (verified via grep) - correct, as this is an internal field normalization detail

What changed:
This PR fixes a bug where deploy incorrectly marked all TailorDB types as updates on every run, even when nothing changed. The fix normalizes optionalOnCreate: false (returned by the platform) to undefined (how local manifests represent it) during comparison. This is an internal implementation detail that makes the actual behavior match the documented behavior - no documentation changes needed.

Re-run this check by adding the docs-check label to the PR.


// Platform returns `optionalOnCreate: false` explicitly, while local
// manifests omit the flag entirely. Treat false as unset so they match.
if (typeof value === "boolean") {
if (path.at(-1) === "optionalOnCreate" && value === false) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This same issue was independently fixed on fix/deploy-drift, now opened as → #1797

Hardcoding individual field names like optionalOnCreate isn't great here, since the trigger is a Platform-side change rather than an SDK-side one, so the same class of bug will keep recurring.

#1797 is still being polished, but it absorbs this generically via proto3's zero-value omission rules, so it might be worth reviewing that one instead.

@dqn

dqn commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of #1797.

@dqn dqn closed this Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants