From aca8aa11be9221eb72684dc95ef1cb023e493868 Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Thu, 19 Nov 2026 03:24:30 +0000 Subject: [PATCH 01/14] test(e2e): let a journey stop MongoDB and write its database directly --- e2e/ctx.ts | 25 +++++++++++++++++++++++++ e2e/stack.ts | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/e2e/ctx.ts b/e2e/ctx.ts index 657443f4..aa39135b 100644 --- a/e2e/ctx.ts +++ b/e2e/ctx.ts @@ -12,6 +12,7 @@ import { type Stack, hasAccessToken, } from "./stack.ts"; +import type { Db } from "mongodb"; import { CONTEXT_OPTIONS, Tab } from "./tab.ts"; /** One observation of a step: what is checked, whether it holds and what was seen. */ @@ -72,6 +73,12 @@ export interface Ctx { api(label: string, request: ApiRequest): Promise; /** Stops and starts the backend on the same database; `env` replaces the overlay, kept as it is without one. */ restartBackend(env?: Env): Promise; + /** A boxed step: `use` on the database the backend reads, for state no route writes (an aged or a legacy row). */ + database(label: string, use: (database: Db) => Promise): Promise; + /** Stops MongoDB under the running backend, keeping its data; a later reset or {@link Ctx.startDatabase} brings it back. */ + stopDatabase(): Promise; + /** Starts MongoDB again on the same port and data. */ + startDatabase(): Promise; /** The overlay the running backend started with. */ readonly backendEnv: Env; /** The checkout, for the journeys that pack the module or read its files. */ @@ -228,6 +235,24 @@ class JourneyCtx implements Ctx { ); } + database(label: string, use: (database: Db) => Promise): Promise { + return test.step(`database ${label}`, () => this.#stack.withDatabase(use), { + box: true, + }); + } + + async stopDatabase(): Promise { + await test.step("stop MongoDB", () => this.#stack.stopDatabase(), { + box: true, + }); + } + + async startDatabase(): Promise { + await test.step("start MongoDB", () => this.#stack.startDatabase(), { + box: true, + }); + } + backendLog(): string { return this.#stack.backendLog(); } diff --git a/e2e/stack.ts b/e2e/stack.ts index 2da3bf64..7d8683aa 100644 --- a/e2e/stack.ts +++ b/e2e/stack.ts @@ -11,7 +11,7 @@ import { createRequire } from "node:module"; import { createServer } from "node:net"; import { dirname, join, resolve } from "node:path"; import { setTimeout as delay } from "node:timers/promises"; -import { MongoClient } from "mongodb"; +import { type Db, MongoClient } from "mongodb"; import { MongoMemoryReplSet } from "mongodb-memory-server-core"; /** The backend's environment overlay: the `VERIFY_DATABASE_*` options a journey restarts the backend with. */ @@ -58,6 +58,12 @@ export interface Stack { reset(precondition: Precondition): Promise; /** Stops and starts the backend on the same database; `env` replaces the overlay, which stays as it is without one. */ restartBackend(env?: Env): Promise; + /** Runs `use` on the database the backend reads, through a client of its own that closes after `use`. */ + withDatabase(use: (database: Db) => Promise): Promise; + /** Stops the MongoDB replica set and keeps its data; the backend keeps running and finds no database. */ + stopDatabase(): Promise; + /** Starts the replica set {@link Stack.stopDatabase} stopped, on the same port and data. */ + startDatabase(): Promise; /** The log of the backend's latest start. */ backendLog(): string; /** How a process of the stack stopped without being asked to, or `null` while every one runs. */ @@ -374,6 +380,31 @@ class WorkerStack implements Stack { await this.#start(); } + async withDatabase(use: (database: Db) => Promise): Promise { + if (this.#mongo === undefined || this.#database === undefined) + throw new Error("no database yet: the journey has not started a backend"); + const client = new MongoClient(this.#mongo.getUri()); + try { + return await use(client.db(this.#database)); + } finally { + await client.close(); + } + } + + async stopDatabase(): Promise { + if (this.#mongo === undefined) + throw new Error("no database yet: the journey has not started a backend"); + await this.#mongo.stop({ doCleanup: false, force: false }); + } + + async startDatabase(): Promise { + this.#refuseAfterStop(); + if (this.#mongo === undefined) + throw new Error("no database yet: the journey has not started a backend"); + await this.#mongo.start(); + await this.#mongo.waitUntilRunning(); + } + backendLog(): string { return this.#backend === undefined ? "" @@ -412,6 +443,8 @@ class WorkerStack implements Stack { if (this.#stopped) await mongo.stop({ doCleanup: true, force: true }); this.#refuseAfterStop(); this.#mongo = mongo; + } else if (this.#mongo.state === "stopped") { + await this.startDatabase(); } this.#starts += 1; const backend = new Child( From c3b80e615fa1b74cfa8541174c8daa92b80b6ec8 Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Thu, 19 Nov 2026 03:26:10 +0000 Subject: [PATCH 02/14] ci(e2e): run @smoke on pull requests and every journey in the merge queue --- .github/workflows/ci.yml | 47 ++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c06fa08..960727b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,7 @@ on: types: [opened, synchronize, reopened, ready_for_review] push: branches: [next] + merge_group: schedule: - cron: "17 2 * * *" workflow_dispatch: @@ -47,6 +48,8 @@ jobs: tier: ${{ steps.tier.outputs.tier }} tests: ${{ steps.tier.outputs.tests }} os: ${{ steps.tier.outputs.os }} + e2e: ${{ steps.tier.outputs.e2e }} + shards: ${{ steps.tier.outputs.shards }} steps: - uses: actions/checkout@v4 if: github.event_name == 'pull_request' @@ -60,6 +63,8 @@ jobs: id: tier env: TIER: ${{ steps.pick.outputs.tier }} + EVENT: ${{ github.event_name }} + FULL_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'ci:full') }} run: | tier="$TIER" @@ -82,12 +87,25 @@ jobs: os='["ubuntu-latest","windows-latest"]' fi + e2e=none + shards='[1]' + if [[ "$tests" == true ]]; then + if [[ "$EVENT" == pull_request && "$FULL_LABEL" != true ]]; then + e2e=smoke + else + e2e=all + shards='[1, 2]' + fi + fi + { echo "tier=${tier}" echo "tests=${tests}" echo "os=${os}" + echo "e2e=${e2e}" + echo "shards=${shards}" } >> "$GITHUB_OUTPUT" - echo "Tier \`${tier}\`: tests ${tests}, runners ${os}" >> "$GITHUB_STEP_SUMMARY" + echo "Tier \`${tier}\`: tests ${tests}, runners ${os}, e2e ${e2e} on ${shards}" >> "$GITHUB_STEP_SUMMARY" frontend: needs: select @@ -171,21 +189,22 @@ jobs: key: tla2tools-1.7.4 - run: node .agents/skills/formal-table-watch/check.mjs - # The Playwright suite in `e2e/`: the journeys tagged @smoke on the full - # tier, every journey in two shards on the nightly tier, nothing on a draft - # or the fast tier. One worker owns a MongoDB replica set, the backend and + # The Playwright suite in `e2e/`: the journeys tagged @smoke on a pull + # request, every journey in two shards in the merge queue, the nightly, a + # manual run and a pull request labelled ci:full, nothing on a draft or a + # docs-only change. One worker owns a MongoDB replica set, the backend and # the dashboard on free ports. e2e: needs: select - if: needs.select.outputs.tier == 'full' || needs.select.outputs.tier == 'nightly' + if: needs.select.outputs.e2e != 'none' runs-on: ubuntu-latest timeout-minutes: 45 strategy: fail-fast: false matrix: - shard: ${{ fromJSON(needs.select.outputs.tier == 'nightly' && '[1, 2]' || '[1]') }} + shard: ${{ fromJSON(needs.select.outputs.shards) }} env: - TIER: ${{ needs.select.outputs.tier }} + SUITE: ${{ needs.select.outputs.e2e }} steps: - uses: actions/checkout@v4 with: @@ -217,19 +236,19 @@ jobs: echo "::warning::Chromium's system packages did not install (the package mirrors of the runner did not answer): installing the browser alone" pnpm exec playwright install --only-shell chromium - run: pnpm e2e:build - - if: env.TIER == 'full' + - if: env.SUITE == 'smoke' run: pnpm e2e:run --grep @smoke # The blob report keeps each test's steps, attachments and traces, so # e2e-report merges the shards into one. - - if: env.TIER == 'nightly' + - if: env.SUITE == 'all' run: pnpm e2e:run --shard=${{ matrix.shard }}/2 --reporter=blob - - if: always() && env.TIER == 'nightly' + - if: always() && env.SUITE == 'all' uses: actions/upload-artifact@v4 with: name: blob-report-${{ matrix.shard }} path: e2e/blob-report retention-days: 3 - - if: failure() && env.TIER == 'full' + - if: failure() && env.SUITE == 'smoke' uses: actions/upload-artifact@v4 with: name: playwright-report @@ -238,10 +257,10 @@ jobs: e2e/test-results retention-days: 7 - # One HTML and JSON report of the nightly shards. + # One HTML and JSON report of the shards of a whole-suite run. e2e-report: needs: [select, e2e] - if: always() && needs.select.outputs.tier == 'nightly' + if: always() && needs.select.outputs.e2e == 'all' runs-on: ubuntu-latest timeout-minutes: 10 steps: @@ -283,7 +302,7 @@ jobs: timeout-minutes: 5 steps: - if: >- - needs.select.result != 'success' || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || needs.ci.result == 'skipped' || (needs.select.outputs.tests == 'true' && (needs.frontend.result == 'skipped' || needs.formal-table-watch.result == 'skipped')) || ((needs.select.outputs.tier == 'full' || needs.select.outputs.tier == 'nightly') && needs.e2e.result == 'skipped') + needs.select.result != 'success' || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || needs.ci.result == 'skipped' || (needs.select.outputs.tests == 'true' && (needs.frontend.result == 'skipped' || needs.formal-table-watch.result == 'skipped')) || (needs.select.outputs.e2e != 'none' && needs.e2e.result == 'skipped') run: exit 1 - if: needs.select.outputs.tier == 'draft' run: | From 2d2d9bc666c5c494f836e461cf2da48246ac8c7b Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Thu, 19 Nov 2026 03:30:16 +0000 Subject: [PATCH 03/14] test: check the package and the verify feature map in the backend suite --- .../verify-dms-database/features/external.md | 10 ++ .../verify-dms-database/features/package.md | 13 +- e2e/journeys/package.mjs | 119 ------------- e2e/specs/package.spec.ts | 4 - src/test/feature-map.test.ts | 56 ++++++ src/test/helpers/featureMap.ts | 94 +++++++++++ src/test/helpers/repository.ts | 97 +++++++++++ src/test/package.test.ts | 159 ++++++++++++++++++ 8 files changed, 424 insertions(+), 128 deletions(-) delete mode 100644 e2e/journeys/package.mjs delete mode 100644 e2e/specs/package.spec.ts create mode 100644 src/test/feature-map.test.ts create mode 100644 src/test/helpers/featureMap.ts create mode 100644 src/test/helpers/repository.ts create mode 100644 src/test/package.test.ts diff --git a/.agents/skills/verify-dms-database/features/external.md b/.agents/skills/verify-dms-database/features/external.md index 74a2a8fd..5ddc672e 100644 --- a/.agents/skills/verify-dms-database/features/external.md +++ b/.agents/skills/verify-dms-database/features/external.md @@ -5,15 +5,25 @@ covers: - src/pages/externalLock.ts - src/service/builderRefusal.ts - src/service/catalog.ts + - src/service/catalogReferences.ts + - src/service/catalogSchemas.ts - src/service/connectionRefusals.ts - src/service/connectionState.ts - src/service/connections.ts + - src/service/database.ts - src/utils/deadline.ts - frontend-vue/app/components/DatabaseSwitcher.vue + - frontend-vue/app/build/components/DatabaseSubtitle.vue + - frontend-vue/app/build/components/DatabaseSwitcherRow.vue - frontend-vue/app/build/components/DataBrowserAccessBar.vue - frontend-vue/app/build/components/FeatureLocked.vue + - frontend-vue/app/build/composables/registerDatabaseSwitcher.ts - frontend-vue/app/build/composables/reloadForSelection.ts - frontend-vue/app/build/composables/useDatabaseConnections.ts + - frontend-vue/app/build/composables/useGridAccess.ts + - frontend-vue/app/build/data/assistantOnboarding.ts + - frontend-vue/app/build/data/databaseOptions.ts + - frontend-vue/app/build/data/readOnlyReason.ts - frontend-vue/app/build/composables/useLockedPages.ts - frontend-vue/app/build/composables/useSelectionRecheck.ts docs: diff --git a/.agents/skills/verify-dms-database/features/package.md b/.agents/skills/verify-dms-database/features/package.md index e32771f5..1ae93d92 100644 --- a/.agents/skills/verify-dms-database/features/package.md +++ b/.agents/skills/verify-dms-database/features/package.md @@ -22,9 +22,11 @@ What a project installs from the registry: the module with its build, its Vue da ## Sub-features -- `the-tarball-holds-what-its-manifest-names`: the packed tarball holds every path the manifest points at, the layer with its components and both locales, the skill and its cases, and holds no test build, no build info and no docs. -- `both-locales-hold-the-same-texts`: the English and French locale files hold the same keys and no empty text. -- `ranges-match-the-compatibility-table`: each `@antelopejs/interface-*` dependency appears in the README compatibility table with the same range, and the layer pins one renderer minor. +No browser drives these: they are mocha tests of the backend suite, `src/test/package.test.ts`, not journeys. + +- `the tarball holds what its manifest names`: the packed tarball holds every path the manifest points at, the layer with its components and both locales, the skill and its cases, and holds no test build, no build info and no docs. +- `both locales hold the same texts, none empty`: the English and French locale files hold the same keys and no empty text. +- `the README compatibility table names each interface range and the layer pins one renderer minor`: each `@antelopejs/interface-*` dependency appears in the README compatibility table with the same range, and the layer pins one renderer minor. ## How to get to it (user POV) @@ -33,10 +35,11 @@ What a project installs from the registry: the module with its build, its Vue da ## Driving it ```bash -pnpm e2e:run specs/package.spec.ts +pnpm run build +pnpm exec ajs module test . -f dist/test/package.test.js ``` ## Gotchas -- The journeys run `npm pack --ignore-scripts` on the checkout and read files; they need no run state, so they use the shared database and no onboarding. +- The tests run `npm pack --ignore-scripts` on the checkout and read its files, so they need the build of `pnpm run build` and no DMS state. - The registered component names (`DmsDatabase` prefix) are driven by the page features: a rename would make a page fail to render. diff --git a/e2e/journeys/package.mjs b/e2e/journeys/package.mjs deleted file mode 100644 index 10114a96..00000000 --- a/e2e/journeys/package.mjs +++ /dev/null @@ -1,119 +0,0 @@ -import { spawnSync } from "node:child_process"; -import { mkdtempSync, readFileSync, rmSync } from "node:fs"; -import { tmpdir } from "node:os"; -import { join } from "node:path"; -import { check, isRow, isText, parseJson, pick } from "../database.mjs"; - -/** @typedef {import("../database.mjs").Ctx} Ctx */ - -/** - * Packs the module the way a release would and lists the tarball. - * - * @param {Ctx} ctx The journey - * @returns {{ files: string[], manifest: unknown }} The packed paths and the packed manifest - */ -function packed(ctx) { - const folder = mkdtempSync(join(tmpdir(), "verify-dms-database-pack-")); - try { - const pack = spawnSync("npm", ["pack", "--ignore-scripts", "--silent", "--pack-destination", folder], { cwd: ctx.repo, encoding: "utf8" }); - const tarball = join(folder, pack.stdout.trim().split("\n").at(-1) ?? ""); - const listed = spawnSync("tar", ["-tzf", tarball], { encoding: "utf8" }); - const manifest = parseJson(spawnSync("tar", ["-xzOf", tarball, "package/package.json"], { encoding: "utf8" }).stdout); - return { files: listed.stdout.split("\n").map((line) => line.replace(/^package\//, "")).filter(Boolean), manifest }; - } finally { - rmSync(folder, { recursive: true, force: true }); - } -} - -/** - * @param {Ctx} ctx The journey - * @param {string} file A file of the checkout - * @returns {string} Its text - */ -function read(ctx, file) { - return readFileSync(join(ctx.repo, file), "utf8"); -} - -/** - * The leaf keys of a locale file, as dotted paths. - * - * @param {unknown} node A locale object - * @param {string} [prefix] The path so far - * @returns {string[]} The sorted paths - */ -function leafKeys(node, prefix = "") { - if (!isRow(node)) return [prefix]; - return Object.entries(node).flatMap(([key, value]) => leafKeys(value, prefix ? `${prefix}.${key}` : key)).sort(); -} - -/** What a project installs from the registry, and the ranges the README names. */ -export const journeys = [ - { - id: "the-tarball-holds-what-its-manifest-names", - title: "the package tarball holds the build, the dashboard layer with both locales and the agent skill, every path the manifest points at, without test build or build info and without the docs", - entryPoint: "npm pack of the module", - database: "shared", - onboard: false, - async run(/** @type {Ctx} */ ctx) { - const { files, manifest } = packed(ctx); - const targets = [pick(manifest, "main"), pick(manifest, "types"), pick(manifest, "exports", ".", "types"), pick(manifest, "exports", ".", "default"), pick(manifest, "dmsFrontend")].map((target) => String(target).replace(/^\.\//, "")); - await ctx.verify("the packed module", [ - ...targets.map((target) => check(`${target} is packed`, files.includes(target), target)), - check("the manifest names the module", pick(manifest, "name") === "@antelopejs/dms-database", pick(manifest, "name")), - check("the skill ships and is declared", JSON.stringify(pick(manifest, "antelopeJs", "skills")) === JSON.stringify(["./skills"]) && files.includes("skills/dms-database/SKILL.md") && files.includes("skills/dms-database/cases.json"), files.filter((file) => file.startsWith("skills/"))), - check("the dashboard layer ships with both locales", files.includes("frontend-vue/dms.frontend.ts") && files.includes("frontend-vue/i18n/locales/database-en-GB.json") && files.includes("frontend-vue/i18n/locales/database-fr-FR.json"), files.filter((file) => file.includes("locales"))), - check("the layer's pages and components ship", files.includes("frontend-vue/app/components/DataBrowser.vue") && files.includes("frontend-vue/app/components/QueryConsole.vue") && files.includes("frontend-vue/app/components/SchemaDiagram.vue") && files.includes("frontend-vue/app/components/TableInspector.vue") && files.includes("frontend-vue/app/components/ConnectionStatus.vue"), files.filter((file) => file.startsWith("frontend-vue/app/components/")).length), - check("no test build, no build info", !files.some((file) => file.startsWith("dist/test/") || file.endsWith(".tsbuildinfo")), files.filter((file) => file.includes("test") || file.endsWith(".tsbuildinfo"))), - check("the docs are not packed", !files.some((file) => file.startsWith("docs/")), files.filter((file) => file.startsWith("docs/"))), - check("public access", pick(manifest, "publishConfig", "access") === "public", pick(manifest, "publishConfig")), - ]); - }, - }, - { - id: "both-locales-hold-the-same-texts", - title: "the English and French locale files hold exactly the same keys, none empty, so every string exists in both languages", - entryPoint: "frontend-vue/i18n/locales/database-en-GB.json and database-fr-FR.json", - database: "shared", - onboard: false, - async run(/** @type {Ctx} */ ctx) { - const english = parseJson(read(ctx, "frontend-vue/i18n/locales/database-en-GB.json")); - const french = parseJson(read(ctx, "frontend-vue/i18n/locales/database-fr-FR.json")); - const [englishKeys, frenchKeys] = [leafKeys(english), leafKeys(french)]; - const missingInFrench = englishKeys.filter((key) => !frenchKeys.includes(key)); - const missingInEnglish = frenchKeys.filter((key) => !englishKeys.includes(key)); - /** @param {unknown} locale @param {string[]} keys @returns {string[]} */ - const empty = (locale, keys) => - keys.filter((key) => { - const value = key.split(".").reduce((node, step) => pick(node, step), locale); - return !isText(value) || value.trim() === ""; - }); - await ctx.verify("the locales", [ - check("every English key exists in French", missingInFrench.length === 0, missingInFrench), - check("every French key exists in English", missingInEnglish.length === 0, missingInEnglish), - check("no English text is empty", empty(english, englishKeys).length === 0, empty(english, englishKeys)), - check("no French text is empty", empty(french, frenchKeys).length === 0, empty(french, frenchKeys)), - ]); - }, - }, - { - id: "ranges-match-the-compatibility-table", - title: "the README compatibility table lists the interface ranges the module depends on, the dashboard layer pins one renderer minor, and the README names the same renderer cap as the layer's engines", - entryPoint: "README.md, package.json, frontend-vue/package.json", - database: "shared", - onboard: false, - async run(/** @type {Ctx} */ ctx) { - const readme = read(ctx, "README.md"); - const table = new Map([...readme.matchAll(/^\| `(@antelopejs\/[^`]+)`\s*\| `([^`]+)`/gm)].map((match) => [match[1] ?? "", match[2] ?? ""])); - const module = parseJson(read(ctx, "package.json")); - const frontend = parseJson(read(ctx, "frontend-vue/package.json")); - const dependencies = pick(module, "dependencies"); - const optional = pick(module, "optionalDependencies"); - const interfaces = [...(isRow(dependencies) ? Object.entries(dependencies) : []), ...(isRow(optional) ? Object.entries(optional) : [])].filter(([name]) => name.startsWith("@antelopejs/interface-")); - await ctx.verify("the ranges", [ - check("the table lists at least the six required interfaces", interfaces.length >= 7, interfaces.map(([name]) => name)), - ...interfaces.map(([name, spec]) => check(`${name} is in the table with the same range`, table.get(name) === spec, [table.get(name), spec])), - check("the dashboard layer pins one renderer minor", /^>=\d+\.\d+\.\d+ <\d+\.\d+\.0$/.test(String(pick(frontend, "engines", "@antelopejs/dms-frontend"))), pick(frontend, "engines")), - ]); - }, - }, -]; diff --git a/e2e/specs/package.spec.ts b/e2e/specs/package.spec.ts deleted file mode 100644 index 3f5d442b..00000000 --- a/e2e/specs/package.spec.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { defineJourneys } from "../fixtures.ts"; -import { journeys } from "../journeys/package.mjs"; - -defineJourneys("package", journeys); diff --git a/src/test/feature-map.test.ts b/src/test/feature-map.test.ts new file mode 100644 index 00000000..6901196c --- /dev/null +++ b/src/test/feature-map.test.ts @@ -0,0 +1,56 @@ +import { strict as assert } from "node:assert"; +import { matchesGlob } from "node:path"; +import { + features, + journeyIds, + repositoryHas, + surface, + trackedFiles, +} from "./helpers/featureMap"; + +function matchesAny(file: string, globs: readonly string[]): boolean { + return globs.some((glob) => matchesGlob(file, glob)); +} + +describe("Verify skill feature map", () => { + const map = features(); + + it("reads a covers list from every feature file", () => { + assert.ok(map.length >= 10, `${map.length} feature files`); + assert.deepEqual( + map.filter((feature) => feature.covers.length === 0).map((f) => f.file), + [], + ); + }); + + it("maps every user-facing file to a feature", () => { + const { userFacing, notUserFacing } = surface(); + assert.ok(userFacing.length > 0, "verify.config.ts names a surface"); + const covers = map.flatMap((feature) => feature.covers); + const unmapped = trackedFiles().filter( + (file) => + matchesAny(file, userFacing) && + !matchesAny(file, notUserFacing) && + !matchesAny(file, covers), + ); + assert.deepEqual(unmapped, []); + }); + + it("names only docs pages that exist", () => { + const missing = map.flatMap((feature) => + feature.docs + .filter((page) => !repositoryHas(page)) + .map((page) => `${feature.file}: ${page}`), + ); + assert.deepEqual(missing, []); + }); + + it("names every journey of the Playwright suite in a feature file", () => { + const ids = journeyIds(); + assert.ok(ids.length > 100, `${ids.length} journeys`); + assert.deepEqual( + ids.filter((id) => !map.some((feature) => feature.text.includes(id))), + [], + ); + }); +}); diff --git a/src/test/helpers/featureMap.ts b/src/test/helpers/featureMap.ts new file mode 100644 index 00000000..52af8098 --- /dev/null +++ b/src/test/helpers/featureMap.ts @@ -0,0 +1,94 @@ +import { execFileSync } from "node:child_process"; +import { existsSync, readdirSync } from "node:fs"; +import { join } from "node:path"; +import { REPOSITORY, repositoryText } from "./repository"; + +const SKILL = ".agents/skills/verify-dms-database"; +const FEATURES = `${SKILL}/features`; +const JOURNEYS = "e2e/journeys"; + +/** One feature file of the verify skill: the source globs it owns, its docs pages and its text. */ +export interface Feature { + readonly file: string; + readonly covers: readonly string[]; + readonly docs: readonly string[]; + readonly text: string; +} + +/** The user-facing globs of `verify.config.ts`, and the globs it excludes from them. */ +export interface Surface { + readonly userFacing: readonly string[]; + readonly notUserFacing: readonly string[]; +} + +function frontmatterList(text: string, key: string): string[] { + const frontmatter = /^---\n([\s\S]*?)\n---/.exec(text)?.[1] ?? ""; + const block = new RegExp(`^${key}:\\n((?: - .*\\n?)*)`, "m").exec( + frontmatter, + )?.[1]; + return (block ?? "") + .split("\n") + .map((line) => line.replace(/^ {2}- /, "").trim()) + .filter(Boolean); +} + +/** Every feature file but the README, with its `covers:` and `docs:` lists. */ +export function features(): Feature[] { + return readdirSync(join(REPOSITORY, FEATURES)) + .filter((file) => file.endsWith(".md") && file !== "README.md") + .sort() + .map((file) => { + const text = repositoryText(`${FEATURES}/${file}`); + return { + file, + covers: frontmatterList(text, "covers"), + docs: frontmatterList(text, "docs"), + text, + }; + }); +} + +/** The user-facing surface `verify.config.ts` declares. */ +export function surface(): Surface { + const config = repositoryText(`${SKILL}/verify.config.ts`); + const globs = (key: string): string[] => + [ + ...( + new RegExp(`^\\s*${key}: \\[(.*)\\],$`, "m").exec(config)?.[1] ?? "" + ).matchAll(/"([^"]+)"/g), + ].map((match) => match[1] ?? ""); + return { + userFacing: globs("userFacing"), + notUserFacing: globs("notUserFacing"), + }; +} + +/** The files git tracks in the checkout, as paths from its root. */ +export function trackedFiles(): string[] { + return execFileSync("git", ["ls-files"], { + cwd: REPOSITORY, + encoding: "utf8", + }) + .split("\n") + .filter(Boolean); +} + +/** Whether a path exists from the repository root. */ +export function repositoryHas(path: string): boolean { + return existsSync(join(REPOSITORY, path)); +} + +/** The id of every journey the Playwright suite registers, from `e2e/journeys` and its parts. */ +export function journeyIds(): string[] { + const files = readdirSync(join(REPOSITORY, JOURNEYS), { + recursive: true, + encoding: "utf8", + }).filter((file) => file.endsWith(".mjs")); + return files.flatMap((file) => + [ + ...repositoryText(`${JOURNEYS}/${file}`).matchAll( + /^\s+id: "([a-z0-9-]+)",$/gm, + ), + ].map((match) => match[1] ?? ""), + ); +} diff --git a/src/test/helpers/repository.ts b/src/test/helpers/repository.ts new file mode 100644 index 00000000..df28f87d --- /dev/null +++ b/src/test/helpers/repository.ts @@ -0,0 +1,97 @@ +import { execFileSync } from "node:child_process"; +import { mkdtempSync, readFileSync, rmSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join, resolve } from "node:path"; +import { + isBoolean, + isFiniteNumber, + isRecord, + isString, +} from "../../utils/guards"; + +/** The root of the checkout the test build runs from. */ +export const REPOSITORY = resolve(__dirname, "..", "..", ".."); + +/** A parsed JSON value. */ +export type Json = + | string + | number + | boolean + | null + | readonly Json[] + | { readonly [key: string]: Json }; + +/** What `npm pack` would publish: the paths in the tarball and its manifest. */ +export interface PackedModule { + readonly files: readonly string[]; + readonly manifest: Json; +} + +function isJson(value: unknown): value is Json { + if ( + value === null || + isString(value) || + isBoolean(value) || + isFiniteNumber(value) + ) + return true; + if (Array.isArray(value)) return value.every(isJson); + return isRecord(value) && Object.values(value).every(isJson); +} + +function parseJson(source: string, origin: string): Json { + const value: unknown = JSON.parse(source); + if (!isJson(value)) throw new Error(`${origin} holds no JSON value`); + return value; +} + +/** + * The text of a file of the checkout. + * + * @param file The path from the repository root + */ +export function repositoryText(file: string): string { + return readFileSync(join(REPOSITORY, file), "utf8"); +} + +/** + * The parsed JSON of a file of the checkout. + * + * @param file The path from the repository root + */ +export function repositoryJson(file: string): Json { + return parseJson(repositoryText(file), file); +} + +/** Packs the checkout the way a release does, without its lifecycle scripts, and lists the tarball. */ +export function packModule(): PackedModule { + const folder = mkdtempSync(join(tmpdir(), "dms-database-pack-")); + try { + const name = execFileSync( + "npm", + ["pack", "--ignore-scripts", "--silent", "--pack-destination", folder], + { + cwd: REPOSITORY, + encoding: "utf8", + shell: process.platform === "win32", + }, + ) + .trim() + .split("\n") + .at(-1); + const tarball = join(folder, name ?? ""); + const files = execFileSync("tar", ["-tzf", tarball], { encoding: "utf8" }) + .split("\n") + .map((line) => line.trim().replace(/^package\//, "")) + .filter(Boolean); + const manifest = parseJson( + execFileSync("tar", ["-xzOf", tarball, "package/package.json"], { + encoding: "utf8", + }), + "the packed package.json", + ); + return { files, manifest }; + } finally { + rmSync(folder, { recursive: true, force: true }); + } +} diff --git a/src/test/package.test.ts b/src/test/package.test.ts new file mode 100644 index 00000000..28617999 --- /dev/null +++ b/src/test/package.test.ts @@ -0,0 +1,159 @@ +import { strict as assert } from "node:assert"; +import { isString } from "../utils/guards"; +import { + type Json, + packModule, + type PackedModule, + repositoryJson, + repositoryText, +} from "./helpers/repository"; + +const ENGLISH = "frontend-vue/i18n/locales/database-en-GB.json"; +const FRENCH = "frontend-vue/i18n/locales/database-fr-FR.json"; + +type JsonObject = { readonly [key: string]: Json }; + +function isObject(value: Json | undefined): value is JsonObject { + return ( + value !== null && + value !== undefined && + !isString(value) && + !Array.isArray(value) && + value !== true && + value !== false && + !Number.isFinite(value) + ); +} + +function pick(value: Json | undefined, ...path: string[]): Json | undefined { + return path.reduce( + (node, step) => (isObject(node) ? node[step] : undefined), + value, + ); +} + +function leafKeys(node: Json, prefix = ""): string[] { + if (!isObject(node)) return [prefix]; + return Object.entries(node) + .flatMap(([key, value]) => + leafKeys(value, prefix ? `${prefix}.${key}` : key), + ) + .sort(); +} + +function emptyTexts(locale: Json, keys: readonly string[]): string[] { + return keys.filter((key) => { + const value = pick(locale, ...key.split(".")); + return !isString(value) || value.trim() === ""; + }); +} + +function packedPath(value: Json | undefined): string { + return isString(value) ? value.replace(/^\.\//, "") : "(not a path)"; +} + +describe("Package", () => { + describe("the tarball holds what its manifest names", () => { + let packed: PackedModule; + + before(function () { + this.timeout(120_000); + packed = packModule(); + }); + + it("packs every path the manifest points at", () => { + const { files, manifest } = packed; + const targets = [ + pick(manifest, "main"), + pick(manifest, "types"), + pick(manifest, "exports", ".", "types"), + pick(manifest, "exports", ".", "default"), + pick(manifest, "dmsFrontend"), + ].map(packedPath); + assert.deepEqual( + targets.filter((target) => !files.includes(target)), + [], + ); + assert.equal(pick(manifest, "name"), "@antelopejs/dms-database"); + assert.equal(pick(manifest, "publishConfig", "access"), "public"); + }); + + it("ships the skill, the layer with both locales and its pages", () => { + const { files, manifest } = packed; + assert.deepEqual(pick(manifest, "antelopeJs", "skills"), ["./skills"]); + const expected = [ + "skills/dms-database/SKILL.md", + "skills/dms-database/cases.json", + "frontend-vue/dms.frontend.ts", + ENGLISH, + FRENCH, + "frontend-vue/app/components/DataBrowser.vue", + "frontend-vue/app/components/QueryConsole.vue", + "frontend-vue/app/components/SchemaDiagram.vue", + "frontend-vue/app/components/TableInspector.vue", + "frontend-vue/app/components/ConnectionStatus.vue", + ]; + assert.deepEqual( + expected.filter((file) => !files.includes(file)), + [], + ); + }); + + it("leaves out the test build, the build info and the docs", () => { + assert.deepEqual( + packed.files.filter( + (file) => + file.startsWith("dist/test/") || + file.endsWith(".tsbuildinfo") || + file.startsWith("docs/"), + ), + [], + ); + }); + }); + + it("both locales hold the same texts, none empty", () => { + const english = repositoryJson(ENGLISH); + const french = repositoryJson(FRENCH); + const englishKeys = leafKeys(english); + const frenchKeys = leafKeys(french); + assert.deepEqual( + englishKeys.filter((key) => !frenchKeys.includes(key)), + [], + ); + assert.deepEqual( + frenchKeys.filter((key) => !englishKeys.includes(key)), + [], + ); + assert.deepEqual(emptyTexts(english, englishKeys), []); + assert.deepEqual(emptyTexts(french, frenchKeys), []); + }); + + it("the README compatibility table names each interface range and the layer pins one renderer minor", () => { + const table = new Map( + [ + ...repositoryText("README.md").matchAll( + /^\| `(@antelopejs\/[^`]+)`\s*\| `([^`]+)`/gm, + ), + ].map((match) => [match[1] ?? "", match[2] ?? ""]), + ); + const module = repositoryJson("package.json"); + const interfaces = ["dependencies", "optionalDependencies"] + .map((field) => pick(module, field)) + .flatMap((ranges) => (isObject(ranges) ? Object.entries(ranges) : [])) + .filter(([name]) => name.startsWith("@antelopejs/interface-")); + assert.ok( + interfaces.length >= 7, + interfaces.map(([name]) => name).join(", "), + ); + for (const [name, range] of interfaces) + assert.equal(table.get(name), range, name); + const renderer = pick( + repositoryJson("frontend-vue/package.json"), + "engines", + "@antelopejs/dms-frontend", + ); + assert.ok(isString(renderer), "the layer's engines name the renderer"); + assert.match(renderer, /^>=\d+\.\d+\.\d+ <\d+\.\d+\.0$/); + }); +}); From 1ddb6bc88921ba9dd99ea5b9ca4fcb09e80e7275 Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Thu, 19 Nov 2026 03:30:48 +0000 Subject: [PATCH 04/14] test(e2e): drive the query console link on each instance --- .../verify-dms-database/features/data.md | 2 +- .../verify-dms-database/features/query.md | 2 + e2e/journeys/parts/query-link.mjs | 45 +++++++++++++++++++ e2e/journeys/query.mjs | 2 + 4 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 e2e/journeys/parts/query-link.mjs diff --git a/.agents/skills/verify-dms-database/features/data.md b/.agents/skills/verify-dms-database/features/data.md index 184dd97c..8e7dab3c 100644 --- a/.agents/skills/verify-dms-database/features/data.md +++ b/.agents/skills/verify-dms-database/features/data.md @@ -113,7 +113,7 @@ pnpm e2e:run specs/data.spec.ts | grill Q24 No match: Clear filters / Search all instances | `no-match-and-empty-tables-say-so` | | grill Q24 Load error: Try again with the error text | `a-refused-read-shows-the-error-and-try-again-reads-it-again` | | docs/5.extending.md:77 `/modules/database/data?schema=&table=` opens the table | `links-open-the-table-in-the-instance-they-name` | -| docs/5.extending.md:78 `/modules/database/query?schema=&table=` opens the console on that table | Not driven: the Query console's feature owns that page | +| docs/5.extending.md:78 `/modules/database/query?schema=&table=` opens the console on that table | `a-link-opens-the-console-on-the-table-in-the-instance-it-names` (the query feature owns that page) | | README:21 browses rows in any instance | `the-sidebar-counts-each-table-in-the-picked-instance`, `links-open-the-table-in-the-instance-they-name`, `all-instances-is-a-read-only-view-with-the-instance-column` | | `GET /browse/list`, `count`, `columns`, `tables`, `references`, `get` | the six API journeys above | | `GET /tables/instances` (the instance picker) | `the-instance-picker-lists-named-instances-with-a-search-and-a-limit`; the sidebar journey picks eu and us from it and reads No named instance for `metrics` | diff --git a/.agents/skills/verify-dms-database/features/query.md b/.agents/skills/verify-dms-database/features/query.md index 74c6b6d8..d1621ffc 100644 --- a/.agents/skills/verify-dms-database/features/query.md +++ b/.agents/skills/verify-dms-database/features/query.md @@ -38,6 +38,7 @@ The Query console, run and read side: write AQL, run it, read the result. - `the-chart-plots-the-first-numeric-column-with-pickers-for-both-axes`: the Chart view, its default axes and the X picker. - `open-in-data-browser-opens-the-target-table-or-the-row`: the result's header link and each row's link. - `format-strips-trailing-spaces-and-blank-lines`: Format removes trailing spaces and surrounding blank lines. +- `a-link-opens-the-console-on-the-table-in-the-instance-it-names`: `/query?schema=&table=` with no instance, `instance=eu` and `instance=all`: the prefilled query, the link leaving the URL, and Run. - `copy-as-json-puts-the-returned-rows-on-the-clipboard`: Copy as JSON and its notice. - `an-export-of-uneven-rows-keeps-every-key-in-csv-and-json`: first row lacking keys later rows have. - `csv-quotes-a-comma-a-quote-and-a-line-break-so-the-cell-reads-back`: CSV quoting round trip. @@ -73,6 +74,7 @@ pnpm e2e:run specs/query.spec.ts | Chart: the first numeric column | `the-chart-plots-the-first-numeric-column-with-pickers-for-both-axes` | | Server returns at most 1,000 rows; truncated results say so | `results-over-1000-rows-are-cut-at-1000` | | Open in data browser opens the target table | `open-in-data-browser-opens-the-target-table-or-the-row` | +| `/modules/database/query?schema=&table=` opens the console on that table (docs/5.extending.md:78) | `a-link-opens-the-console-on-the-table-in-the-instance-it-names` ; the link's landing is also checked by `deep-links-open-the-documented-pages-on-the-table` | | Copy as JSON | `copy-as-json-puts-the-returned-rows-on-the-clipboard` | | Failures name the problem (Q29b) | `a-failed-query-says-what-failed-and-offers-the-nearest-name` | | Export CSV holds the same returned rows, whatever keys they have | 5.query-console.md:34 | `an-export-of-uneven-rows-keeps-every-key-in-csv-and-json` | diff --git a/e2e/journeys/parts/query-link.mjs b/e2e/journeys/parts/query-link.mjs new file mode 100644 index 00000000..24ada036 --- /dev/null +++ b/e2e/journeys/parts/query-link.mjs @@ -0,0 +1,45 @@ +import { check } from "../../database.mjs"; +import { editorText, openConsole, resultText, runSource } from "./console.mjs"; + +/** @typedef {import("../../database.mjs").Ctx} Ctx */ + +/** The deep link into the console, `/modules/database/query?schema=&table=`. */ +export const linkJourneys = [ + { + id: "a-link-opens-the-console-on-the-table-in-the-instance-it-names", + title: "/query?schema=&table= opens the console with a query on that table, on the default instance, the named one (instance=eu) or every instance (instance=all), the link leaves the URL, and Run reads the table", + entryPoint: "/modules/database/query?schema=shop&table=orders, docs/5.extending.md deep links", + async run(/** @type {Ctx} */ ctx) { + const opened = async (/** @type {string} */ search) => { + const tab = await openConsole(ctx, `/modules/database/query?${search}`); + const source = await editorText(tab); + const url = new URL(tab.page.url()); + return { tab, source, search: url.search }; + }; + const standard = await opened("schema=shop&table=products"); + await runSource(standard.tab, standard.source); + const standardResult = await resultText(standard.tab); + const named = await opened("schema=shop&table=orders&instance=eu"); + await runSource(named.tab, named.source); + const namedResult = await resultText(named.tab); + const every = await opened("schema=shop&table=orders&instance=all"); + await runSource(every.tab, every.source); + const everyResult = await resultText(every.tab); + await ctx.verify("the default instance", [ + check("the editor holds a query on shop.products, the default instance, 50 rows", standard.source === 'schemas.shop.instance().table("products").slice(0, 50)', standard.source), + check("the link left the URL", standard.search === "", standard.search), + check("Run reads the six products", /^Result 6 rows \d+ ms · read-only · shop\.products\b(?! @)/.test(standardResult), standardResult.slice(0, 120)), + ]); + await ctx.verify("a named instance", [ + check("the editor holds a query on shop.orders in eu", named.source === 'schemas.shop.instance("eu").table("orders").slice(0, 50)', named.source), + check("the link left the URL", named.search === "", named.search), + check("Run reads 50 rows of shop.orders @eu", /^Result 50 rows \d+ ms · read-only · shop\.orders @eu/.test(namedResult), namedResult.slice(0, 120)), + ]); + await ctx.verify("every instance", [ + check("the editor holds a query on shop.orders in every instance", every.source === 'schemas.shop.instance(CROSS_INSTANCE).table("orders").slice(0, 50)', every.source), + check("the link left the URL", every.search === "", every.search), + check("Run reads 50 rows of shop.orders @*", /^Result 50 rows \d+ ms · read-only · shop\.orders @\*/.test(everyResult), everyResult.slice(0, 120)), + ]); + }, + }, +]; diff --git a/e2e/journeys/query.mjs b/e2e/journeys/query.mjs index 43b3042b..f3281059 100644 --- a/e2e/journeys/query.mjs +++ b/e2e/journeys/query.mjs @@ -1,5 +1,6 @@ import { check, db, list, text } from "../database.mjs"; import { extraJourneys } from "./parts/query-extra.mjs"; +import { linkJourneys } from "./parts/query-link.mjs"; import { chooseView, editorText, exportCsv, flat, openConsole, resultText, runSource } from "./parts/console.mjs"; /** @typedef {import("../database.mjs").Ctx} Ctx */ @@ -193,4 +194,5 @@ export const journeys = [ }, }, ...extraJourneys, + ...linkJourneys, ]; From ca12a057f04031614661f8c07a872d516fa45593 Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Thu, 19 Nov 2026 03:35:45 +0000 Subject: [PATCH 05/14] test(e2e): drive a failed undo and the diagram's Escape steps --- .../verify-dms-database/features/data.md | 1 + .../verify-dms-database/features/diagram.md | 5 +- .../verify-dms-database/features/editing.md | 5 +- e2e/journeys/diagram.mjs | 3 +- e2e/journeys/parts/diagram-escape.mjs | 83 +++++++++++++++++++ e2e/journeys/parts/edit-undo.mjs | 56 ++++++++++++- 6 files changed, 146 insertions(+), 7 deletions(-) create mode 100644 e2e/journeys/parts/diagram-escape.mjs diff --git a/.agents/skills/verify-dms-database/features/data.md b/.agents/skills/verify-dms-database/features/data.md index 8e7dab3c..b9ad92b2 100644 --- a/.agents/skills/verify-dms-database/features/data.md +++ b/.agents/skills/verify-dms-database/features/data.md @@ -5,6 +5,7 @@ covers: - src/service/browse.ts - src/service/declaredFields.ts - src/service/references.ts + - src/service/rowFilter.ts - src/utils/query.ts - src/utils/requestValidation.ts - frontend-vue/app/components/DataBrowser.vue diff --git a/.agents/skills/verify-dms-database/features/diagram.md b/.agents/skills/verify-dms-database/features/diagram.md index fce5bd29..837cbce8 100644 --- a/.agents/skills/verify-dms-database/features/diagram.md +++ b/.agents/skills/verify-dms-database/features/diagram.md @@ -13,6 +13,7 @@ covers: - frontend-vue/app/build/components/Diagram* - frontend-vue/app/build/components/diagramFloat.css - frontend-vue/app/build/diagram/** + - frontend-vue/app/build/composables/useCatalogReferences.ts - frontend-vue/app/build/composables/useDiagram*.ts docs: - docs/4.usage/3.diagram.md @@ -43,11 +44,13 @@ The Diagram page draws the tables of one schema and the relations between them, - `a-table-not-placed-yet-takes-its-automatic-place-and-placed-tables-stay`: placement rule. - `auto-layout-previews-the-arrangement-and-keep-or-discard-decides`: preview bar, count, Discard, Keep, Undo, Escape. - `auto-layout-keeps-groups-together-and-clear-of-notes-that-never-move`: arrangement rules, folded height, notes. +- `auto-layout-and-note-wait-until-the-picked-schema-has-loaded`: while a picked schema reads its layout and notes, Auto layout, Note and N do nothing, so no preview or note holds the previous schema. - `n-and-the-note-button-drop-a-note-ready-to-write-and-it-is-saved-with-the-schema`: add notes. - `a-double-click-edits-a-note-and-the-trash-button-and-delete-remove-it`: edit and delete. - `notes-belong-to-their-schema-and-everyone-reads-them`: shared notes. - `undo-and-redo-cover-every-move-and-note-and-are-saved`: Ctrl Z, Ctrl Shift Z, Ctrl Y and the buttons. - `escape-steps-back-from-a-selected-table`: a click selects a table and Escape clears the selection. +- `escape-leaves-the-find-field-then-lifts-the-focus-then-clears-the-selection`: Escape in the find field only leaves it, with a table in focus it brings every table back and keeps the selection, and the next Escape clears the selection and its bar. - `a-double-click-opens-the-inspector-and-a-relation-opens-the-other-table-in-it`: the drawer titled with the table, its four tabs, no position, J and K ignored, and a relation opening the other table in the same drawer. - `f-focuses-the-find-field-but-not-while-writing-a-note`: F focuses the find field; an f typed into a note stays in the note. - `h-pans-the-canvas-and-v-selects-again`: the hand moves the view and no table; V restores table dragging. @@ -96,7 +99,7 @@ pnpm e2e:run specs/diagram.spec.ts | Shortcuts `1`, `0` | 3.diagram.md:41 | a-large-schema-opens-at-forty-percent... | | Shortcuts `V` / `H` | 3.diagram.md:40 | `h-pans-the-canvas-and-v-selects-again` | | Shortcuts Ctrl Z, Ctrl Shift Z, Ctrl Y | 3.diagram.md:42-43 | undo-and-redo-cover-every-move... | -| Shortcut `Esc` | 3.diagram.md:44 | auto-layout-previews... (discards the preview); focus and selection steps Not driven | +| Shortcut `Esc` | 3.diagram.md:44 | auto-layout-previews... (discards the preview); `escape-leaves-the-find-field-then-lifts-the-focus-then-clears-the-selection` (find field, focus, selection) | | The Shortcuts settings page lists them | 3.diagram.md:46 | `the-shortcuts-settings-page-lists-the-diagram-shortcuts` | | Schema ... not found, Table ... not found, No tables in X | design, SchemaDiagram.vue | the-url-picks-the-schema..., a-schema-without-a-table... | | Layout and notes API | routes/diagram.ts | the API journeys | diff --git a/.agents/skills/verify-dms-database/features/editing.md b/.agents/skills/verify-dms-database/features/editing.md index edbe39f6..5fcc8513 100644 --- a/.agents/skills/verify-dms-database/features/editing.md +++ b/.agents/skills/verify-dms-database/features/editing.md @@ -40,6 +40,7 @@ Staged edits of the Data browser: a cell or a drawer field is staged with the ol - `hashed-encrypted-and-localized-columns-are-written-as-typed`: the warning, driven on `vault.accounts`. - `the-row-drawer-stages-edits-like-the-cells-do`: the drawer's fields stage with the same messages, and its footer and the bar count the same changes. - `discard-drops-the-changes-of-every-staged-row`: Discard with changes on three rows empties the bar, restores every cell and writes nothing. +- `an-undo-whose-write-fails-keeps-the-saved-values-and-offers-undo-again`: the undo PUT answered 500 (injected in the browser) after a two-row save, the toast says 2 changes couldn't be undone, the saved names stay stored, Undo is offered again, and the retry writes the previous names back. ## How to get to it (user POV) @@ -56,7 +57,7 @@ pnpm e2e:run specs/editing.spec.ts - The bar's status line names the changed fields (`Unsaved changes · name, price`); the count is on the **Review and save N changes** button, the tab dot and the drawer's footer. - The Undo window is measured from the click on Save; the journey polls for the button and asserts the 9.9 to 11.5 second range. - Row identities: a cell is found by the text of the row's `_id` cell and the column's header; unsorted rows are in stored order. -- A write that fails is injected with `page.route` in the browser (HTTP 500 for one row's PUT); a deleted row is deleted through the query console's route. +- A write that fails is injected with `page.route` in the browser (HTTP 500 for one row's PUT, or for every PUT once a flag is set, as the undo journey does after the save); a deleted row is deleted through the query console's route. - `e2e/playground/src/browse-fixtures.ts` adds two rows to `vault.accounts` (the stored form of a hashed, an encrypted and a localized column), imported from `e2e/playground/src/index.ts`. - `src/service/stagedSerialization.ts` and `frontend-vue/app/build/utils/stagedSerialization.ts` are the query console's wire format; the journeys use them to read rows back (`query-wire.mjs` encodes the same way) and to delete and insert rows. @@ -93,5 +94,5 @@ pnpm e2e:run specs/editing.spec.ts | edits only on one instance; an edit lands in its instance only | `an-edit-and-its-undo-land-in-the-instance-of-the-tab-only` | | read-back through a second view (API, query console, reload, fresh tab) | `edits-are-staged-then-reviewed-then-written-one-put-per-row` and the stored-value checks of the other journeys | | the Undo of an edit that emptied a cell writes null back | `undo-writes-the-previous-values-back-within-the-window` | -| failure to undo with a failure of the write itself (`dms_database.data.save.undo_failed`) | Not driven: the undo's write failing leaves the rows for a retry, an injected 500 on the undo PUT was not added | +| an undo whose write fails leaves the rows for a retry (source: `useStagedSave.ts` shows `undo_partial`, never the `undo_failed` text) | `an-undo-whose-write-fails-keeps-the-saved-values-and-offers-undo-again` | | Discard drops the unsaved changes (every staged row) | 4.data-browser.md:36 | `discard-drops-the-changes-of-every-staged-row` | diff --git a/e2e/journeys/diagram.mjs b/e2e/journeys/diagram.mjs index b63d10ea..d5571dca 100644 --- a/e2e/journeys/diagram.mjs +++ b/e2e/journeys/diagram.mjs @@ -4,7 +4,8 @@ import { editing, notes, sharedNotes, undoing } from "./parts/diagram-notes.mjs" import { arrangement, preview, whileLoading } from "./parts/diagram-auto.mjs"; import { dragging, placement } from "./parts/diagram-layout.mjs"; import { keyJourneys } from "./parts/diagram-keys.mjs"; +import { escapeJourneys } from "./parts/diagram-escape.mjs"; import { layoutApi, notesApi, notesRefusals, ownerOnly } from "./parts/diagram-api.mjs"; /** The Diagram page: its tables, folds, layout, notes, shortcuts and the routes behind them. */ -export const journeys = [layoutApi, notesApi, notesRefusals, ownerOnly, reading, modifierIcons, folding, foldRule, notSaved, finding, startView, stubs, crossSchema, deepLinks, emptySchema, dragging, placement, preview, whileLoading, arrangement, notes, editing, sharedNotes, undoing, ...keyJourneys]; +export const journeys = [layoutApi, notesApi, notesRefusals, ownerOnly, reading, modifierIcons, folding, foldRule, notSaved, finding, startView, stubs, crossSchema, deepLinks, emptySchema, dragging, placement, preview, whileLoading, arrangement, notes, editing, sharedNotes, undoing, ...keyJourneys, ...escapeJourneys]; diff --git a/e2e/journeys/parts/diagram-escape.mjs b/e2e/journeys/parts/diagram-escape.mjs new file mode 100644 index 00000000..d7575816 --- /dev/null +++ b/e2e/journeys/parts/diagram-escape.mjs @@ -0,0 +1,83 @@ +import { check } from "../../database.mjs"; +import { box, byName, openDiagram, tables, tablesUntil } from "./diagram-page.mjs"; + +/** + * @typedef {import("../../database.mjs").Ctx} Ctx + * @typedef {import("../../database.mjs").Tab} Tab + * @typedef {{ id: string, title: string, entryPoint: string, run: (ctx: Ctx) => Promise }} JourneyDef + */ + +const FIND_FIELD = "INPUT:Find a table or column"; + +/** + * @param {Tab} tab The tab + * @returns {Promise} The tag and the accessible name of the element that has the focus + */ +function activeElement(tab) { + return tab.page.evaluate(() => `${document.activeElement?.tagName}:${document.activeElement?.getAttribute("aria-label") ?? ""}`); +} + +/** + * @param {Tab} tab The tab + * @returns {Promise} The selection bar's text, empty when none shows + */ +async function selectionBar(tab) { + return (await tab.page.locator(".diagram-float").filter({ hasText: /Inspect|Show all tables/ }).first().innerText().catch(() => "")).replace(/\s+/g, " ").trim(); +} + +/** + * @param {Tab} tab The tab + * @param {string} name A table of the schema + * @returns {Promise} + */ +async function selectTable(tab, name) { + const grab = await box(tab, `shop::${name}`); + await tab.page.mouse.click(grab.x + 90, grab.y + 18); + await tab.page.waitForTimeout(600); +} + +/** @type {JourneyDef} */ +export const escapeLevels = { + id: "escape-leaves-the-find-field-then-lifts-the-focus-then-clears-the-selection", + title: "Escape steps back one level at a time: from the find field it only leaves the field and keeps the selected table, with a table in focus it brings every table back and keeps the selection, and the next Escape clears the selection and its bar", + entryPoint: "/modules/database/diagram Esc", + async run(ctx) { + const tab = await openDiagram(ctx, "?schema=shop"); + await selectTable(tab, "orders"); + const selectedBar = await selectionBar(tab); + await tab.page.keyboard.press("f"); + await tab.page.waitForTimeout(400); + const inField = await activeElement(tab); + await tab.page.keyboard.press("Escape"); + await tab.page.waitForTimeout(500); + const afterField = await activeElement(tab); + const stillSelected = byName(await tables(tab), "orders")?.selected; + await ctx.verify("Escape in the find field", [ + check("selecting orders shows its selection bar", /^orders Inspect Focus$/.test(selectedBar), selectedBar), + check("F put the focus in the find field", inField === FIND_FIELD, inField), + check("Escape took the focus out of the field", afterField !== FIND_FIELD, afterField), + check("it did not clear the selection: orders is still selected and its bar shows", stillSelected === true && /^orders Inspect Focus$/.test(await selectionBar(tab)), [stillSelected, await selectionBar(tab)]), + ]); + await tab.click({ role: "button", name: "Focus" }); + const focused = await tablesUntil(tab, (drawn) => drawn.length === 3); + const focusBar = await selectionBar(tab); + await tab.page.keyboard.press("Escape"); + const lifted = await tablesUntil(tab, (drawn) => drawn.length === 4); + const liftedBar = await selectionBar(tab); + await ctx.verify("Escape in focus mode", [ + check("Focus leaves orders and its neighbours", focused.map((node) => node.name).sort().join() === "customers,order_items,orders", focused.map((node) => node.name)), + check("the bar offers Show all tables", /Show all tables/.test(focusBar), focusBar), + check("Escape brings all four tables back", lifted.map((node) => node.name).sort().join() === "customers,order_items,orders,products", lifted.map((node) => node.name)), + check("the selection is kept, with its bar offering Focus again", byName(lifted, "orders")?.selected === true && /^orders Inspect Focus$/.test(liftedBar), [byName(lifted, "orders")?.selected, liftedBar]), + ]); + await tab.page.keyboard.press("Escape"); + const cleared = await tablesUntil(tab, (drawn) => drawn.every((node) => !node.selected)); + const clearedBar = await selectionBar(tab); + await ctx.verify("Escape on a selection", [ + check("no table is selected", cleared.length === 4 && cleared.every((node) => !node.selected), cleared.map((node) => [node.name, node.selected])), + check("the selection bar is gone", clearedBar === "", clearedBar), + ]); + }, +}; + +export const escapeJourneys = [escapeLevels]; diff --git a/e2e/journeys/parts/edit-undo.mjs b/e2e/journeys/parts/edit-undo.mjs index c8a41c28..da99e354 100644 --- a/e2e/journeys/parts/edit-undo.mjs +++ b/e2e/journeys/parts/edit-undo.mjs @@ -1,6 +1,6 @@ import { check, show } from "../../database.mjs"; -import { openTable } from "./browse.mjs"; -import { barStatus, cellState, recordEdits, reviewLabel, saveStaged, storedRow, typeInto } from "./edit.mjs"; +import { openTable, settle } from "./browse.mjs"; +import { barStatus, cellState, recordEdits, reviewLabel, savedNotice, saveStaged, storedRow, typeInto } from "./edit.mjs"; import { queryRow } from "./query-wire.mjs"; /** @typedef {import("../../database.mjs").Ctx} Ctx */ @@ -104,5 +104,55 @@ const undoExpires = { }, }; -export const undoJourneys = [undoRestores, undoExpires]; +/** @type {{ id: string, title: string, entryPoint: string, run: (ctx: Ctx) => Promise }} */ +const undoFails = { + id: "an-undo-whose-write-fails-keeps-the-saved-values-and-offers-undo-again", + title: "when the write of an Undo fails the saved values stay stored, a toast says how many changes could not be undone, Undo is offered again for the rows left, and the retry writes the previous values back", + entryPoint: "PUT /api/database/browse/edit answering 500 after a save", + async run(ctx) { + const tab = await shopTab(ctx, "products", "eu"); + const before = await storedRow(ctx, "products", "eu_sku_lamp", "eu"); + const chairBefore = await storedRow(ctx, "products", "eu_sku_chair", "eu"); + await typeInto(tab, "eu_sku_lamp", "name", "Reading lamp"); + await typeInto(tab, "eu_sku_chair", "name", "Armchair"); + let failing = false; + let refused = 0; + await tab.page.route("**/api/database/browse/edit**", async (route) => { + if (!failing) { + await route.continue(); + return; + } + refused += 1; + await route.fulfill({ status: 500, contentType: "application/json", body: JSON.stringify({ message: "Disk full" }) }); + }); + await saveStaged(tab); + const saved = await storedRow(ctx, "products", "eu_sku_lamp", "eu"); + failing = true; + await tab.click({ role: "button", name: "Undo" }); + const toast = await settle(() => tab.page.locator("body").innerText(), (content) => /couldn.t be undone/.test(content)); + const lamp = await storedRow(ctx, "products", "eu_sku_lamp", "eu"); + const chair = await storedRow(ctx, "products", "eu_sku_chair", "eu"); + const offered = await tab.visible({ role: "button", name: "Undo" }); + const lampCell = await cellState(tab, "eu_sku_lamp", "name"); + await ctx.verify("the undo is refused", [ + check("the save wrote both names", saved.name === "Reading lamp", saved.name), + check("the toast says 2 changes couldn't be undone", /2 changes couldn.t be undone/.test(toast), toast.replace(/\s+/g, " ").slice(-300)), + check("the run stopped at the first failing write", refused === 1, refused), + check("the saved names stay stored", lamp.name === "Reading lamp" && chair.name === "Armchair", [lamp.name, chair.name]), + check("the grid shows the saved name, nothing struck", lampCell.text === "Reading lamp" && lampCell.struck === "", lampCell), + check("Undo is offered again", offered.pass, offered.detail), + ]); + failing = false; + await tab.click({ role: "button", name: "Undo" }); + const retried = await savedNotice(tab); + const lampBack = await storedRow(ctx, "products", "eu_sku_lamp", "eu"); + const chairBack = await storedRow(ctx, "products", "eu_sku_chair", "eu"); + await ctx.verify("the retry", [ + check("the bar says 2 changes undone", /2 changes undone/.test(retried), retried), + check("both previous names are stored again", lampBack.name === before.name && chairBack.name === chairBefore.name, [lampBack.name, chairBack.name]), + ]); + }, +}; + +export const undoJourneys = [undoRestores, undoExpires, undoFails]; From 5344d143ca3e2390f9fde9b1a1275b6caaea73d8 Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Thu, 19 Nov 2026 03:35:55 +0000 Subject: [PATCH 06/14] test(e2e): drive the history's day groups and a row without a status --- .../verify-dms-database/features/library.md | 7 +- e2e/journeys/library.mjs | 3 +- e2e/journeys/parts/library-legacy.mjs | 133 ++++++++++++++++++ 3 files changed, 140 insertions(+), 3 deletions(-) create mode 100644 e2e/journeys/parts/library-legacy.mjs diff --git a/.agents/skills/verify-dms-database/features/library.md b/.agents/skills/verify-dms-database/features/library.md index c2ab7a51..f02a03d1 100644 --- a/.agents/skills/verify-dms-database/features/library.md +++ b/.agents/skills/verify-dms-database/features/library.md @@ -23,6 +23,8 @@ The history, saved and team queries beside the console. - `a-saved-query-needs-a-name-and-can-be-edited-and-deleted`: Ctrl+S, the name rule, description, restore, edit, delete. - `a-shared-query-reaches-the-team-and-only-its-author-changes-it`: Team tab, 404 for a teammate's edit or delete. - `history-belongs-to-its-user-and-a-link-restores-a-run`: per-user history and the `?history=` link. +- `history-groups-runs-by-day-with-yesterday-and-older-dates`: runs aged through `ctx.database` list under Today, Yesterday and an older day's date, in that order. +- `a-history-row-without-a-status-reads-as-ok`: a row written without status, mutation or error reads as a successful run (design Q26), in the API and in the library. - `the-library-survives-a-backend-restart`: persistence. - `clear-history-empties-only-your-own-runs`: two owners, each clearing leaves the other's runs. @@ -38,6 +40,7 @@ pnpm e2e:run specs/library.spec.ts ## Gotchas +- The history collection is the one named like `query_history` in the backend's database; `parts/library-legacy.mjs` finds it, then ages rows with `updateMany` on `executedAt` and writes a legacy row with `insertOne`. - The 500-run journey makes 503 requests, so it takes about a minute. - A teammate is a second owner (`member(ctx, name, [], true)`): the routes are owner-only, so a plain member sees nothing. @@ -46,12 +49,12 @@ pnpm e2e:run specs/library.spec.ts | Documented behaviour | Journey and check | |---|---| | History: your last 500 runs | `history-keeps-your-last-500-runs-newest-first` | -| History: grouped by day, searchable | `history-records-failures-and-writes-with-their-status` (Today), `history-is-searchable-and-clearing-it-keeps-the-saved-queries` (search). Yesterday group: Not driven, a run cannot be aged | +| History: grouped by day, searchable | `history-records-failures-and-writes-with-their-status` (Today), `history-is-searchable-and-clearing-it-keeps-the-saved-queries` (search). Yesterday and older-day groups: `history-groups-runs-by-day-with-yesterday-and-older-dates` | | Clear history empties it | `history-is-searchable-and-clearing-it-keeps-the-saved-queries` | | Saved: the queries you saved (Ctrl S), with a name and a description | `a-saved-query-needs-a-name-and-can-be-edited-and-deleted` | | Team: shared queries; teammates run them; only the author edits or deletes (README, FAQ) | `a-shared-query-reaches-the-team-and-only-its-author-changes-it` | | FAQ: only you see your saved queries unless you tick Share with team | same journey (the private query is not in Team) | -| History records failures; old rows without status read as ok (design Q26) | failures: `history-records-failures-and-writes-with-their-status`; old rows: Not driven, the journeys cannot write a legacy row into the module's table | +| History records failures; old rows without status read as ok (design Q26) | failures: `history-records-failures-and-writes-with-their-status`; old rows: `a-history-row-without-a-status-reads-as-ok` | | Persistence in the module's own schema | `the-library-survives-a-backend-restart` | | Clear history empties it (yours only; per-user, two users) | 5.query-console.md:60 | `clear-history-empties-only-your-own-runs` | | The 500 runs are kept per user | 5.query-console.md:60 | `history-keeps-your-last-500-runs-newest-first` (a teammate's runs survive the owner's 503) | diff --git a/e2e/journeys/library.mjs b/e2e/journeys/library.mjs index 7e6b3579..22dab066 100644 --- a/e2e/journeys/library.mjs +++ b/e2e/journeys/library.mjs @@ -1,6 +1,7 @@ import { check, db, list, member, pick, runQuery, tableQuery, text } from "../database.mjs"; import { flat, openConsole } from "./parts/console.mjs"; import { HISTORY_LIMIT, SLICE, TAGS_QUERY, TAGS_SOURCE, history, save } from "./parts/library-kit.mjs"; +import { legacyJourneys } from "./parts/library-legacy.mjs"; import { savedJourneys } from "./parts/library-saved.mjs"; /** @typedef {import("../database.mjs").Ctx} Ctx */ @@ -127,4 +128,4 @@ const historyJourneys = [ ]; /** History, saved queries and team queries. */ -export const journeys = [...historyJourneys, ...savedJourneys]; +export const journeys = [...historyJourneys, ...legacyJourneys, ...savedJourneys]; diff --git a/e2e/journeys/parts/library-legacy.mjs b/e2e/journeys/parts/library-legacy.mjs new file mode 100644 index 00000000..c14b0653 --- /dev/null +++ b/e2e/journeys/parts/library-legacy.mjs @@ -0,0 +1,133 @@ +import { randomUUID } from "node:crypto"; +import { check, runQuery, tableQuery, text, pick } from "../../database.mjs"; +import { flat, openConsole } from "./console.mjs"; +import { SLICE, TAGS_SOURCE, history } from "./library-kit.mjs"; + +/** @typedef {import("../../database.mjs").Ctx} Ctx */ +/** @typedef {import("mongodb").Db} Db */ +/** @typedef {import("mongodb").Collection} Collection */ + +const DAY_MS = 24 * 60 * 60 * 1000; +const OLDER_DAYS = 3; +const HISTORY_COLLECTION = /query_history$/; +const LEGACY_SOURCE = `${TAGS_SOURCE}.slice(0, 1)`; +const NEWER_SOURCE = `${TAGS_SOURCE}.slice(0, 2)`; +const OLDER_SOURCE = `${TAGS_SOURCE}.slice(0, 3)`; + +/** + * The module's history collection: the one collection of the journey's database named like the `query_history` table. + * + * @param {Db} database The database the backend reads + * @returns {Promise} Its history collection + */ +async function historyCollection(database) { + const names = (await database.listCollections().toArray()).map((collection) => collection.name); + const found = names.filter((name) => HISTORY_COLLECTION.test(name)); + const [name] = found; + if (name === undefined || found.length !== 1) throw new Error(`expected one query_history collection among ${JSON.stringify(names)}`); + return database.collection(name); +} + +/** + * Moves the stored date of the runs with `source` back by `days` days. + * + * @param {Ctx} ctx The journey + * @param {string} source The AQL text of the runs to age + * @param {number} days How many days back + * @returns {Promise} How many rows were aged + */ +function age(ctx, source, days) { + return ctx.database(`age ${source} by ${days} days`, async (database) => { + const runs = await historyCollection(database); + const moved = await runs.updateMany({ source }, { $set: { executedAt: new Date(Date.now() - days * DAY_MS) } }); + return moved.modifiedCount; + }); +} + +/** + * The text of the console's library, with the history's day headings and its rows in order. + * + * @param {Ctx} ctx The journey + * @returns {Promise} The flattened page text up to the history's closing sentence + */ +async function libraryText(ctx) { + const tab = await openConsole(ctx); + await tab.page.waitForTimeout(800); + return (flat(await tab.page.locator("body").innerText()).split("Your last 500")[0] ?? ""); +} + +/** What the history does with rows the clock or an older release left behind. */ +export const legacyJourneys = [ + { + id: "history-groups-runs-by-day-with-yesterday-and-older-dates", + title: "a run moved back one day lists under Yesterday and one moved back three days under its date, below today's runs under Today; the API still lists all three newest first", + entryPoint: "/modules/database/query History tab, GET /api/database/query/history", + async run(/** @type {Ctx} */ ctx) { + await runQuery(ctx, OLDER_SOURCE, tableQuery("demo", "tags", [SLICE(3)])); + await runQuery(ctx, LEGACY_SOURCE, tableQuery("demo", "tags", [SLICE(1)])); + await runQuery(ctx, NEWER_SOURCE, tableQuery("demo", "tags", [SLICE(2)])); + const aged = [await age(ctx, LEGACY_SOURCE, 1), await age(ctx, OLDER_SOURCE, OLDER_DAYS)]; + const olderLabel = new Intl.DateTimeFormat("en-US", { day: "numeric", month: "short" }).format(new Date(Date.now() - OLDER_DAYS * DAY_MS)); + const listed = await history(ctx); + const sources = listed.items.map((item) => text(item, "source")); + await ctx.verify("the stored dates", [ + check("one row of each aged source moved", aged[0] === 1 && aged[1] === 1, aged), + check("the API lists the three runs newest first", JSON.stringify(sources) === JSON.stringify([NEWER_SOURCE, LEGACY_SOURCE, OLDER_SOURCE]), sources), + ]); + const body = await libraryText(ctx); + const lower = body.toLowerCase(); + const today = lower.indexOf("today"); + const yesterday = lower.indexOf("yesterday"); + const older = lower.indexOf(olderLabel.toLowerCase(), yesterday); + const newer = body.indexOf(NEWER_SOURCE); + const legacy = body.indexOf(LEGACY_SOURCE); + const oldest = body.indexOf(OLDER_SOURCE); + await ctx.verify("the library", [ + check("the headings run Today, Yesterday, then the older day's date", today >= 0 && yesterday > today && older > yesterday, { today, yesterday, older, olderLabel, body: body.slice(0, 800) }), + check("today's run is under Today", newer > today && newer < yesterday, { newer, today, yesterday }), + check("yesterday's run is under Yesterday", legacy > yesterday && legacy < older, { legacy, yesterday, older }), + check("the three-day-old run is under its date", oldest > older, { oldest, older }), + check("each heading appears once", lower.split("yesterday").length === 2 && lower.split("today").length === 2, body.slice(0, 800)), + ]); + }, + }, + { + id: "a-history-row-without-a-status-reads-as-ok", + title: "a row stored before runs recorded a status, a mutation flag or an error is listed as a successful run: the API says status ok and no mutation, the library shows its duration and rows, never a failure", + entryPoint: "GET /api/database/query/history, /modules/database/query History tab", + async run(/** @type {Ctx} */ ctx) { + await runQuery(ctx, NEWER_SOURCE, tableQuery("demo", "tags", [SLICE(2)])); + const written = (await history(ctx)).items[0]; + const stored = await ctx.database("write a row as an older release stored it", async (database) => { + const runs = await historyCollection(database); + const row = { + _id: randomUUID(), + userId: text(written, "userId"), + query: pick(written, "query"), + source: LEGACY_SOURCE, + language: text(written, "language"), + durationMs: 7, + rowCount: 1, + executedAt: new Date(Date.now() - 1000), + }; + await runs.insertOne(row); + return Object.keys((await runs.findOne({ _id: row._id })) ?? {}).sort(); + }); + await ctx.verify("the stored row", [ + check("the legacy row has no status, mutation or error field", !["status", "mutation", "error"].some((field) => stored.includes(field)), stored), + check("a run the module wrote carries a status", pick(written, "status") === "ok", written), + ]); + const listed = await history(ctx); + const legacy = listed.items.find((item) => text(item, "source") === LEGACY_SOURCE); + await ctx.verify("the API", [ + check("the legacy row is listed and counted", legacy !== undefined && listed.total === 2, [listed.total, listed.items.length]), + check("it reads as ok, not a mutation, with its rows and no error", pick(legacy, "status") === "ok" && pick(legacy, "mutation") === false && pick(legacy, "rowCount") === 1 && pick(legacy, "error") === undefined, legacy), + ]); + const body = await libraryText(ctx); + await ctx.verify("the library", [ + check("the legacy run shows its duration and row, as a successful run does", /demo\.tags schemas\.demo\.instance\(\)\.table\("tags"\)\.slice\(0, 1\) \d\d:\d\d [AP]M · 7 ms · 1 row\b/.test(body), body.slice(0, 900)), + check("nothing is worded as a failure", !/Unknown|failed|error/i.test(body), body.slice(0, 900)), + ]); + }, + }, +]; From 0ad00451a8c4732939f647d45dbecb0a2b8e9093 Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Thu, 19 Nov 2026 03:57:44 +0000 Subject: [PATCH 07/14] test(e2e): drive the Overview while MongoDB is down --- .../verify-dms-database/features/README.md | 14 ++--- .../verify-dms-database/features/overview.md | 4 +- AGENTS.md | 2 +- e2e/journeys/overview.mjs | 53 +++++++++++++++++++ e2e/stack.ts | 17 +++++- 5 files changed, 79 insertions(+), 11 deletions(-) diff --git a/.agents/skills/verify-dms-database/features/README.md b/.agents/skills/verify-dms-database/features/README.md index 209b03f5..249e6c97 100644 --- a/.agents/skills/verify-dms-database/features/README.md +++ b/.agents/skills/verify-dms-database/features/README.md @@ -1,22 +1,22 @@ # Feature map -One file per feature. `covers:` lists the source globs it owns, `docs:` the pages a verdict judges, and `e2e/journeys/.mjs` its journeys, which `e2e/specs/.spec.ts` registers with the Playwright suite. `dms-control map` checks that every user-facing file is covered and that every docs page exists; it no longer finds the journeys, which left the skill. Each file ends with a Coverage table: every documented behaviour either names the journey that asserts it or says why it is not driven. +One file per feature. `covers:` lists the source globs it owns, `docs:` the pages a verdict judges, and `e2e/journeys/.mjs` its journeys, which `e2e/specs/.spec.ts` registers with the Playwright suite. `src/test/feature-map.test.ts`, in `pnpm test`, checks that every user-facing file is covered, that every docs page exists and that every journey is named in a feature file. Each file ends with a Coverage table: every documented behaviour either names the journey that asserts it or says why it is not driven. | Feature | What the user does | Journeys | |---|---|---| | [smoke](smoke.md) | # Smoke | smoke | -| [overview](overview.md) | # Overview | the-connection-card-reads-the-probe, a-configured-driver-label-shows-beside-the-age, without-a-driver-label-the-card-shows-a-dash, the-card-age-counts-up-and-the-probe-repeats-every-thirty-seconds, schema-cards-list-every-schema-largest-first, largest-tables-rank-the-default-instances-by-rows, recent-queries-list-your-last-five-runs, the-header-buttons-lead-to-the-working-pages | +| [overview](overview.md) | # Overview | the-connection-card-reads-the-probe, a-configured-driver-label-shows-beside-the-age, without-a-driver-label-the-card-shows-a-dash, the-card-age-counts-up-and-the-probe-repeats-every-thirty-seconds, schema-cards-list-every-schema-largest-first, largest-tables-rank-the-default-instances-by-rows, recent-queries-list-your-last-five-runs, the-header-buttons-lead-to-the-working-pages, an-unreachable-database-shows-unavailable-and-check-again-recovers | | [config](config.md) | # Config | built-in-patterns-label-schemas-by-the-start-of-their-id, an-exact-key-beats-a-pattern-which-beats-a-built-in-label, a-glob-key-matches-the-whole-schema-id, a-label-takes-each-of-the-seven-tones | | [access](access.md) | # Access | every-route-needs-a-signed-in-session, a-member-gets-403-from-every-route-and-writes-nothing, a-member-sees-neither-the-pages-nor-the-catalog-tile, the-catalog-tile-reads-the-database, the-owner-only-gate-is-logged-at-start | | [schemas](schemas.md) | # Schemas | the-source-counts-rows-columns-indexes-relations-and-modifiers-of-each-table, schema-instance-search-and-structure-filters-narrow-the-source-and-combine, rows-are-counted-in-the-picked-instance-default-named-or-all, the-instances-route-searches-sorts-and-limits-the-named-instances-of-a-schema, a-table-is-read-by-its-schema-and-name-id, columns-are-declared-in-code-and-inferred-from-sampled-rows, the-tables-and-schemas-routes-answer-the-platform-owner-only, each-filter-of-the-bar-narrows-the-list-and-sets-its-own-url-key, the-url-restores-every-filter-after-a-reload-and-clear-removes-them, slash-focuses-the-search-field-but-not-while-typing-or-with-a-modifier, a-filter-that-matches-nothing-says-no-result-and-clear-filters-restores-the-list, each-of-the-five-sortable-columns-sorts-both-ways-and-the-third-click-restores-the-default-order, the-relations-and-modifiers-columns-name-the-tables-and-the-flags, a-row-click-opens-the-inspector-and-previous-next-j-and-k-step-through-the-list, dragging-the-drawer-edge-resizes-it-and-it-opens-at-the-width-you-left-it, the-inspector-states-the-counts-and-lists-each-column-with-its-type-null-and-notes, a-column-named-constructor-is-listed-like-any-other-column, the-indexes-and-relations-tabs-list-what-the-table-declares-and-a-relation-opens-the-other-table, the-sample-row-tab-shows-one-row-and-another-row-pages-through-the-table, browse-query-and-diagram-actions-open-the-other-pages-on-the-same-table | -| [diagram](diagram.md) | # Diagram | the-layout-api-stores-one-layout-per-schema-and-refuses-bad-positions, the-notes-api-creates-lists-updates-and-deletes-notes-per-schema, the-notes-api-refuses-missing-numbers-with-400-and-unknown-notes-with-404, every-diagram-route-answers-the-platform-owner-only, tables-list-their-columns-with-types-and-icons-and-relations-are-arrows, an-encrypted-column-carries-the-lock-icon-of-the-legend, a-table-of-more-than-twelve-columns-comes-folded-and-folding-is-not-saved, folding-is-a-setting-of-your-own-view-and-is-not-saved-with-the-team-layout, finding-a-column-a-folded-table-hides-unfolds-that-table, the-fold-keeps-the-twelve-column-boundary-and-every-column-an-arrow-ends-on, a-large-schema-opens-at-forty-percent-on-its-top-left-and-fit-view-shows-it-whole, a-relation-to-a-table-not-drawn-ends-on-a-dashed-chip-that-opens-that-table, a-relation-to-another-schema-ends-on-a-chip-that-opens-that-table, the-url-picks-the-schema-and-the-table-and-names-what-it-cannot-find, a-schema-without-a-table-says-so-and-offers-no-note-or-auto-layout, dragging-a-table-saves-the-layout-and-everyone-reads-it, a-table-not-placed-yet-takes-its-automatic-place-and-placed-tables-stay, auto-layout-previews-the-arrangement-and-keep-or-discard-decides, auto-layout-keeps-groups-together-and-clear-of-notes-that-never-move, n-and-the-note-button-drop-a-note-ready-to-write-and-it-is-saved-with-the-schema, a-double-click-edits-a-note-and-the-trash-button-and-delete-remove-it, notes-belong-to-their-schema-and-everyone-reads-them, undo-and-redo-cover-every-move-and-note-and-are-saved | +| [diagram](diagram.md) | # Diagram | the-layout-api-stores-one-layout-per-schema-and-refuses-bad-positions, the-notes-api-creates-lists-updates-and-deletes-notes-per-schema, the-notes-api-refuses-missing-numbers-with-400-and-unknown-notes-with-404, every-diagram-route-answers-the-platform-owner-only, tables-list-their-columns-with-types-and-icons-and-relations-are-arrows, an-encrypted-column-carries-the-lock-icon-of-the-legend, a-table-of-more-than-twelve-columns-comes-folded-and-folding-is-not-saved, folding-is-a-setting-of-your-own-view-and-is-not-saved-with-the-team-layout, finding-a-column-a-folded-table-hides-unfolds-that-table, the-fold-keeps-the-twelve-column-boundary-and-every-column-an-arrow-ends-on, a-large-schema-opens-at-forty-percent-on-its-top-left-and-fit-view-shows-it-whole, a-relation-to-a-table-not-drawn-ends-on-a-dashed-chip-that-opens-that-table, a-relation-to-another-schema-ends-on-a-chip-that-opens-that-table, the-url-picks-the-schema-and-the-table-and-names-what-it-cannot-find, a-schema-without-a-table-says-so-and-offers-no-note-or-auto-layout, dragging-a-table-saves-the-layout-and-everyone-reads-it, a-table-not-placed-yet-takes-its-automatic-place-and-placed-tables-stay, auto-layout-previews-the-arrangement-and-keep-or-discard-decides, auto-layout-keeps-groups-together-and-clear-of-notes-that-never-move, n-and-the-note-button-drop-a-note-ready-to-write-and-it-is-saved-with-the-schema, a-double-click-edits-a-note-and-the-trash-button-and-delete-remove-it, notes-belong-to-their-schema-and-everyone-reads-them, undo-and-redo-cover-every-move-and-note-and-are-saved, escape-leaves-the-find-field-then-lifts-the-focus-then-clears-the-selection | | [data](data.md) | # Data | the-instance-picker-lists-named-instances-with-a-search-and-a-limit, list-clamps-the-page-and-orders-the-rows, list-filters-search-and-counts-follow-the-wire-tokens, the-selection-decodes-schema-table-and-instance, columns-get-and-tables-answer-what-the-grid-needs, references-count-the-rows-pointing-at-a-row, the-browse-api-answers-the-platform-owner-only, the-sidebar-counts-each-table-in-the-picked-instance, tables-open-as-preview-tabs-and-are-kept-on-demand, links-open-the-table-in-the-instance-they-name, search-filters-and-sort-narrow-and-order-the-rows, the-footer-pages-1250-rows-with-exact-ranges-at-every-size, r-refreshes-the-rows-and-the-search-shortcut-works-from-the-grid, the-row-drawer-steps-through-the-page-with-j-and-k, the-row-drawer-shows-fields-json-and-the-rows-pointing-at-it, the-fields-tab-widens-long-values-and-sets-null-with-the-dashed-circle, all-instances-is-a-read-only-view-with-the-instance-column, recently-opened-tables-are-offered-when-no-tab-is-open, no-match-and-empty-tables-say-so, a-refused-read-shows-the-error-and-try-again-reads-it-again | -| [editing](editing.md) | # Editing | edits-are-staged-then-reviewed-then-written-one-put-per-row, invalid-drafts-are-refused-esc-cancels-and-a-click-away-decides, null-empties-a-cell-and-backslash-null-is-the-text-null, object-and-array-cells-open-the-json-editor-in-a-side-drawer, the-json-editor-is-as-tall-as-the-drawer, discard-and-closing-a-tab-with-staged-changes-ask-first, undo-writes-the-previous-values-back-within-the-window, undo-is-offered-for-ten-seconds-then-the-values-stay, a-row-deleted-meanwhile-drops-its-changes-and-the-rest-is-saved, a-failed-write-stops-the-save-and-the-rows-left-stay-staged, a-saved-row-shows-in-place-unless-the-save-may-move-rows, a-save-under-a-search-or-a-filter-reads-the-page-again, an-edit-and-its-undo-land-in-the-instance-of-the-tab-only, saved-cells-keep-their-type-numbers-booleans-dates-and-objects, the-edit-route-writes-typed-values-and-refuses-the-rest, hashed-encrypted-and-localized-columns-are-written-as-typed, the-row-drawer-stages-edits-like-the-cells-do | -| [query](query.md) | # Query | a-query-returns-its-rows-in-the-order-it-asks, an-instance-and-every-instance-are-targeted, a-failed-query-says-what-failed-and-offers-the-nearest-name, the-insert-chips-add-their-operation, ctrl-space-completes-schemas-and-tables-from-the-workspace, an-empty-console-offers-examples-built-on-your-own-tables, results-over-1000-rows-are-cut-at-1000, the-table-view-shows-every-returned-row | +| [editing](editing.md) | # Editing | edits-are-staged-then-reviewed-then-written-one-put-per-row, invalid-drafts-are-refused-esc-cancels-and-a-click-away-decides, null-empties-a-cell-and-backslash-null-is-the-text-null, object-and-array-cells-open-the-json-editor-in-a-side-drawer, the-json-editor-is-as-tall-as-the-drawer, discard-and-closing-a-tab-with-staged-changes-ask-first, undo-writes-the-previous-values-back-within-the-window, undo-is-offered-for-ten-seconds-then-the-values-stay, a-row-deleted-meanwhile-drops-its-changes-and-the-rest-is-saved, a-failed-write-stops-the-save-and-the-rows-left-stay-staged, a-saved-row-shows-in-place-unless-the-save-may-move-rows, a-save-under-a-search-or-a-filter-reads-the-page-again, an-edit-and-its-undo-land-in-the-instance-of-the-tab-only, saved-cells-keep-their-type-numbers-booleans-dates-and-objects, the-edit-route-writes-typed-values-and-refuses-the-rest, hashed-encrypted-and-localized-columns-are-written-as-typed, the-row-drawer-stages-edits-like-the-cells-do, an-undo-whose-write-fails-keeps-the-saved-values-and-offers-undo-again | +| [query](query.md) | # Query | a-query-returns-its-rows-in-the-order-it-asks, an-instance-and-every-instance-are-targeted, a-failed-query-says-what-failed-and-offers-the-nearest-name, the-insert-chips-add-their-operation, ctrl-space-completes-schemas-and-tables-from-the-workspace, an-empty-console-offers-examples-built-on-your-own-tables, results-over-1000-rows-are-cut-at-1000, the-table-view-shows-every-returned-row, an-export-of-uneven-rows-keeps-every-key-in-csv-and-json, csv-quotes-a-comma-a-quote-and-a-line-break-so-the-cell-reads-back, format-strips-trailing-spaces-and-blank-lines, ctrl-space-inside-a-filter-completes-the-columns-of-the-table, the-chart-plots-the-first-numeric-column-with-pickers-for-both-axes, open-in-data-browser-opens-the-target-table-or-the-row, copy-as-json-puts-the-returned-rows-on-the-clipboard, a-link-opens-the-console-on-the-table-in-the-instance-it-names | | [guard](guard.md) | # Guard | a-delete-names-its-operation-target-and-rows-and-waits-for-the-table-name, every-write-names-its-operation-and-counts-the-rows-it-would-touch, confirming-a-single-row-update-needs-the-table-name-as-the-docs-say, a-confirmed-write-acts-on-the-data-of-that-moment, a-read-query-runs-straight-away | -| [library](library.md) | # Library | history-keeps-your-last-500-runs-newest-first, history-records-failures-and-writes-with-their-status, history-is-searchable-and-clearing-it-keeps-the-saved-queries, a-saved-query-needs-a-name-and-can-be-edited-and-deleted, a-shared-query-reaches-the-team-and-only-its-author-changes-it, history-belongs-to-its-user-and-a-link-restores-a-run, the-library-survives-a-backend-restart | +| [library](library.md) | # Library | history-keeps-your-last-500-runs-newest-first, history-records-failures-and-writes-with-their-status, history-is-searchable-and-clearing-it-keeps-the-saved-queries, a-saved-query-needs-a-name-and-can-be-edited-and-deleted, a-shared-query-reaches-the-team-and-only-its-author-changes-it, history-belongs-to-its-user-and-a-link-restores-a-run, the-library-survives-a-backend-restart, history-groups-runs-by-day-with-yesterday-and-older-dates, a-history-row-without-a-status-reads-as-ok | | [extending](extending.md) | # Extending | a-registered-schema-shows-its-tables-columns-indexes-relations-and-modifiers, deep-links-open-the-documented-pages-on-the-table, without-the-automation-module-the-trigger-registration-is-a-silent-no-op | | [external](external.md) | # External | an-external-database-is-picked-browsed-edited-and-left, an-external-database-refuses-what-it-cannot-serve-with-sentences | -| [package](package.md) | # Package | the-tarball-holds-what-its-manifest-names, both-locales-hold-the-same-texts, ranges-match-the-compatibility-table | +| [package](package.md) | # Package | none: `src/test/package.test.ts` checks the tarball, the locales and the ranges | The smoke journey runs on every verdict. diff --git a/.agents/skills/verify-dms-database/features/overview.md b/.agents/skills/verify-dms-database/features/overview.md index aa1e4caa..6c91a31a 100644 --- a/.agents/skills/verify-dms-database/features/overview.md +++ b/.agents/skills/verify-dms-database/features/overview.md @@ -28,6 +28,7 @@ The landing page of the module: whether the database answers, what it holds and - `schema-cards-list-every-schema-largest-first`: one card per schema, largest first, with instances, tables, rows and relations; a card opens Schemas filtered. - `largest-tables-rank-the-default-instances-by-rows`: five tables, biggest first, default instances only, each linking to the Data browser. - `recent-queries-list-your-last-five-runs`: empty state, then the last five runs, newest first, failed flagged, each linking to its run. +- `an-unreachable-database-shows-unavailable-and-check-again-recovers`: the journey stops MongoDB under the running backend; the card turns to Unavailable with Last error and Check again, then Check again shows Healthy once MongoDB is back. Known failure: the health route answers 500 after about 30 s, not `down` within the 3 s probe deadline. - `the-header-buttons-lead-to-the-working-pages`: Open query console and Browse data. ## How to get to it (user POV) @@ -42,6 +43,7 @@ pnpm e2e:run specs/overview.spec.ts ## Gotchas +- With MongoDB stopped, the page learns of it at its next 30 s probe, and the health route takes about 30 s (the driver's server selection timeout) to answer 500: expect Unavailable 60 to 120 s after `ctx.stopDatabase()`. Check again is disabled while a request runs. - Queries for the feed are run through the console's execute route with the staged wire format (`tableQuery` in `e2e/database.mjs`). ## Coverage @@ -56,5 +58,5 @@ pnpm e2e:run specs/overview.spec.ts | Overview: Largest tables, default instances | `largest-tables-rank-the-default-instances-by-rows` | | Overview: Recent queries, Query console link | `recent-queries-list-your-last-five-runs` | | Overview: header buttons | `the-header-buttons-lead-to-the-working-pages` | -| Overview: unreachable database ("Unavailable", Check again) | Not driven: a journey cannot stop and restart the run's mongod (draft `dms-control-stop-database`) | +| Overview: unreachable database ("Unavailable", Check again) | `an-unreachable-database-shows-unavailable-and-check-again-recovers` | | Overview: empty schema cards state | Not driven: the DMS registers its own schemas, so the list is never empty | diff --git a/AGENTS.md b/AGENTS.md index f1fec9ab..5ecdae45 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -28,7 +28,7 @@ - `scripts/check-sources.mts` runs in `pnpm lint`: the components the backend pages name exist, `` reads the global messages, and every text key a page names resolves in each locale. - The playground is linted but not type-checked. Check it with `pnpm --dir playground install --ignore-workspace --frozen-lockfile && pnpm --dir playground build`. -`e2e/` is the Playwright suite of the verify skill's journeys, one spec per feature, run on the `e2e/playground` project with one worker that starts its own MongoDB, backend and dashboard on free ports. `pnpm e2e:smoke` builds once and runs the journeys tagged `@smoke`, as the `e2e` job of `ci.yml` does on the full tier; the nightly tier runs every journey in two shards, and a draft or the fast tier runs none. After `pnpm e2e:build`, `pnpm e2e:run specs/.spec.ts` runs one feature without a rebuild. +`e2e/` is the Playwright suite of the verify skill's journeys, one spec per feature, run on the `e2e/playground` project with one worker that starts its own MongoDB, backend and dashboard on free ports. `pnpm e2e:smoke` builds once and runs the journeys tagged `@smoke`, as the `e2e` job of `ci.yml` does on a pull request; the merge queue, the nightly, a manual run and a pull request labelled `ci:full` run every journey in two shards, and a draft or a docs-only change runs none. After `pnpm e2e:build`, `pnpm e2e:run specs/.spec.ts` runs one feature without a rebuild. `pnpm knip` checks dependencies only. `pnpm knip:all` also reports unused files and exports; confirm each finding before you remove it. diff --git a/e2e/journeys/overview.mjs b/e2e/journeys/overview.mjs index e9a6885e..09c0885f 100644 --- a/e2e/journeys/overview.mjs +++ b/e2e/journeys/overview.mjs @@ -175,6 +175,59 @@ export const journeys = [ await ctx.verify("the link opens the console", [tab.at(/\/modules\/database\/query$/)]); }, }, + { + id: "an-unreachable-database-shows-unavailable-and-check-again-recovers", + title: "when the database stops answering, the Connection card turns to Unavailable with the last error and a Check again button, the backend keeps running, and Check again shows Healthy once the database is back", + entryPoint: "/modules/database/overview, GET /api/database/health", + knownFailures: { + "the health route answers status down within 10 s of the request": "with MongoDB stopped, GET /api/database/health answers 500 after the driver's 30 s server selection timeout, not status down with the probe's error within the 3 s probe deadline: the totals read after the probe throw, so the card's Last error reads No answer", + }, + async run(/** @type {Ctx} */ ctx) { + const tab = await overviewTab(ctx); + const checkAgain = { role: "button", name: "Check again" }; + await ctx.verify("the card starts healthy", [tab.shows(/Healthy/), tab.visible(checkAgain, { hidden: true }), tab.shows(/Unavailable/, { not: true })]); + /** @type {{ status: number, body: unknown, ms: number }[]} */ + const probes = []; + /** @type {Map} */ + const started = new Map(); + tab.page.on("request", (request) => { + if (request.url().endsWith("/api/database/health")) started.set(request, Date.now()); + }); + tab.page.on("response", (response) => { + const begun = started.get(response.request()); + if (begun === undefined) return; + const answered = (/** @type {unknown} */ body) => probes.push({ status: response.status(), body, ms: Date.now() - begun }); + void response.json().then(answered, () => answered(null)); + }); + await ctx.stopDatabase(); + await ctx.verify("the page's own probe finds the database gone", [tab.shows(/Unavailable/, { timeoutMs: 150_000 })], { critical: true }); + await ctx.verify("the card reads Unavailable", [ + tab.shows(/Last error\s+\S/i), + tab.shows(/Next probe\s+30\s*s/i), + tab.visible(checkAgain), + tab.shows(/Probe latency/i, { not: true }), + tab.shows(/Healthy/, { not: true }), + ]); + const first = probes[0]; + await ctx.verify("the probe's answer", [check("the health route answers status down within 10 s of the request", first !== undefined && first.status === 200 && pick(first.body, "status") === "down" && first.ms < 10_000, first)]); + await ctx.startDatabase(); + let healthy = false; + for (let attempt = 0; attempt < 6 && !healthy; attempt += 1) { + const ready = await tab.enabled(checkAgain, { timeoutMs: 60_000 }); + if (!ready.pass) continue; + await tab.click(checkAgain); + healthy = (await tab.shows(/Healthy/, { timeoutMs: 45_000 })).pass; + } + const health = await db(ctx, "health after the database came back", "GET", "/health"); + await ctx.verify("Check again recovers", [ + check("the card shows Healthy after Check again", healthy, healthy), + tab.shows(/Probe latency\s+\d+\s*ms/i), + tab.visible(checkAgain, { hidden: true }), + tab.shows(/Unavailable/, { not: true }), + check("the backend answers the health route and reports ok", health.status === 200 && pick(health.body, "status") === "ok", [health.status, pick(health.body, "status")]), + ]); + }, + }, { id: "the-header-buttons-lead-to-the-working-pages", title: "Open query console and Browse data lead to the Query console and the Data browser", diff --git a/e2e/stack.ts b/e2e/stack.ts index 7d8683aa..57156c22 100644 --- a/e2e/stack.ts +++ b/e2e/stack.ts @@ -62,7 +62,10 @@ export interface Stack { withDatabase(use: (database: Db) => Promise): Promise; /** Stops the MongoDB replica set and keeps its data; the backend keeps running and finds no database. */ stopDatabase(): Promise; - /** Starts the replica set {@link Stack.stopDatabase} stopped, on the same port and data. */ + /** + * Starts the replica set {@link Stack.stopDatabase} stopped, on the same port and data; a start the node refuses + * while it is still applying its configuration runs again, up to five times. + */ startDatabase(): Promise; /** The log of the backend's latest start. */ backendLog(): string; @@ -80,6 +83,8 @@ const MONGO_VERSION = "8.0.8"; const READY_TIMEOUT_MS = 180_000; const STOP_GRACE_MS = 10_000; const POLL_MS = 250; +const RESTART_ATTEMPTS = 5; +const RESTART_RETRY_MS = 1_000; const LOG_TAIL = 2_000; const SECRET_BYTES = 32; const PASSWORD_BYTES = 9; @@ -401,7 +406,15 @@ class WorkerStack implements Stack { this.#refuseAfterStop(); if (this.#mongo === undefined) throw new Error("no database yet: the journey has not started a backend"); - await this.#mongo.start(); + for (let attempt = 1; ; attempt += 1) { + try { + await this.#mongo.start(); + break; + } catch (error) { + if (attempt === RESTART_ATTEMPTS) throw error; + await delay(RESTART_RETRY_MS); + } + } await this.#mongo.waitUntilRunning(); } From 1dcbb9ca08a069a9300f3af72935f77b97669f6c Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Thu, 19 Nov 2026 03:57:57 +0000 Subject: [PATCH 08/14] docs(verify): drop the flows the suite now drives from Not driven --- .agents/skills/verify-dms-database/SKILL.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.agents/skills/verify-dms-database/SKILL.md b/.agents/skills/verify-dms-database/SKILL.md index 31d8ed63..9e9b4684 100644 --- a/.agents/skills/verify-dms-database/SKILL.md +++ b/.agents/skills/verify-dms-database/SKILL.md @@ -5,7 +5,7 @@ description: "Drive the AntelopeJS dms-database module (the Database console: Ov # Verify dms-database -The scripted journeys are a Playwright suite in the repository's `e2e/` folder: `e2e/journeys/.mjs` holds a feature's journeys, `e2e/specs/.spec.ts` registers them, and CI runs the ones tagged `@smoke` on the full tier and every journey on the nightly tier. You choose which features to run, judge what they show, and look at the product yourself with `dms-control`; you never write a multi-step shell recipe. When a journey you need does not exist, add it to `e2e/journeys/.mjs`, describe it in its feature file, and run its spec. +The scripted journeys are a Playwright suite in the repository's `e2e/` folder: `e2e/journeys/.mjs` holds a feature's journeys, `e2e/specs/.spec.ts` registers them, and CI runs the ones tagged `@smoke` on a pull request and every journey in the merge queue and the nightly. You choose which features to run, judge what they show, and look at the product yourself with `dms-control`; you never write a multi-step shell recipe. When a journey you need does not exist, add it to `e2e/journeys/.mjs`, describe it in its feature file, and run its spec. `dms-control` is the bin of `@antelopejs/dms`, a devDependency of this repository. Run it with Node 24 after `pnpm install`: @@ -55,7 +55,7 @@ pnpm exec playwright show-trace e2e/test-results//trace.zip - A journey starts on an empty database with the administrator onboarded and the backend restarted on it, so configuration switches are gone and the playground has seeded its schemas again. It reads every mutation back through a second view: the API, a reload, another tab, another account, or a backend restart. - `withConfig(ctx, { VERIFY_DATABASE_*: … }, body)` restarts the backend with module options set (`DRIVER_LABEL`, `SCHEMA_LABELS`; see `e2e/playground/antelope.config.ts`) and restarts it again without them. - To look at the product yourself, drive the run `up` started: `$C onboard "$RUN"`, `$C browser "$RUN" login`, `goto --path`, `snapshot`, `click --role --name`, `fill`, `press`, `screenshot`, `$C api "$RUN" [--as anon] [--body ]`, `$C reset "$RUN"`. Each writes its evidence under `$RUN/evidence/`. -- `dms-control map`, `journey` and `verdict` read the journeys from this folder, which no longer holds them, so they do not work for this skill; `plan` and `doors` do. +- `dms-control map`, `journey` and `verdict` read the journeys from this folder, which no longer holds them, so they do not work for this skill; `plan` and `doors` do. `src/test/feature-map.test.ts` in `pnpm test` does what `map` checked. ## Evidence @@ -90,12 +90,9 @@ Report the verdict in your own reply: the result line, the one-way doors, the sp List these as not verified in every verdict: -- the Overview's unreachable-database state (Unavailable, Last error, Check again): a journey cannot stop and restart the suite's MongoDB (draft `dms-control-stop-database`); - the Table watch trigger's failure on a standalone MongoDB and its one reconnect: the suite's MongoDB is a replica set, and a journey cannot break its change stream; - the Overview's empty schema-cards state: the DMS registers its own schemas, so the list is never empty; -- history rows written before runs recorded a status, and the Yesterday group of the history: a journey cannot write a legacy row or age a run; - the Diagram's name order of the tables without relations: `frontend-vue/tests/diagramLayout.test.ts` checks it, no journey does (see the diagram feature); -- the column completion of the console, Format, the Chart view and "Open in data browser" of a result row, until a journey drives them (listed in the query feature's coverage table); - the supported extension boundary (root barrel exports, no subclassing contract): a statement of non-support has no observable effect; - the role editor hiding one block per role: pages stay owner-only, so a hidden block has no effect an owner can see. From 686e57419501d0e91c982477779dac70859f4059 Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Thu, 19 Nov 2026 03:58:31 +0000 Subject: [PATCH 09/14] test: narrow the package test's JSON objects with the shared guard --- src/test/package.test.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/test/package.test.ts b/src/test/package.test.ts index 28617999..9306232b 100644 --- a/src/test/package.test.ts +++ b/src/test/package.test.ts @@ -1,5 +1,5 @@ import { strict as assert } from "node:assert"; -import { isString } from "../utils/guards"; +import { isRecord, isString } from "../utils/guards"; import { type Json, packModule, @@ -14,15 +14,7 @@ const FRENCH = "frontend-vue/i18n/locales/database-fr-FR.json"; type JsonObject = { readonly [key: string]: Json }; function isObject(value: Json | undefined): value is JsonObject { - return ( - value !== null && - value !== undefined && - !isString(value) && - !Array.isArray(value) && - value !== true && - value !== false && - !Number.isFinite(value) - ); + return isRecord(value) && !Array.isArray(value); } function pick(value: Json | undefined, ...path: string[]): Json | undefined { From dc567a9dede47d97fb92f038684d93e86232f071 Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Thu, 19 Nov 2026 04:49:20 +0000 Subject: [PATCH 10/14] test: address the review of the journeys, the pack check and the e2e jobs --- .github/workflows/ci.yml | 4 +-- AGENTS.md | 2 +- e2e/journeys/overview.mjs | 15 +++++--- e2e/journeys/parts/library-legacy.mjs | 11 +++--- e2e/stack.ts | 3 +- src/test/helpers/repository.ts | 52 +++++++++++---------------- 6 files changed, 41 insertions(+), 46 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 960727b5..46f25545 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -241,7 +241,7 @@ jobs: # The blob report keeps each test's steps, attachments and traces, so # e2e-report merges the shards into one. - if: env.SUITE == 'all' - run: pnpm e2e:run --shard=${{ matrix.shard }}/2 --reporter=blob + run: pnpm e2e:run --shard=${{ matrix.shard }}/2 --reporter=blob,list - if: always() && env.SUITE == 'all' uses: actions/upload-artifact@v4 with: @@ -260,7 +260,7 @@ jobs: # One HTML and JSON report of the shards of a whole-suite run. e2e-report: needs: [select, e2e] - if: always() && needs.select.outputs.e2e == 'all' + if: always() && !cancelled() && needs.select.outputs.e2e == 'all' runs-on: ubuntu-latest timeout-minutes: 10 steps: diff --git a/AGENTS.md b/AGENTS.md index 5ecdae45..4a98e578 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -28,7 +28,7 @@ - `scripts/check-sources.mts` runs in `pnpm lint`: the components the backend pages name exist, `` reads the global messages, and every text key a page names resolves in each locale. - The playground is linted but not type-checked. Check it with `pnpm --dir playground install --ignore-workspace --frozen-lockfile && pnpm --dir playground build`. -`e2e/` is the Playwright suite of the verify skill's journeys, one spec per feature, run on the `e2e/playground` project with one worker that starts its own MongoDB, backend and dashboard on free ports. `pnpm e2e:smoke` builds once and runs the journeys tagged `@smoke`, as the `e2e` job of `ci.yml` does on a pull request; the merge queue, the nightly, a manual run and a pull request labelled `ci:full` run every journey in two shards, and a draft or a docs-only change runs none. After `pnpm e2e:build`, `pnpm e2e:run specs/.spec.ts` runs one feature without a rebuild. +`e2e/` is the Playwright suite of the verify skill's journeys, one spec per feature, run on the `e2e/playground` project with one worker that starts its own MongoDB, backend and dashboard on free ports. `pnpm e2e:smoke` builds once and runs the journeys tagged `@smoke`, as the `e2e` job of `ci.yml` does on a pull request; every other run (the merge queue, the nightly, a manual run, a push and a pull request labelled `ci:full`) runs every journey in two shards, and a draft runs none. After `pnpm e2e:build`, `pnpm e2e:run specs/.spec.ts` runs one feature without a rebuild. `pnpm knip` checks dependencies only. `pnpm knip:all` also reports unused files and exports; confirm each finding before you remove it. diff --git a/e2e/journeys/overview.mjs b/e2e/journeys/overview.mjs index 09c0885f..4af09030 100644 --- a/e2e/journeys/overview.mjs +++ b/e2e/journeys/overview.mjs @@ -211,12 +211,17 @@ export const journeys = [ const first = probes[0]; await ctx.verify("the probe's answer", [check("the health route answers status down within 10 s of the request", first !== undefined && first.status === 200 && pick(first.body, "status") === "down" && first.ms < 10_000, first)]); await ctx.startDatabase(); + const button = tab.page.getByRole("button", { name: "Check again" }); + const deadline = Date.now() + 240_000; let healthy = false; - for (let attempt = 0; attempt < 6 && !healthy; attempt += 1) { - const ready = await tab.enabled(checkAgain, { timeoutMs: 60_000 }); - if (!ready.pass) continue; - await tab.click(checkAgain); - healthy = (await tab.shows(/Healthy/, { timeoutMs: 45_000 })).pass; + while (!healthy && Date.now() < deadline) { + if (await button.isEnabled().catch(() => false)) { + await tab.click(checkAgain); + healthy = (await tab.shows(/Healthy/, { timeoutMs: 45_000 })).pass; + } else { + await tab.page.waitForTimeout(500); + healthy = (await tab.shows(/Healthy/, { timeoutMs: 1 })).pass; + } } const health = await db(ctx, "health after the database came back", "GET", "/health"); await ctx.verify("Check again recovers", [ diff --git a/e2e/journeys/parts/library-legacy.mjs b/e2e/journeys/parts/library-legacy.mjs index c14b0653..9699cbf8 100644 --- a/e2e/journeys/parts/library-legacy.mjs +++ b/e2e/journeys/parts/library-legacy.mjs @@ -63,9 +63,9 @@ export const legacyJourneys = [ title: "a run moved back one day lists under Yesterday and one moved back three days under its date, below today's runs under Today; the API still lists all three newest first", entryPoint: "/modules/database/query History tab, GET /api/database/query/history", async run(/** @type {Ctx} */ ctx) { - await runQuery(ctx, OLDER_SOURCE, tableQuery("demo", "tags", [SLICE(3)])); - await runQuery(ctx, LEGACY_SOURCE, tableQuery("demo", "tags", [SLICE(1)])); await runQuery(ctx, NEWER_SOURCE, tableQuery("demo", "tags", [SLICE(2)])); + await runQuery(ctx, LEGACY_SOURCE, tableQuery("demo", "tags", [SLICE(1)])); + await runQuery(ctx, OLDER_SOURCE, tableQuery("demo", "tags", [SLICE(3)])); const aged = [await age(ctx, LEGACY_SOURCE, 1), await age(ctx, OLDER_SOURCE, OLDER_DAYS)]; const olderLabel = new Intl.DateTimeFormat("en-US", { day: "numeric", month: "short" }).format(new Date(Date.now() - OLDER_DAYS * DAY_MS)); const listed = await history(ctx); @@ -111,11 +111,12 @@ export const legacyJourneys = [ executedAt: new Date(Date.now() - 1000), }; await runs.insertOne(row); - return Object.keys((await runs.findOne({ _id: row._id })) ?? {}).sort(); + const own = await runs.findOne({ source: NEWER_SOURCE }); + return { legacy: Object.keys((await runs.findOne({ _id: row._id })) ?? {}).sort(), ownStatus: pick(own, "status") }; }); await ctx.verify("the stored row", [ - check("the legacy row has no status, mutation or error field", !["status", "mutation", "error"].some((field) => stored.includes(field)), stored), - check("a run the module wrote carries a status", pick(written, "status") === "ok", written), + check("the legacy row has no status, mutation or error field", !["status", "mutation", "error"].some((field) => stored.legacy.includes(field)), stored.legacy), + check("a run the module wrote stores its status", stored.ownStatus === "ok", stored.ownStatus), ]); const listed = await history(ctx); const legacy = listed.items.find((item) => text(item, "source") === LEGACY_SOURCE); diff --git a/e2e/stack.ts b/e2e/stack.ts index 57156c22..36ebd5cb 100644 --- a/e2e/stack.ts +++ b/e2e/stack.ts @@ -411,7 +411,8 @@ class WorkerStack implements Stack { await this.#mongo.start(); break; } catch (error) { - if (attempt === RESTART_ATTEMPTS) throw error; + if (attempt === RESTART_ATTEMPTS || this.#mongo.state !== "stopped") + throw error; await delay(RESTART_RETRY_MS); } } diff --git a/src/test/helpers/repository.ts b/src/test/helpers/repository.ts index df28f87d..df1d521a 100644 --- a/src/test/helpers/repository.ts +++ b/src/test/helpers/repository.ts @@ -1,6 +1,5 @@ import { execFileSync } from "node:child_process"; -import { mkdtempSync, readFileSync, rmSync } from "node:fs"; -import { tmpdir } from "node:os"; +import { readFileSync } from "node:fs"; import { join, resolve } from "node:path"; import { isBoolean, @@ -39,6 +38,10 @@ function isJson(value: unknown): value is Json { return isRecord(value) && Object.values(value).every(isJson); } +function isJsonArray(value: Json | undefined): value is readonly Json[] { + return Array.isArray(value); +} + function parseJson(source: string, origin: string): Json { const value: unknown = JSON.parse(source); if (!isJson(value)) throw new Error(`${origin} holds no JSON value`); @@ -63,35 +66,20 @@ export function repositoryJson(file: string): Json { return parseJson(repositoryText(file), file); } -/** Packs the checkout the way a release does, without its lifecycle scripts, and lists the tarball. */ +/** What `npm pack` would put in the tarball, listed without writing it, and the manifest it packs. */ export function packModule(): PackedModule { - const folder = mkdtempSync(join(tmpdir(), "dms-database-pack-")); - try { - const name = execFileSync( - "npm", - ["pack", "--ignore-scripts", "--silent", "--pack-destination", folder], - { - cwd: REPOSITORY, - encoding: "utf8", - shell: process.platform === "win32", - }, - ) - .trim() - .split("\n") - .at(-1); - const tarball = join(folder, name ?? ""); - const files = execFileSync("tar", ["-tzf", tarball], { encoding: "utf8" }) - .split("\n") - .map((line) => line.trim().replace(/^package\//, "")) - .filter(Boolean); - const manifest = parseJson( - execFileSync("tar", ["-xzOf", tarball, "package/package.json"], { - encoding: "utf8", - }), - "the packed package.json", - ); - return { files, manifest }; - } finally { - rmSync(folder, { recursive: true, force: true }); - } + const report = parseJson( + execFileSync("npm", ["pack", "--dry-run", "--json", "--ignore-scripts"], { + cwd: REPOSITORY, + encoding: "utf8", + shell: process.platform === "win32", + }), + "npm pack --json", + ); + const entry = isJsonArray(report) ? report.at(0) : undefined; + const listed = isRecord(entry) ? entry["files"] : undefined; + const files = (isJsonArray(listed) ? listed : []).flatMap((file) => + isRecord(file) && isString(file["path"]) ? [file["path"]] : [], + ); + return { files, manifest: repositoryJson("package.json") }; } From 3ba681543059ea7d301f29fcc35f7df022218af9 Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Thu, 19 Nov 2026 04:50:55 +0000 Subject: [PATCH 11/14] test(e2e): follow the whole-value number filters and the external Diagram --- .../skills/verify-dms-database/features/data.md | 2 +- .../verify-dms-database/features/external.md | 6 +++--- e2e/journeys/parts/browse-api.mjs | 14 ++++++-------- e2e/journeys/parts/browse-grid.mjs | 9 ++++----- e2e/journeys/parts/edit-place.mjs | 2 +- e2e/journeys/parts/external-browse.mjs | 15 ++++++++------- e2e/journeys/parts/external-kit.mjs | 10 ++++++++++ e2e/journeys/parts/external-refusals.mjs | 17 ++++++++++++----- 8 files changed, 45 insertions(+), 30 deletions(-) diff --git a/.agents/skills/verify-dms-database/features/data.md b/.agents/skills/verify-dms-database/features/data.md index b9ad92b2..1a299b1e 100644 --- a/.agents/skills/verify-dms-database/features/data.md +++ b/.agents/skills/verify-dms-database/features/data.md @@ -45,7 +45,7 @@ The Data browser's read side: the schema and instance pickers with the row count - `the-instance-picker-lists-named-instances-with-a-search-and-a-limit`: `tables/instances` sorted, searched without case, cut to the limit with the total, and its 400 and 404. - `list-clamps-the-page-and-orders-the-rows`: `browse/list` answers 25 rows by default, clamps `limit` to 1..200 (199, 200, 201 driven) and `offset` to 0, sorts descending only for the word `desc`, and answers the exact total. -- `list-filters-search-and-counts-follow-the-wire-tokens`: `filter_` with `is:`, `contains:`, a bare value, an unknown mode and an empty value; search across every cell; both combined; the totals. +- `list-filters-search-and-counts-follow-the-wire-tokens`: `filter_` with `is:`, `contains:` (a substring on text, the whole value on a number), a bare value, an unknown mode and an empty value; search across the text and number cells; both combined; the totals. - `the-selection-decodes-schema-table-and-instance`: `filter_schema`, `filter_table` and `filter_instance` (default, empty, named, `__CROSS_INSTANCE__`, `contains:`), the 400 and 404 refusals, and the `_instance` tag. - `columns-get-and-tables-answer-what-the-grid-needs`: `browse/columns` (declared columns in declaration order, then sampled ones; runtime types; primary key), `browse/get` and `browse/tables` with the counts of the default instance, of eu, and across all instances. - `references-count-the-rows-pointing-at-a-row`: `browse/references` counts per relation column, in the same instance, for one and many relations, and refuses all instances, a missing id and a missing row. diff --git a/.agents/skills/verify-dms-database/features/external.md b/.agents/skills/verify-dms-database/features/external.md index 5ddc672e..e99b90b6 100644 --- a/.agents/skills/verify-dms-database/features/external.md +++ b/.agents/skills/verify-dms-database/features/external.md @@ -37,8 +37,8 @@ The databases a project connects to but does not own: the switcher, the Overview ## Sub-features -- `an-external-database-is-picked-browsed-edited-and-left`: `erp` is listed next to the project database, picked in the switcher, browsed (rows, inspector, sample row, locked links), refused a save while its access is read, switched to read & write and saved, then left for the project database, whose tabs and recents follow it. -- `an-external-database-refuses-what-it-cannot-serve-with-sentences`: the locked Diagram and Query console, the routes that answer 409, a stale tab, a project file the writer cannot rewrite, and the API's refusals of an unknown database and a bad body. +- `an-external-database-is-picked-browsed-edited-and-left`: `erp` is listed next to the project database, picked in the switcher, browsed (rows, inspector, sample row, the Diagram link open, the Query console link locked), refused a save while its access is read, switched to read & write and saved, then left for the project database, whose tabs and recents follow it. +- `an-external-database-refuses-what-it-cannot-serve-with-sentences`: the drawn Diagram with a layout of its own and the locked Query console, the routes that answer 409, a stale tab, a project file the writer cannot rewrite, and the API's refusals of an unknown database and a bad body. ## How to get to it (user POV) @@ -63,7 +63,7 @@ pnpm e2e:run specs/external.spec.ts | Documented behaviour | Journey and check | |---|---| | The switcher lists the project database, then each external one with its engine and the External badge | `an-external-database-is-picked-browsed-edited-and-left` (the console lists erp, the switcher) | -| Overview, Schemas, Data browser read it; Diagram and Query console are locked; no instances | the same journey (the Data browser, Schemas and the inspector, the Overview) and `an-external-database-refuses-what-it-cannot-serve-with-sentences` (the locked pages) | +| Overview, Schemas, Diagram and Data browser read it; the Query console is locked; no instances | the same journey (the Data browser, Schemas and the inspector, the Overview) and `an-external-database-refuses-what-it-cannot-serve-with-sentences` (the locked and the drawn pages) | | Rows edit only when the access is `read-write`; a refusal says so | `an-external-database-is-picked-browsed-edited-and-left` (a save while the access is read, a save while read-write) | | The bar changes the access in development; turning on asks once, turning off asks nothing | the same journey (the confirmation, the access switch, a save while read-write) | | An edit on a stale tab is refused | `an-external-database-refuses-what-it-cannot-serve-with-sentences` (a stale tab) | diff --git a/e2e/journeys/parts/browse-api.mjs b/e2e/journeys/parts/browse-api.mjs index 9b7f4570..1a5ff5f1 100644 --- a/e2e/journeys/parts/browse-api.mjs +++ b/e2e/journeys/parts/browse-api.mjs @@ -66,27 +66,25 @@ const listFiltersAndSearch = { const search = await browse(ctx, "search BAND-3", "list", "metrics.readings", { search: "BAND-3", limit: 1 }); const searchId = await browse(ctx, "search an id", "list", "metrics.readings", { search: "R_0042" }); const searchNumber = await browse(ctx, "search a number", "list", "metrics.readings", { search: "1250", limit: 5 }); - const both = await browse(ctx, "search and filter", "list", "metrics.readings", { search: "band-1", filter_seq: "contains:5", limit: 1 }); + const both = await browse(ctx, "search and filter", "list", "metrics.readings", { search: "band-1", filter_seq: "contains:6", limit: 5 }); + const bothApart = await browse(ctx, "a search and a filter no row satisfies together", "list", "metrics.readings", { search: "band-2", filter_seq: "contains:6", limit: 5 }); const twoFilters = await browse(ctx, "two filters", "list", "metrics.readings", { filter_band: "is:band-1", filter_seq: "is:1", limit: 5 }); const sortedFiltered = await browse(ctx, "a filter sorted descending", "list", "metrics.readings", { filter_band: "is:band-2", sortKey: "seq", sortDirection: "desc", limit: 2 }); const none = await browse(ctx, "no match", "list", "metrics.readings", { search: "zzz-no-such-text" }); - const seqsContaining12 = Array.from({ length: 1250 }, (_, index) => String(index + 1)).filter((seq) => seq.includes("12")).length; - const bandOne = Array.from({ length: 1250 }, (_, index) => index).filter((index) => index % 5 === 0).length; - const bandOneWith5 = Array.from({ length: 1250 }, (_, index) => index).filter((index) => index % 5 === 0 && String(index + 1).includes("5")).length; await ctx.verify("the filter grammar", [ check("is:band-1 matches 250 rows, all of band-1", pick(is.body, "total") === 250 && rowsOf(is).length === 200 && rowsOf(is).every((row) => row.band === "band-1"), [pick(is.body, "total"), rowsOf(is).length]), check("a bare value is an exact match", pick(bare.body, "total") === 250, pick(bare.body, "total")), check("is: is case-sensitive: BAND-1 matches nothing", pick(upperIs.body, "total") === 0, pick(upperIs.body, "total")), check("contains: ignores case: AND-2 matches the 250 rows of band-2", pick(contains.body, "total") === 250, pick(contains.body, "total")), - check("a number cell is compared as its text: is:100 finds one row", pick(seqIs.body, "total") === 1 && rowsOf(seqIs)[0]?.seq === 100, [pick(seqIs.body, "total"), rowsOf(seqIs)[0]?.seq]), - check(`contains:12 finds the ${seqsContaining12} seq values holding 12`, pick(seqContains.body, "total") === seqsContaining12, [pick(seqContains.body, "total"), seqsContaining12]), + check("a number cell is compared as a whole value: is:100 finds one row", pick(seqIs.body, "total") === 1 && rowsOf(seqIs)[0]?.seq === 100, [pick(seqIs.body, "total"), rowsOf(seqIs)[0]?.seq]), + check("contains: on a number column compares the whole value: contains:12 finds seq 12, not 120 or 1200", pick(seqContains.body, "total") === 1 && rowsOf(seqContains)[0]?.seq === 12, [pick(seqContains.body, "total"), rowsOf(seqContains).map((row) => row.seq)]), check("an unknown mode filters nothing", pick(unknownMode.body, "total") === 1250, pick(unknownMode.body, "total")), check("an empty value filters nothing", pick(empty.body, "total") === 1250, pick(empty.body, "total")), check("only the first colon splits the mode: contains:band-1:x matches nothing", pick(colon.body, "total") === 0, pick(colon.body, "total")), check("search ignores case and counts 250 rows", pick(search.body, "total") === 250, pick(search.body, "total")), check("search reads the id cell too: R_0042 finds r_0042", pick(searchId.body, "total") === 1 && rowsOf(searchId)[0]?._id === "r_0042", [pick(searchId.body, "total"), rowsOf(searchId)[0]?._id]), - check("search reads number cells as text: 1250 finds the seq 1250 row", rowsOf(searchNumber).some((row) => row.seq === 1250), ids(rowsOf(searchNumber))), - check(`search and a filter combine: ${bandOneWith5} rows`, pick(both.body, "total") === bandOneWith5 && bandOneWith5 < bandOne, [pick(both.body, "total"), bandOneWith5]), + check("search compares a number cell as a whole value: 1250 finds the seq 1250 row", rowsOf(searchNumber).some((row) => row.seq === 1250), ids(rowsOf(searchNumber))), + check("search and a filter combine: band-1 and contains:6 find seq 6, band-2 and contains:6 find nothing", pick(both.body, "total") === 1 && rowsOf(both)[0]?.seq === 6 && pick(bothApart.body, "total") === 0, [pick(both.body, "total"), rowsOf(both).map((row) => row.seq), pick(bothApart.body, "total")]), check("two filters both apply", pick(twoFilters.body, "total") === 1 && rowsOf(twoFilters)[0]?.seq === 1, [pick(twoFilters.body, "total"), rowsOf(twoFilters).map((row) => row.seq)]), check("a filtered page sorts descending by seq", show(rowsOf(sortedFiltered).map((row) => row.seq)) === "[1247,1242]", rowsOf(sortedFiltered).map((row) => row.seq)), check("no match answers no row and a total of 0", rowsOf(none).length === 0 && pick(none.body, "total") === 0, [rowsOf(none).length, pick(none.body, "total")]), diff --git a/e2e/journeys/parts/browse-grid.mjs b/e2e/journeys/parts/browse-grid.mjs index 1272b3e9..40c733b6 100644 --- a/e2e/journeys/parts/browse-grid.mjs +++ b/e2e/journeys/parts/browse-grid.mjs @@ -65,11 +65,10 @@ const searchFilterSort = { await tab.click({ role: "button", name: "Remove the filter on band" }); await addFilter(tab, "band", "is exactly", "band-2"); const bandTwo = await settle(() => toolbarCount(tab), (text) => text === "250 rows"); - await addFilter(tab, "seq", "contains", "5"); - const seqCount = Array.from({ length: 1250 }, (_, index) => index).filter((index) => index % 5 === 1 && String(index + 1).includes("5")).length; - const both = await settle(() => toolbarCount(tab), (text) => text === `${seqCount} rows`); + await addFilter(tab, "seq", "contains", "2"); + const both = await settle(() => toolbarCount(tab), (text) => text === "1 row"); const chipsBoth = await filterChips(tab); - const apiBoth = await browse(ctx, "the same two filters", "list", "metrics.readings", { filter_band: "is:band-2", filter_seq: "contains:5", limit: 50, sortKey: "_id" }); + const apiBoth = await browse(ctx, "the same two filters", "list", "metrics.readings", { filter_band: "is:band-2", filter_seq: "contains:2", limit: 50, sortKey: "_id" }); await tab.click({ role: "button", name: "Remove the filter on seq" }); const oneLeft = await settle(() => filterChips(tab), (chips) => chips.length === 1); await tab.click({ role: "button", name: "Clear all" }); @@ -80,7 +79,7 @@ const searchFilterSort = { check("the chip names column, mode and value", show(chipExact) === '["band is exactly band"]', chipExact), check("contains BAND matches every row, whatever the case", containsAll === "1,250 rows" && show(chipContains) === '["band contains BAND"]', [containsAll, chipContains]), check("is exactly band-2 matches 250 rows", bandTwo === "250 rows", bandTwo), - check(`two filters combine: ${seqCount} rows and two chips`, both === `${seqCount} rows` && show(chipsBoth) === '["band is exactly band-2","seq contains 5"]' && pick(apiBoth.body, "total") === seqCount, [both, chipsBoth, pick(apiBoth.body, "total")]), + check("two filters combine: band-2 and seq contains 2 find the one row, seq 2, and two chips", both === "1 row" && show(chipsBoth) === '["band is exactly band-2","seq contains 2"]' && pick(apiBoth.body, "total") === 1 && rowsOf(apiBoth)[0]?.seq === 2, [both, chipsBoth, pick(apiBoth.body, "total")]), check("removing one chip keeps the other", show(oneLeft) === '["band is exactly band-2"]', oneLeft), check("Clear all removes every chip and restores 1,250 rows", cleared === "1,250 rows" && noChips.length === 0, [cleared, noChips]), ]); diff --git a/e2e/journeys/parts/edit-place.mjs b/e2e/journeys/parts/edit-place.mjs index 3762163a..b6da89cb 100644 --- a/e2e/journeys/parts/edit-place.mjs +++ b/e2e/journeys/parts/edit-place.mjs @@ -102,7 +102,7 @@ const refined = { await saveStaged(tab); await settle(() => savedNotice(tab), (content) => /saved/.test(content)); const afterSearch = await columnValues(tab, "price"); - await tab.fill({ role: "textbox", name: "Search rows" }, "o"); + await tab.fill({ role: "textbox", name: "Search rows" }, "c"); const several = await settle(() => columnValues(tab, "name"), (values) => values.length > 1); await elsewhere(ctx, "eu_sku_monitor", { price: 5 }); await typeInto(tab, "eu_sku_chair", "price", "322"); diff --git a/e2e/journeys/parts/external-browse.mjs b/e2e/journeys/parts/external-browse.mjs index d14b4b52..218dac10 100644 --- a/e2e/journeys/parts/external-browse.mjs +++ b/e2e/journeys/parts/external-browse.mjs @@ -8,6 +8,7 @@ import { barReads, closeTabs, disabledLink, + enabledLink, ERP, lockedEntry, pageText, @@ -59,7 +60,7 @@ async function listing(ctx) { await ctx.verify("the console lists erp next to the project database", [ check("the project database is listed first", text(rows[0], "kind") === "own", show(listed.body)), check("erp is external, on MongoDB, read only", text(erp, "kind") === "external" && text(erp, "engine") === "mongodb" && text(erp, "access") === "read", show(erp)), - check("erp has no diagram, query console, instances or references", Array.isArray(unsupported) && ["diagram", "queryConsole", "instances", "rowReferences"].every((feature) => unsupported.includes(feature)), show(unsupported)), + check("erp has no query console, instances or references, and its diagram is served", Array.isArray(unsupported) && ["queryConsole", "instances", "rowReferences"].every((feature) => unsupported.includes(feature)) && !unsupported.includes("diagram"), show(unsupported)), ]); } @@ -72,8 +73,8 @@ async function switching(ctx, tab) { await tab.goto(DATA_PAGE); const menu = await pickDatabase(tab, "Project database", ERP); await ctx.verify("the switcher", [ - check("the menu lists the project database and erp with its engine, its Read only access and its External badge", /Project database\s+This project\s+erp\s+mongodb\s*·\s*Read only\s+External/i.test(menu), menu), - check("the sidebar entry of the Diagram is locked with its reason", (await lockedEntry(tab, "Diagram")) === true, "Diagram"), + check("the menu lists the project database and erp with its engine, its Read only access and its External badge", /Project database\s+This project\s+erp\s+External\s+mongodb\s*·\s*Read only/i.test(menu), menu), + check("the sidebar entry of the Diagram stays open", (await lockedEntry(tab, "Diagram")) === null && (await enabledLink(tab, "Diagram")), "Diagram"), check("the sidebar entry of the Query console is locked with its reason", (await lockedEntry(tab, "Query console")) === true, "Query console"), ]); } @@ -106,7 +107,7 @@ async function schemas(ctx, tab) { await tab.goto("/modules/database/schemas"); await tab.visible({ role: "button", name: "Actions for customers" }, { timeoutMs: 60_000 }); const page = await pageText(tab); - const diagramLocked = await disabledLink(tab, "Diagram"); + const diagramOpen = await enabledLink(tab, "Diagram"); await tab.click({ role: "button", name: "Actions for customers" }); const actions = await tab.page.getByRole("menuitem").allInnerTexts(); await tab.press("Escape"); @@ -118,8 +119,8 @@ async function schemas(ctx, tab) { const sample = await settle(() => dialogText(tab), (content) => /"_id": "c1"/.test(content)); await ctx.verify("Schemas and the inspector", [ check("the table list holds the one table of erp", /Tables\s+1\b/i.test(page) && /customers/.test(page) && /\berp\b/.test(page), page), - check("the header Diagram link is locked", diagramLocked, "Diagram"), - check("the row actions offer Inspect and Browse data only", show(actions) === '["Inspect","Browse data"]', actions), + check("the header Diagram link is open", diagramOpen, "Diagram"), + check("the row actions offer Inspect, Browse data and Show in diagram, and no Query this table", show(actions) === '["Inspect","Browse data","Show in diagram"]', actions), check("the inspector says 3 rows, 3 columns, with no instance badge", /3 rows/.test(inspector) && /3 columns/.test(inspector) && !/\binstances?\b/i.test(inspector), inspector), check("Browse data leads to the table", browseLink === "/modules/database/data?schema=erp&table=customers", browseLink), check("the sample row is the first customer, as JSON, with no instance in its position", /ROW 1 OF 3(?! ·)/i.test(sample) && /"name": "Ada"/.test(sample) && !/default/i.test(sample), sample), @@ -250,7 +251,7 @@ async function tabsAndRecents(ctx, tab) { check("the project database offers demo.tags", show(ownRecent) === '["demo.tags"]', ownRecent), check("erp offers customers again and not demo.tags", show(back) === '["erp.customers"]', back), check("no read of the other database's table fails", !/Couldn't load/.test(backText) && !/Couldn't load/.test(reloaded), backText), - check("a reload keeps erp selected", /Database\s+mongodb\s+erp/i.test(reloaded) && /Access to erp: Read only/.test(reloaded), reloaded), + check("a reload keeps erp selected", /Database\s+mongodb\s*·\s*Read only\s+erp\s+External/i.test(reloaded) && /Access to erp: Read only/.test(reloaded), reloaded), ]); } diff --git a/e2e/journeys/parts/external-kit.mjs b/e2e/journeys/parts/external-kit.mjs index f3014e91..69f2f56d 100644 --- a/e2e/journeys/parts/external-kit.mjs +++ b/e2e/journeys/parts/external-kit.mjs @@ -99,6 +99,16 @@ export async function disabledLink(tab, name) { return (await link.evaluate((element) => element.getAttribute("aria-disabled") === "true" || element.hasAttribute("disabled"), undefined, { timeout: 5_000 }).catch(() => false)); } +/** + * @param {Tab} tab The tab + * @param {string} name A link's name + * @returns {Promise} Whether the link is there and not disabled + */ +export async function enabledLink(tab, name) { + const link = tab.page.getByRole("link", { name, exact: true }).first(); + return link.evaluate((element) => element.getAttribute("aria-disabled") !== "true" && !element.hasAttribute("disabled"), undefined, { timeout: 5_000 }).catch(() => false); +} + /** * Closes every open tab of the Data browser, which leaves the list of the tables opened lately. * diff --git a/e2e/journeys/parts/external-refusals.mjs b/e2e/journeys/parts/external-refusals.mjs index eed667f6..b8458e56 100644 --- a/e2e/journeys/parts/external-refusals.mjs +++ b/e2e/journeys/parts/external-refusals.mjs @@ -39,13 +39,20 @@ async function connectionRoutes(ctx) { async function unservedRoutes(ctx) { await db(ctx, "pick erp", "PUT", "/connections/selected", { body: { connection: ERP } }); const readOnly = await db(ctx, "edit while read", "PUT", `/browse/edit?${SELECTION}&connection=${ERP}`, { body: { name: "X" } }); - const diagram = await db(ctx, "diagram", "GET", "/diagram/layout/erp"); + const diagram = await db(ctx, "diagram layout", "GET", "/diagram/layout/erp"); + const drawn = await db(ctx, "save the erp layout", "PUT", `/diagram/layout/erp?connection=${ERP}`, { body: { positions: { customers: { x: 5, y: 6 } } } }); + const drawnBack = await db(ctx, "read the erp layout", "GET", "/diagram/layout/erp"); + await db(ctx, "pick the project database", "PUT", "/connections/selected", { body: { connection: "own" } }); + const ownLayout = await db(ctx, "the project database's layout of a schema named erp", "GET", "/diagram/layout/erp"); + await db(ctx, "pick erp again", "PUT", "/connections/selected", { body: { connection: ERP } }); + await db(ctx, "clear the erp layout", "PUT", `/diagram/layout/erp?connection=${ERP}`, { body: { positions: {} } }); const execute = await db(ctx, "query", "POST", "/query/execute", { body: { query: tableQuery("erp", "customers"), source: "x", language: "aql" } }); const references = await db(ctx, "references", "GET", `/browse/references?${SELECTION}`); const stored = await storedCustomer(ctx); await ctx.verify("the routes answer for an external database", [ check("a write while the access is read answers 403 with its key and the database", readOnly.status === 403 && pick(readOnly.body, "message") === "$dms_database.data.save.read_only_access" && pick(readOnly.body, "params", "connection") === ERP, show(readOnly)), - check("the diagram answers 409 and names itself", diagram.status === 409 && diagram.body === "The diagram is not available on an external database", show(diagram)), + check("the diagram is served: its layout answers 200", diagram.status === 200 && show(pick(diagram.body, "positions")) === "{}", show(diagram)), + check("the layout of an external database's schema is its own: saved on erp it reads back there and not on the project database's schema of the same name", drawn.status === 200 && show(pick(drawnBack.body, "positions")) === '{"customers":{"x":5,"y":6}}' && show(pick(ownLayout.body, "positions")) === "{}", [show(drawnBack), show(ownLayout)]), check("the query console answers 409 and names itself", execute.status === 409 && execute.body === "The query console is not available on an external database", show(execute)), check("a row's references answer 409 and name themselves", references.status === 409 && references.body === "A row's references is not available on an external database", show(references)), check("the customer was not written", text(stored, "name") === "Ada", show(stored)), @@ -59,11 +66,11 @@ async function unservedRoutes(ctx) { */ async function lockedPages(ctx, tab) { await tab.goto("/modules/database/diagram"); - const diagram = await settle(() => pageText(tab), (content) => /Not available on an external database/.test(content)); + const diagram = await settle(() => pageText(tab), (content) => /customers\s+_id\s+string/.test(content)); await tab.goto("/modules/database/query"); const query = await settle(() => pageText(tab), (content) => /Not available on an external database/.test(content)); await ctx.verify("the locked pages", [ - check("the Diagram page says why it has nothing to show", /Not available on an external database/.test(diagram), diagram), + check("the Diagram page draws the table of erp with its columns, not a lock", /customers\s+_id\s+string\s+name\s+string\s+segment\s+string/.test(diagram) && !/Not available on an external database/.test(diagram), diagram), check("the Query console page says why it has nothing to show", /Not available on an external database/.test(query), query), ]); } @@ -123,7 +130,7 @@ export const refusalJourneys = [ { id: "an-external-database-refuses-what-it-cannot-serve-with-sentences", title: - "on an external database each refusal reads as a sentence: the pages it cannot serve are locked and their routes answer 409, a stale tab and a save while the access is read are refused in the user's language, a project file the writer cannot rewrite is refused with its reason, and an unknown database or a bad body is refused by the API", + "on an external database each refusal reads as a sentence: the query console and a row's references are locked and their routes answer 409, the diagram is drawn from the catalog with a layout of its own, a stale tab and a save while the access is read are refused in the user's language, a project file the writer cannot rewrite is refused with its reason, and an unknown database or a bad body is refused by the API", entryPoint: "/modules/database/diagram and /query on an external database, PUT /connections/*, PUT /browse/edit, the access switch", backend: "dev", async run(/** @type {Ctx} */ ctx) { From f4aa7c169ac4d6e08050e20c1fc9621ebfdb2e56 Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Thu, 19 Nov 2026 04:51:59 +0000 Subject: [PATCH 12/14] ci: start the checks on the ready pull request From 160e541285cf5e0f4c962f76044b66c6a9822503 Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Thu, 19 Nov 2026 04:56:06 +0000 Subject: [PATCH 13/14] ci: keep the synced triggers of the workflow --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46f25545..558599a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,6 @@ on: types: [opened, synchronize, reopened, ready_for_review] push: branches: [next] - merge_group: schedule: - cron: "17 2 * * *" workflow_dispatch: From 94e468ec1b9615ca812729c02947c99d01e8d025 Mon Sep 17 00:00:00 2001 From: Antony Rizzitelli Date: Thu, 19 Nov 2026 07:07:46 +0000 Subject: [PATCH 14/14] build: move to @antelopejs/tooling-configs 0.8.9 and its synced workflows --- .github/workflows/ci.yml | 10 +++++++--- .github/workflows/next-sync.yml | 17 ----------------- .github/workflows/release.yml | 4 +++- .github/workflows/stale.yml | 16 ---------------- package.json | 2 +- pnpm-lock.yaml | 22 +++++++++++----------- 6 files changed, 22 insertions(+), 49 deletions(-) delete mode 100644 .github/workflows/next-sync.yml delete mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 558599a1..becc4cd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,12 +2,14 @@ name: ci on: pull_request: - types: [opened, synchronize, reopened, ready_for_review] + types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] + merge_group: push: - branches: [next] + branches: [main] schedule: - cron: "17 2 * * *" workflow_dispatch: + permissions: contents: read @@ -36,10 +38,12 @@ jobs: cache-paths: .antelope/cache permissions: contents: read + secrets: + NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} # ci-node.yml exposes no outputs, so the jobs declared here select by the # shared tier rule: tests on a ready pull request that touches more than docs, - # on a push to next and in the nightly, Windows in the nightly only. + # on a push, in the merge queue and in the nightly, Windows in the nightly only. select: runs-on: ubuntu-latest timeout-minutes: 5 diff --git a/.github/workflows/next-sync.yml b/.github/workflows/next-sync.yml deleted file mode 100644 index 46932323..00000000 --- a/.github/workflows/next-sync.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Next sync - -on: - push: - branches: [main] - workflow_dispatch: - -permissions: {} - -jobs: - next-sync: - permissions: - issues: write - uses: AntelopeJS/.github/.github/workflows/next-sync.yml@v2 - secrets: - RELEASE_GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} - NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85dc9fa1..0b6f68a3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,9 @@ name: Release on: push: - branches: [next] + branches: [main] + pull_request: + types: [labeled, synchronize, reopened] workflow_dispatch: inputs: release-version: diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index 5faf7ec5..00000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Close stale issues - -on: - schedule: - - cron: "30 4 * * *" - workflow_dispatch: - -permissions: {} - -jobs: - stale: - permissions: - actions: write - issues: write - pull-requests: write - uses: AntelopeJS/.github/.github/workflows/stale.yml@v2 diff --git a/package.json b/package.json index 678c91e8..c33c52a0 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "@antelopejs/dms-frontend": ">=0.11.8 <0.12.0", "@antelopejs/interface-data-api": ">=0.8.0 <0.9.0", "@antelopejs/mongodb": "~1.8.11", - "@antelopejs/tooling-configs": ">=0.8.4 <0.9.0", + "@antelopejs/tooling-configs": ">=0.8.9 <0.9.0", "@playwright/test": "^1.65.1", "@types/chai": "^5.2.3", "@types/mocha": "^10.0.10", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e9593964..146f0ed6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -49,8 +49,8 @@ importers: specifier: ~1.8.11 version: 1.8.11(socks@2.8.8) '@antelopejs/tooling-configs': - specifier: '>=0.8.4 <0.9.0' - version: 0.8.4(knip@6.34.0)(oxfmt@0.66.0)(oxlint@1.81.0(oxlint-tsgolint@7.0.2001))(playwright-core@1.65.1) + specifier: '>=0.8.9 <0.9.0' + version: 0.8.9(knip@6.34.0)(oxfmt@0.66.0)(oxlint@1.81.0(oxlint-tsgolint@7.0.2001))(playwright-core@1.65.1) '@playwright/test': specifier: ^1.65.1 version: 1.65.1 @@ -234,8 +234,8 @@ packages: '@antelopejs/mongodb@1.8.11': resolution: {integrity: sha512-JnymonWA9jw/AoplJ13UtzP+zYlbh4rzCI3qjC30N88YYXjhsGvYGzIQW4NUZnmhWVYPZgOq6xAi0ZBmwLh9UA==} - '@antelopejs/tooling-configs@0.8.4': - resolution: {integrity: sha512-jlxLUEYxa1EguRwF9FrTLo6vMXVkfptyQr8oe+cgej2OVCwCWmb9yF/Ky3w1lXBiOO0fqTNac7poAasJr8Jnyw==} + '@antelopejs/tooling-configs@0.8.9': + resolution: {integrity: sha512-DMar3gDUBy73qpAqv8coGCmvIBrZ12FtyYwD+Igqn6jrb92GMxZAuI2YlW9pED9tS3tdk17+aZRIyVO0oDacHA==} engines: {node: '>=22.18.0'} hasBin: true peerDependencies: @@ -243,8 +243,8 @@ packages: eslint-plugin-perfectionist: '>=5.0.0' knip: '>=6.0.0' mongodb-memory-server: '>=10.0.0' - oxfmt: ^0.66.0 || ^0.77.0 - oxlint: 1.81.0 + oxfmt: ^0.66.0 || ^0.77.0 || ^0.79.0 + oxlint: 1.81.0 || 1.94.0 pixelmatch: '>=7.0.0' playwright-core: '>=1.56.0' sharp: '>=0.34.0' @@ -1101,8 +1101,8 @@ packages: cpu: [x64] os: [win32] - '@oxlint/plugins@1.81.0': - resolution: {integrity: sha512-HhD8kd3r6XpelZkhxhRty/po8V6yK1VV63Eq4kSsOS2IoHUywG3DV2EX+z/ZHw46aLI74Y6aA604NRiAqLKW9w==} + '@oxlint/plugins@1.94.0': + resolution: {integrity: sha512-YT6htikBOBQ00XDxZpRZLZ0anEDo7h9s4+YvjRU0/Ng/cLd0D6SZQ3tsms4g/GDer/z8UKlegC5iptEfyRXJcw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} '@phun-ky/typeof@2.0.3': @@ -3464,9 +3464,9 @@ snapshots: - snappy - socks - '@antelopejs/tooling-configs@0.8.4(knip@6.34.0)(oxfmt@0.66.0)(oxlint@1.81.0(oxlint-tsgolint@7.0.2001))(playwright-core@1.65.1)': + '@antelopejs/tooling-configs@0.8.9(knip@6.34.0)(oxfmt@0.66.0)(oxlint@1.81.0(oxlint-tsgolint@7.0.2001))(playwright-core@1.65.1)': dependencies: - '@oxlint/plugins': 1.81.0 + '@oxlint/plugins': 1.94.0 dts-bundle-generator: 9.5.1 minimatch: 10.2.6 semver: 7.8.6 @@ -4067,7 +4067,7 @@ snapshots: '@oxlint/binding-win32-x64-msvc@1.81.0': optional: true - '@oxlint/plugins@1.81.0': {} + '@oxlint/plugins@1.94.0': {} '@phun-ky/typeof@2.0.3': {}