mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-18 16:02:10 +00:00
fix: accept ssh/scheme-less git repo urls and $var: refs in app repo resolution (#10246)
* fix(git-sync): accept ssh/scheme-less repo urls and $var: refs in app repo resolution Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(git-sync): interpolate repo urls at github-call sites only, not in persisted markers Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * chore: update ee-repo-ref to 183f78b3ee193d6b5e55fd453c570f94a12c8b13 This commit updates the EE repository reference after PR #681 was merged in windmill-ee-private. Previous ee-repo-ref: 9bc5018f68edf3a9f256ef6315ad6ddf4fba3a45 New ee-repo-ref: 183f78b3ee193d6b5e55fd453c570f94a12c8b13 Automated by sync-ee-ref workflow. --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
This commit is contained in:
@@ -1 +1 @@
|
||||
8bf73f803158bcbf7b8d55a36f4a1ebfcc1bbcd9
|
||||
183f78b3ee193d6b5e55fd453c570f94a12c8b13
|
||||
|
||||
@@ -3523,7 +3523,8 @@ async fn edit_git_sync_config(
|
||||
tracing::warn!("git auto-pull: webhook field persist error: {}", e);
|
||||
}
|
||||
for (path, hook_id) in removed_webhooks {
|
||||
if let Ok(url) = windmill_common::git_sync_ee::resolve_repo_url(&db, &w_id, &path).await
|
||||
if let Ok(url) =
|
||||
windmill_common::git_sync_ee::resolve_repo_url_interpolated(&db, &w_id, &path).await
|
||||
{
|
||||
let _ =
|
||||
windmill_common::git_sync_ee::delete_repo_webhook(&db, &w_id, &url, hook_id)
|
||||
@@ -3882,7 +3883,7 @@ async fn delete_git_sync_repository(
|
||||
// Removal is durable now — best-effort delete the GitHub webhook.
|
||||
#[cfg(all(feature = "enterprise", feature = "private"))]
|
||||
if let Some(hook_id) = webhook_to_delete {
|
||||
if let Ok(url) = windmill_common::git_sync_ee::resolve_repo_url(
|
||||
if let Ok(url) = windmill_common::git_sync_ee::resolve_repo_url_interpolated(
|
||||
&db,
|
||||
&w_id,
|
||||
&request.git_repo_resource_path,
|
||||
@@ -7071,7 +7072,8 @@ async fn attach_dev_workspace(
|
||||
// (their auto_pull is gone), so remove them from GitHub.
|
||||
#[cfg(all(feature = "enterprise", feature = "private"))]
|
||||
for (path, hook_id) in stripped_webhooks {
|
||||
if let Ok(url) = windmill_common::git_sync_ee::resolve_repo_url(&db, &dev_w_id, &path).await
|
||||
if let Ok(url) =
|
||||
windmill_common::git_sync_ee::resolve_repo_url_interpolated(&db, &dev_w_id, &path).await
|
||||
{
|
||||
let _ =
|
||||
windmill_common::git_sync_ee::delete_repo_webhook(&db, &dev_w_id, &url, hook_id)
|
||||
|
||||
@@ -805,7 +805,8 @@ pub(crate) async fn change_workspace_id(
|
||||
#[cfg(all(feature = "enterprise", feature = "private"))]
|
||||
for (path, hook_id) in stale_webhooks {
|
||||
if let Ok(url) =
|
||||
windmill_common::git_sync_ee::resolve_repo_url(&db, &rw.new_id, &path).await
|
||||
windmill_common::git_sync_ee::resolve_repo_url_interpolated(&db, &rw.new_id, &path)
|
||||
.await
|
||||
{
|
||||
let _ =
|
||||
windmill_common::git_sync_ee::delete_repo_webhook(&db, &rw.new_id, &url, hook_id)
|
||||
|
||||
@@ -1081,14 +1081,19 @@ async fn maybe_open_git_sync_deploy_pr(
|
||||
return;
|
||||
};
|
||||
|
||||
let repo_url =
|
||||
match windmill_common::git_sync_ee::resolve_repo_url(db, workspace_id, &repo_path).await {
|
||||
Ok(url) => url,
|
||||
Err(e) => {
|
||||
tracing::warn!("git sync PR: could not resolve repo url for {repo_path}: {e:#}");
|
||||
return;
|
||||
}
|
||||
};
|
||||
let repo_url = match windmill_common::git_sync_ee::resolve_repo_url_interpolated(
|
||||
db,
|
||||
workspace_id,
|
||||
&repo_path,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(url) => url,
|
||||
Err(e) => {
|
||||
tracing::warn!("git sync PR: could not resolve repo url for {repo_path}: {e:#}");
|
||||
return;
|
||||
}
|
||||
};
|
||||
// A fork of a dev workspace diverged from the dev's label branch, so its PR
|
||||
// merges back there; everything else targets the tracked branch.
|
||||
let pr_base = row.parent_dev_workspace_label.as_deref().unwrap_or(&base);
|
||||
@@ -1252,9 +1257,22 @@ async fn maybe_post_git_sync_check(
|
||||
(None, Some(deploy)) => (true, deploy),
|
||||
(None, None) => return,
|
||||
};
|
||||
let Ok(check) = serde_json::from_value::<GitSyncCheck>(marker) else {
|
||||
let Ok(mut check) = serde_json::from_value::<GitSyncCheck>(marker) else {
|
||||
return;
|
||||
};
|
||||
// Markers carry the literal resource URL (job args are persisted, so a
|
||||
// `$var:`-resolved URL must not land there); interpolate before calling
|
||||
// GitHub.
|
||||
check.repo_url =
|
||||
match windmill_common::variables::get_variable_or_self(check.repo_url, db, workspace_id)
|
||||
.await
|
||||
{
|
||||
Ok(u) => u,
|
||||
Err(e) => {
|
||||
tracing::error!("git sync-check: cannot interpolate repo url: {e:#}");
|
||||
return;
|
||||
}
|
||||
};
|
||||
// "In sync" on a PR that visibly changes files reads as a bug when those
|
||||
// files are outside the repo's sync filters — say what the scope is.
|
||||
let scope_note = if !is_deploy && success {
|
||||
|
||||
Reference in New Issue
Block a user