feat: let a data table name tables its forks copy without rows (#12825)

* feat: let a data table name tables its forks copy without rows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: leave hierarchical continuous aggregates out and recheck patterns after the dump

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: point at the replay change of the companion EE branch

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: match only chunk names when leaving a hypertable's chunks out

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: update ee-repo-ref to 2afccf8964aef7d7d318d6a14868a0757dbc0e13

This commit updates the EE repository reference after PR #1045 was merged in windmill-ee-private.

Previous ee-repo-ref: dd7749a6d20e777e7e27bf0a2e27f5ac9ac4d0b1

New ee-repo-ref: 2afccf8964aef7d7d318d6a14868a0757dbc0e13

Automated by sync-ee-ref workflow.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
This commit is contained in:
Ruben Fiszel
2026-12-02 23:08:59 +01:00
committed by GitHub
co-authored by Claude Opus 5.5 windmill-internal-app[bot]
parent d303cb855a
commit 76bfdf32a9
14 changed files with 653 additions and 58 deletions
+1 -1
View File
@@ -221,7 +221,7 @@ async function create(
`Workspace already has datatable(s): ${existing
.map((d) => d.name)
.join(", ")}. Re-run with --force to add '${dtName}' ` +
"(note: fork metadata on existing datatables is not preserved)",
"(note: fork metadata and settings such as tables forked without rows are not preserved on existing datatables)",
);
}
+18 -6
View File
@@ -23,8 +23,14 @@ import {
readConfigFile,
} from "../../core/conf.ts";
/** Wait for a fork creation started in the background, by the id its request answered with. */
async function waitForForkCreation(parentWorkspace: string, creationId: string) {
/**
* Wait for a fork creation started in the background, by the id its request answered with.
* Resolves to what the created fork goes without.
*/
async function waitForForkCreation(
parentWorkspace: string,
creationId: string,
): Promise<string[]> {
let failingSince: number | undefined;
let lastStep: string | undefined;
while (true) {
@@ -47,7 +53,7 @@ async function waitForForkCreation(parentWorkspace: string, creationId: string)
lastStep = result.step;
log.info(colors.gray(`${lastStep}...`));
}
if (result?.status === "completed") return;
if (result?.status === "completed") return result.warnings ?? [];
if (result?.status === "failed") {
throw new Error(result.error ?? "Unknown error");
}
@@ -355,7 +361,7 @@ async function createWorkspaceFork(
)
);
await wmill.importPgDatabase({
const imported = await wmill.importPgDatabase({
workspace: workspace.workspaceId,
requestBody: {
source: `datatable://${dt.name}`,
@@ -365,6 +371,9 @@ async function createWorkspaceFork(
},
});
for (const warning of imported.split("\n").slice(1)) {
log.warn(colors.yellow(` ${warning}`));
}
log.info(colors.green(` ✓ Datatable "${dt.name}" cloned.`));
forkedDatatables.push({ name: dt.name, new_dbname: newDbName });
} catch (e) {
@@ -420,8 +429,11 @@ async function createWorkspaceFork(
},
});
// A server without background forks ignores the flag and answers once the fork is created.
if (!response.startsWith("Created forked workspace")) {
await waitForForkCreation(workspace.workspaceId, response);
const warnings = response.startsWith("Created forked workspace")
? response.split("\n").slice(1)
: await waitForForkCreation(workspace.workspaceId, response);
for (const warning of warnings) {
log.warn(colors.yellow(warning));
}
log.info(colors.green(`✅ Created forked workspace ${trueWorkspaceId}`));