windmill-cli 1.753.0 → 1.753.1-gitsync.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/main.js +33 -35
- package/package.json +2 -2
package/esm/main.js
CHANGED
|
@@ -17152,7 +17152,6 @@ __export(exports_services_gen, {
|
|
|
17152
17152
|
setFlowUserState: () => setFlowUserState,
|
|
17153
17153
|
setEnvironmentVariable: () => setEnvironmentVariable,
|
|
17154
17154
|
setEmailTriggerMode: () => setEmailTriggerMode,
|
|
17155
|
-
setDevWorkspaceLabel: () => setDevWorkspaceLabel,
|
|
17156
17155
|
setDefaultErrorOrRecoveryHandler: () => setDefaultErrorOrRecoveryHandler,
|
|
17157
17156
|
setCaptureConfig: () => setCaptureConfig,
|
|
17158
17157
|
setAzureTriggerMode: () => setAzureTriggerMode,
|
|
@@ -18233,16 +18232,6 @@ var backendVersion = () => {
|
|
|
18233
18232
|
workspace: data3.workspace
|
|
18234
18233
|
}
|
|
18235
18234
|
});
|
|
18236
|
-
}, setDevWorkspaceLabel = (data3) => {
|
|
18237
|
-
return request(OpenAPI, {
|
|
18238
|
-
method: "POST",
|
|
18239
|
-
url: "/w/{workspace}/workspaces/set_dev_workspace_label",
|
|
18240
|
-
path: {
|
|
18241
|
-
workspace: data3.workspace
|
|
18242
|
-
},
|
|
18243
|
-
body: data3.requestBody,
|
|
18244
|
-
mediaType: "application/json"
|
|
18245
|
-
});
|
|
18246
18235
|
}, existsWorkspace = (data3) => {
|
|
18247
18236
|
return request(OpenAPI, {
|
|
18248
18237
|
method: "POST",
|
|
@@ -25772,7 +25761,6 @@ __export(exports_gen, {
|
|
|
25772
25761
|
setFlowUserState: () => setFlowUserState,
|
|
25773
25762
|
setEnvironmentVariable: () => setEnvironmentVariable,
|
|
25774
25763
|
setEmailTriggerMode: () => setEmailTriggerMode,
|
|
25775
|
-
setDevWorkspaceLabel: () => setDevWorkspaceLabel,
|
|
25776
25764
|
setDefaultErrorOrRecoveryHandler: () => setDefaultErrorOrRecoveryHandler,
|
|
25777
25765
|
setCaptureConfig: () => setCaptureConfig,
|
|
25778
25766
|
setAzureTriggerMode: () => setAzureTriggerMode,
|
|
@@ -26636,22 +26624,28 @@ function isGitRepository() {
|
|
|
26636
26624
|
return false;
|
|
26637
26625
|
}
|
|
26638
26626
|
}
|
|
26639
|
-
function isForkWorkspace(workspaceId) {
|
|
26640
|
-
return workspaceId.startsWith(FORK_WORKSPACE_PREFIX);
|
|
26627
|
+
function isForkWorkspace(workspaceId, parentWorkspaceId) {
|
|
26628
|
+
return !!parentWorkspaceId || workspaceId.startsWith(FORK_WORKSPACE_PREFIX);
|
|
26641
26629
|
}
|
|
26642
|
-
function forkBranchName(workspaceId, originalBranch) {
|
|
26643
|
-
|
|
26630
|
+
function forkBranchName(workspaceId, originalBranch, devWorkspaceLabel) {
|
|
26631
|
+
if (devWorkspaceLabel) {
|
|
26632
|
+
return devWorkspaceLabel;
|
|
26633
|
+
}
|
|
26634
|
+
const branchPrefix = `${WM_FORK_PREFIX}/${originalBranch}/`;
|
|
26635
|
+
return workspaceId.startsWith(FORK_WORKSPACE_PREFIX) ? workspaceId.replace(FORK_WORKSPACE_PREFIX, branchPrefix) : `${branchPrefix}${workspaceId}`;
|
|
26644
26636
|
}
|
|
26645
26637
|
function computeGitSyncDeployBranch(params) {
|
|
26646
26638
|
const {
|
|
26647
26639
|
workspaceId,
|
|
26640
|
+
parentWorkspaceId,
|
|
26641
|
+
devWorkspaceLabel,
|
|
26648
26642
|
items,
|
|
26649
26643
|
useIndividualBranch,
|
|
26650
26644
|
groupByFolder,
|
|
26651
26645
|
clonedBranchName
|
|
26652
26646
|
} = params;
|
|
26653
|
-
if (workspaceId
|
|
26654
|
-
return forkBranchName(workspaceId, clonedBranchName);
|
|
26647
|
+
if (isForkWorkspace(workspaceId, parentWorkspaceId)) {
|
|
26648
|
+
return forkBranchName(workspaceId, clonedBranchName, devWorkspaceLabel);
|
|
26655
26649
|
}
|
|
26656
26650
|
if (items.length === 0)
|
|
26657
26651
|
return null;
|
|
@@ -49071,7 +49065,7 @@ var require_zipEntries = __commonJS((exports, module) => {
|
|
|
49071
49065
|
if (this.centralDirRecords !== this.files.length) {
|
|
49072
49066
|
if (this.centralDirRecords !== 0 && this.files.length === 0) {
|
|
49073
49067
|
throw new Error("Corrupted zip or bug: expected " + this.centralDirRecords + " records in central dir, got " + this.files.length);
|
|
49074
|
-
}
|
|
49068
|
+
} else {}
|
|
49075
49069
|
}
|
|
49076
49070
|
},
|
|
49077
49071
|
readEndOfCentral: function() {
|
|
@@ -57505,7 +57499,7 @@ var require_loader = __commonJS((exports, module) => {
|
|
|
57505
57499
|
var error2 = generateError(state, message);
|
|
57506
57500
|
if (state.onWarning) {
|
|
57507
57501
|
state.onWarning.call(null, error2);
|
|
57508
|
-
}
|
|
57502
|
+
} else {}
|
|
57509
57503
|
}
|
|
57510
57504
|
var directiveHandlers = {
|
|
57511
57505
|
YAML: function handleYamlDirective(state, name, args) {
|
|
@@ -58043,7 +58037,7 @@ var require_loader = __commonJS((exports, module) => {
|
|
|
58043
58037
|
} else if (detectedIndent) {
|
|
58044
58038
|
sc.value += common3.repeat(`
|
|
58045
58039
|
`, emptyLines + 1);
|
|
58046
|
-
}
|
|
58040
|
+
} else {}
|
|
58047
58041
|
detectedIndent = true;
|
|
58048
58042
|
emptyLines = 0;
|
|
58049
58043
|
captureStart = state.position;
|
|
@@ -69467,28 +69461,32 @@ async function pull(opts) {
|
|
|
69467
69461
|
process.exit(1);
|
|
69468
69462
|
}
|
|
69469
69463
|
const clonedBranchName = getCurrentGitBranch() ?? "main";
|
|
69470
|
-
const targetIsFork = isForkWorkspace(workspace.workspaceId);
|
|
69464
|
+
const targetIsFork = isForkWorkspace(workspace.workspaceId, opts.parentWorkspaceId);
|
|
69471
69465
|
const useIndividualBranch = targetIsFork ? false : !!opts.useIndividualBranch;
|
|
69472
69466
|
const groupByFolder = targetIsFork ? false : !!opts.groupByFolder;
|
|
69473
|
-
|
|
69474
|
-
|
|
69475
|
-
|
|
69476
|
-
|
|
69477
|
-
|
|
69478
|
-
|
|
69479
|
-
|
|
69480
|
-
|
|
69481
|
-
|
|
69482
|
-
checkoutGitSyncDeployBranch(parentBranch);
|
|
69483
|
-
}
|
|
69467
|
+
const parentBranch = opts.parentDevWorkspaceLabel ? opts.parentDevWorkspaceLabel : opts.parentWorkspaceId && isForkWorkspace(opts.parentWorkspaceId) ? computeGitSyncDeployBranch({
|
|
69468
|
+
workspaceId: opts.parentWorkspaceId,
|
|
69469
|
+
items: deployItems,
|
|
69470
|
+
useIndividualBranch,
|
|
69471
|
+
groupByFolder,
|
|
69472
|
+
clonedBranchName
|
|
69473
|
+
}) : null;
|
|
69474
|
+
if (parentBranch && parentBranch !== clonedBranchName) {
|
|
69475
|
+
checkoutGitSyncDeployBranch(parentBranch);
|
|
69484
69476
|
}
|
|
69485
69477
|
const deployBranch = computeGitSyncDeployBranch({
|
|
69486
69478
|
workspaceId: workspace.workspaceId,
|
|
69479
|
+
parentWorkspaceId: opts.parentWorkspaceId,
|
|
69480
|
+
devWorkspaceLabel: opts.devWorkspaceLabel,
|
|
69487
69481
|
items: deployItems,
|
|
69488
69482
|
useIndividualBranch,
|
|
69489
69483
|
groupByFolder,
|
|
69490
69484
|
clonedBranchName
|
|
69491
69485
|
});
|
|
69486
|
+
if (targetIsFork && deployBranch && deployBranch === clonedBranchName) {
|
|
69487
|
+
error(`Fork branch '${deployBranch}' equals the checked-out branch '${clonedBranchName}'; refusing to deploy a fork directly to the tracked branch. Use a different dev workspace label or tracked branch.`);
|
|
69488
|
+
process.exit(1);
|
|
69489
|
+
}
|
|
69492
69490
|
if (deployBranch && deployBranch !== clonedBranchName) {
|
|
69493
69491
|
checkoutGitSyncDeployBranch(deployBranch);
|
|
69494
69492
|
}
|
|
@@ -69745,7 +69743,7 @@ async function gitDeploy(opts) {
|
|
|
69745
69743
|
process.exit(1);
|
|
69746
69744
|
}
|
|
69747
69745
|
}
|
|
69748
|
-
const isFork = isForkWorkspace(opts.workspace ?? "");
|
|
69746
|
+
const isFork = isForkWorkspace(opts.workspace ?? "", opts.parentWorkspaceId);
|
|
69749
69747
|
const useIndividualBranch = isFork ? false : !!opts.useIndividualBranch;
|
|
69750
69748
|
const includes = deriveGitSyncDeployIncludes(items, useIndividualBranch);
|
|
69751
69749
|
const promotion = useIndividualBranch && !opts.promotion ? getCurrentGitBranch() ?? undefined : opts.promotion;
|
|
@@ -70832,7 +70830,7 @@ var init_sync = __esm(async () => {
|
|
|
70832
70830
|
aliasDuplicateObjects: false,
|
|
70833
70831
|
singleQuote: true
|
|
70834
70832
|
};
|
|
70835
|
-
command8 = new Command().description("sync local with a remote workspaces or the opposite (push or pull)").action(() => info("2 actions available, pull and push. Use -h to display help.")).command("pull").description("Pull any remote changes and apply them locally.").option("--yes", "Pull without needing confirmation").option("--dry-run", "Show changes that would be pulled without actually pushing").option("--plain-secrets", "Pull secrets as plain text").option("--json", "Use JSON instead of YAML").option("--skip-variables", "Skip syncing variables (including secrets)").option("--skip-secrets", "Skip syncing only secrets variables").option("--include-secrets", "Include secrets in sync (overrides skipSecrets in wmill.yaml)").option("--skip-resources", "Skip syncing resources").option("--skip-resource-types", "Skip syncing resource types").option("--skip-scripts", "Skip syncing scripts").option("--skip-flows", "Skip syncing flows").option("--skip-apps", "Skip syncing apps").option("--skip-folders", "Skip syncing folders").option("--skip-workspace-dependencies", "Skip syncing workspace dependencies").option("--include-schedules", "Include syncing schedules").option("--include-triggers", "Include syncing triggers").option("--include-users", "Include syncing users").option("--include-groups", "Include syncing groups").option("--include-settings", "Include syncing workspace settings").option("--include-key", "Include workspace encryption key").option("--skip-branch-validation", "Skip git branch validation and prompts").option("--json-output", "Output results in JSON format").option("-i --includes <patterns:file[]>", "Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string). Overrides wmill.yaml includes").option("-e --excludes <patterns:file[]>", "Comma separated patterns to specify which file to NOT take into account. Overrides wmill.yaml excludes").option("--extra-includes <patterns:file[]>", "Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string). Useful to still take wmill.yaml into account and act as a second pattern to satisfy").option("--repository <repo:string>", "Specify repository path (e.g., u/user/repo) when multiple repositories exist").option("--promotion <branch:string>", "Use promotionOverrides from the specified branch instead of regular overrides").option("--branch, --env <branch:string>", "[Deprecated: use --workspace] Override the current git branch/environment").action(pull).command("push").description("Push any local changes and apply them remotely.").option("--yes", "Push without needing confirmation").option("--dry-run", "Show changes that would be pushed without actually pushing").option("--plain-secrets", "Push secrets as plain text").option("--json", "Use JSON instead of YAML").option("--skip-variables", "Skip syncing variables (including secrets)").option("--skip-secrets", "Skip syncing only secrets variables").option("--include-secrets", "Include secrets in sync (overrides skipSecrets in wmill.yaml)").option("--skip-resources", "Skip syncing resources").option("--skip-resource-types", "Skip syncing resource types").option("--skip-scripts", "Skip syncing scripts").option("--skip-flows", "Skip syncing flows").option("--skip-apps", "Skip syncing apps").option("--skip-folders", "Skip syncing folders").option("--skip-workspace-dependencies", "Skip syncing workspace dependencies").option("--include-schedules", "Include syncing schedules").option("--include-triggers", "Include syncing triggers").option("--include-users", "Include syncing users").option("--include-groups", "Include syncing groups").option("--include-settings", "Include syncing workspace settings").option("--include-key", "Include workspace encryption key").option("--skip-reencrypt-on-key-change", "When the pushed encryption key differs from the remote, do NOT re-encrypt existing remote secrets. Only safe if they are already encrypted with the new key (e.g. workspace/instance migration). Default is to re-encrypt.").option("--skip-branch-validation", "Skip git branch validation and prompts").option("--json-output", "Output results in JSON format").option("-i --includes <patterns:file[]>", "Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string)").option("-e --excludes <patterns:file[]>", "Comma separated patterns to specify which file to NOT take into account.").option("--extra-includes <patterns:file[]>", "Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string). Useful to still take wmill.yaml into account and act as a second pattern to satisfy").option("--message <message:string>", "Include a message that will be added to all scripts/flows/apps updated during this push").option("--parallel <number>", "Number of changes to process in parallel").option("--repository <repo:string>", "Specify repository path (e.g., u/user/repo) when multiple repositories exist").option("--branch, --env <branch:string>", "[Deprecated: use --workspace] Override the current git branch/environment").option("--lint", "Run lint validation before pushing").option("--locks-required", "Fail if scripts or flow inline scripts that need locks have no locks").option("--auto-metadata", "Automatically regenerate stale metadata (locks and schemas) before pushing").option("--accept-overriding-permissioned-as-with-self", "Accept that items with a different permissioned_as will be updated with your own user").action(push4).command("git-deploy").hidden().description("Internal git-sync deployment-callback step (used by the git-sync hub script). Runs inside an existing clone: switches to the wm_deploy/fork branch when applicable, pulls workspace content, then commits and pushes.").option("--repository <repo:string>", "Repository resource path (e.g. u/user/repo)").option("--git-deploy-items <json:string>", "JSON array of {path_type,path,parent_path,commit_msg} being deployed").option("--use-individual-branch", "Push each deployed object to its own wm_deploy/<workspace>/<...> branch").option("--group-by-folder", "With --use-individual-branch, group deployed objects per folder branch").option("--only-create-branch", "Only create/push the deploy branch, skip pulling and committing files").option("--parent-workspace-id <id:string>", "Parent workspace id, used to root a fork-of-a-fork branch").option("--skip-secrets", "Skip syncing only secrets variables").option("--git-committer-email <email:string>", "Committer email for the deploy commit (GPG-signed repos pass the GPG key email; defaults to WM_EMAIL)").option("--git-committer-name <name:string>", "Committer name for the deploy commit (defaults to WM_USERNAME)").action(gitDeploy);
|
|
70833
|
+
command8 = new Command().description("sync local with a remote workspaces or the opposite (push or pull)").action(() => info("2 actions available, pull and push. Use -h to display help.")).command("pull").description("Pull any remote changes and apply them locally.").option("--yes", "Pull without needing confirmation").option("--dry-run", "Show changes that would be pulled without actually pushing").option("--plain-secrets", "Pull secrets as plain text").option("--json", "Use JSON instead of YAML").option("--skip-variables", "Skip syncing variables (including secrets)").option("--skip-secrets", "Skip syncing only secrets variables").option("--include-secrets", "Include secrets in sync (overrides skipSecrets in wmill.yaml)").option("--skip-resources", "Skip syncing resources").option("--skip-resource-types", "Skip syncing resource types").option("--skip-scripts", "Skip syncing scripts").option("--skip-flows", "Skip syncing flows").option("--skip-apps", "Skip syncing apps").option("--skip-folders", "Skip syncing folders").option("--skip-workspace-dependencies", "Skip syncing workspace dependencies").option("--include-schedules", "Include syncing schedules").option("--include-triggers", "Include syncing triggers").option("--include-users", "Include syncing users").option("--include-groups", "Include syncing groups").option("--include-settings", "Include syncing workspace settings").option("--include-key", "Include workspace encryption key").option("--skip-branch-validation", "Skip git branch validation and prompts").option("--json-output", "Output results in JSON format").option("-i --includes <patterns:file[]>", "Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string). Overrides wmill.yaml includes").option("-e --excludes <patterns:file[]>", "Comma separated patterns to specify which file to NOT take into account. Overrides wmill.yaml excludes").option("--extra-includes <patterns:file[]>", "Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string). Useful to still take wmill.yaml into account and act as a second pattern to satisfy").option("--repository <repo:string>", "Specify repository path (e.g., u/user/repo) when multiple repositories exist").option("--promotion <branch:string>", "Use promotionOverrides from the specified branch instead of regular overrides").option("--branch, --env <branch:string>", "[Deprecated: use --workspace] Override the current git branch/environment").action(pull).command("push").description("Push any local changes and apply them remotely.").option("--yes", "Push without needing confirmation").option("--dry-run", "Show changes that would be pushed without actually pushing").option("--plain-secrets", "Push secrets as plain text").option("--json", "Use JSON instead of YAML").option("--skip-variables", "Skip syncing variables (including secrets)").option("--skip-secrets", "Skip syncing only secrets variables").option("--include-secrets", "Include secrets in sync (overrides skipSecrets in wmill.yaml)").option("--skip-resources", "Skip syncing resources").option("--skip-resource-types", "Skip syncing resource types").option("--skip-scripts", "Skip syncing scripts").option("--skip-flows", "Skip syncing flows").option("--skip-apps", "Skip syncing apps").option("--skip-folders", "Skip syncing folders").option("--skip-workspace-dependencies", "Skip syncing workspace dependencies").option("--include-schedules", "Include syncing schedules").option("--include-triggers", "Include syncing triggers").option("--include-users", "Include syncing users").option("--include-groups", "Include syncing groups").option("--include-settings", "Include syncing workspace settings").option("--include-key", "Include workspace encryption key").option("--skip-reencrypt-on-key-change", "When the pushed encryption key differs from the remote, do NOT re-encrypt existing remote secrets. Only safe if they are already encrypted with the new key (e.g. workspace/instance migration). Default is to re-encrypt.").option("--skip-branch-validation", "Skip git branch validation and prompts").option("--json-output", "Output results in JSON format").option("-i --includes <patterns:file[]>", "Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string)").option("-e --excludes <patterns:file[]>", "Comma separated patterns to specify which file to NOT take into account.").option("--extra-includes <patterns:file[]>", "Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string). Useful to still take wmill.yaml into account and act as a second pattern to satisfy").option("--message <message:string>", "Include a message that will be added to all scripts/flows/apps updated during this push").option("--parallel <number>", "Number of changes to process in parallel").option("--repository <repo:string>", "Specify repository path (e.g., u/user/repo) when multiple repositories exist").option("--branch, --env <branch:string>", "[Deprecated: use --workspace] Override the current git branch/environment").option("--lint", "Run lint validation before pushing").option("--locks-required", "Fail if scripts or flow inline scripts that need locks have no locks").option("--auto-metadata", "Automatically regenerate stale metadata (locks and schemas) before pushing").option("--accept-overriding-permissioned-as-with-self", "Accept that items with a different permissioned_as will be updated with your own user").action(push4).command("git-deploy").hidden().description("Internal git-sync deployment-callback step (used by the git-sync hub script). Runs inside an existing clone: switches to the wm_deploy/fork branch when applicable, pulls workspace content, then commits and pushes.").option("--repository <repo:string>", "Repository resource path (e.g. u/user/repo)").option("--git-deploy-items <json:string>", "JSON array of {path_type,path,parent_path,commit_msg} being deployed").option("--use-individual-branch", "Push each deployed object to its own wm_deploy/<workspace>/<...> branch").option("--group-by-folder", "With --use-individual-branch, group deployed objects per folder branch").option("--only-create-branch", "Only create/push the deploy branch, skip pulling and committing files").option("--parent-workspace-id <id:string>", "Parent workspace id, used to root a fork-of-a-fork branch").option("--dev-workspace-label <label:string>", "Environment label of a dev workspace (dev/staging); its deploys go to that branch").option("--parent-dev-workspace-label <label:string>", "Environment label of the parent dev workspace; roots a fork-of-dev branch on it").option("--skip-secrets", "Skip syncing only secrets variables").option("--git-committer-email <email:string>", "Committer email for the deploy commit (GPG-signed repos pass the GPG key email; defaults to WM_EMAIL)").option("--git-committer-name <name:string>", "Committer name for the deploy commit (defaults to WM_USERNAME)").action(gitDeploy);
|
|
70836
70834
|
sync_default = command8;
|
|
70837
70835
|
});
|
|
70838
70836
|
|
package/package.json
CHANGED