Skip to content

test: gate demo and journey e2e specs behind moon typecheck - #859

Merged
fforootd merged 3 commits into
mainfrom
claude/pensive-tesla-3a3b9a
Aug 12, 2026
Merged

test: gate demo and journey e2e specs behind moon typecheck#859
fforootd merged 3 commits into
mainfrom
claude/pensive-tesla-3a3b9a

Conversation

@fforootd

Copy link
Copy Markdown
Member

Summary

  • demo-next-e2e, demo-nuxt-e2e, and cli-journey-e2e had no typecheck task, so API/SDK contract drift in their Playwright specs only surfaced when someone ran the opt-in suites. This mirrors fix(console): follow the flat-by-id management API contract #858's console-e2e gate in all three: a package.json typecheck script + typescript: "catalog:" devDep, a moon typecheck task with deps on the built workspace packages each program actually imports (testing:build for demo-next and cli-journey; demo-nuxt imports none), and tsconfig includes broadened so every config and spec file is inside the checked surface — demo-next's playwright.real.config.mts and the entire src-real/ directory were previously invisible to any type checker.
  • The new gates immediately caught the flat-by-id drift (feat(authz): resolve path-id scope from RSI before Check #810): the @zitadel/testing seedUser fix landed on main in fix(console): follow the flat-by-id management API contract #858 (the identical hunk rebased away here), and demo-next's registration spec carried a response cast that no longer converts from the generated ListUsers200 — replaced by a plain destructure of the typed envelope.
  • Dropped inert tsconfig references (sdk-next/api-mock) from the demo projects: nothing there imports their types, and under plain tsc -p those references redirect transitive @zitadel/api imports onto the packages' stale out-tsc/ declaration outputs — the gate was checking an eight-day-old client signature (phantom 3-arg camelCase setUserPassword). Workspace imports now resolve to current source via the @zitadel/source condition, same as console-e2e.
  • cli-journey-e2e's .mjs runner scripts leave the tsconfig include list: they import root workspace scripts (outside the composite project's rootDir), were never type-checked (checkJs off), and keep their runtime coverage through the node --test task.

Validation

  • moon run demo-next-e2e:typecheck demo-nuxt-e2e:typecheck cli-journey-e2e:typecheck — green (re-run after rebasing onto fix(console): follow the flat-by-id management API contract #858)
  • moon run testing:typecheck testing:test demo-next-e2e:lint demo-nuxt-e2e:lint cli-journey-e2e:lint — green (4 lint warnings pre-existing on untouched lines)
  • node scripts/check-pr-title.mjs --title "test: gate demo and journey e2e specs behind moon typecheck" — ok

Release notes / changeset

Notes

  • The stale-reference redirect is the reviewer-relevant mechanism: tsconfig references combined with the @zitadel/source custom condition make plain tsc -p (not --build) resolve transitive workspace imports to the referenced closure's out-tsc/ declarations, which nothing in these projects keeps fresh. References here must reflect actual type-level imports (console-e2e precedent: none).
  • The demo/journey e2e suites remain opt-in (runInCI: false); only their type surface joins CI, via the standard :typecheck lane and ci: gate full-mode tail steps on moon affected-task selection #731's affected gating.

demo-next-e2e, demo-nuxt-e2e, and cli-journey-e2e had no typecheck
task, so API/SDK contract drift in their Playwright specs only
surfaced when someone ran the opt-in suites. Mirror the console-e2e
gate (#858) in all three: a package.json typecheck script, a moon
typecheck task with deps on the built workspace packages each program
imports (@zitadel/testing for demo-next and cli-journey; demo-nuxt
imports none), and tsconfig includes broadened so every config and
spec file is inside the checked surface (demo-next's
playwright.real.config.mts and src-real/ were previously invisible).

The new gates immediately surfaced the flat-by-id drift (#810) in
@zitadel/testing's seedUser — that fix landed on main in #858 (the
identical hunk rebased away here) — and in demo-next's registration
spec, whose response cast no longer converts from the generated
ListUsers200; a plain destructure of the typed envelope replaces it.

The demo tsconfigs also referenced sdk-next/api-mock without importing
any of their types. Under plain tsc -p, those references redirect
transitive @zitadel/api imports onto the packages' stale out-tsc
declaration outputs, which made the gate check an eight-day-old client
signature. Drop the references; workspace imports resolve to current
source via the @zitadel/source condition, same as console-e2e.

cli-journey-e2e's .mjs runner scripts leave the tsconfig include list:
they import root workspace scripts (outside the composite project's
rootDir), were never type-checked (checkJs off), and keep their
runtime coverage through the node --test task.
Copilot AI lite review requested due to automatic review settings August 12, 2026 17:06
@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nextgen Ready Ready Preview Aug 12, 2026 5:25pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
nextgen-docs Skipped Skipped Aug 12, 2026 5:25pm
nextgen-mock-zitadel Skipped Skipped Aug 12, 2026 5:25pm

Request Review

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

⚠️ No Changeset found

Latest commit: e692252

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copilot AI left a comment

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.

Pull request overview

This PR adds CI-visible typechecking for the opt-in Playwright suites in demo-next-e2e, demo-nuxt-e2e, and cli-journey-e2e, so contract drift in their specs is caught in the standard :typecheck lane instead of only when someone runs the e2e suites manually.

Changes:

  • Add typecheck scripts (with local typescript devDependency) and Moon typecheck tasks for the three e2e projects.
  • Broaden tsconfig include globs to ensure Playwright configs and relevant spec directories are actually part of the typechecked surface, and remove tsconfig project references that could redirect workspace imports to stale out-tsc declarations.
  • Fix demo-next-e2e registration spec to rely on the typed listUsers response shape instead of casting.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pnpm-lock.yaml Adds typescript to relevant workspace importers to support new tsc-based typecheck scripts.
apps/demo-nuxt-e2e/tsconfig.json Broadens includes and removes project references to avoid stale declaration redirects.
apps/demo-nuxt-e2e/package.json Adds typecheck script and typescript devDependency.
apps/demo-nuxt-e2e/moon.yml Introduces a Moon typecheck task for the Nuxt e2e project.
apps/demo-next-e2e/tsconfig.json Broadens includes (including src-real) and removes project references.
apps/demo-next-e2e/src-real/registration.spec.ts Removes an outdated response cast and uses the typed listUsers result.
apps/demo-next-e2e/package.json Adds typecheck script and typescript devDependency.
apps/demo-next-e2e/moon.yml Introduces a Moon typecheck task with the needed workspace build dependency.
apps/cli-journey-e2e/tsconfig.json Adds DOM lib support and narrows the typechecked surface to TS specs/configs (excluding .mjs runner scripts).
apps/cli-journey-e2e/package.json Adds typecheck script and typescript devDependency.
apps/cli-journey-e2e/moon.yml Introduces a Moon typecheck task with the needed workspace build dependency.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Review finding (codex, P2): fixtures/testkit/zitadel-e2e/*.spec.ts pin
the customer-facing @zitadel/testing/playwright contract but were only
exercised through the opt-in e2e-testkit task — a type error inserted
there passed the new gate. Add fixtures/testkit/**/*.ts to the checked
surface; the fixtures/preexisting/ family stays out because its
framework globals (defineNuxtConfig) only exist inside the generated
app.
@vercel
vercel Bot temporarily deployed to Preview – nextgen-mock-zitadel August 12, 2026 17:13 Inactive
@vercel
vercel Bot temporarily deployed to Preview – nextgen-docs August 12, 2026 17:13 Inactive
Review finding (codex, P2, round two): the testkit fixture's Playwright
config imported withZitadel/nextAppEnv as an unchecked .mjs — a
nonexistent export passed the gate, and including the file would not
have helped with checkJs off. Convert it to .mts so the *.mts include
picks it up fully checked: the kit README documents a TypeScript
config (playwright.config.ts) and the suite's specs are already .ts,
so this moves the fixture closer to the documented consumer posture,
not away. The journey copies fixtures/testkit recursively; the only
filename reference is run-local.mjs's --config invocation, updated.

Verified: tsc --listFilesOnly shows the config in the program; a
broken kit import now fails the gate (TS2724); playwright test --list
loads and evaluates the .mts config and enumerates both consumer
tests. The full runtime lane runs in CI — journey_testkit gates on
the journey project, which this PR touches.
@vercel
vercel Bot temporarily deployed to Preview – nextgen-mock-zitadel August 12, 2026 17:24 Inactive
@vercel
vercel Bot temporarily deployed to Preview – nextgen-docs August 12, 2026 17:24 Inactive
@fforootd
fforootd enabled auto-merge (squash) August 12, 2026 17:29
@fforootd
fforootd merged commit 8143e0c into main Aug 12, 2026
14 checks passed
@fforootd
fforootd deleted the claude/pensive-tesla-3a3b9a branch August 12, 2026 17:41
@github-project-automation github-project-automation Bot moved this from Inbox to Done in Engineering Kanban Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants