mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-28 00:02:42 +00:00
fix(cli): keep the workspace color when settings are synced from git (#11144)
* fix(cli): keep the workspace color when settings are synced from git Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * docs(cli): name the sync direction consistently in the identity-field comments Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * fix(cli): apply the workspace color from settings.yaml only when the file sets one Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
8b4f6220dc
commit
129c045595
@@ -2542,6 +2542,21 @@ export function preservePendingScriptLocks(
|
||||
}
|
||||
}
|
||||
|
||||
// `sync push` never applies the workspace's display name from settings.yaml and
|
||||
// applies its color only when the local file carries one (see
|
||||
// pushWorkspaceSettings), so on a push the fields it would not apply must
|
||||
// compare equal, or the row is listed on every run.
|
||||
const isWorkspaceSettingsFile = (p: string) =>
|
||||
/^settings(\.[^./\\]+)?\.(yaml|json)$/.test(p);
|
||||
function stripUnappliedSettingsFields(local: any, remote: any) {
|
||||
delete local?.name;
|
||||
delete remote?.name;
|
||||
if (local?.color == null) {
|
||||
delete local?.color;
|
||||
delete remote?.color;
|
||||
}
|
||||
}
|
||||
|
||||
export async function compareDynFSElement(
|
||||
els1: DynFSElement,
|
||||
els2: DynFSElement | undefined,
|
||||
@@ -2757,6 +2772,9 @@ export async function compareDynFSElement(
|
||||
delete parsedV?.enabled;
|
||||
delete parsedM2?.enabled;
|
||||
}
|
||||
if (isEls1Remote === false && isWorkspaceSettingsFile(k)) {
|
||||
stripUnappliedSettingsFields(parsedV, parsedM2);
|
||||
}
|
||||
if (deepEqual(parsedV, parsedM2)) {
|
||||
continue;
|
||||
}
|
||||
@@ -2771,6 +2789,9 @@ export async function compareDynFSElement(
|
||||
delete before?.enabled;
|
||||
delete after?.enabled;
|
||||
}
|
||||
if (isEls1Remote === false && isWorkspaceSettingsFile(k)) {
|
||||
stripUnappliedSettingsFields(after, before);
|
||||
}
|
||||
if (deepEqual(before, after)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user