feat: forkables workspaces v0 (#6479)

* Add create_ephemeral workspace endpoint

* Add cli devShell

* List ephemeral workspaces + improve endpoint

* Add postgres function to clone a workspace (to be revisited)

* Clone workspace using the postgres function

* Add first iteration of ephemeral workspaces command

* Update display of forked workspaces

* Remove SQLX_OFFLINE

* Add UI to create ephemeral workspace

* Add option to exclude repository from being inherited to forks

* WIP: reworking cloning logic

* Fix cloning

* Fix redirect after creating fork

* Clean up cloning behaviour

* Rename ephemeral to fork

* emove ephemeral_workspaces table in favour of columns in  workspaces

* Fix display of forked workspaces

* Fix skip inherit git sync repo setting

* Fix fork invite display + creating fork as user

* Fix SideMenu bug

* Fix alignment

* Simplify migrations

* Update deletion of workspaces

* Delete forked workspace from cli

* Deleting fork workspaces from the UI as non-admin

* Update cli sync and fork creation to adapt to branches and forks

* Update fork prefix

* Remove skip tracking toggle

* Fix npm check warnings

* Fix last npm check

* fix: force stdin to Stdio::null for all user code execution (#6575)

Set stdin to Stdio::null for all Commands that execute user code across all supported languages to prevent unwanted input consumption. This affects Python, Deno, Bash, PowerShell, Go, Rust, PHP, Ruby, Java, C#, Ansible, Nu, and Bun executors.

The dedicated worker handler was intentionally left unchanged as it requires stdin for inter-process communication.

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>

* Update ee-repo ref

* Update SQLx metadata

* Fix typos

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
This commit is contained in:
wendrul
2025-09-10 17:42:45 +00:00
committed by GitHub
co-authored by claude[bot] windmill-internal-app[bot]
parent b7125074a2
commit 0bf200d26c
62 changed files with 3506 additions and 436 deletions
+29
View File
@@ -1,5 +1,6 @@
import { log } from "../../deps.ts";
import { execSync } from "node:child_process";
import { WM_FORK_PREFIX } from "../main.ts";
export function getCurrentGitBranch(): string | null {
try {
@@ -15,6 +16,34 @@ export function getCurrentGitBranch(): string | null {
}
}
export function getOriginalBranchForWorkspaceForks(branchName: string): string | null {
if (!branchName.startsWith(WM_FORK_PREFIX)) {
return null
}
const start = branchName.indexOf("/") + 1;
const end = branchName.lastIndexOf("/");
if (start < 0 || end < 0 || end - start <= 0) {
return null
}
return branchName.slice(start, end)
}
export function getWorkspaceIdForWorkspaceForkFromBranchName(branchName: string): string | null {
if (!branchName.startsWith(WM_FORK_PREFIX)) {
return null
}
const start = branchName.lastIndexOf("/") + 1;
if (start < 0) {
return null
}
return `${WM_FORK_PREFIX}-${branchName.slice(start)}`
}
export function isGitRepository(): boolean {
try {
execSync("git rev-parse --git-dir", {