Repository navigation
Conversation
This was referenced Oct 19, 2026
ditadi
force-pushed
the
stack/database-dev-flow/05-db-init
branch
from
October 19, 2026 20:35
960b211 to
c56de21
Compare
ditadi
force-pushed
the
stack/database-dev-flow/06-db-verify
branch
from
October 20, 2026 08:44
6dd2fd4 to
42df642
Compare
`appkit db verify` checks, read-only, that the branch .env points at has every
table and column config/database/schema.ts declares and every committed
migration. It also reports the migrations the migrator would never run there:
merged out of order, edited after they ran, or run from a checkout that no
longer commits them.
With --deployed it checks a databricks.yml target's app through the
Databricks API only: the app exists, its postgres resource names the target's
branch and database with CAN_CONNECT_AND_CREATE, its service principal has a
role there, it is running, and its active deployment has every committed
migration. -t picks the target. Verify refuses when the target's
workspace.host is not the workspace the shell is authenticated against. It
reads no database, so it needs no role on the deploy branch.
databricks.yml is read once for the guard, init and verify. The reader follows
include:, resolves ${var.*}, ${bundle.target} and ${bundle.name}, reads the
branch on an app's postgres resource, and lists every target.
Signed-off-by: ditadi <victordperd@gmail.com>
ditadi
force-pushed
the
stack/database-dev-flow/06-db-verify
branch
from
October 20, 2026 12:22
42df642 to
1b3bde7
Compare
ditadi
force-pushed
the
stack/database-dev-flow/05-db-init
branch
from
October 20, 2026 12:23
c56de21 to
98ef27b
Compare
Contributor
🤖 AppKit PR bot🔬 Run evalsStart an eval for this PR from the evals-monitor app: Go to Evals Monitor → 📦 Try this PR's app templateScaffolds a new app from this PR's SDK build. Run it in any folder (requires the GitHub CLI — gh run download 39422043965 -R databricks/appkit -n appkit-template-0.89.0-pr.a796dd4-stack-database-dev-flow-06-db-verify-674 -D appkit-pr-674 \
&& unzip -o "appkit-pr-674/appkit-template-0.89.0-pr.a796dd4-stack-database-dev-flow-06-db-verify-674.zip" -d "appkit-pr-674" \
&& databricks apps init --template "appkit-pr-674"The template pins |
This was referenced Oct 20, 2026
This branch has not been deployed
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.
🥞 Stacked PR (generated by Stack)
Use this link to review incremental changes.
Stacked on #672.
Summary
Adds
appkit db verify, a read-only check that answers "will my app work with its database?".appkit db verifychecks the branch.envpoints at, which is normally your dev or session branch:config/database/schema.tsdeclares exists (the same check the plugin runs on start);appkit db verify --deployedchecks adatabricks.ymltarget's app through the Databricks API only.-t, --targetpicks the target; without it, verify uses the bundle's default target. It checks that:postgresresource names the target's branch and database, withCAN_CONNECT_AND_CREATE;--deployedreads no database, so it needs no Postgres role on the deploy branch. It refuses when the target'sworkspace.hostis not the workspace the shell is authenticated against.Both exit 1 on any finding, and each finding names its fix. The OK lines say what was checked and nothing more.
Details
The local check runs in one
READ ONLYtransaction that is rolled back, then the pool closes.Drift comes from reconciling the journal table's
(created_at, hash)rows with the committed journal and files. The result is pending, stranded and edited migrations, plus rows no committed migration matches. Two entries that share awhenkeep their own rows. The migrator itself is unchanged.The deployed migrations come from the journal in the snapshot the active deployment runs. That is
deployment_artifacts.source_code_path, read through the workspace export API. When the journal cannot be read, verify falls back to the migrations generated after the deployment'screate_time, and the report says which method it used.With
--deployed, a crashed, stopped, failed or in-progress app is reported with the app's own status message and the command to run next (databricks apps logs,startordeploy).databricks.ymlis read once for the guard,initandverify. The reader:include:;${var.*},${bundle.target}and${bundle.name};postgresresource as well as frompostgres_branch;workspace.host.A reference only a deploy resolves, such as a lookup or
${workspace.*}, reads as unresolved, never as a value.A target with several apps on a
postgresresource is refused, because verify checks one app per target.The app is read with
GET /api/2.0/apps/{name}and the journal withGET /api/2.0/workspace/export, both through the workspace client'srequest, in the API's snake_case. The authenticated host comes from the client'sgetHost.findSchemaProblemsis split out of the plugin's startup check, so verify reports the same problems the app would fail on.Tests
The local tests cover:
The
--deployedtests use a faked Apps, Workspace and Lakebase API where the developer has no role on the deploy branch. They cover:--target, an unknown target and a bundle without a default target;postgres.They also assert that no database connection and no write happens.
The bundle reader tests cover:
include:;${bundle.*}resolution per target;Migration drift runs against a local Postgres 14 with the real migrator, including two entries with one
when.Checked live, read-only, against a workspace through the workspace client:
postgresresource format and a missing app's 404;source_code_path, and a file in it exported and decoded from base64;getHost.A stopped app's response (it has no active deployment) and the service principal's role lookup were checked on the first revision. The live export read the snapshot's
package.json, not a migration journal.