From 362ae248fe899368fee05046976f01bc2f128c3f Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 15 Apr 2026 16:50:18 -0400 Subject: [PATCH] fix: per-branch concurrency key for promotion-mode git sync (#8844) * [ee] fix: per-branch concurrency key for promotion-mode git sync jobs Co-Authored-By: Claude Opus 4.6 (1M context) * chore: bump ee-repo-ref for per-branch concurrency key Co-Authored-By: Claude Opus 4.6 (1M context) * chore: update ee-repo-ref to 7bc0fdb8647268c7afa67b4b0bed69c897eaf92a This commit updates the EE repository reference after PR #537 was merged in windmill-ee-private. Previous ee-repo-ref: b933874649a63c5266a33360a95e3c163acc6b5f New ee-repo-ref: 7bc0fdb8647268c7afa67b4b0bed69c897eaf92a Automated by sync-ee-ref workflow. --------- Co-authored-by: Claude Opus 4.6 (1M context) Co-authored-by: windmill-internal-app[bot] --- backend/ee-repo-ref.txt | 2 +- backend/windmill-queue/src/jobs.rs | 35 +++++++++++++++++++----------- backend/windmill-types/src/jobs.rs | 4 ++++ 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/backend/ee-repo-ref.txt b/backend/ee-repo-ref.txt index dc01a40e29..a694fc939e 100644 --- a/backend/ee-repo-ref.txt +++ b/backend/ee-repo-ref.txt @@ -1 +1 @@ -e587df81d31638259efec13d0e68e54c890fdc2e \ No newline at end of file +7bc0fdb8647268c7afa67b4b0bed69c897eaf92a diff --git a/backend/windmill-queue/src/jobs.rs b/backend/windmill-queue/src/jobs.rs index dff7b49203..a81e151b0b 100644 --- a/backend/windmill-queue/src/jobs.rs +++ b/backend/windmill-queue/src/jobs.rs @@ -3638,8 +3638,11 @@ pub fn resolve_debounce_key<'b>( .join(":"), )); - tracing::debug!("Original debounce key (len={}): {}", original_debounce_key.len(), original_debounce_key); - + tracing::debug!( + "Original debounce key (len={}): {}", + original_debounce_key.len(), + original_debounce_key + ); // If debounce_key is not too long (< 255 chars), keep it as is, otherwise hash it. // On cloud, we prepend "{workspace_id}:" so we must reserve space for that prefix @@ -5383,17 +5386,23 @@ async fn push_inner<'c, 'd>( ..Default::default() } } - JobPayload::DeploymentCallback { path, debouncing_settings } => JobPayloadUntagged { - runnable_path: Some(path.clone()), - job_kind: JobKind::DeploymentCallback, - concurrency_settings: ConcurrencySettings { - concurrency_key: Some(format!("{workspace_id}:git_sync")), - concurrent_limit: Some(1), - concurrency_time_window_s: Some(0), - }, - debouncing_settings, - ..Default::default() - }, + JobPayload::DeploymentCallback { path, debouncing_settings, concurrency_key_append } => { + let concurrency_key = match concurrency_key_append { + Some(suffix) => format!("{workspace_id}:git_sync:{suffix}"), + None => format!("{workspace_id}:git_sync"), + }; + JobPayloadUntagged { + runnable_path: Some(path.clone()), + job_kind: JobKind::DeploymentCallback, + concurrency_settings: ConcurrencySettings { + concurrency_key: Some(concurrency_key), + concurrent_limit: Some(1), + concurrency_time_window_s: Some(0), + }, + debouncing_settings, + ..Default::default() + } + } JobPayload::Identity => { JobPayloadUntagged { job_kind: JobKind::Identity, ..Default::default() } } diff --git a/backend/windmill-types/src/jobs.rs b/backend/windmill-types/src/jobs.rs index 9261302272..01fe78a5a3 100644 --- a/backend/windmill-types/src/jobs.rs +++ b/backend/windmill-types/src/jobs.rs @@ -476,6 +476,10 @@ pub enum JobPayload { DeploymentCallback { path: String, debouncing_settings: DebouncingSettings, + // Per-invocation suffix appended to the `{workspace_id}:git_sync` concurrency key. + // Used in promotion mode so sync jobs targeting different branches run in parallel + // instead of serializing through a single workspace-wide key. + concurrency_key_append: Option, }, Identity, Noop,