mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-24 08:01:38 +00:00
fix(cli): improve back-compatibility with app.yaml with policy still present
This commit is contained in:
@@ -25,6 +25,9 @@ export interface AppFile {
|
||||
|
||||
const alreadySynced: string[] = [];
|
||||
|
||||
export function isExecutionModeAnonymous(app: any) {
|
||||
return app?.["policy"]?.["execution_mode"] == "anonymous";
|
||||
}
|
||||
export async function pushApp(
|
||||
workspace: string,
|
||||
remotePath: string,
|
||||
@@ -46,7 +49,7 @@ export async function pushApp(
|
||||
} catch {
|
||||
//ignore
|
||||
}
|
||||
if (app?.["policy"]?.["execution_mode"] == "anonymous") {
|
||||
if (isExecutionModeAnonymous(app)) {
|
||||
app.public = true;
|
||||
}
|
||||
// console.log(app);
|
||||
@@ -85,7 +88,9 @@ export async function pushApp(
|
||||
}
|
||||
|
||||
replaceInlineScripts(localApp.value);
|
||||
await generatingPolicy(localApp, remotePath, localApp?.["public"] ?? false);
|
||||
// console.log(localApp, localApp?.["policy"]);
|
||||
await generatingPolicy(localApp, remotePath, localApp?.["public"] ?? (localApp.policy ? isExecutionModeAnonymous(localApp) : false));
|
||||
// console.log(localApp, localApp?.["policy"]);
|
||||
if (app) {
|
||||
if (isSuperset(localApp, app)) {
|
||||
log.info(colors.green(`App ${remotePath} is up to date`));
|
||||
|
||||
@@ -67,6 +67,7 @@ import {
|
||||
PathAssigner,
|
||||
} from "../../../windmill-utils-internal/src/path-utils/path-assigner.ts";
|
||||
import { extractInlineScripts as extractInlineScriptsForFlows } from "../../../windmill-utils-internal/src/inline-scripts/extractor.ts";
|
||||
import { isExecutionModeAnonymous } from "../app/apps.ts";
|
||||
|
||||
// Merge CLI options with effective settings, preserving CLI flags as overrides
|
||||
function mergeCliWithEffectiveOptions<
|
||||
@@ -415,7 +416,7 @@ function ZipFSElement(
|
||||
};
|
||||
}
|
||||
|
||||
if (app?.["policy"]?.["execution_mode"] == "anonymous") {
|
||||
if (isExecutionModeAnonymous(app)) {
|
||||
app.public = true;
|
||||
}
|
||||
app.policy = undefined;
|
||||
|
||||
Reference in New Issue
Block a user