Compare commits

..

15 Commits

Author SHA1 Message Date
Ruben Fiszel
020e5f7b32 update metrics 2023-02-27 11:56:55 +01:00
Ruben Fiszel
1414030afe chore(main): release 1.70.1 (#1241) 2023-02-27 10:41:23 +01:00
Ruben Fiszel
92bf928b78 chore(main): release 1.70.1 (#1239)
* chore(main): release 1.70.1

* Apply automatic changes

---------

Co-authored-by: rubenfiszel <rubenfiszel@users.noreply.github.com>
2023-02-27 10:41:23 +01:00
Faton Ramadani
0bcc036a84 fix(frontend): Fix inline scripts list (#1240) 2023-02-27 10:41:23 +01:00
Faton Ramadani
6277188c1b fix(frontend): Fix subgrid lock (#1232)
* fix(frontend): Fix subgrid lock

* feat(frontend): restore
2023-02-27 10:41:23 +01:00
Ruben Fiszel
65c9d43419 fix findGridItemById 2023-02-27 10:41:23 +01:00
Faton Ramadani
cc5744ee2d fix(frontend): Disable move in nested subgrid (#1238)
* fix(frontend): Disable move in nested subgrid

* fix(frontend): Disable move in nested subgrid
2023-02-27 10:41:23 +01:00
Ruben Fiszel
1e796881b3 fix(cli): make cli resilient to systems without openable browsers 2023-02-27 10:41:23 +01:00
Ruben Fiszel
a55d99a8b7 chore(main): release 1.70.0 (#1236)
* chore(main): release 1.70.0

* Apply automatic changes

---------

Co-authored-by: rubenfiszel <rubenfiszel@users.noreply.github.com>
2023-02-27 10:41:23 +01:00
Ruben Fiszel
07477f9e35 fix(cli): bump cli to non broken client 1.69.3 2023-02-27 10:41:23 +01:00
Ruben Fiszel
9409d5e266 update 2023-02-27 10:41:23 +01:00
Ruben Fiszel
2d71ebbe09 fix stripe checkout 2023-02-27 10:41:23 +01:00
Ruben Fiszel
c1673ac036 update 2023-02-27 08:27:08 +01:00
Ruben Fiszel
8ca54e02c0 Merge branch 'main' into rf/diff3 2023-02-27 08:23:29 +01:00
Ruben Fiszel
53ddf013df foo 2023-02-24 11:01:45 +01:00
24 changed files with 1337 additions and 120 deletions

View File

@@ -1,6 +1,25 @@
# Changelog
## [1.70.1](https://github.com/windmill-labs/windmill/compare/v1.70.0...v1.70.1) (2023-02-27)
### Bug Fixes
* **cli:** make cli resilient to systems without openable browsers ([c051ffe](https://github.com/windmill-labs/windmill/commit/c051ffeb42c1cff609f93da7745036ea722e17d4))
* **frontend:** Disable move in nested subgrid ([#1238](https://github.com/windmill-labs/windmill/issues/1238)) ([70eab30](https://github.com/windmill-labs/windmill/commit/70eab303bd45111ae198d9b710bfd6f9f59e53b0))
* **frontend:** Fix inline scripts list ([#1240](https://github.com/windmill-labs/windmill/issues/1240)) ([97602ac](https://github.com/windmill-labs/windmill/commit/97602ac6db1404d36d160a431ffcea6c0f567a48))
* **frontend:** Fix subgrid lock ([#1232](https://github.com/windmill-labs/windmill/issues/1232)) ([8ee9d67](https://github.com/windmill-labs/windmill/commit/8ee9d67f4faa91446338b41c664ef91913eb8b81))
## [1.70.1](https://github.com/windmill-labs/windmill/compare/v1.70.0...v1.70.1) (2023-02-27)
### Bug Fixes
* **cli:** make cli resilient to systems without openable browsers ([c051ffe](https://github.com/windmill-labs/windmill/commit/c051ffeb42c1cff609f93da7745036ea722e17d4))
* **frontend:** Disable move in nested subgrid ([#1238](https://github.com/windmill-labs/windmill/issues/1238)) ([70eab30](https://github.com/windmill-labs/windmill/commit/70eab303bd45111ae198d9b710bfd6f9f59e53b0))
* **frontend:** Fix subgrid lock ([#1232](https://github.com/windmill-labs/windmill/issues/1232)) ([8ee9d67](https://github.com/windmill-labs/windmill/commit/8ee9d67f4faa91446338b41c664ef91913eb8b81))
## [1.70.0](https://github.com/windmill-labs/windmill/compare/v1.69.3...v1.70.0) (2023-02-27)

52
backend/Cargo.lock generated
View File

@@ -255,9 +255,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "axum"
version = "0.6.8"
version = "0.6.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bd379e511536bad07447f899300aa526e9bae8e6f66dc5e5ca45d7587b7c1ec"
checksum = "6137c6234afb339e75e764c866e3594900f0211e1315d33779f269bbe2ec6967"
dependencies = [
"async-trait",
"axum-core",
@@ -282,7 +282,7 @@ dependencies = [
"sync_wrapper",
"tokio",
"tower",
"tower-http 0.3.5",
"tower-http",
"tower-layer",
"tower-service",
]
@@ -4141,25 +4141,6 @@ dependencies = [
"tower-service",
]
[[package]]
name = "tower-http"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858"
dependencies = [
"bitflags",
"bytes",
"futures-core",
"futures-util",
"http",
"http-body",
"http-range-header",
"pin-project-lite",
"tower",
"tower-layer",
"tower-service",
]
[[package]]
name = "tower-http"
version = "0.4.0"
@@ -4174,6 +4155,7 @@ dependencies = [
"http-body",
"http-range-header",
"pin-project-lite",
"tower",
"tower-layer",
"tower-service",
"tracing",
@@ -4774,7 +4756,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windmill"
version = "1.70.0"
version = "1.70.1"
dependencies = [
"anyhow",
"axum",
@@ -4801,7 +4783,7 @@ dependencies = [
[[package]]
name = "windmill-api"
version = "1.70.0"
version = "1.70.1"
dependencies = [
"anyhow",
"argon2",
@@ -4840,7 +4822,7 @@ dependencies = [
"tokio-util",
"tower",
"tower-cookies",
"tower-http 0.4.0",
"tower-http",
"tracing",
"tracing-subscriber",
"urlencoding",
@@ -4856,7 +4838,7 @@ dependencies = [
[[package]]
name = "windmill-api-client"
version = "1.70.0"
version = "1.70.1"
dependencies = [
"base64 0.21.0",
"chrono",
@@ -4871,7 +4853,7 @@ dependencies = [
[[package]]
name = "windmill-audit"
version = "1.70.0"
version = "1.70.1"
dependencies = [
"chrono",
"serde",
@@ -4884,7 +4866,7 @@ dependencies = [
[[package]]
name = "windmill-common"
version = "1.70.0"
version = "1.70.1"
dependencies = [
"anyhow",
"axum",
@@ -4909,7 +4891,7 @@ dependencies = [
[[package]]
name = "windmill-parser"
version = "1.70.0"
version = "1.70.1"
dependencies = [
"serde",
"serde_json",
@@ -4917,7 +4899,7 @@ dependencies = [
[[package]]
name = "windmill-parser-bash"
version = "1.70.0"
version = "1.70.1"
dependencies = [
"anyhow",
"itertools",
@@ -4931,7 +4913,7 @@ dependencies = [
[[package]]
name = "windmill-parser-go"
version = "1.70.0"
version = "1.70.1"
dependencies = [
"anyhow",
"itertools",
@@ -4943,7 +4925,7 @@ dependencies = [
[[package]]
name = "windmill-parser-py"
version = "1.70.0"
version = "1.70.1"
dependencies = [
"anyhow",
"itertools",
@@ -4958,7 +4940,7 @@ dependencies = [
[[package]]
name = "windmill-parser-ts"
version = "1.70.0"
version = "1.70.1"
dependencies = [
"anyhow",
"deno_core",
@@ -4972,7 +4954,7 @@ dependencies = [
[[package]]
name = "windmill-queue"
version = "1.70.0"
version = "1.70.1"
dependencies = [
"anyhow",
"chrono",
@@ -4995,7 +4977,7 @@ dependencies = [
[[package]]
name = "windmill-worker"
version = "1.70.0"
version = "1.70.1"
dependencies = [
"anyhow",
"async-recursion",

View File

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

View File

@@ -0,0 +1 @@
-- Add down migration script here

View File

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

View File

@@ -351,7 +351,10 @@ pub async fn push<'c>(
.unwrap_or(false);
if !is_super_admin {
if usage > MAX_FREE_EXECS {
if usage > MAX_FREE_EXECS
&& !matches!(job_payload, JobPayload::Dependencies { .. })
&& !matches!(job_payload, JobPayload::FlowDependencies { .. })
{
return Err(error::Error::BadRequest(format!(
"User {email} has exceeded the free usage limit of {MAX_FREE_EXECS} that applies outside of premium workspaces."
)));
@@ -466,10 +469,10 @@ pub async fn push<'c>(
}
JobPayload::Flow(flow) => {
let value_json = sqlx::query_scalar!(
"SELECT value FROM flow WHERE path = $1 AND workspace_id = $2",
flow,
workspace_id
)
"SELECT value FROM flow WHERE path = $1 AND workspace_id = $2",
flow,
workspace_id
)
.fetch_optional(&mut tx)
.await?
.ok_or_else(|| Error::InternalErr(format!("not found flow at path {:?}", flow)))?;

View File

@@ -383,7 +383,7 @@ lazy_static::lazy_static! {
.unwrap();
static ref WORKER_UPTIME_OPTS: prometheus::Opts = prometheus::opts!(
"worker_uptime",
"Total number of milliseconds since the worker has started"
"Total number of seconds since the worker has started"
);
static ref TIMEOUT: u16 = std::env::var("TIMEOUT")
@@ -445,15 +445,11 @@ pub async fn run_worker(
insert_initial_ping(worker_instance, &worker_name, ip, db).await;
let uptime_metric = prometheus::register_int_counter!(WORKER_UPTIME_OPTS
let uptime_metric = prometheus::register_counter!(WORKER_UPTIME_OPTS
.clone()
.const_label("name", &worker_name))
.unwrap();
uptime_metric.inc_by(
((Instant::now() - start_time).as_millis() - uptime_metric.get() as u128)
.try_into()
.unwrap(),
);
let worker_execution_duration = prometheus::register_histogram_vec!(
prometheus::HistogramOpts::new(
@@ -465,6 +461,14 @@ pub async fn run_worker(
)
.expect("register prometheus metric");
let worker_execution_duration_counter = prometheus::register_counter!(prometheus::opts!(
"worker_execution_duration_counter",
"Total number of seconds spent executing jobs"
)
.const_label("name", &worker_name))
.expect("register prometheus metric");
let worker_sleep_duration = prometheus::register_histogram!(prometheus::HistogramOpts::new(
"worker_sleep_duration",
"Duration sleeping waiting for job",
@@ -472,6 +476,15 @@ pub async fn run_worker(
.const_label("name", &worker_name),)
.expect("register prometheus metric");
let worker_sleep_duration_counter = prometheus::register_counter!(prometheus::opts!(
"worker_execution_sleep_counter",
"Total number of seconds spent sleeping between pulling jobs from the queue"
)
.const_label("name", &worker_name))
.expect("register prometheus metric");
let worker_pull_duration = prometheus::register_histogram!(prometheus::HistogramOpts::new(
"worker_pull_duration",
"Duration pulling next job",
@@ -479,6 +492,13 @@ pub async fn run_worker(
.const_label("name", &worker_name),)
.expect("register prometheus metric");
let worker_pull_duration_counter = prometheus::register_counter!(prometheus::opts!(
"worker_pull_sleep_counter",
"Total number of seconds spent pulling jobs (if growing large the db is undersized)"
)
.const_label("name", &worker_name))
.expect("register prometheus metric");
let worker_execution_failed = prometheus::register_int_counter_vec!(
prometheus::Opts::new("worker_execution_failed", "Number of failed jobs",)
.const_label("name", &worker_name),
@@ -526,11 +546,12 @@ pub async fn run_worker(
worker_busy.set(0);
uptime_metric.inc_by(
((Instant::now() - start_time).as_millis() - uptime_metric.get() as u128)
(((Instant::now() - start_time).as_millis() as f64)/1000.0 - uptime_metric.get())
.try_into()
.unwrap(),
);
let do_break = async {
if last_ping.elapsed().as_secs() > NUM_SECS_ENV_CHECK {
sqlx::query!(
@@ -574,7 +595,8 @@ pub async fn run_worker(
(job, timer) = {
let timer = worker_pull_duration.start_timer();
pull(&db, WHITELIST_WORKSPACES.clone(), BLACKLIST_WORKSPACES.clone()).map(|x| (x, timer)) } => {
drop(timer);
let duration_pull_s = timer.stop_and_record();
worker_pull_duration_counter.inc_by(duration_pull_s);
(false, job)
},
}
@@ -680,6 +702,8 @@ pub async fn run_worker(
.await;
};
let duration = _timer.stop_and_record();
worker_execution_duration_counter.inc_by(duration);
if !*KEEP_JOB_DIR && !(is_flow && same_worker) {
let _ = tokio::fs::remove_dir_all(job_dir).await;
@@ -689,9 +713,9 @@ pub async fn run_worker(
let _timer = worker_sleep_duration
.start_timer();
tokio::time::sleep(Duration::from_millis(*SLEEP_QUEUE)).await;
let duration = _timer.stop_and_record();
worker_sleep_duration_counter.inc_by(duration);
}
Err(err) => {
tracing::error!(worker = %worker_name, "run_worker: pulling jobs: {}", err);

View File

@@ -51,9 +51,11 @@ export async function browserLogin(
const url = `${baseUrl}user/cli?port=${port}`
console.log(`Login by going to ${url}`);
try {
open(url)
await open(url)
console.log("Opened browser for you");
} catch { }
} catch {
console.error(`Failed to open browser, please navigate to ${url}`)
}
const firstConnection = await server.accept();
const httpFirstConnection = Deno.serveHttp(firstConnection);
const firstRequest = (await httpFirstConnection.nextRequest())!;

View File

@@ -13,7 +13,7 @@ import sync from "./sync.ts";
import { tryResolveVersion } from "./context.ts";
import { GlobalOptions } from "./types.ts";
const VERSION = "v1.70.0";
const VERSION = "v1.70.1";
let command: any = new Command()
.name("wmill")

View File

@@ -1,12 +1,12 @@
{
"name": "windmill",
"version": "1.70.0",
"version": "1.70.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "windmill",
"version": "1.70.0",
"version": "1.70.1",
"dependencies": {
"@fortawesome/free-brands-svg-icons": "^6.2.1",
"@fortawesome/free-solid-svg-icons": "^6.2.1",

View File

@@ -1,6 +1,6 @@
{
"name": "windmill",
"version": "1.70.0",
"version": "1.70.1",
"scripts": {
"dev": "vite dev",
"build": "vite build",

View File

@@ -36,7 +36,6 @@
import UnsavedConfirmationModal from '$lib/components/common/confirmationModal/UnsavedConfirmationModal.svelte'
import { page } from '$app/stores'
import CssSettings from './componentsPanel/CssSettings.svelte'
import { findGridItem } from './appUtils'
export let app: App
export let path: string

View File

@@ -5,6 +5,7 @@
import { columnConfiguration, isFixed, toggleFixed } from '../gridUtils'
import type { AppEditorContext, GridItem } from '../types'
import Component from './component/Component.svelte'
import { findGridItem } from './appUtils'
export let containerHeight: number
export let noPadding = false
@@ -48,7 +49,7 @@
}
function lock(gridComponent: GridItem) {
let fComponent = $app.grid.find((c) => c.id === gridComponent.id)
let fComponent = findGridItem($app, gridComponent.data.id)
if (fComponent) {
fComponent = toggleFixed(fComponent)
}

View File

@@ -1,6 +1,6 @@
import { getNextId } from '$lib/components/flows/flowStateUtils'
import type { App, FocusedGrid, GridItem } from '../types'
import { Component, getRecommendedDimensionsByComponent, type AppComponent } from './component'
import { getRecommendedDimensionsByComponent, type AppComponent } from './component'
import gridHelp from '@windmill-labs/svelte-grid/src/utils/helper'
import { gridColumns } from '../gridUtils'
import { allItems } from '../utils'
@@ -10,27 +10,11 @@ function findGridItemById(
subGrids: Record<string, GridItem[]> | undefined,
id: string
): GridItem | undefined {
for (const gridItem of root) {
for (const gridItem of allItems(root, subGrids)) {
if (gridItem.id === id) {
return gridItem
}
if (subGrids) {
const numberOfSubgrids = gridItem.data.numberOfSubgrids
if (numberOfSubgrids) {
for (let i = 0; i < numberOfSubgrids; i++) {
const subgrid = subGrids[`${gridItem.id}-${i}`] ?? []
const found = findGridItemById(subgrid, subGrids, id)
if (found) {
return found
}
}
}
}
}
return undefined
}

View File

@@ -21,7 +21,7 @@
}
}
$: runnables = getAppScripts($lazyGrid)
$: runnables = getAppScripts($lazyGrid, $app.subgrids)
// When selected component changes, update selectedScriptComponentId
$: if ($selectedComponent != selectedScriptComponentId) {

View File

@@ -1,11 +1,11 @@
import type { Schema } from "$lib/common";
import type { AppInputs, Runnable } from "../../inputType"
import type { GridItem } from "../../types"
import { fieldTypeToTsType, schemaToInputsSpec } from "../../utils";
import type { AppComponent } from "../component";
import type { Schema } from '$lib/common'
import type { AppInputs, Runnable } from '../../inputType'
import type { GridItem } from '../../types'
import { fieldTypeToTsType, schemaToInputsSpec } from '../../utils'
import type { AppComponent } from '../component'
export interface AppScriptsList {
inline: { name: string; id: string }[],
inline: { name: string; id: string }[]
imported: { name: string; id: string }[]
}
@@ -42,38 +42,50 @@ export function computeFields(schema: Schema, defaultUserInput: boolean, fields:
return result
}
export function getAppScripts(grid: GridItem[]) {
return grid.reduce((acc, gridComponent) => {
const component: AppComponent = gridComponent.data
const componentInput = component.componentInput
function processGridItemRunnable(gridItem: GridItem, list: AppScriptsList): AppScriptsList {
const component: AppComponent = gridItem.data
const componentInput = component.componentInput
if (component.type === 'tablecomponent') {
component.actionButtons.forEach((actionButton) => {
if (actionButton.componentInput?.type !== 'runnable') {
return
}
processRunnable(actionButton.componentInput.runnable, actionButton.id, list)
})
}
if (componentInput?.type === 'runnable') {
processRunnable(componentInput.runnable, gridItem.id, list)
}
return list
}
if (component.type === 'tablecomponent') {
component.actionButtons.forEach((actionButton) => {
if (actionButton.componentInput?.type !== 'runnable') { return }
processRunnable(
actionButton.componentInput.runnable,
actionButton.id,
acc
)
export function getAppScripts(
lazyGrid: GridItem[],
subgrids: Record<string, GridItem[]> | undefined
): AppScriptsList {
const scriptsList = lazyGrid.reduce(
(acc, gridComponent) => processGridItemRunnable(gridComponent, acc),
{ inline: [], imported: [] } as AppScriptsList
)
if (subgrids) {
Object.values(subgrids).forEach((subgrid: GridItem[]) => {
subgrid.forEach((subgridComponent: GridItem) => {
processGridItemRunnable(subgridComponent, scriptsList)
})
}
if (componentInput?.type === 'runnable') {
processRunnable(
componentInput.runnable,
gridComponent.id,
acc
)
}
})
}
return acc
}, { inline: [], imported: [] } as AppScriptsList)
return scriptsList
}
function processRunnable(runnable: Runnable, id: string, list: AppScriptsList) {
if (runnable?.type === undefined) { return }
if (runnable?.type === undefined) {
return
}
const type: keyof AppScriptsList = runnable.type === 'runnableByPath' ? 'imported' : 'inline'
list[type].push({
name: runnable[runnable.type === 'runnableByPath' ? 'path' : 'name'],
id
})
}
}

View File

@@ -4,7 +4,13 @@
import { faCopy } from '@fortawesome/free-solid-svg-icons'
import { getContext } from 'svelte'
import type { App, AppEditorContext } from '../../types'
import { createNewGridItem, deleteGridItem, findGridItem, insertNewGridItem } from '../appUtils'
import {
createNewGridItem,
deleteGridItem,
findGridItem,
getAllSubgridsAndComponentIds,
insertNewGridItem
} from '../appUtils'
import type { AppComponent } from '../component'
export let component: AppComponent | undefined
@@ -73,6 +79,8 @@
value: 'main-grid',
disabled: parent === undefined
}
$: [subgrids] = component ? getAllSubgridsAndComponentIds($app, component) : [[], []]
$: availableGrids = listAllSubGrids($app)
$: options = availableGrids
? [
@@ -80,7 +88,7 @@
...availableGrids?.map((grid) => ({
label: grid,
value: grid,
disabled: grid === parent || (component && grid.startsWith(component.id))
disabled: grid === parent || subgrids.includes(grid)
}))
]
: [defaultOption]

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "wmill"
version = "1.70.0"
version = "1.70.1"
description = "A client library for accessing Windmill server wrapping the Windmill client API"
license = "Apache-2.0"
homepage = "https://windmill.dev"
@@ -16,7 +16,7 @@ include = ["wmill/py.typed"]
[tool.poetry.dependencies]
python = "^3.7"
windmill-api = "^1.70.0"
windmill-api = "^1.70.1"
[build-system]
requires = ["poetry>=1.0.2", "poetry-dynamic-versioning"]

View File

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

View File

@@ -1 +1 @@
1.70.0
1.70.1