Repository navigation
Conversation
Only `start` and `setup` (for a process server) compared a running local server's release with the CLI's. Once clients call the API under /api/v1 (ADR 077), a newer CLI against a server an older release left running fails on its first request with nothing that says why. LocalServer.outdated decides once: the nearest record names the server the command is about to call, its own process or container runs, and it runs another release (the server version for a process, the image tag of a published image for a container; overrides and moving tags are never compared). LocalServer.assertCurrent refuses such a server with E_CONFLICT and suggests `start --cwd <dir>`, then the command again where the caller can name it. It runs before the first request in EnvironmentCommand.connect (every project command), `api`, `console`, `env add`, `setup` (the flag's server, the server the wizard picked, and `--dev-port`). `start` keeps restarting such a server; `doctor` warns (`runtime-version`) and suggests the same `start`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er-version Resolves the conflicts in doctor.test.ts and env/add.test.ts, where both sides added imports and tests. The runtime-version advice test now passes the selector argument that advisoryForWarnings gained on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Oct 26, 2026
Contributor
🦋 Changeset detectedLatest commit: 4332305 The changes in this PR will be included in the next version bump. This PR includes changesets to release 24 packages
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 |
…er-version Resolves the conflict in setup.test.ts, where both sides added an import: main's expectedPublicCliCommand and this branch's aBinaryRecord. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er-version Resolves the conflict in doctor's call to the local runtime checks: main now skips them for a project on a hosted server, and this branch passes them the CLI release for the runtime-version check. The call keeps both, so runtime-version is skipped with the other local runtime checks; it has no local server record to read there anyway. main's test list of local runtime checks gains runtime-version, so its hosted-project test covers the new check too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er-version Resolves three conflicts where both sides added code in the same place: - server.ts: this branch's LocalServer.outdated and assertCurrent, beside main's isPortFree and nextFreePort; - setup: the wizard's branch keeps this branch's check of the local server the wizard picked, and main's warning about a taken app port follows as the branch for a run that asks nothing; - setup.test.ts: both sides' imports. The wizard test for a local server another release started now answers main's questions: the port is free, so it is not asked, and the new password minimum is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er-version Resolves the conflicts in doctor's local runtime checks: main now passes them the parent folder a runtime came from, for the runtime check's message, and this branch its release options, for runtime-version. They take both, this branch's first, because main's is optional, and each check list keeps main's runtime check followed by the release check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er-version Resolves the conflict in env add's imports: main moved the command's first deploy into deployInitialRelease, and this branch imports LocalServer there for its release check. The file takes both. Nothing main added reaches a local server around the check: setup's new deploy goes to the server this branch already checks, and policies test connects through EnvironmentCommand.connect. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully 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.
Context
Summary
Until now only
zitadel startandzitadel setup(and setup only for a server running as a process) compared a running local server's release with the CLI's. Once clients call the API under/api/v1(ADR 077, §5 "Versions"), a newer CLI talking to a server an older release left running fails on its first request withreq.not_foundand nothing that says why. This PR makes every command that sends a local server requests check its release first.LocalServer.outdated(cwd, serverUrl, …)decides it in one place. It returns a mismatch only when all of these hold:.zitadel/local/runtime.jsonnames the server the command is about to call (sameLocalServer);server_versionfor a process, and for a container the tag of a publishedghcr.io/zitadel/nextgen:<version>image, compared with the image a barestartwould run (ZITADEL_LOCAL_IMAGE, else the CLI's default).ZITADEL_SERVER_BINARY, which recordsoverrideor adev+<commit>version), a moving tag such aslatest, any other image, or a record that cannot be read (doctor's to report).LocalServer.assertCurrentrefuses such a server withE_CONFLICT. Itsnext_commandsarestart --cwd <dir that holds the server>, then the command again when the caller can name it. setup's existing message, hint and details keys are kept.EnvironmentCommand.connect, which covers every project command, before it asks for the project id or the credential;zitadel api, after--dry-run;zitadel console;zitadel env add, before it creates a project;zitadel setup, for the--serverit was given, the local server the wizard picked (a gap until now: the check only saw the flag's server), andsetup --dev-porton an app that is already set up.startkeeps restarting such a server, andstop,reset,logsandstatusstill work on it.status's user probe degrades tounknown.zitadel doctorgets a warning-levelruntime-versioncheck whose advice is the samestart --cwd. A path that needs shell quoting leaves the command out, as doctor's other runtime advice does.claim-as-adminruns only insidesetup, after setup's check, so it needs no call of its own.SKILL.mdandapps/cli/src/lib/local-server/AGENTS.mdrecord the behavior and the rule for new commands.Validation
All commands were run from
apps/cliunless the line says otherwise. Everyvitestline usescorepack pnpm exec vitest run.moon run cli:typecheck: passed.moon run cli:lint: passed afterbiome format --writerewrapped one line of a test.corepack pnpm run build: passed (the command tests drivedist/).vitestruns, all passing:tests/unit/lib/oclif/environment-command.test.ts tests/unit/commands/api.test.ts tests/unit/commands/console.test.ts tests/unit/commands/env/add.test.ts tests/unit/lib/local-server/server.test.ts: 97 tests.tests/unit/commands/claim.test.ts -t "server local": 4 tests.tests/unit/commands/doctor.test.ts -t "release|advisoryForWarnings": 4 tests.tests/unit/commands/setup/index.test.ts -t "local server|runtime start left|nobody to ask|local-runtime-missing": 5 tests, including setup's existing refusal test, unchanged.tests/unit/commands/setup.test.ts -t "setup asked on a terminal": 6 tests, including the new wizard case.tests/unit/commands/setup.test.ts -t "setup --dev-port": 5 tests.tests/unit/docs tests/unit/lib/oclif/reference.test.ts tests/unit/lib/warnings.test.ts: 21 tests.main(see Notes):moon run cli:typecheck cli:lint cli:test: pass, 4818 tests, with a locally builtapps/server-win32-x64/bin/nextgen.exemoved aside:server-binary.test.tsexpects it to be missing.moon run cli:teston this branch alone: 4314 passed. On a local branch that merges all five ADR 077 PRs (docs: amend and accept ADR 077 on the /api/v1 prefix #2356, feat: accept /api/v1 paths in the SDK and dev-proxy gates #2357, this one, feat: serve the API under /api/v1 and deprecate the root paths #2358 and feat!: call the API under /api/v1 #2359): 4338 passed.Release notes / changeset
.changeset/cli-local-server-release-check.md,@zitadel/climinor:Notes
start's decision, in the directory that holds the server, and it may be a parent of the one the command runs in.claim.test.ts's running-server fixture now records the bundled server version. It used the helper's default1.0.0, which the new check correctly refuses.mainis merged in six times to resolve conflicts:doctor.test.ts,env/add.test.tsandsetup.test.ts. This PR's doctor test now passes theselectorargument thatadvisoryForWarningsgained onmain;doctor's call to its local runtime checks, whichmainnow skips for a project on a hosted server.runtime-versionis one of them, so it is skipped there too, and the hosted-project test's list of local runtime checks names it;LocalServerkeepsoutdatedandassertCurrentbesidemain's port helpers. Insetup, the wizard's branch keeps this PR's check of the local server the wizard picked, andmain's warning about a taken app port is the branch for a run that asks nothing. This PR's wizard test now answersmain's questions: the port only when it is taken, and the new password minimum;doctor's local runtime checks again:mainnow passes them the parent folder a runtime came from, for theruntimecheck's message, and this PR its release options, forruntime-version. They take both, this PR's first, becausemain's is optional.env add's imports:mainmoved its first deploy intodeployInitialRelease(feat: deploy .zitadel/ at the end of zitadel setup #2461), and this PR importsLocalServerthere for its check. The file takes both. Nothingmainadded sends a local server requests without the check: the deploysetupnow ends with goes to the server this PR already checks, andmain's newpolicies testconnects throughEnvironmentCommand.connect, which runs it.stop,reset,logsandstatusare deliberately unchecked: they are how a user gets rid of a stale server.🤖 Generated with Claude Code