remove debug logs

This commit is contained in:
wendrul
2026-03-09 16:01:35 +01:00
parent 29bb77b0cb
commit c4495db2e6
2 changed files with 28 additions and 6 deletions
+4 -5
View File
@@ -119,7 +119,10 @@ async function resolveEffectiveSyncOptions(
promotion?: string,
branchOverride?: string,
): Promise<SyncOptions> {
return await getEffectiveSettings(localConfig, promotion, false, false, branchOverride);
return await getEffectiveSettings(localConfig, promotion, false, false, branchOverride, {
workspaceId: workspace.workspaceId,
remote: workspace.remote,
});
}
type DynFSElement = {
@@ -2920,13 +2923,10 @@ export async function push(
});
break;
case "resource":
console.log("ASDASDASDSAD")
log.error("Deleting resourceee");
await wmill.deleteResource({
workspace: workspaceId,
path: removeSuffix(target, ".resource.json"),
});
log.error("no reach here right?")
break;
case "resource-type":
await wmill.deleteResourceType({
@@ -3065,7 +3065,6 @@ export async function push(
break;
}
case "variable":
log.error("Deleting variableeee");
await wmill.deleteVariable({
workspace: workspaceId,
path: removeSuffix(target, ".variable.json"),
+24 -1
View File
@@ -509,7 +509,8 @@ export async function getEffectiveSettings(
promotion?: string,
skipBranchValidation?: boolean,
suppressLogs?: boolean,
branchOverride?: string
branchOverride?: string,
targetWorkspace?: { workspaceId: string; remote: string },
): Promise<SyncOptions> {
// Start with top-level settings from config
const { gitBranches, ...topLevelSettings } = config;
@@ -597,5 +598,27 @@ export async function getEffectiveSettings(
);
}
// If a target workspace is provided, resolve defaultPermissionedAs from the
// branch config that matches it (rules are workspace-specific)
if (targetWorkspace && gitBranches) {
const matchingEntry = Object.entries(gitBranches).find(
([_, branchConfig]) =>
branchConfig.workspaceId === targetWorkspace.workspaceId &&
branchConfig.baseUrl === targetWorkspace.remote
);
if (matchingEntry) {
const [, branchConfig] = matchingEntry;
if (branchConfig.defaultPermissionedAs) {
effective.defaultPermissionedAs = branchConfig.defaultPermissionedAs;
} else {
// Matching branch has no rules — fall back to root-level
effective.defaultPermissionedAs = topLevelSettings.defaultPermissionedAs;
}
} else {
// No branch matches the target workspace — use root-level rules
effective.defaultPermissionedAs = topLevelSettings.defaultPermissionedAs;
}
}
return effective;
}