Compare commits

..

3 Commits

Author SHA1 Message Date
Ruben Fiszel
39f0752525 all 2024-08-19 21:43:22 +02:00
Ruben Fiszel
1ee78da4bf Merge branch 'main' into rf/foo2 2024-08-19 12:43:08 +02:00
Ruben Fiszel
0a336467d8 all 2024-08-19 12:32:43 +02:00
31 changed files with 398 additions and 550 deletions

View File

@@ -1,30 +1,5 @@
# Changelog
## [1.382.1](https://github.com/windmill-labs/windmill/compare/v1.382.0...v1.382.1) (2024-08-20)
### Bug Fixes
* **frontend:** Fix flow graph step preview ([#4264](https://github.com/windmill-labs/windmill/issues/4264)) ([0a6832a](https://github.com/windmill-labs/windmill/commit/0a6832aa4561468fb0150f9eb435b7ad857fc841))
## [1.382.0](https://github.com/windmill-labs/windmill/compare/v1.381.0...v1.382.0) (2024-08-20)
### Features
* **frontend:** improve versions history by adding a diff viewer with… ([#4261](https://github.com/windmill-labs/windmill/issues/4261)) ([c19df12](https://github.com/windmill-labs/windmill/commit/c19df12292241c20c12e3de5d880c04df9b74324))
### Bug Fixes
* add FORCE_WORKER_TAGS & fix workers page when default worker group is missing ([09c6af0](https://github.com/windmill-labs/windmill/commit/09c6af05cd6e0b3b30f771a125b1fa330a938101))
* **bun:** disable large transpiling cache ([1a0e32b](https://github.com/windmill-labs/windmill/commit/1a0e32b40b5f1ac5dcfe3639e697affb6e79a558))
* **cli:** improve error message of cli ([f3bcadb](https://github.com/windmill-labs/windmill/commit/f3bcadbfb1e42b56996e273800aa0dcb01a6868b))
* frontend/package.json & frontend/package-lock.json to reduce vulnerabilities ([#4255](https://github.com/windmill-labs/windmill/issues/4255)) ([7fe0442](https://github.com/windmill-labs/windmill/commit/7fe0442a814ed42b1775386be5f4defdcb5c0a0f))
* **frontend:** nit worker limits ([#4258](https://github.com/windmill-labs/windmill/issues/4258)) ([bb92824](https://github.com/windmill-labs/windmill/commit/bb9282427399f305c3e8874204e6478272c43ff8))
* improve resource picker handling of objects ([2502377](https://github.com/windmill-labs/windmill/commit/250237793b3c2b1afd5ee122b147301bc487eeeb))
* **typescript-client:** runFlowAsync by default assume job doesn't outlive flow ([010e0fd](https://github.com/windmill-labs/windmill/commit/010e0fdc2352d740a72de124cc26eea8fc1915af))
## [1.381.0](https://github.com/windmill-labs/windmill/compare/v1.380.0...v1.381.0) (2024-08-16)

427
backend/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
[package]
name = "windmill"
version = "1.382.1"
version = "1.381.0"
authors.workspace = true
edition.workspace = true
@@ -25,7 +25,7 @@ members = [
]
[workspace.package]
version = "1.382.1"
version = "1.381.0"
authors = ["Ruben Fiszel <ruben@windmill.dev>"]
edition = "2021"

View File

@@ -1,7 +1,7 @@
openapi: "3.0.3"
info:
version: 1.382.1
version: 1.381.0
title: Windmill API
contact:

View File

@@ -563,17 +563,6 @@ pub async fn load_worker_config(
config.worker_tags = Some(all_tags);
}
if let Some(force_worker_tags) = std::env::var("FORCE_WORKER_TAGS")
.ok()
.map(|x| x.split(',').map(|x| x.to_string()).collect::<Vec<String>>())
{
tracing::info!(
"Detected FORCE_WORKER_TAGS, forcing worker tags to: {:#?}",
force_worker_tags
);
config.worker_tags = Some(force_worker_tags);
}
// set worker_tags using default if none. If priority tags is set, compute the sorted priority tags as well
let worker_tags = config
.worker_tags

View File

@@ -571,7 +571,6 @@ pub fn copy_recursively(
}
}
}
let original = entry.path();
if filetype.is_dir() {
@@ -1291,10 +1290,6 @@ pub async fn get_common_bun_proc_envs(base_internal_url: &str) -> HashMap<String
String::from("BUN_INSTALL_CACHE_DIR"),
BUN_CACHE_DIR.to_string(),
),
(
String::from("BUN_RUNTIME_TRANSPILER_CACHE_PATH"),
"0".to_string(),
),
]);
if let Some(ref node_path) = NODE_PATH.as_ref() {

View File

@@ -2,7 +2,7 @@ import { sleep } from "https://deno.land/x/sleep@v1.2.1/mod.ts";
import * as windmill from "https://deno.land/x/windmill@v1.174.0/mod.ts";
import * as api from "https://deno.land/x/windmill@v1.174.0/windmill-api/index.ts";
export const VERSION = "v1.382.1";
export const VERSION = "v1.381.0";
export async function login(email: string, password: string): Promise<string> {
return await windmill.UserService.login({

View File

@@ -12,7 +12,7 @@ import {
yamlParse,
} from "./deps.ts";
import { requireLogin, resolveWorkspace, validatePath } from "./context.ts";
import { resolve, track_job } from "./script.ts";
import { findGlobalDeps, resolve, track_job } from "./script.ts";
import { defaultFlowDefinition } from "./bootstrap/flow_bootstrap.ts";
import { generateFlowLockInternal } from "./metadata.ts";
import { SyncOptions, mergeConfigWithConfigFile } from "./conf.ts";
@@ -115,20 +115,14 @@ export async function pushFlow(
});
} else {
log.info(colors.bold.yellow("Creating new flow..."));
try {
await FlowService.createFlow({
workspace: workspace,
requestBody: {
path: remotePath.replaceAll(SEP, "/"),
deployment_message: message,
...localFlow,
},
});
} catch (e) {
throw new Error(
`Failed to create flow ${remotePath}: ${e.body ?? e.message}`
);
}
await FlowService.createFlow({
workspace: workspace,
requestBody: {
path: remotePath.replaceAll(SEP, "/"),
deployment_message: message,
...localFlow,
},
});
}
}
@@ -243,8 +237,15 @@ async function generateLocks(
await requireLogin(opts);
opts = await mergeConfigWithConfigFile(opts);
if (folder) {
const globalDeps = await findGlobalDeps();
// read script metadata file
await generateFlowLockInternal(folder, false, workspace);
await generateFlowLockInternal(
folder,
false,
workspace,
globalDeps,
opts.defaultTs
);
} else {
const ignore = await ignoreF(opts);
const elems = Object.keys(
@@ -264,8 +265,16 @@ async function generateLocks(
).map((x) => x.substring(0, x.lastIndexOf(SEP)));
let hasAny = false;
const globalDeps = await findGlobalDeps();
for (const folder of elems) {
const candidate = await generateFlowLockInternal(folder, true, workspace);
const candidate = await generateFlowLockInternal(
folder,
true,
workspace,
globalDeps,
opts.defaultTs
);
if (candidate) {
hasAny = true;
log.info(colors.green(`+ ${candidate}`));
@@ -287,7 +296,13 @@ async function generateLocks(
return;
}
for (const folder of elems) {
await generateFlowLockInternal(folder, false, workspace);
await generateFlowLockInternal(
folder,
false,
workspace,
globalDeps,
opts.defaultTs
);
}
}
}

View File

@@ -92,7 +92,8 @@ export async function pushFolder(
},
});
} catch (e) {
throw Error(`Failed to create folder ${name}: ${e.body ?? e.message}`);
console.error(e.body);
throw e;
}
}
}

View File

@@ -34,7 +34,7 @@ addEventListener("error", (event) => {
}
});
export const VERSION = "v1.382.1";
export const VERSION = "v1.381.0";
let command: any = new Command()
.name("wmill")

View File

@@ -46,7 +46,7 @@ import { FlowFile, replaceInlineScripts } from "./flow.ts";
export async function generateAllMetadata() {}
function findClosestRawReqs(
lang: "bun" | "python3" | "php" | undefined,
lang: "bun" | "python3" | "php" | string | undefined,
remotePath: string,
globalDeps: GlobalDeps
): string | undefined {
@@ -84,20 +84,56 @@ function findClosestRawReqs(
}
const TOP_HASH = "__flow_hash";
async function generateFlowHash(folder: string) {
async function generateFlowHash(
folder: string,
globalDeps: GlobalDeps,
defaultTs: "bun" | "deno" | undefined
): Promise<{
hashes: Record<string, string>;
pathsWithRawReqs: string[];
}> {
const elems = await FSFSElement(path.join(Deno.cwd(), folder), []);
const hashes: Record<string, string> = {};
const pathsWithRawReqs: string[] = [];
for await (const f of elems.getChildren()) {
if (exts.some((e) => f.path.endsWith(e))) {
hashes[f.path] = await generateHash(await f.getContentText());
const found_ext = exts.find((e) => f.path.endsWith(e));
if (found_ext) {
const lang = inferContentTypeFromFilePath(f.path, defaultTs);
// log.info(remote_path + "/script" + ext);
const raw = findClosestRawReqs(
lang as "bun" | "php" | "python3" | undefined,
path.join(folder, f.path),
globalDeps
);
// if (raw) {
// rawReqs[ext] = raw;
// }
let text = await f.getContentText();
if (raw) {
text = raw + text;
pathsWithRawReqs.push(f.path);
}
hashes[f.path] = await generateHash(text);
}
}
return { ...hashes, [TOP_HASH]: await generateHash(JSON.stringify(hashes)) };
return {
hashes: {
...hashes,
[TOP_HASH]: await generateHash(JSON.stringify(hashes)),
},
pathsWithRawReqs,
};
}
export async function generateFlowLockInternal(
folder: string,
dryRun: boolean,
workspace: Workspace,
globalDeps: GlobalDeps,
defaultTs: "bun" | "deno" | undefined,
justUpdateMetadataLock?: boolean
): Promise<string | undefined> {
if (folder.endsWith(SEP)) {
@@ -110,7 +146,11 @@ export async function generateFlowLockInternal(
log.info(`Generating lock for flow ${folder} at ${remote_path}`);
}
let hashes = await generateFlowHash(folder);
let { hashes, pathsWithRawReqs } = await generateFlowHash(
folder,
globalDeps,
defaultTs
);
const conf = await readLockfile();
if (await checkifMetadataUptodate(folder, hashes[TOP_HASH], conf, TOP_HASH)) {
@@ -126,6 +166,7 @@ export async function generateFlowLockInternal(
await Deno.readTextFile(folder! + SEP + "flow.yaml")
) as FlowFile;
const fullReqs: Partial<Record<ScriptLanguage, string>> = {};
if (!justUpdateMetadataLock) {
const changedScripts = [];
//find hashes that do not correspond to previous hashes
@@ -139,6 +180,19 @@ export async function generateFlowLockInternal(
}
log.info(`Recomputing locks of ${changedScripts.join(", ")} in ${folder}`);
for (const script of changedScripts) {
if (pathsWithRawReqs.includes(script)) {
const lang = inferContentTypeFromFilePath(script, defaultTs);
log.info(`Inline script ${script} has raw requirements`);
let req = fullReqs[lang];
if (!req) {
const rawReq = findClosestRawReqs(lang, script, globalDeps) ?? "";
const fullReq = await getLockfileFromWindmill();
fullReqs[lang] = req;
}
}
}
replaceInlineScripts(
flowValue.value.modules,
folder + SEP!,
@@ -161,7 +215,7 @@ export async function generateFlowLockInternal(
});
}
hashes = await generateFlowHash(folder);
hashes = (await generateFlowHash(folder, globalDeps, defaultTs)).hashes;
for (const [path, hash] of Object.entries(hashes)) {
await updateMetadataGlobalLock(folder, hash, path);
@@ -308,27 +362,13 @@ export async function updateScriptSchema(
metadataContent.schema = newSchema;
}
async function updateScriptLock(
async function getLockfileFromWindmill(
workspace: Workspace,
scriptContent: string,
language: ScriptLanguage,
remotePath: string,
metadataContent: Record<string, any>,
rawDeps: string | undefined
): Promise<void> {
if (
!(
language == "bun" ||
language == "python3" ||
language == "go" ||
language == "deno" ||
language == "php"
)
) {
return;
}
// generate the script lock running a dependency job in Windmill and update it inplace
// TODO: update this once the client is released
): Promise<{ lock: string | undefined }> {
const rawResponse = await fetch(
`${workspace.remote}api/w/${workspace.workspaceId}/jobs/run/dependencies`,
{
@@ -354,27 +394,7 @@ async function updateScriptLock(
let responseText = "reading response failed";
try {
responseText = await rawResponse.text();
const response = JSON.parse(responseText);
const lock = response.lock;
if (lock === undefined) {
throw new Error(
`Failed to generate lockfile. Full response was: ${JSON.stringify(
response
)}`
);
}
const lockPath = remotePath + ".script.lock";
if (lock != "") {
await Deno.writeTextFile(lockPath, lock);
metadataContent.lock = "!inline " + lockPath.replaceAll(SEP, "/");
} else {
try {
if (await Deno.stat(lockPath)) {
await Deno.remove(lockPath);
}
} catch {}
metadataContent.lock = "";
}
return JSON.parse(responseText);
} catch (e) {
throw new Error(
`Failed to generate lockfile. Status was: ${rawResponse.statusText}, ${responseText}, ${e}`
@@ -382,6 +402,57 @@ async function updateScriptLock(
}
}
async function updateScriptLock(
workspace: Workspace,
scriptContent: string,
language: ScriptLanguage,
remotePath: string,
metadataContent: Record<string, any>,
rawDeps: string | undefined
): Promise<void> {
if (
!(
language == "bun" ||
language == "python3" ||
language == "go" ||
language == "deno" ||
language == "php"
)
) {
return;
}
// generate the script lock running a dependency job in Windmill and update it inplace
// TODO: update this once the client is released
const response = getLockfileFromWindmill(
workspace,
scriptContent,
language,
remotePath,
rawDeps
);
const lock = response.lock;
if (lock === undefined) {
throw new Error(
`Failed to generate lockfile. Full response was: ${JSON.stringify(
response
)}`
);
}
const lockPath = remotePath + ".script.lock";
if (lock != "") {
await Deno.writeTextFile(lockPath, lock);
metadataContent.lock = "!inline " + lockPath.replaceAll(SEP, "/");
} else {
try {
if (await Deno.stat(lockPath)) {
await Deno.remove(lockPath);
}
} catch {}
metadataContent.lock = "";
}
}
export async function updateFlow(
workspace: Workspace,
flow_value: FlowValue,

View File

@@ -366,19 +366,11 @@ async function createScript(
workspace: Workspace
) {
if (!bundleContent) {
try {
// no parent hash
await ScriptService.createScript({
workspace: workspaceId,
requestBody: body,
});
} catch (e) {
throw Error(
`Script creation for ${body.path} with parent ${
body.parent_hash
} was not successful: ${e.body ?? e.message}`
);
}
// no parent hash
await ScriptService.createScript({
workspace: workspaceId,
requestBody: body,
});
} else {
const form = new FormData();
form.append("script", JSON.stringify(body));

View File

@@ -1070,7 +1070,14 @@ export async function pull(opts: GlobalOptions & SyncOptions) {
}
for (const change of changedFlows) {
log.info(`Updating lock for flow ${change}`);
await generateFlowLockInternal(change, false, workspace, true);
await generateFlowLockInternal(
change,
false,
workspace,
globalDeps,
opts.defaultTs,
true
);
}
log.info(
colors.bold.green.underline(

View File

@@ -1,12 +1,12 @@
{
"name": "windmill-components",
"version": "1.382.1",
"version": "1.381.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "windmill-components",
"version": "1.382.1",
"version": "1.381.0",
"license": "AGPL-3.0",
"dependencies": {
"@aws-crypto/sha256-js": "^4.0.0",
@@ -16,7 +16,7 @@
"@redocly/json-to-json-schema": "^0.0.1",
"@tanstack/svelte-table": "^8.9.9",
"@windmill-labs/svelte-dnd-action": "latest",
"@xyflow/svelte": "^0.1.15",
"@xyflow/svelte": "^0.1.14",
"ag-charts-community": "^9.0.1",
"ag-charts-enterprise": "^9.0.1",
"ag-grid-community": "^31.0.0",
@@ -2294,8 +2294,7 @@
"node_modules/@types/pug": {
"version": "2.0.9",
"resolved": "https://registry.npmjs.org/@types/pug/-/pug-2.0.9.tgz",
"integrity": "sha512-Yg4LkgFYvn1faISbDNWmcAC1XoDT8IoMUFspp5mnagKk+UvD2N0IWt5A7GRdMubsNWqgCLmrkf8rXkzNqb4szA==",
"dev": true
"integrity": "sha512-Yg4LkgFYvn1faISbDNWmcAC1XoDT8IoMUFspp5mnagKk+UvD2N0IWt5A7GRdMubsNWqgCLmrkf8rXkzNqb4szA=="
},
"node_modules/@types/semver": {
"version": "7.5.5",
@@ -2516,24 +2515,23 @@
}
},
"node_modules/@xyflow/svelte": {
"version": "0.1.15",
"resolved": "https://registry.npmjs.org/@xyflow/svelte/-/svelte-0.1.15.tgz",
"integrity": "sha512-QGM7rlBkoLG6jhHA9U8ZyMtqL62Cpn/T4OElTAUuKTgwuLTdzWqwSCdXpFTs8T6eiJD/Y4jYbVYsmQKDaB9rOw==",
"license": "MIT",
"version": "0.1.14",
"resolved": "https://registry.npmjs.org/@xyflow/svelte/-/svelte-0.1.14.tgz",
"integrity": "sha512-DdlFz+JKW1sQt8Q8O1DoSsroTvFk1RzmpcEZcGARt1REbnLy4BYG/03piaiclaC4iHK6feaPDvxpF057CkMCTw==",
"dependencies": {
"@svelte-put/shortcut": "^3.1.0",
"@xyflow/system": "0.0.38",
"classcat": "^5.0.4"
"@xyflow/system": "0.0.37",
"classcat": "^5.0.4",
"svelte-preprocess": "^5.1.3"
},
"peerDependencies": {
"svelte": "^3.0.0 || ^4.0.0"
}
},
"node_modules/@xyflow/system": {
"version": "0.0.38",
"resolved": "https://registry.npmjs.org/@xyflow/system/-/system-0.0.38.tgz",
"integrity": "sha512-auJU8djbT59S5Afb9lFds1lQJvKIb0zUoHhO+il/ogDDG5BbFds6D8g5a8Q3oHdyR6dy0TaD1oZq9s7Ydhn41g==",
"license": "MIT",
"version": "0.0.37",
"resolved": "https://registry.npmjs.org/@xyflow/system/-/system-0.0.37.tgz",
"integrity": "sha512-hSIhezhxgftPUpC+xiQVIorcRILZUOWlLjpYPTyGWRu8s4RJvM4GqvrsFmD5OnMKXLgpU7/PqqUibDVO67oWQQ==",
"dependencies": {
"@types/d3-drag": "^3.0.7",
"@types/d3-selection": "^3.0.10",
@@ -3006,7 +3004,6 @@
"version": "0.2.13",
"resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
"integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==",
"dev": true,
"engines": {
"node": "*"
}
@@ -3346,8 +3343,7 @@
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
"devOptional": true
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
},
"node_modules/confbox": {
"version": "0.1.6",
@@ -3959,7 +3955,6 @@
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz",
"integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==",
"dev": true,
"engines": {
"node": ">=8"
}
@@ -4186,8 +4181,7 @@
"node_modules/es6-promise": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz",
"integrity": "sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==",
"dev": true
"integrity": "sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg=="
},
"node_modules/esbuild": {
"version": "0.21.5",
@@ -4881,8 +4875,7 @@
"node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
"devOptional": true
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
},
"node_modules/fsevents": {
"version": "2.3.3",
@@ -5000,7 +4993,6 @@
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
"devOptional": true,
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
@@ -5032,7 +5024,6 @@
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"devOptional": true,
"dependencies": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -5042,7 +5033,6 @@
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"devOptional": true,
"dependencies": {
"brace-expansion": "^1.1.7"
},
@@ -5159,8 +5149,7 @@
"node_modules/graceful-fs": {
"version": "4.2.11",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
"dev": true
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
},
"node_modules/graphemer": {
"version": "1.4.0",
@@ -5468,7 +5457,6 @@
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
"devOptional": true,
"dependencies": {
"once": "^1.3.0",
"wrappy": "1"
@@ -5477,8 +5465,7 @@
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"devOptional": true
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"node_modules/ini": {
"version": "1.3.8",
@@ -5958,7 +5945,7 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz",
"integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==",
"dev": true,
"devOptional": true,
"engines": {
"node": ">=10"
}
@@ -7037,7 +7024,6 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz",
"integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==",
"dev": true,
"engines": {
"node": ">=4"
}
@@ -7126,7 +7112,6 @@
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
"dev": true,
"dependencies": {
"minimist": "^1.2.6"
},
@@ -7239,7 +7224,7 @@
"version": "3.3.7",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
"dev": true,
"devOptional": true,
"funding": [
{
"type": "github",
@@ -7548,7 +7533,6 @@
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
"devOptional": true,
"dependencies": {
"wrappy": "1"
}
@@ -7745,7 +7729,6 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
"devOptional": true,
"engines": {
"node": ">=0.10.0"
}
@@ -7833,7 +7816,7 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz",
"integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==",
"dev": true
"devOptional": true
},
"node_modules/picomatch-browser": {
"version": "2.2.6",
@@ -7923,7 +7906,7 @@
"version": "8.4.41",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.41.tgz",
"integrity": "sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==",
"dev": true,
"devOptional": true,
"funding": [
{
"type": "opencollective",
@@ -8098,7 +8081,7 @@
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.1.tgz",
"integrity": "sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==",
"dev": true,
"devOptional": true,
"dependencies": {
"lilconfig": "^2.0.5",
"yaml": "^2.1.1"
@@ -9065,7 +9048,6 @@
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/sander/-/sander-0.5.1.tgz",
"integrity": "sha512-3lVqBir7WuKDHGrKRDn/1Ye3kwpXaDOMsiRP1wd6wpZW56gJhsbp5RqQpA6JG/P+pkXizygnr1dKR8vzWaVsfA==",
"dev": true,
"dependencies": {
"es6-promise": "^3.1.2",
"graceful-fs": "^4.1.3",
@@ -9077,7 +9059,6 @@
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
"dev": true,
"dependencies": {
"glob": "^7.1.3"
},
@@ -9247,7 +9228,6 @@
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/sorcery/-/sorcery-0.11.0.tgz",
"integrity": "sha512-J69LQ22xrQB1cIFJhPfgtLuI6BpWRiWu1Y3vSsIwK/eAScqJxd/+CJlUuHQRdX2C9NGFamq+KqNywGgaThwfHw==",
"dev": true,
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.4.14",
"buffer-crc32": "^0.2.5",
@@ -9905,7 +9885,6 @@
"version": "5.1.4",
"resolved": "https://registry.npmjs.org/svelte-preprocess/-/svelte-preprocess-5.1.4.tgz",
"integrity": "sha512-IvnbQ6D6Ao3Gg6ftiM5tdbR6aAETwjhHV+UKGf5bHGYR69RQvF1ho0JKPcbUON4vy4R7zom13jPjgdOWCQ5hDA==",
"dev": true,
"hasInstallScript": true,
"dependencies": {
"@types/pug": "^2.0.6",
@@ -9967,7 +9946,6 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz",
"integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==",
"dev": true,
"dependencies": {
"min-indent": "^1.0.0"
},
@@ -10347,7 +10325,7 @@
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
"integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
"dev": true,
"devOptional": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@@ -10810,8 +10788,7 @@
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
"devOptional": true
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
},
"node_modules/write-file-atomic": {
"version": "5.0.1",

View File

@@ -1,6 +1,6 @@
{
"name": "windmill-components",
"version": "1.382.1",
"version": "1.381.0",
"scripts": {
"dev": "vite dev",
"build": "vite build",
@@ -97,7 +97,7 @@
"@redocly/json-to-json-schema": "^0.0.1",
"@tanstack/svelte-table": "^8.9.9",
"@windmill-labs/svelte-dnd-action": "latest",
"@xyflow/svelte": "^0.1.15",
"@xyflow/svelte": "^0.1.14",
"ag-charts-community": "^9.0.1",
"ag-charts-enterprise": "^9.0.1",
"ag-grid-community": "^31.0.0",

View File

@@ -6,7 +6,6 @@
import FlowGraphViewerStep from './FlowGraphViewerStep.svelte'
import FlowGraphV2 from './graph/FlowGraphV2.svelte'
import { dfs } from './flows/dfs'
export let flow: {
summary: string
@@ -14,7 +13,6 @@
value: FlowValue
schema?: any
}
export let overflowAuto = false
export let noSide = false
export let download = false
@@ -37,8 +35,7 @@
modules={flow?.value?.modules}
failureModule={flow?.value?.failure_module}
on:select={(e) => {
const mod = dfs(flow?.value?.modules, (m) => m).find((m) => m?.id === e?.detail)
stepDetail = mod ?? e.detail
stepDetail = e.detail
dispatch('select', stepDetail)
}}
/>

View File

@@ -87,7 +87,6 @@
{:else}
<div class="text-secondary text-xs italic mb-4">No inputs</div>
{/if}
<FlowGraphViewer download {noSide} {flow} overflowAuto />
</div>
</TabContent>

View File

@@ -8,9 +8,7 @@
import FlowModuleScript from './flows/content/FlowModuleScript.svelte'
import { createEventDispatcher } from 'svelte'
import Button from './common/button/Button.svelte'
import { ExternalLink, Pencil, ArrowRight, X, Diff, Code } from 'lucide-svelte'
import ToggleButtonGroup from './common/toggleButton-v2/ToggleButtonGroup.svelte'
import ToggleButton from './common/toggleButton-v2/ToggleButton.svelte'
import { ExternalLink, Pencil, ArrowRight, X } from 'lucide-svelte'
const dispatch = createEventDispatcher()
@@ -21,7 +19,6 @@
let deploymentMsgUpdate: string | undefined = undefined
let selectedVersion: ScriptHistory | undefined = undefined
let selectedVersionIndex: number | undefined = undefined
let versions: ScriptHistory[] | undefined = undefined
let loading: boolean = false
@@ -56,9 +53,6 @@
}
loadVersions()
let showDiff: boolean = false
let previousHash: string | undefined = undefined
</script>
<Splitpanes class="!overflow-visible">
@@ -68,34 +62,17 @@
{#if !loading}
{#if versions && versions.length > 0}
<div class="flex gap-2 flex-col">
{#each versions ?? [] as version, versionIndex}
{#each versions ?? [] as version}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
class={classNames(
'border flex gap-1 truncate justify-between flex-row w-full items-center p-2 rounded-md cursor-pointer ',
'border flex gap-1 truncate justify-between flex-row w-full items-center p-2 rounded-md cursor-pointer hover:bg-blue-50 hover:text-blue-400',
selectedVersion?.script_hash == version.script_hash
? 'bg-surface-selected'
: '',
'hover:bg-surface-hover'
? 'bg-blue-100 text-blue-600'
: ''
)}
on:click={() => {
selectedVersion = version
selectedVersionIndex = versionIndex
if (showDiff && versions && selectedVersionIndex === versions.length - 1) {
showDiff = false
}
const availableVersions = versions?.slice(selectedVersionIndex + 1)
if (
previousHash &&
!availableVersions?.find((v) => v.script_hash === previousHash)
) {
previousHash = availableVersions?.[0]?.script_hash
}
deploymentMsgUpdate = undefined
deploymentMsgUpdateMode = false
}}
@@ -132,7 +109,7 @@
<div class="h-full w-full overflow-auto">
{#if selectedVersion}
{#key selectedVersion}
<div class="flex flex-col min-h-full">
<div class="flex flex-col">
<span class="flex flex-row text-sm p-2 text-tertiary">
{#if deploymentMsgUpdateMode}
<div class="flex w-full">
@@ -191,41 +168,7 @@
</button>
{/if}
</span>
{#if selectedVersionIndex !== undefined && versions?.slice(selectedVersionIndex + 1).length}
<div class="p-2 flex flex-row items-center gap-2 h-8">
<div class="w-min">
<ToggleButtonGroup bind:selected={showDiff}>
<ToggleButton light small value={false} label="Code" icon={Code} />
<ToggleButton light small value={true} label="Diff" icon={Diff} />
</ToggleButtonGroup>
</div>
{#if showDiff}
<div class="text-xs">Versions:</div>
<select bind:value={previousHash} class="!text-xs !w-40">
{#each versions?.slice(selectedVersionIndex + 1) ?? [] as version}
<option
value={version.script_hash}
selected={version.script_hash === selectedVersion.script_hash}
class="!text-xs"
>
{version.deployment_msg ?? version.script_hash}
</option>
{/each}
</select>
{/if}
</div>
{:else}
<div class="p-2 text-xs text-secondary"> No previous version found </div>
{/if}
<FlowModuleScript
showDate
path={scriptPath}
hash={selectedVersion.script_hash}
{previousHash}
{showDiff}
/>
<FlowModuleScript showDate path={scriptPath} hash={selectedVersion.script_hash} />
</div>
{/key}
{:else}

View File

@@ -91,7 +91,6 @@
on:close={() => {
drawer?.closeDrawer()
}}
noPadding
>
<Splitpanes class="!overflow-visible">
<Pane size={20}>

View File

@@ -1,20 +1,17 @@
<script lang="ts">
import type { SupportedLanguage } from '$lib/common'
import DiffEditor from '$lib/components/DiffEditor.svelte'
import HighlightCode from '$lib/components/HighlightCode.svelte'
import TimeAgo from '$lib/components/TimeAgo.svelte'
import { ScriptService } from '$lib/gen'
import { getScriptByPath, scriptLangToEditorLang } from '$lib/scripts'
import { getScriptByPath } from '$lib/scripts'
import { workspaceStore } from '$lib/stores'
export let path: string
export let hash: string | undefined = undefined
export let previousHash: string | undefined = undefined
export let showDate = false
export let showAllCode: boolean = true
let code: string
let previousCode: string
let language: SupportedLanguage
let lock: string | undefined = undefined
let date: string | undefined = undefined
@@ -27,7 +24,6 @@
? await ScriptService.getScriptByHash({ workspace: $workspaceStore!, hash })
: await getScriptByPath(path!)
code = script.content
language = script.language
lock = script.lock
date = script.created_at
@@ -37,26 +33,11 @@
}
}
async function loadPreviousCode(previousHash: string) {
try {
const previousScript = await ScriptService.getScriptByHash({
workspace: $workspaceStore!,
hash: previousHash
})
previousCode = previousScript.content
} catch (e) {
console.error(e)
}
}
$: path && loadCode(path, hash)
$: path && previousHash && loadPreviousCode(previousHash)
function toggleShowAll() {
showAllCode = !showAllCode
}
export let showDiff: boolean = false
</script>
<div class="flex flex-col flex-1 h-full overflow-auto p-2">
@@ -66,20 +47,7 @@
{#if notFound}
<div class="text-red-400">script not found at {path} in workspace {$workspaceStore}</div>
{:else if showAllCode}
{#if showDiff}
{#key previousCode + code}
<DiffEditor
class="h-screen"
readOnly
automaticLayout
defaultLang={scriptLangToEditorLang(language)}
defaultOriginal={previousCode}
defaultModified={code}
/>
{/key}
{:else}
<HighlightCode {language} {code} />
{/if}
<HighlightCode {language} {code} />
{:else}
<div class="code-container h-full">
<HighlightCode {language} code={code?.split('\n').slice(0, 10).join('\n')} />

View File

@@ -475,7 +475,7 @@
{#if script}
<Drawer bind:open={versionsDrawerOpen} size="1200px">
<DrawerContent title="Versions History" on:close={() => (versionsDrawerOpen = false)} noPadding>
<DrawerContent title="Versions History" on:close={() => (versionsDrawerOpen = false)}>
<ScriptVersionHistory
scriptPath={script.path}
openDetails

View File

@@ -189,10 +189,10 @@
let queueMetricsDrawer: Drawer
let selectedTab: string = 'default'
$: groupedWorkers && selectedTab == 'default' && updateSelectedTabIfDefaultDoesNotExist()
$: workerGroups && selectedTab == 'default' && updateSelectedTabIfDefaultDoesNotExist()
function updateSelectedTabIfDefaultDoesNotExist() {
if (selectedTab == 'default' && !groupedWorkers.some((x) => x[0] == 'default')) {
if (selectedTab == 'default' && !workerGroups?.hasOwnProperty('default')) {
selectedTab = Object.keys(workerGroups ?? {})[0] ?? 'default'
}
}
@@ -567,7 +567,7 @@
<Cell>
<div class="flex flex-col gap-1">
<div>
{vcpus ? (vcpus / 100000).toFixed(2) + ' vCPUs' : '--'}
{vcpus ? (vcpus / 100000).toFixed(1) + ' vCPUs' : '--'}
</div>
<div>
{memory ? Math.round(memory / 1024 / 1024) + 'MB' : '--'}

View File

@@ -4,8 +4,8 @@ verify_ssl = true
name = "pypi"
[packages]
wmill = ">=1.382.1"
wmill_pg = ">=1.382.1"
wmill = ">=1.381.0"
wmill_pg = ">=1.381.0"
sendgrid = "*"
mysql-connector-python = "*"
pymongo = "*"

View File

@@ -1,7 +1,7 @@
openapi: "3.0.3"
info:
version: 1.382.1
version: 1.381.0
title: OpenFlow Spec
contact:
name: Ruben Fiszel

View File

@@ -12,7 +12,7 @@
RootModule = 'WindmillClient.psm1'
# Version number of this module.
ModuleVersion = '1.382.1'
ModuleVersion = '1.381.0'
# Supported PSEditions
# CompatiblePSEditions = @()

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "wmill"
version = "1.382.1"
version = "1.381.0"
description = "A client library for accessing Windmill server wrapping the Windmill client API"
license = "Apache-2.0"
homepage = "https://windmill.dev"

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "wmill-pg"
version = "1.382.1"
version = "1.381.0"
description = "An extension client for the wmill client library focused on pg"
license = "Apache-2.0"
homepage = "https://windmill.dev"

View File

@@ -134,7 +134,7 @@ export async function runFlow(
console.info(`running \`${path}\` synchronously with args:`, args);
}
const jobId = await runFlowAsync(path, args, null, false);
const jobId = await runFlowAsync(path, args);
return await waitJob(jobId, verbose);
}
@@ -272,8 +272,7 @@ export async function runScriptAsync(
export async function runFlowAsync(
path: string | null,
args: Record<string, any> | null,
scheduledInSeconds: number | null = null,
flowOutlivesParent: boolean = true
scheduledInSeconds: number | null = null
): Promise<string> {
// Create a script job and return its job id.
@@ -284,11 +283,9 @@ export async function runFlowAsync(
params["scheduled_in_secs"] = scheduledInSeconds;
}
if (!flowOutlivesParent) {
let parentJobId = getEnv("WM_JOB_ID");
if (parentJobId !== undefined) {
params["parent_job"] = parentJobId;
}
let parentJobId = getEnv("WM_JOB_ID");
if (parentJobId !== undefined) {
params["parent_job"] = parentJobId;
}
let rootJobId = getEnv("WM_ROOT_FLOW_JOB_ID");

View File

@@ -1,6 +1,6 @@
{
"name": "@windmill/windmill",
"version": "1.382.1",
"version": "1.381.0",
"exports": "./src/index.ts",
"publish": {
"exclude": ["!src", "./s3Types.ts", "./client.ts"]

View File

@@ -1,7 +1,7 @@
{
"name": "windmill-client",
"description": "Windmill SDK client for browsers and Node.js",
"version": "1.382.1",
"version": "1.381.0",
"author": "Ruben Fiszel",
"license": "Apache 2.0",
"devDependencies": {

View File

@@ -1 +1 @@
1.382.1
1.381.0