mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-14 16:02:57 +00:00
fix: keep the app editor's parent_version out of deployed apps (#11719)
* fix: keep the app editor's parent_version out of deployed apps Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix: drop parent_version when deploying an app draft Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
a298ed3fc1
commit
2c6de9d896
@@ -115,6 +115,14 @@ export function replaceInlineScripts(
|
||||
}
|
||||
return [];
|
||||
}
|
||||
/** `parent_version` is the editor's stale-draft base: a version id that changes on
|
||||
* every deploy and means nothing in another workspace, so it is kept out of the
|
||||
* tracked file and out of what a push deploys. */
|
||||
export function stripEditorState(app: any) {
|
||||
if (app?.value && typeof app.value == "object") {
|
||||
delete app.value.parent_version;
|
||||
}
|
||||
}
|
||||
export function isExecutionModeAnonymous(app: any) {
|
||||
return app?.["policy"]?.["execution_mode"] == "anonymous";
|
||||
}
|
||||
@@ -294,6 +302,7 @@ export async function pushApp(
|
||||
}
|
||||
const path = localPath + "app.yaml";
|
||||
const localApp = (await yamlParseFile(path)) as AppFile;
|
||||
stripEditorState(localApp);
|
||||
const isolation = statedIsolation(localApp, false);
|
||||
|
||||
replaceInlineScripts(localApp.value, localPath, true);
|
||||
|
||||
@@ -149,7 +149,11 @@ import {
|
||||
extractCurrentMapping,
|
||||
} from "../../../windmill-utils-internal/src/inline-scripts/extractor.ts";
|
||||
import { generateFlowLockInternal } from "../flow/flow_metadata.ts";
|
||||
import { markAccessFromPolicy, markIsolationFromPolicy } from "../app/app.ts";
|
||||
import {
|
||||
markAccessFromPolicy,
|
||||
markIsolationFromPolicy,
|
||||
stripEditorState,
|
||||
} from "../app/app.ts";
|
||||
import {
|
||||
APP_BACKEND_FOLDER,
|
||||
generateAppLocksInternal,
|
||||
@@ -1329,6 +1333,7 @@ export function ZipFSElement(
|
||||
log.error(`Failed to parse app.yaml at path: ${p}`);
|
||||
throw error;
|
||||
}
|
||||
stripEditorState(app);
|
||||
let inlineScripts;
|
||||
try {
|
||||
inlineScripts = extractInlineScriptsForApps(
|
||||
@@ -2749,12 +2754,18 @@ export async function compareDynFSElement(
|
||||
}
|
||||
return o;
|
||||
} else {
|
||||
let o: any;
|
||||
try {
|
||||
return yamlParseContent(k, v);
|
||||
o = yamlParseContent(k, v);
|
||||
} catch (error) {
|
||||
log.error(`Failed to parse YAML content at path: ${k}`);
|
||||
throw error;
|
||||
}
|
||||
// A file tracked before the field was dropped still carries it.
|
||||
if (path.basename(k) == "app.yaml") {
|
||||
stripEditorState(o);
|
||||
}
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user