Skip to content

Embed native Server 3.12.0 in the development Server - #165

Merged
rmcdaniel merged 1 commit into
mainfrom
cli/embedded-server-3.12.0
Nov 17, 2026
Merged

rmcdaniel merged 1 commit into
mainfrom
cli/embedded-server-3.12.0

Conversation

@rmcdaniel

Copy link
Copy Markdown
Member

What

  • Moves the embedded native Server (dependency and the three [patch.crates-io] sources) from 3d90086f to the published Server 3.12.0 tag commit da655a8500691d6ce8e018d1552801491a696135. Cargo.lock changes only those four sources (plus the test-only miniz_oxide dev-dependency, which was already in the graph).
  • dw server:start-dev now advertises capabilities.workflow_version_usage, so dw workflow:version-usage (Show legacy and unknown workflow version usage #158) works against the built-in Server.

Existing development data

Server 3.12.0 uses native SQLite schema 15. On a schema-14 database (written by CLI 2.9.0), Runtime::open checks it read-only and refuses with native_schema_upgrade_required without writing anything. Native startup never upgrades.

The development Server holds its own data directory exclusively under its lock. So when Runtime::open refuses with native_schema_upgrade_required, start-dev:

  1. rechecks the directory lease,
  2. runs the Server's public runtime::schema_upgrade::upgrade_sqlite("database.sqlite"). This is the same upgrade schema-upgrade runs: an exact recognition check, then one BEGIN IMMEDIATE transaction,
  3. prints Upgraded the development database from schema 14 to 15.,
  4. opens the runtime.

It never touches a database outside its data directory. A schema newer than the binary still refuses, and the message now says what to do (native_schema_newer_than_binary). The README's start-dev section notes both behaviors.

Tests

  • The fresh-directory test now asserts workflow_version_usage: true and an empty workflow:version-usage result.
  • New: a real data directory database written by the published CLI 2.9.0 release binary (schema 14, one started workflow; zlib fixture) is upgraded once. The test checks that the workflow is intact and that a restart does not upgrade again.
  • New: a schema-99 marker refuses and leaves the file unchanged.
  • With the old start-dev code, both new tests fail with the expected refusals.
  • cargo fmt --check, cargo clippy --locked --all-targets -D warnings and cargo test --locked pass (343 passed, 0 failed, 2 ignored). cargo build --locked and scripts/ci/smoke-native-dev.py also pass.

🤖 Generated with Claude Code

Move the built-in development Server to the published Server 3.12.0
tag commit da655a85, so `dw server:start-dev` advertises
capabilities.workflow_version_usage for `dw workflow:version-usage`.

Server 3.12.0 uses native schema 15 and its startup refuses an
earlier schema with native_schema_upgrade_required. The development
Server holds its own data directory exclusively, so when it finds an
earlier upgradable schema there it now runs the Server's own
schema_upgrade::upgrade_sqlite on that database, prints the versions,
and starts. A newer schema still refuses, now with a message that says
what to do.

Tests start a data directory written by the published CLI 2.9.0 binary
(schema 14, with one started workflow), and a schema-99 marker.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rmcdaniel

Copy link
Copy Markdown
Member Author

General review of head 9d2adf2d: PASS.

  • All four Server rev references move to the 3.12.0 tag commit da655a85.
  • open() upgrades only on native_schema_upgrade_required, using the Server's public schema_upgrade::upgrade_sqlite on the dev Server's own database.sqlite. It runs Data::verify() before and after, and the step is one SQLite transaction, so an interrupt rolls it back.
  • native_schema_newer_than_binary still refuses, now with actionable guidance.
  • The fixture made by the real 2.9.0 binary proves the upgrade and data retention, and that a restart doesn't upgrade again. The schema-99 fixture proves the file stays byte-identical on refusal.

The one-way upgrade (2.9.0 can't reopen an upgraded dev directory) goes in the 2.10.0 release notes. Merging when hosted checks pass.

@sonarqubecloud

Copy link
Copy Markdown

@rmcdaniel
rmcdaniel merged commit 5e5dc3c into main Nov 17, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant