From dd91089436a6bdb8a64d4a1d08387e7b9aeed339 Mon Sep 17 00:00:00 2001 From: Alexander Petric Date: Tue, 1 Jul 2025 09:45:04 -0400 Subject: [PATCH 01/11] improve graphql error reporting (#6092) --- backend/windmill-worker/src/graphql_executor.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/backend/windmill-worker/src/graphql_executor.rs b/backend/windmill-worker/src/graphql_executor.rs index d9117adb53..b5a3aadc3d 100644 --- a/backend/windmill-worker/src/graphql_executor.rs +++ b/backend/windmill-worker/src/graphql_executor.rs @@ -10,9 +10,9 @@ use windmill_queue::{CanceledBy, MiniPulledJob}; use serde::Deserialize; +use crate::common::build_args_map; use crate::common::{build_http_client, resolve_job_timeout, OccupancyMetrics}; use crate::handle_child::run_future_with_polling_update_job_poller; -use crate::common::build_args_map; use windmill_common::client::AuthedClient; #[derive(Deserialize)] @@ -107,6 +107,20 @@ pub async fn do_graphql( .await .map_err(|e| Error::ExecutionErr(e.to_string()))?; + // Check HTTP status before processing response + if !response.status().is_success() { + let status = response.status(); + let error_body = response + .text() + .await + .unwrap_or_else(|_| "Failed to read error response".to_string()); + return Err(Error::ExecutionErr(format!( + "GraphQL request failed with HTTP {}: {}", + status.as_u16(), + error_body + ))); + } + let result_stream = response.bytes_stream(); let mut i = 0; From 7042a6f52db823d6b9b5ad14fa83af36880bd2d5 Mon Sep 17 00:00:00 2001 From: Guilhem Date: Tue, 1 Jul 2025 17:14:06 +0100 Subject: [PATCH 02/11] fix(frontend): only show test button for script modules (#6107) * fix(frontend): only show test button for script modules * nit --- .../flows/map/FlowModuleSchemaItem.svelte | 102 +++++++++--------- .../lib/components/flows/map/MapItem.svelte | 1 + 2 files changed, 54 insertions(+), 49 deletions(-) diff --git a/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte b/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte index cca8f3da32..b24e8bb240 100644 --- a/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte +++ b/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte @@ -76,6 +76,7 @@ inputTransform?: Record | undefined onUpdateMock?: (mock: { enabled: boolean; return_value?: unknown }) => void onEditInput?: (moduleId: string, key: string) => void + enableTestRun?: boolean } let { @@ -106,7 +107,8 @@ onTestUpTo, inputTransform, onUpdateMock, - onEditInput + onEditInput, + enableTestRun = false }: Props = $props() let pickableIds: Record | undefined = $state(undefined) @@ -462,56 +464,58 @@ {#if deletable && !action} -
- {#if (hover || selected) && outputPickerVisible} -
- {#if !testIsLoading} - - {:else} - - {/if} -
- {/if} -
+ ]} + dropdownBtnClasses="!w-4 px-1" + > + {#if testIsLoading} + + {:else} + + {/if} + + {:else} + + {/if} + + {/if} + + {/if} {/if} - {#if message.role === 'user' && message.snapshot} -
- Saved a flow snapshot - -
- {/if} {/each} {#if aiChatManager.loading && !aiChatManager.currentReply}
From 0afe3f9691d93f837b10b29a0cf125eaa175589d Mon Sep 17 00:00:00 2001 From: Guilhem Date: Tue, 1 Jul 2025 22:41:26 +0100 Subject: [PATCH 06/11] fix(frontend): improve step job load (#6109) * fix(frontend): improve step job load * nit --- .../ModulePreviewResultViewer.svelte | 24 +++--------- frontend/src/lib/components/ModuleTest.svelte | 7 +++- .../flows/content/FlowModuleComponent.svelte | 6 ++- .../flows/map/FlowModuleSchemaItem.svelte | 17 +++------ .../flows/propPicker/OutputPickerInner.svelte | 38 ++++++++++++------- 5 files changed, 46 insertions(+), 46 deletions(-) diff --git a/frontend/src/lib/components/ModulePreviewResultViewer.svelte b/frontend/src/lib/components/ModulePreviewResultViewer.svelte index 3bbe230375..4d4d6a10bf 100644 --- a/frontend/src/lib/components/ModulePreviewResultViewer.svelte +++ b/frontend/src/lib/components/ModulePreviewResultViewer.svelte @@ -24,7 +24,7 @@ disableMock?: boolean disableHistory?: boolean onUpdateMock?: (mock: { enabled: boolean; return_value?: unknown }) => void - loadingHistory?: boolean + loadingJob?: boolean } let { @@ -40,26 +40,15 @@ disableMock = false, disableHistory = false, onUpdateMock, - loadingHistory = false + loadingJob = false }: Props = $props() const { testSteps } = getContext('FlowEditorContext') let selectedJob: Job | undefined = $state(undefined) - let fetchingLastJob = false let preview: 'mock' | 'job' | undefined = $state(undefined) let jobProgressReset: () => void = $state(() => {}) - let nlastJob = $derived.by(() => { - if (testJob && testJob.type === 'CompletedJob') { - return { ...testJob, preview: true } - } - if (lastJob) { - return { ...lastJob, preview: false } - } - return undefined - }) - let forceJson = $state(false) const logJob = $derived(testJob ?? selectedJob) @@ -77,7 +66,8 @@ {/if} {/if} diff --git a/frontend/src/lib/components/ModuleTest.svelte b/frontend/src/lib/components/ModuleTest.svelte index 7f3213ce32..f12e791003 100644 --- a/frontend/src/lib/components/ModuleTest.svelte +++ b/frontend/src/lib/components/ModuleTest.svelte @@ -1,7 +1,7 @@ {#each Object.keys(components['carousellistcomponent'].initialData.configuration) as key (key)} diff --git a/frontend/src/lib/components/apps/editor/appUtils.ts b/frontend/src/lib/components/apps/editor/appUtils.ts index c299e3341f..63b83a0237 100644 --- a/frontend/src/lib/components/apps/editor/appUtils.ts +++ b/frontend/src/lib/components/apps/editor/appUtils.ts @@ -1319,6 +1319,7 @@ export function isContainer(type: string): boolean { type === 'horizontalsplitpanescomponent' || type === 'steppercomponent' || type === 'listcomponent' || + type === 'carousellistcomponent' || type === 'decisiontreecomponent' ) } @@ -1336,6 +1337,9 @@ export function subGridIndexKey(type: string | undefined, id: string, world: Wor case 'steppercomponent': { return (world?.outputsById?.[id]?.currentStepIndex?.peak() as number) ?? 0 } + case 'carousellistcomponent': { + return (world?.outputsById?.[id]?.currentIndex?.peak() as number) ?? 0 + } case 'decisiontreecomponent': { return (world?.outputsById?.[id]?.currentNodeIndex?.peak() as number) ?? 0 } diff --git a/frontend/src/lib/components/apps/editor/componentsPanel/componentControlUtils.ts b/frontend/src/lib/components/apps/editor/componentsPanel/componentControlUtils.ts index c8efd73813..a74198b562 100644 --- a/frontend/src/lib/components/apps/editor/componentsPanel/componentControlUtils.ts +++ b/frontend/src/lib/components/apps/editor/componentsPanel/componentControlUtils.ts @@ -38,7 +38,8 @@ const setValue = { const setSelectedIndex = { title: 'setSelectedIndex', - description: 'Use the setSelectedIndex function to select a row in a table or an AG Grid table.', + description: + 'Use the setSelectedIndex function to select a row in a table, an AG Grid table, or navigate to a slide in a Carousel component.', example: 'setSelectedIndex(id: string, index: number)', documentation: 'https://www.windmill.dev/docs/apps/app-runnable-panel#setselectedindex' } @@ -90,6 +91,8 @@ export function getComponentControl(type: keyof typeof components): Array void) | undefined = $state(undefined) - console.log('FOOBAR', component.type) - let selected = $state( (component.type === 'plotlycomponentv2' || component.type === 'chartjscomponentv2') && component.datasets !== undefined From 4f77fdeeb0df3591800a5c2f9831b174ecc4c2a9 Mon Sep 17 00:00:00 2001 From: centdix <40307056+centdix@users.noreply.github.com> Date: Wed, 2 Jul 2025 18:32:14 +0200 Subject: [PATCH 10/11] internal: add ee ref command (#6115) * add eeref command * fix * Update .github/workflows/git-commands.yaml Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- .../{update-sqlx.yaml => git-commands.yaml} | 72 ++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) rename .github/workflows/{update-sqlx.yaml => git-commands.yaml} (55%) diff --git a/.github/workflows/update-sqlx.yaml b/.github/workflows/git-commands.yaml similarity index 55% rename from .github/workflows/update-sqlx.yaml rename to .github/workflows/git-commands.yaml index 7632a9b705..c12b102c46 100644 --- a/.github/workflows/update-sqlx.yaml +++ b/.github/workflows/git-commands.yaml @@ -1,4 +1,4 @@ -name: Update SQLx +name: Git commands on: issue_comment: @@ -103,3 +103,73 @@ jobs: repo: context.repo.repo, body: 'Successfully ran sqlx update' }) + + update-ee-ref: + if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/eeref') + runs-on: ubicloud-standard-2 + permissions: + contents: write + pull-requests: write + issues: write + steps: + - name: Comment on PR - Starting + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Starting ee ref update...' + }) + + - name: Checkout repository + uses: actions/checkout@v3 + with: + ref: ${{ github.event.issue.pull_request.head.ref }} + fetch-depth: 0 + + - name: Checkout windmill-ee-private + uses: actions/checkout@v3 + with: + repository: windmill-labs/windmill-ee-private + path: windmill-ee-private + token: ${{ secrets.WINDMILL_EE_PRIVATE_ACCESS }} + + - name: Get last commit hash of private-repo + id: get-commit-hash + run: | + cd windmill-ee-private + COMMIT_HASH=$(git rev-parse HEAD) + echo "commit_hash=$COMMIT_HASH" >> $GITHUB_OUTPUT + echo "Latest commit hash: $COMMIT_HASH" + + - name: Update ee-repo-ref.txt + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + echo "${{ steps.get-commit-hash.outputs.commit_hash }}" > backend/ee-repo-ref.txt + echo "Updated backend/ee-repo-ref.txt with commit hash: ${{ steps.get-commit-hash.outputs.commit_hash }}" + # commit and push the changes + PR_NUMBER=${{ github.event.issue.number }} + BRANCH_NAME=$(gh pr view $PR_NUMBER --json headRefName --jq .headRefName) + echo "Checking out PR branch: $BRANCH_NAME" + git checkout $BRANCH_NAME + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add backend/ee-repo-ref.txt + git commit -m "Update ee-repo-ref.txt" || echo "No changes to commit" + git push origin $BRANCH_NAME + + - name: Comment on PR - Completed + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Successfully updated ee-repo-ref.txt' + }) From 23d624aa23e96ab3c25564b4c148e4186892de59 Mon Sep 17 00:00:00 2001 From: HugoCasa Date: Wed, 2 Jul 2025 23:28:13 +0200 Subject: [PATCH 11/11] fix: error handling for S3 file loading in py and ts clients (#6124) --- python-client/wmill/wmill/s3_reader.py | 11 +++++++++++ typescript-client/client.ts | 13 +++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/python-client/wmill/wmill/s3_reader.py b/python-client/wmill/wmill/s3_reader.py index 62161a6946..557bc9d200 100644 --- a/python-client/wmill/wmill/s3_reader.py +++ b/python-client/wmill/wmill/s3_reader.py @@ -22,6 +22,17 @@ class S3BufferedReader(BufferedReader): def __enter__(self): reader = self._context_manager.__enter__() + if reader.status_code >= 400: + error_bytes = reader.read() + try: + error_text = error_bytes.decode('utf-8') + except UnicodeDecodeError: + error_text = str(error_bytes) + raise httpx.HTTPStatusError( + f"Failed to load S3 file: {reader.status_code} {reader.reason_phrase} - {error_text}", + request=reader.request, + response=reader + ) self._iterator = reader.iter_bytes() return self diff --git a/typescript-client/client.ts b/typescript-client/client.ts index 25de187598..f2388d2962 100644 --- a/typescript-client/client.ts +++ b/typescript-client/client.ts @@ -717,7 +717,7 @@ export async function loadS3FileStream( const queryParams = new URLSearchParams(params); // We use raw fetch here b/c OpenAPI generated client doesn't handle Blobs nicely - const fileContentBlob = await fetch( + const response = await fetch( `${ OpenAPI.BASE }/w/${getWorkspace()}/job_helpers/download_s3_file?${queryParams}`, @@ -728,7 +728,16 @@ export async function loadS3FileStream( }, } ); - return fileContentBlob.blob(); + + // Check if the response was successful + if (!response.ok) { + const errorText = await response.text(); + throw new Error( + `Failed to load S3 file: ${response.status} ${response.statusText} - ${errorText}` + ); + } + + return response.blob(); } /**