25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
fix(ci): scope PR checks and reduce runner queue contention
t8y29a49b5306c77
diff --git a/.github/scripts/ci-change-base.mjs b/.github/scripts/ci-change-base.mjsnew file mode 100644index 0000000000..9e9914fb62--- /dev/null+++ b/.github/scripts/ci-change-base.mjs@@ -0,0 +1,21 @@+import { execFileSync } from "node:child_process";+import path from "node:path";+import { pathToFileURL } from "node:url";++export function changeBase({ eventName, before, root = process.cwd() }) {+ if (eventName === "pull_request") {+ const commits = execFileSync("git", ["rev-list", "--parents", "-n", "1", "HEAD"], {+ cwd: root, encoding: "utf8", stdio: "pipe",+ }).trim().split(/\s+/);+ if (commits.length !== 3) throw new Error("PR change detection requires the checked-out merge commit and both parents");+ return commits[1];+ }+ if (!before || /^0+$/.test(before)) return null;+ if (!/^[0-9a-f]{40}$/.test(before)) throw new Error("Invalid push base SHA");+ return before;+}++if (process.argv[1] && import.meta.url === pathToFileURL(path.resolve(process.argv[1])).href) {+ const base = changeBase({ eventName: process.env.GITHUB_EVENT_NAME, before: process.env.BEFORE_SHA });+ if (base) console.log(base);+}diff --git a/.github/scripts/ci-change-base.test.mjs b/.github/scripts/ci-change-base.test.mjsnew file mode 100644index 0000000000..e262c83e6d--- /dev/null+++ b/.github/scripts/ci-change-base.test.mjs@@ -0,0 +1,117 @@+import assert from "node:assert/strict";+import test from "node:test";+import { execFileSync } from "node:child_process";+import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";+import { tmpdir } from "node:os";+import path from "node:path";+import { pathToFileURL } from "node:url";+import { changeBase } from "./ci-change-base.mjs";+import { changedPaths, planCi } from "./ci-plan.mjs";++function mergeFixture(context) {+ const directory = mkdtempSync(path.join(tmpdir(), "dbx-ci-change-base-"));+ context.after(() => rmSync(directory, { recursive: true, force: true }));+ const root = path.join(directory, "source");+ mkdirSync(root);+ const git = (...args) => execFileSync("git", args, { cwd: root, encoding: "utf8", stdio: "pipe" }).trim();+ const write = (file, content) => {+ const filename = path.join(root, file);+ mkdirSync(path.dirname(filename), { recursive: true });+ writeFileSync(filename, content);+ };+ const commit = (message) => {+ git("add", ".");+ git("-c", "core.hooksPath=/dev/null", "commit", "-m", message);+ return git("rev-parse", "HEAD");+ };+ git("init", "--initial-branch=main");+ git("config", "user.email", "[email protected]");+ git("config", "user.name", "CI Fixture");+ write("crates/dbx-core/tests/old.rs", "original source\n");+ write("crates/dbx-core/tests/deleted.rs", "removed source\n");+ write("crates/dbx-web/src/routes/transfer.rs", "original route\n");+ const staleBase = commit("baseline");+ git("checkout", "-b", "pull-request");+ git("mv", "crates/dbx-core/tests/old.rs", "crates/dbx-core/tests/renamed\nfile.rs");+ git("rm", "crates/dbx-core/tests/deleted.rs");+ write("crates/dbx-core/tests/runtime_diagnostic_history.rs", "diagnostic test\n");+ write("crates/dbx-web/src/routes/transfer.rs", "updated route\n");+ const pullRequestHead = commit("PR diagnostic changes");+ git("checkout", "main");+ write(".github/workflows/ci.yml", "main CI changes\n");+ write("agents/drivers/zookeeper/main.go", "main native Agent changes\n");+ write("agents/drivers/oceanbase-oracle/src/main/java/Agent.java", "main JDBC changes\n");+ const actualBase = commit("main advances while PR remains open");+ git("-c", "core.hooksPath=/dev/null", "merge", "--no-ff", "pull-request", "-m", "synthetic PR test merge");+ return { directory, root, staleBase, actualBase, pullRequestHead };+}++test("PR routing uses the exact test merge first parent, excluding unrelated main changes", (context) => {+ const fixture = mergeFixture(context);+ const base = changeBase({ eventName: "pull_request", before: fixture.staleBase, root: fixture.root });+ assert.equal(base, fixture.actualBase);+ assert.notEqual(base, fixture.pullRequestHead);+ const files = changedPaths(base, fixture.root);+ assert.deepEqual(files.toSorted(), [+ "crates/dbx-core/tests/old.rs", "crates/dbx-core/tests/deleted.rs", "crates/dbx-core/tests/renamed\nfile.rs",+ "crates/dbx-core/tests/runtime_diagnostic_history.rs", "crates/dbx-web/src/routes/transfer.rs",+ ].toSorted());+ const metadata = {+ workspace_members: ["dbx-core", "dbx-web", "dbx"],+ packages: [+ { id: "dbx-core", name: "dbx-core", manifest_path: path.join(fixture.root, "crates/dbx-core/Cargo.toml"), dependencies: [] },+ { id: "dbx-web", name: "dbx-web", manifest_path: path.join(fixture.root, "crates/dbx-web/Cargo.toml"), dependencies: [{ name: "dbx-core" }] },+ { id: "dbx", name: "dbx", manifest_path: path.join(fixture.root, "src-tauri/Cargo.toml"), dependencies: [{ name: "dbx-core" }] },+ ],+ };+ const corrected = planCi({ files, metadata, root: fixture.root });+ assert.equal(corrected.rust_full, false);+ assert.deepEqual(corrected.rust_matrix.include.map((entry) => entry.group), ["application"]);+ assert.deepEqual(corrected.agent_rust.include, [{ driver: "duckdb" }]);+ assert.equal(corrected.agent_java, false);+ assert.deepEqual(corrected.agent_go.include, []);+ assert.deepEqual(corrected.agent_integration.include, []);+ assert.equal(corrected.windows_standard, true);+ assert.equal(corrected.windows_win7_bundle, false);+ const staleFiles = changedPaths(fixture.staleBase, fixture.root);+ assert.ok(staleFiles.includes(".github/workflows/ci.yml"));+ assert.ok(staleFiles.includes("agents/drivers/zookeeper/main.go"));+ const polluted = planCi({ files: staleFiles, metadata, root: fixture.root });+ assert.equal(polluted.rust_full, true);+ assert.equal(polluted.agent_java, true);+ assert.ok(polluted.agent_go.include.length > 0);+ assert.ok(polluted.agent_integration.include.length > 0);+});++test("a depth-two checkout preserves the PR parents and supports the base CLI", (context) => {+ const fixture = mergeFixture(context);+ const checkout = path.join(fixture.directory, "depth-two");+ execFileSync("git", ["clone", "--depth=2", pathToFileURL(fixture.root).href, checkout], { stdio: "pipe" });+ assert.equal(changeBase({ eventName: "pull_request", root: checkout }), fixture.actualBase);+ assert.deepEqual(changedPaths(fixture.actualBase, checkout), changedPaths(fixture.actualBase, fixture.root));+ const output = execFileSync(process.execPath, [path.join(import.meta.dirname, "ci-change-base.mjs")], {+ cwd: checkout, encoding: "utf8", env: { ...process.env, GITHUB_EVENT_NAME: "pull_request", BEFORE_SHA: fixture.staleBase },+ });+ assert.equal(output.trim(), fixture.actualBase);+});++test("PR base detection rejects a nonmerge commit and a depth-one checkout", (context) => {+ const fixture = mergeFixture(context);+ const checkout = path.join(fixture.directory, "depth-one");+ execFileSync("git", ["clone", "--depth=1", pathToFileURL(fixture.root).href, checkout], { stdio: "pipe" });+ assert.throws(() => changeBase({ eventName: "pull_request", root: checkout }), /merge commit and both parents/);+ execFileSync("git", ["checkout", "--detach", fixture.pullRequestHead], { cwd: fixture.root, stdio: "pipe" });+ assert.throws(() => changeBase({ eventName: "pull_request", root: fixture.root }), /merge commit and both parents/);+});++test("push routing preserves the event before SHA even when HEAD is a merge", (context) => {+ const fixture = mergeFixture(context);+ assert.equal(changeBase({ eventName: "push", before: fixture.staleBase, root: fixture.root }), fixture.staleBase);+ assert.equal(changeBase({ eventName: "push", before: fixture.pullRequestHead, root: fixture.root }), fixture.pullRequestHead);+ for (const before of [undefined, "", "0".repeat(40)]) {+ assert.equal(changeBase({ eventName: "push", before }), null);+ }+ for (const before of ["not-a-ref", "HEAD", "a".repeat(39), "a".repeat(41)]) {+ assert.throws(() => changeBase({ eventName: "push", before }), /Invalid push base SHA/);+ }+});diff --git a/.github/scripts/ci-config.mjs b/.github/scripts/ci-config.mjsindex 0aa5dd3bd1..8d49cf1dea 100644--- a/.github/scripts/ci-config.mjs+++ b/.github/scripts/ci-config.mjs@@ -8,7 +8,7 @@ export const rustGroups = {"dbx-driver-mysql", "dbx-driver-postgres", "dbx-driver-redis", "dbx-driver-sqlserver", "dbx-drivers","dbx-sqlite-worker",],- application: ["dbx", "dbx-core", "dbx-web", "dbx-cli", "dbx-mcp"],+ application: ["dbx", "dbx-core", "dbx-web", "dbx-cli", "dbx-mcp", "dbx-tauri-consul", "dbx-tauri-schema"],};export const goAgents = [diff --git a/.github/scripts/ci-gate.mjs b/.github/scripts/ci-gate.mjsindex 3938e6c273..ab61f1011a 100644--- a/.github/scripts/ci-gate.mjs+++ b/.github/scripts/ci-gate.mjs@@ -9,7 +9,7 @@ export function gateFailures(needs, mode) {const flags = ["rust", "agents", "fast", "agent_java", "agent_go_changed", "agent_rust_changed", "agent_integration_changed"];if (!flags.every((flag) => typeof plan[flag] === "boolean")) return ["incomplete CI plan"];const routedJobs = { frontend: "frontend", packages: "packages", "github-scripts": "github_scripts",- "windows-standard-check": "windows_win7_bundle", "windows-win7-bundle": "windows_win7_bundle",+ "windows-standard-check": "windows_standard", "windows-win7-bundle": "windows_win7_bundle","duckdb-windows-driver": "duckdb_windows", jdbc: "jdbc", "offline-jdbc-release": "offline_jdbc", "nix-packaging": "nix" };// Draft PRs intentionally skip the heavy validation jobs; the gate may only// demand them once ready_for_review re-triggers the workflow without draft.diff --git a/.github/scripts/ci-guide.md b/.github/scripts/ci-guide.mdindex a2a815f811..556bca9491 100644--- a/.github/scripts/ci-guide.md+++ b/.github/scripts/ci-guide.md@@ -13,8 +13,13 @@ cancellations as a failure of the commit that no longer matters.## Selection-`scripts/ci-plan.mjs` reads Cargo workspace metadata and the exact event base/head-diff. Renames include both paths and deleted paths remain visible. Rust package+`scripts/ci-change-base.mjs` uses the first parent of the checked-out PR test merge+as its base, not the potentially stale base SHA in the PR event. A depth-two+checkout preserves both parents; a missing merge parent fails change detection.+Pushes use the exact event `before` SHA. `paths-filter` uses Git, with an empty API+token and explicit base/head, so its selection matches `scripts/ci-plan.mjs`+rather than a mutable PR file list. An unavailable push diff keeps conservative+planner coverage. Renames include both paths and deleted paths remain visible. Rust packageselection follows reverse dependencies, including build and test dependencies.Connection-type descriptors belong to `dbx-types`; dialect descriptors belong to`dbx-sql`. A changed core dependency also selects the standalone DuckDB Agent tests,@@ -22,7 +27,10 @@ whose development dependency is `dbx-core`.- Ordinary Rust PRs select foundation, driver, and application test groups from`scripts/ci-config.mjs`. Each group contains several packages, not one runner per- crate. At most three Rust test groups run concurrently.+ crate. The application group includes `dbx-tauri-consul` and `dbx-tauri-schema`.+ At most three Rust test groups run concurrently; a contract checks the groups+ against actual workspace metadata so extracted crates cannot silently force+ every PR into the full-workspace fallback.- Main pushes, shared Cargo manifests/locks, toolchain/config/vendor changes, CIinfrastructure changes, an unknown workspace member, or an unavailable diffselect the original full-workspace test lane instead of duplicating it with all@@ -34,8 +42,16 @@ whose development dependency is `dbx-core`.cases. Shared Agent inputs conservatively select all existing Agent checks.Windows DuckDB packaging is selected by its own inputs or shared build/lockchanges, not every change to its development dependency's source.-- Existing frontend, package, Windows, JDBC, offline-payload and Nix jobs retain- their commands and path filters, except for the snapshot-only routing below.+- Standard Windows compilation follows desktop reverse dependencies, including+ ordinary core/driver source changes. Full Win7 packaging runs for Cargo+ manifests/locks, toolchain/config/vendor changes, platform/update/installer+ code, Tauri configuration, Win7 fixtures/scripts and release/CI workflow inputs.+ Unknown Rust paths, unassigned Rust workspace members and unavailable diffs+ retain both Windows jobs. Other desktop source and test changes keep standard+ Windows compilation without repeating the full Win7 installer build. The final+ gate validates each Windows selection independently; release builds are unchanged.+- Existing frontend, package, JDBC, offline-payload and Nix jobs retain their+ commands and path filters, except for the snapshot-only routing below.Contributor snapshots refresh weekly, at 02:00 Monday in Asia/Shanghai, and canstill be refreshed manually. An unchanged snapshot keeps its existing timestamp@@ -87,7 +103,9 @@ incompatible SQLite backends.| `agent-integration` | Sixteen existing engine/version/authentication cases | 4 |Matrix jobs set `fail-fast: false`, so one failure does not conceal results from-the other selected cases. Live test predicates, readiness checks, time limits,+the other selected cases. Go and live matrix parallelism is bounded at four each+to reduce bursts competing with other workflows; this is not a reservation or a+priority guarantee for release jobs. Live test predicates, readiness checks, time limits,credentials for disposable fixtures, and failure cleanup are retained.Native, Java and live jobs wait for fast checks and Agent source validation beforestarting expensive builds or containers.diff --git a/.github/scripts/ci-plan.mjs b/.github/scripts/ci-plan.mjsindex f56a491ed9..6cd81cba04 100644--- a/.github/scripts/ci-plan.mjs+++ b/.github/scripts/ci-plan.mjs@@ -17,12 +17,14 @@ const win7InfrastructureFiles = new Set(["src-tauri/build.rs",]);const win7InfrastructurePrefixes = [+ ".cargo/",+ "rust-toolchain",+ ".github/fixtures/win7-","src-tauri/windows/nsis/",- "vendor/wry/",- "vendor/webview2-com-sys/",- "vendor/ctor/",- "vendor/dirs-sys/",- "vendor/pageant/",+ "src-tauri/src/commands/update",+ "crates/dbx-core/src/host/update",+ "crates/dbx-platform/",+ "vendor/",];function expandAffectedPackages(packages, members, affected) {@@ -93,7 +95,8 @@ export function planCi({ files, metadata, root, eventName = "pull_request", rustif (full) for (const pkg of packages) affected.add(pkg.name);expandAffectedPackages(packages, members, affected);const win7InfrastructureChanged = unknownDiff || files.some((file) => win7InfrastructureFiles.has(file)- || win7InfrastructurePrefixes.some((prefix) => file.startsWith(prefix)));+ || win7InfrastructurePrefixes.some((prefix) => file.startsWith(prefix))+ || /^src-tauri\/tauri.*\.json$/.test(file));const win7DependencyChanged = files.includes("Cargo.toml") || files.includes("Cargo.lock")|| files.some((file) => /^(?:crates\/[^/]+|src-tauri)\/Cargo\.toml$/.test(file));const windowsWin7Reasons = {@@ -101,6 +104,7 @@ export function planCi({ files, metadata, root, eventName = "pull_request", rustdependency_input: win7DependencyChanged,desktop_dependency: win7Affected.has("dbx"),unknown_rust: unknownRust,+ unknown_member: rust && unknownMember,};const windowsWin7Candidate = Object.values(windowsWin7Reasons).some(Boolean);const rustMatrix = !rust ? [] : full ? [{ group: "workspace" }] : Object.entries(rustGroups)@@ -136,6 +140,8 @@ export function planCi({ files, metadata, root, eventName = "pull_request", rustagent_rust_changed: nativeRustMatrix.length > 0, agent_integration_changed: liveMatrix.length > 0,duckdb_changed: nativeChanges.has("duckdb"),duckdb_windows: sharedRust || files.some((file) => file.startsWith("agents/drivers/duckdb/")),+ windows_standard: windowsWin7Candidate,+ windows_win7_bundle: win7InfrastructureChanged || win7DependencyChanged || unknownRust || (rust && unknownMember),windows_win7_candidate: windowsWin7Candidate,windows_win7_affected_packages: [...win7Affected].sort(),windows_win7_reasons: windowsWin7Reasons,@@ -154,13 +160,5 @@ if (process.argv[1] && import.meta.url === pathToFileURL(path.resolve(process.arconst outputs = { ...plan, plan };appendFileSync(process.env.GITHUB_OUTPUT, Object.entries(outputs).map(([name, value]) => `${name}=${JSON.stringify(value)}\n`).join(""));}- console.log(JSON.stringify({- ...plan,- win7_routing_comparison: {- current: process.env.WIN7_CURRENT === "true",- candidate: plan.windows_win7_candidate,- affected_packages: plan.windows_win7_affected_packages,- reasons: plan.windows_win7_reasons,- },- }, null, 2));+ console.log(JSON.stringify(plan, null, 2));}diff --git a/.github/scripts/ci-plan.test.mjs b/.github/scripts/ci-plan.test.mjsindex ec5ff31713..8f967726df 100644--- a/.github/scripts/ci-plan.test.mjs+++ b/.github/scripts/ci-plan.test.mjs@@ -29,7 +29,8 @@ const graph = {"dbx-driver-mysql", "dbx-driver-postgres", "dbx-driver-redis", "dbx-driver-sqlserver", "dbx-driver-support","dbx-platform", "dbx-sql-core", "dbx-sql-data", "dbx-sql-dialect", "dbx-types", "dbx-sqlite-worker"],"dbx-core": ["dbx-drivers", "dbx-sql", "dbx-types", "dbx-platform", "dbx-ai-provider", "dbx-plugin-runtime", "dbx-formats"],- "dbx-mcp": ["dbx-core"], "dbx-cli": ["dbx-core", "dbx-mcp"], "dbx-web": ["dbx-core", "dbx-mcp"], "dbx": ["dbx-core", "dbx-mcp"],+ "dbx-mcp": ["dbx-core"], "dbx-cli": ["dbx-core", "dbx-mcp"], "dbx-web": ["dbx-core", "dbx-mcp"], "dbx": ["dbx-core", "dbx-mcp", "dbx-tauri-consul", "dbx-tauri-schema"],+ "dbx-tauri-consul": ["dbx-core"], "dbx-tauri-schema": ["dbx-core"],};const metadata = {workspace_members: Object.keys(graph),@@ -52,10 +53,8 @@ test("the planner uses the runner stable Cargo only for metadata", () => {assert.deepEqual(invocation.args, ["+stable", "metadata", "--locked", "--offline", "--no-deps", "--format-version", "1"]);assert.equal(invocation.options.cwd, "/workspace");});-// Keep the gate fixtures in sync with ci-gate.mjs routedJobs. Both Windows jobs-// share the windows_win7_bundle routing output.const routedJobs = { frontend: "frontend", packages: "packages", "github-scripts": "github_scripts",- "windows-standard-check": "windows_win7_bundle", "windows-win7-bundle": "windows_win7_bundle",+ "windows-standard-check": "windows_standard", "windows-win7-bundle": "windows_win7_bundle","duckdb-windows-driver": "duckdb_windows", jdbc: "jdbc", "offline-jdbc-release": "offline_jdbc", "nix-packaging": "nix" };test("only an exact contributor snapshot diff skips desktop frontend validation", () => {@@ -97,6 +96,21 @@ test("Win7 candidate follows the desktop package dependency graph", () => {assert.equal(plan(["crates/dbx-cli/src/main.rs"]).windows_win7_candidate, false);});+test("ordinary desktop Rust changes keep Windows compilation without full Win7 packaging", () => {+ for (const file of ["crates/dbx-core/src/query/mod.rs", "crates/dbx-core/tests/runtime_diagnostic_history.rs",+ "crates/dbx-drivers/src/lib.rs", "crates/dbx-driver-postgres/src/postgres.rs", "crates/dbx-driver-mysql/tests/query.rs",+ "src-tauri/src/commands/query.rs", "crates/dbx-tauri-consul/src/lib.rs", "crates/dbx-tauri-schema/src/lib.rs"]) {+ const result = plan([file]);+ assert.equal(result.windows_standard, true, file);+ assert.equal(result.windows_win7_bundle, false, file);+ }+ for (const file of ["crates/dbx-cli/src/main.rs", "crates/dbx-web/src/routes/transfer.rs", "docs/README.md"]) {+ const result = plan([file]);+ assert.equal(result.windows_standard, false, file);+ assert.equal(result.windows_win7_bundle, false, file);+ }+});+test("old Win7 Rust paths remain candidates through the dependency graph", () => {for (const file of ["src-tauri/src/commands/update.rs",@@ -126,20 +140,45 @@ test("Win7 infrastructure changes remain candidates outside the Cargo graph", ()"vendor/ctor/src/lib.rs","vendor/dirs-sys/src/lib.rs","vendor/pageant/src/lib.rs",+ ".cargo/config.toml",+ "rust-toolchain.toml",+ ".github/fixtures/win7-imports/dll.json",+ "src-tauri/tauri.conf.json",+ "src-tauri/tauri.windows.conf.json",+ "src-tauri/src/commands/update.rs",+ "crates/dbx-core/src/host/update.rs",+ "crates/dbx-platform/src/lib.rs",]) {- assert.equal(plan([file]).windows_win7_candidate, true, file);+ const result = plan([file]);+ assert.equal(result.windows_win7_candidate, true, file);+ assert.equal(result.windows_standard, true, file);+ assert.equal(result.windows_win7_bundle, true, file);}});test("Win7 dependency inputs fail open", () => {for (const file of ["Cargo.toml", "Cargo.lock", "src-tauri/Cargo.toml", "crates/dbx-cli/Cargo.toml"]) {assert.equal(plan([file]).windows_win7_candidate, true, file);+ assert.equal(plan([file]).windows_standard, true, file);+ assert.equal(plan([file]).windows_win7_bundle, true, file);}});test("unknown Rust changes and unknown diffs remain Win7 candidates", () => {- assert.equal(plan(["crates/new-engine/src/lib.rs"]).windows_win7_candidate, true);- assert.equal(plan(null).windows_win7_candidate, true);+ for (const files of [["crates/new-engine/src/lib.rs"], null]) {+ const result = plan(files);+ assert.equal(result.windows_win7_candidate, true);+ assert.equal(result.windows_standard, true);+ assert.equal(result.windows_win7_bundle, true);+ }+ const fixture = structuredClone(metadata);+ fixture.workspace_members.push("new-engine");+ fixture.packages.push({ id: "new-engine", name: "new-engine", manifest_path: `${root}/crates/new-engine/Cargo.toml`, dependencies: [] });+ const result = plan(["crates/dbx-web/src/lib.rs"], { metadata: fixture });+ assert.equal(result.windows_standard, true);+ assert.equal(result.windows_win7_bundle, true);+ assert.equal(result.windows_win7_reasons.unknown_member, true);+ assert.equal(plan(["docs/README.md"], { metadata: fixture }).windows_win7_bundle, false);});test("unrelated CI inputs do not become Win7 candidates through full Rust coverage", () => {@@ -164,6 +203,7 @@ test("Win7 candidate reports each routing reason", () => {dependency_input: false,desktop_dependency: false,unknown_rust: false,+ unknown_member: false,});});@@ -264,6 +304,22 @@ test("test groups partition every current workspace package exactly once", () =>assert.deepEqual(selected.toSorted(), Object.keys(graph).toSorted());});+test("Rust groups cover the actual workspace metadata, including extracted Tauri crates", () => {+ const repository = path.resolve(import.meta.dirname, "../..");+ const actual = cargoMetadata(repository);+ const members = actual.packages.filter((pkg) => actual.workspace_members.includes(pkg.id)).map((pkg) => pkg.name);+ assert.deepEqual(Object.values(rustGroups).flat().toSorted(), members.toSorted());+ const result = planCi({ files: ["crates/dbx-core/tests/runtime_diagnostic_history.rs", "crates/dbx-web/src/routes/transfer.rs"],+ metadata: actual, root: repository });+ assert.equal(result.rust_groups_known, true);+ assert.equal(result.rust_full, false);+ assert.deepEqual(groups(result), ["application"]);+ assert.deepEqual(result.agent_rust.include, [{ driver: "duckdb" }]);+ assert.equal(result.agent_java, false);+ assert.equal(result.agent_go.include.length, 0);+ assert.equal(result.agent_integration.include.length, 0);+});+test("workspace Cargo flags preserve full versus fast coverage and strict clippy", () => {for (const mode of ["fast", "full"]) {const command = rustCommand("test", "workspace", mode);@@ -418,6 +474,7 @@ test("the final gate requires both Windows jobs when the bundle routing is selecneeds.changes.outputs[output] = "false";}needs.changes.outputs.windows_win7_bundle = "true";+ needs.changes.outputs.windows_standard = "true";needs["windows-standard-check"].result = "success";needs["windows-win7-bundle"].result = "success";assert.deepEqual(gateFailures(needs, "all"), []);@@ -429,6 +486,26 @@ test("the final gate requires both Windows jobs when the bundle routing is selecassert.ok(gateFailures(needs, "all").length);});+test("the final gate independently requires standard Windows compilation without Win7 packaging", () => {+ const needs = results(["crates/dbx-core/src/query/mod.rs"]);+ const selected = plan(["crates/dbx-core/src/query/mod.rs"]);+ needs.rust = needs.agents = { result: "success" };+ for (const [job, output] of Object.entries(routedJobs)) {+ needs.changes.outputs[output] = String(selected[output] ?? false);+ needs[job] = { result: selected[output] ? "success" : "skipped" };+ }+ assert.equal(needs.changes.outputs.windows_standard, "true");+ assert.equal(needs.changes.outputs.windows_win7_bundle, "false");+ assert.deepEqual(gateFailures(needs, "all"), []);+ for (const result of ["failure", "skipped", "cancelled"]) {+ needs["windows-standard-check"].result = result;+ assert.ok(gateFailures(needs, "all").some((failure) => failure.includes("windows-standard-check")));+ }+ needs["windows-standard-check"].result = "success";+ delete needs.changes.outputs.windows_standard;+ assert.ok(gateFailures(needs, "all").length);+});+test("coverage audit rejects lost features, omitted packages, and overlapping group selection", () => {const coverage = { workspace: Object.fromEntries(Object.keys(graph).map((name) => [name, ["fixture"]])),...Object.fromEntries(Object.entries(rustGroups).map(([group, packages]) => [group, Object.fromEntries(packages.map((name) => [name, ["fixture"]]))])) };diff --git a/.github/scripts/ci-workflow.test.mjs b/.github/scripts/ci-workflow.test.mjsindex ffa295a669..834fbb6e6a 100644--- a/.github/scripts/ci-workflow.test.mjs+++ b/.github/scripts/ci-workflow.test.mjs@@ -46,8 +46,8 @@ test("Agent and Rust matrices are bounded and do not cancel sibling failures", (for (const [name, output, parallel] of [["rust-test", "rust_matrix", 3],["agent-rust", "agent_rust", 2],- ["agent-go", "agent_go", 8],- ["agent-integration", "agent_integration", 8],+ ["agent-go", "agent_go", 4],+ ["agent-integration", "agent_integration", 4],]) {const content = job(name);assert.match(content, /fail-fast: false/);@@ -243,9 +243,8 @@ test("DuckDB Windows builds persist Rust and C++ compiler results", () => {});test("Windows compatibility jobs cache Rust compilation without wrapping C or C++", () => {- assert.ok(job("changes").includes("'vendor/webview2-com-sys/**'"));const standard = job("windows-standard-check");- assert.ok(standard.includes("needs.changes.outputs.windows_win7_bundle == 'true'"));+ assert.ok(standard.includes("needs.changes.outputs.windows_standard == 'true'"));assert.ok(standard.includes("RUSTC_WRAPPER: sccache"));assert.ok(standard.includes('SCCACHE_GHA_ENABLED: "true"'));assert.ok(standard.includes("SCCACHE_GHA_VERSION: windows-standard-v1"));@@ -255,6 +254,7 @@ test("Windows compatibility jobs cache Rust compilation without wrapping C or C+assert.ok(standard.includes("sccache --show-stats"));const win7 = job("windows-win7-bundle");+ assert.ok(win7.includes("needs.changes.outputs.windows_win7_bundle == 'true'"));assert.doesNotMatch(win7, /x86_64-pc-windows-msvc|Setup Rust for standard Windows/);for (const setting of ["RUSTC_WRAPPER: sccache", 'SCCACHE_GHA_ENABLED: "true"', "SCCACHE_GHA_VERSION: win7-webview2-1.0.902.49-v1", 'SCCACHE_IDLE_TIMEOUT: "0"', 'CARGO_PROFILE_RELEASE_LTO: "off"', 'CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "8"']) assert.ok(win7.includes(setting));assert.ok(win7.includes("fc920bf0ec8de6ee65d409111f7ec508035751ba"));@@ -295,20 +295,23 @@ test("Win7 TLS cache keys ignore the workspace lockfile", () => {assert.doesNotMatch(win7, /key: win7-(?:aws-lc|openssl).*hashFiles\('Cargo\.lock'/);});-test("the planner uses the exact event base and preserves a single workflow cancellation scope", () => {+test("path filtering and the planner use the exact test merge first parent and preserve cancellation scope", () => {const changes = job("changes");- assert.ok(changes.includes("github.event.pull_request.base.sha || github.event.before"));+ assert.ok(changes.includes("BEFORE_SHA: ${{ github.event.before }}"));+ assert.ok(changes.includes('BASE_SHA="$(node .github/scripts/ci-change-base.mjs)"'));+ assert.ok(changes.includes("fetch-depth: 2"));assert.ok(changes.includes('git fetch --no-tags --depth=1 origin "$BASE_SHA"'));assert.ok(changes.includes("base: ${{ steps.change-base.outputs.sha }}"));+ assert.match(changes, /with:\s+token: ''\s+base: \$\{\{ steps\.change-base\.outputs\.sha \}\}\s+ref: \$\{\{ github\.sha \}\}/);assert.ok(changes.includes("BASE_SHA: ${{ steps.change-base.outputs.sha }}"));assert.ok(changes.includes("node .github/scripts/ci-plan.mjs"));assert.doesNotMatch(changes, /fetch-depth:\s*0/);assert.doesNotMatch(changes, /dtolnay\/rust-toolchain/);for (const flag of ["rust", "rust_full", "rust_matrix", "agents", "agent_go", "agent_rust", "agent_integration",- "windows_win7_candidate", "windows_win7_affected_packages", "windows_win7_reasons", "plan"]) {+ "windows_standard", "windows_win7_bundle", "windows_win7_candidate", "windows_win7_affected_packages", "windows_win7_reasons", "plan"]) {assert.ok(changes.includes(`steps.plan.outputs.${flag}`));}- assert.ok(changes.includes("WIN7_CURRENT: ${{ steps.filter.outputs.windows_win7_bundle }}"));+ assert.doesNotMatch(changes, /steps\.filter\.outputs\.windows_win7_bundle|github\.event\.pull_request\.base\.sha|WIN7_CURRENT/);assert.ok(workflow.includes("group: ${{ github.workflow }}-${{ github.ref }}"));assert.ok(workflow.includes("cancel-in-progress: true"));});diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 97640d111d..4c99c2e8a1 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -303,7 +303,7 @@ jobs:windows-standard-check:needs: changes- if: needs.changes.outputs.windows_win7_bundle == 'true' && needs.changes.outputs.draft != 'true'+ if: needs.changes.outputs.windows_standard == 'true' && needs.changes.outputs.draft != 'true'runs-on: windows-2022timeout-minutes: 45env:@@ -1112,7 +1112,8 @@ jobs:agents: ${{ steps.plan.outputs.agents }}duckdb_windows: ${{ steps.filter.outputs.duckdb_windows == 'true' || steps.plan.outputs.duckdb_windows == 'true' }}nix: ${{ steps.filter.outputs.nix }}- windows_win7_bundle: ${{ steps.filter.outputs.windows_win7_bundle }}+ windows_standard: ${{ steps.plan.outputs.windows_standard }}+ windows_win7_bundle: ${{ steps.plan.outputs.windows_win7_bundle }}windows_win7_candidate: ${{ steps.plan.outputs.windows_win7_candidate }}windows_win7_affected_packages: ${{ steps.plan.outputs.windows_win7_affected_packages }}windows_win7_reasons: ${{ steps.plan.outputs.windows_win7_reasons }}@@ -1134,14 +1135,15 @@ jobs:steps:- uses: actions/checkout@v7with:- fetch-depth: 1+ fetch-depth: 2- name: Fetch change baseid: change-baseenv:- BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}+ BEFORE_SHA: ${{ github.event.before }}run: |- if [[ -z "$BASE_SHA" || "$BASE_SHA" =~ ^0+$ ]]; then+ BASE_SHA="$(node .github/scripts/ci-change-base.mjs)"+ if [[ -z "$BASE_SHA" ]]; thenexit 0figit fetch --no-tags --depth=1 origin "$BASE_SHA"@@ -1151,7 +1153,9 @@ jobs:uses: dorny/paths-filter@v4id: filterwith:+ token: ''base: ${{ steps.change-base.outputs.sha }}+ ref: ${{ github.sha }}filters: |frontend:- 'apps/desktop/**'@@ -1234,32 +1238,6 @@ jobs:- 'flake.lock'- '.github/workflows/ci.yml'- '.github/workflows/update-nix-pnpm-hash.yml'- windows_win7_bundle:- - '.github/scripts/assert-win7-pe-compat.ps1'- - '.github/scripts/assert-webview2-win7-loader.ps1'- - '.github/scripts/assert-win7-installer-content.ps1'- - '.github/scripts/assert-webview2-win7-runtime.ps1'- - '.github/scripts/prepare-webview2-win7-loader.ps1'- - '.github/scripts/prepare-webview2-win7-runtime.ps1'- - '.github/workflows/ci.yml'- - '.github/workflows/release.yml'- - 'src-tauri/tauri.webview2-win7-fixed.conf.json'- - 'src-tauri/build.rs'- - 'src-tauri/Cargo.toml'- - 'src-tauri/windows/nsis/**'- - 'src-tauri/src/commands/update.rs'- - 'crates/dbx-core/Cargo.toml'- - 'crates/dbx-drivers/**'- - 'crates/dbx-driver-*/**'- - 'crates/dbx-platform/**'- - 'crates/dbx-core/src/host/update.rs'- - 'Cargo.toml'- - 'Cargo.lock'- - 'vendor/ctor/**'- - 'vendor/dirs-sys/**'- - 'vendor/pageant/**'- - 'vendor/webview2-com-sys/**'- - 'vendor/wry/**'github_scripts:- '.github/scripts/**'- 'docs/scripts/contributor-snapshot.mjs'@@ -1282,7 +1260,6 @@ jobs:BASE_SHA: ${{ steps.change-base.outputs.sha }}RUST_CHANGED: ${{ steps.filter.outputs.rust }}AGENTS_CHANGED: ${{ steps.filter.outputs.agents }}- WIN7_CURRENT: ${{ steps.filter.outputs.windows_win7_bundle }}run: node .github/scripts/ci-plan.mjsagents:@@ -1528,7 +1505,7 @@ jobs:run: bash ../.github/scripts/ci-agent-go.sh "$DRIVER" "$BINARY" "$RACE"strategy:fail-fast: false- max-parallel: 8+ max-parallel: 4matrix: ${{ fromJSON(needs.changes.outputs.agent_go) }}agent-integration:needs: [changes, fast-checks, agent-checks]@@ -1586,7 +1563,7 @@ jobs:name: agent-integration (${{ matrix.scenario }}, ${{ matrix.version }})strategy:fail-fast: false- max-parallel: 8+ max-parallel: 4matrix: ${{ fromJSON(needs.changes.outputs.agent_integration) }}ci:needs: