{"record":{"id":"e15dfe5ac408d3f6","repo":"windmill-labs/windmill","slug":"no-base-branches-are-configured-in-wmill-yaml-s-wo","errorCode":null,"errorMessage":"No base branches are configured in wmill.yaml's workspaces section, so the fork can't be linked to a parent. Add the parent workspace to wmill.yaml, or pass --from-branch <base>.","messagePattern":"No base branches are configured in wmill\\.yaml's workspaces section, so the fork can't be linked to a parent\\. Add the parent workspace to wmill\\.yaml, or pass --from-branch <base>\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/workspace/fork.ts","lineNumber":457,"sourceCode":"      `or check out a base branch and run \\`wmill workspace fork\\` to create a fresh fork branch.`,\n    );\n  }\n\n  const { Select } = await import(\"@cliffy/prompt/select\");\n  const proceed = await Select.prompt({\n    message: `You're on working branch \\`${currentBranch}\\`, not a base branch. Base a fork on it and rename it onto the fork branch?`,\n    options: [\n      { name: \"Yes, base the fork on this branch and rename it\", value: \"yes\" },\n      { name: \"No, cancel\", value: \"no\" },\n    ],\n  });\n  if (proceed !== \"yes\") {\n    throw new Error(\"Fork cancelled. Check out a base branch to create a fresh fork branch instead.\");\n  }\n\n  const baseBranches = listConfiguredBaseBranches(config);\n  if (baseBranches.length === 0) {\n    throw new Error(\n      `No base branches are configured in wmill.yaml's workspaces section, so the fork can't be linked to a parent. ` +\n      `Add the parent workspace to wmill.yaml, or pass --from-branch <base>.`,\n    );\n  }\n  if (baseBranches.length === 1) {\n    log.info(`Basing the fork on \\`${baseBranches[0]}\\`.`);\n    return baseBranches[0];\n  }\n  return await Select.prompt({\n    message: \"Which base branch is this fork based on (the parent)?\",\n    options: baseBranches.map((b) => ({ name: b, value: b })),\n  });\n}\n\n// The backend caps a fork workspace id (`wm-fork-<slug>`) at 50 chars total\n// (validate_fork_workspace_id in windmill-common), so the slug is at most\n// 50 - \"wm-fork-\".length (8) = 42.\nconst MAX_FORK_ID_SLUG = 42;","sourceCodeStart":439,"sourceCodeEnd":475,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/workspace/fork.ts#L439-L475","documentation":"After the user agrees to fork, the branch must be linked to a parent workspace listed under `workspaces` in wmill.yaml. When `listConfiguredBaseBranches` finds no base branches configured, the fork cannot be linked to a parent, so the command throws.","triggerScenarios":"Interactive `wmill workspace fork` accepted the prompt, but wmill.yaml has no `workspaces` section entries defining base branches, and no `--from-branch` was given.","commonSituations":"Fresh clone where wmill.yaml only has the default workspace profile; team repo where the workspaces mapping was never added; yaml edited and the workspaces block removed.","solutions":["Add the parent workspace and its base branches to the `workspaces` section of wmill.yaml","Pass `--from-branch <base>` to base the fork explicitly","Verify you are in the repo root where wmill.yaml lives"],"exampleFix":"# before (wmill.yaml)\nworkspaces: {}\n# after\nworkspaces:\n  main:\n    path: [\"main\"]\n    workspace: my-ws\n    default: true","handlingStrategy":"validation","validationCode":"const cfg = await readConfigFile(configDir);\nif (listConfiguredBaseBranches(cfg).length === 0) {\n  throw new Error('Add workspaces/base branches to wmill.yaml first');\n}","typeGuard":"function hasBaseBranches(cfg: unknown): cfg is Config & { workspaces: Record<string, unknown> } {\n  return !!cfg && typeof cfg === 'object' && 'workspaces' in cfg && Object.keys((cfg as any).workspaces ?? {}).length > 0;\n}","tryCatchPattern":"try {\n  await createWorkspaceFork(opts, cfg, branch);\n} catch (e) {\n  if (e.message.includes('No base branches are configured')) {\n    log.error('Add the parent workspace to wmill.yaml workspaces section.');\n  } else throw e;\n}","preventionTips":["Commit a wmill.yaml with the workspaces section in the repo","Verify workspaces config after cloning a new repo","Prefer --from-branch in CI to sidestep interactive resolution"],"tags":["cli","configuration","wmill-yaml","workspace-fork"],"backgroundTag":"missing-wmill-yaml-workspaces-config","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}