Skip to content

Conversation

@pyranota
Copy link
Contributor

@pyranota pyranota commented Jan 5, 2026

Drastically improve sync jobs performance.

Screenshot 2026-01-05 at 14-08-03 WM Deploy 15 objects · pyranota_test-git-sync-windmill@80193b0 Screenshot 2026-01-05 at 14-07-37 Runs Windmill

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 5, 2026

Deploying windmill with  Cloudflare Pages  Cloudflare Pages

Latest commit: ed3ebc5
Status: ✅  Deploy successful!
Preview URL: https://d668be9a.windmill.pages.dev
Branch Preview URL: https://git-sync-debouncing.windmill.pages.dev

View logs

@pyranota pyranota marked this pull request as ready for review January 5, 2026 16:28
@claude
Copy link
Contributor

claude bot commented Jan 5, 2026

Claude finished @pyranota's task in 2m 41s —— View job


PR Review Complete

  • Analyze the PR context and changes
  • Review the code changes for quality and best practices
  • Check for potential bugs or issues
  • Evaluate performance considerations
  • Assess security implications
  • Provide comprehensive feedback

Summary

This PR adds debouncing support for git-sync jobs (DeploymentCallback), which should improve performance by reducing redundant sync operations when multiple deployments happen in quick succession.

Critical Issues

  1. ⚠️ Cargo.toml default features changed - The default features were changed from [] to ["enterprise", "private", "python", "license"]. This appears to be a local development configuration that should not be merged as it would enable enterprise features by default in the open-source build.

Issues to Address

  1. Placeholder version (worker.rs:1300) - The version 1.999.0 with // todo comment needs to be updated to the actual release version before merge.

  2. Typo (workspaces.rs:71) - Comment says "emit" but should say "omit".

Design Considerations

  1. Hub script ID assumption (workspaces.rs:67-88) - The is_script_meets_min_version method assumes hub script IDs are sequential. This assumption may be fragile if scripts are deleted or if the path doesn't follow the expected hub/{id}/{name} format.

What Looks Good

  • The DebouncingSettings integration into DeploymentCallback follows the existing pattern used by other job types
  • The concurrency settings for git-sync jobs are preserved (concurrent_limit: Some(1))
  • The feature flag pattern with MIN_VERSION_SUPPORTS_SYNC_JOBS_DEBOUNCING ensures backward compatibility

Testing Instructions

To verify the git-sync debouncing feature:

Navigate to a workspace with git-sync configured (Workspace Settings → Git Sync). Deploy multiple scripts or flows in quick succession (e.g., via the UI or API). Observe that instead of creating individual sync jobs for each deployment, the system should debounce these into fewer sync operations. Check the Runs page filtered by "deployment_callback" jobs to verify the debouncing behavior - you should see consolidated commits like "[WM]: Deploy 15 objects" instead of 15 separate sync jobs.

Comment on lines 67 to 88
pub fn is_script_meets_min_version(&self, min_version: u32) -> error::Result<bool> {
// example: "hub/28102/sync-script-to-git-repo-windmill"
let current: u32 = self
.script_path
.split("/") // -> ["hub" "28102" "sync-script-to-git-repo-windmill"]
.skip(1) // emit "hub"
.next() // get numeric id
.ok_or(Error::InternalErr(format!(
"cannot get script version id from: {}",
&self.script_path
)))
.and_then(|s| {
s.parse().map_err(|e| {
Error::InternalErr(format!(
"cannot get script version id from: {}. e: {e}",
&self.script_path
))
})
})?;

Ok(current >= min_version) // this works on assumption that all scripts in hub have sequential ids
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concern: Assumption about sequential hub script IDs

The comment states this "works on assumption that all scripts in hub have sequential ids". This assumption may be fragile:

  1. Hub scripts could be deleted - IDs might not be strictly sequential
  2. Different hub scripts - Not all hub scripts are the sync script; comparing IDs across different scripts doesn't indicate version
  3. Non-hub paths - If script_path doesn't follow the hub/{id}/{name} format, this will fail

Consider adding more robust error handling or documentation about when this method should be called and what guarantees exist about hub script ID ordering.

pyranota and others added 5 commits January 5, 2026 17:31
Signed-off-by: pyranota <[email protected]>
Signed-off-by: pyranota <[email protected]>
This commit updates the EE repository reference after PR #371 was merged in windmill-ee-private.

Previous ee-repo-ref: 346d38e91776e987f88866543adbf78a9c721073

New ee-repo-ref: bc904859dd66c55ebad002e8526103c73de841cd

Automated by sync-ee-ref workflow.
@windmill-internal-app
Copy link
Contributor

🤖 Updated ee-repo-ref.txt to bc904859dd66c55ebad002e8526103c73de841cd after windmill-ee-private PR #371 was merged.

@rubenfiszel rubenfiszel merged commit b31d8df into main Jan 7, 2026
10 checks passed
@rubenfiszel rubenfiszel deleted the git-sync-debouncing branch January 7, 2026 04:07
@github-actions github-actions bot locked and limited conversation to collaborators Jan 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants