From 2d68985e32601652c55b540ae19ae8f67bfdcf3b Mon Sep 17 00:00:00 2001 From: Pierre Chalamet Date: Sun, 14 Dec 2025 19:18:54 +0100 Subject: [PATCH 1/7] implement syntax --- src/Terrabuild.Configuration.Tests/Project.fs | 4 ++++ .../TestFiles/Success_PROJECT | 1 + .../TestFiles/Success_WORKSPACE | 1 + .../Workspace.fs | 18 ++++++++++------ src/Terrabuild.Configuration/AST/Project.fs | 1 + src/Terrabuild.Configuration/AST/Workspace.fs | 3 ++- .../Transpiler/Project.fs | 4 +++- .../Transpiler/Workspace.fs | 6 ++++-- .../Core/GraphPipeline/Batch.fs | 3 ++- src/Terrabuild/Core/Configuration.fs | 18 ++++++++++++++-- src/Terrabuild/Core/GraphDef.fs | 7 +++++++ src/Terrabuild/Core/GraphPipeline/Batch.fs | 3 ++- src/Terrabuild/Core/GraphPipeline/Node.fs | 21 +++++++++++-------- 13 files changed, 67 insertions(+), 23 deletions(-) diff --git a/src/Terrabuild.Configuration.Tests/Project.fs b/src/Terrabuild.Configuration.Tests/Project.fs index 401551bf..2c545e9a 100644 --- a/src/Terrabuild.Configuration.Tests/Project.fs +++ b/src/Terrabuild.Configuration.Tests/Project.fs @@ -54,12 +54,14 @@ let parseProject() = TargetBlock.Build = None TargetBlock.Outputs = None TargetBlock.Cache = None + TargetBlock.Batch = Expr.Enum "none" |> Some TargetBlock.Steps = [ { Extension = "@dotnet"; Command = "build"; Parameters = Map.empty } ] } let targetDist = { TargetBlock.DependsOn = None TargetBlock.Build = None TargetBlock.Outputs = None TargetBlock.Cache = None + TargetBlock.Batch = None TargetBlock.Steps = [ { Extension = "@dotnet"; Command = "build"; Parameters = Map.empty } { Extension = "@dotnet"; Command = "publish"; Parameters = Map.empty } ] } let targetDocker = @@ -67,6 +69,7 @@ let parseProject() = TargetBlock.Build = "auto" |> Expr.Enum |> Some TargetBlock.Outputs = None TargetBlock.Cache = "remote" |> Expr.Enum |> Some + TargetBlock.Batch = None TargetBlock.Steps = [ { Extension = "@shell"; Command = "echo" Parameters = Map [ "arguments", Expr.Function (Function.Trim, [ Expr.Function (Function.Plus, @@ -125,6 +128,7 @@ let parseProject2() = Expr.String ".dll" ])] |> Some TargetBlock.DependsOn = None TargetBlock.Cache = None + TargetBlock.Batch = None TargetBlock.Steps = [ { Extension = "@dotnet"; Command = "build"; Parameters = Map.empty } ] } let locals = diff --git a/src/Terrabuild.Configuration.Tests/TestFiles/Success_PROJECT b/src/Terrabuild.Configuration.Tests/TestFiles/Success_PROJECT index 0761fe80..dc688537 100644 --- a/src/Terrabuild.Configuration.Tests/TestFiles/Success_PROJECT +++ b/src/Terrabuild.Configuration.Tests/TestFiles/Success_PROJECT @@ -36,6 +36,7 @@ project id { target build { depends_on = [ target.dist ] + batch = ~none @dotnet build { } } diff --git a/src/Terrabuild.Configuration.Tests/TestFiles/Success_WORKSPACE b/src/Terrabuild.Configuration.Tests/TestFiles/Success_WORKSPACE index fddff48a..f578ed57 100644 --- a/src/Terrabuild.Configuration.Tests/TestFiles/Success_WORKSPACE +++ b/src/Terrabuild.Configuration.Tests/TestFiles/Success_WORKSPACE @@ -18,6 +18,7 @@ target dist { depends_on = [ target.build ] build = ~auto artifacts = ~none + batch = ~global } target dummy { } diff --git a/src/Terrabuild.Configuration.Tests/Workspace.fs b/src/Terrabuild.Configuration.Tests/Workspace.fs index ac369af8..0c178fff 100644 --- a/src/Terrabuild.Configuration.Tests/Workspace.fs +++ b/src/Terrabuild.Configuration.Tests/Workspace.fs @@ -14,15 +14,18 @@ let parseWorkspace() = let targetBuild = { TargetBlock.DependsOn = Set [ "install"; "^build" ] |> Some TargetBlock.Build = None - TargetBlock.Cache = None } + TargetBlock.Cache = None + TargetBlock.Batch = None } let targetDist = { TargetBlock.DependsOn = Set [ "build" ] |> Some TargetBlock.Build = "auto" |> Expr.Enum |> Some - TargetBlock.Cache = "none" |> Expr.Enum |> Some } + TargetBlock.Cache = "none" |> Expr.Enum |> Some + TargetBlock.Batch = "global" |> Expr.Enum |> Some } let targetDummy = { TargetBlock.DependsOn = None TargetBlock.Build = None - TargetBlock.Cache = None } + TargetBlock.Cache = None + TargetBlock.Batch = None } let extDotnet = { Image = Some (Expr.String "mcr.microsoft.com/dotnet/sdk:8.0.101") @@ -77,15 +80,18 @@ let parseWorkspace2() = let targetBuild = { TargetBlock.DependsOn = Set [ "^build" ] |> Some TargetBlock.Build = None - TargetBlock.Cache = None } + TargetBlock.Cache = None + TargetBlock.Batch = None } let targetDist = { TargetBlock.DependsOn = Set [ "build" ] |> Some TargetBlock.Build = None - TargetBlock.Cache = None } + TargetBlock.Cache = None + TargetBlock.Batch = None } let targetDummy = { TargetBlock.DependsOn = None TargetBlock.Build = None - TargetBlock.Cache = None } + TargetBlock.Cache = None + TargetBlock.Batch = None } let extDotnet = { Image = Expr.String "mcr.microsoft.com/dotnet/sdk:8.0.101" |> Some diff --git a/src/Terrabuild.Configuration/AST/Project.fs b/src/Terrabuild.Configuration/AST/Project.fs index db79678b..b943a094 100644 --- a/src/Terrabuild.Configuration/AST/Project.fs +++ b/src/Terrabuild.Configuration/AST/Project.fs @@ -27,6 +27,7 @@ type TargetBlock = DependsOn: Set option Build: Expr option Cache: Expr option + Batch: Expr option Steps: Step list } [] diff --git a/src/Terrabuild.Configuration/AST/Workspace.fs b/src/Terrabuild.Configuration/AST/Workspace.fs index 4ebd060b..36e3c09d 100644 --- a/src/Terrabuild.Configuration/AST/Workspace.fs +++ b/src/Terrabuild.Configuration/AST/Workspace.fs @@ -17,7 +17,8 @@ type WorkspaceBlock = type TargetBlock = { DependsOn: Set option Build: Expr option - Cache: Expr option } + Cache: Expr option + Batch: Expr option } [] type WorkspaceFile = diff --git a/src/Terrabuild.Configuration/Transpiler/Project.fs b/src/Terrabuild.Configuration/Transpiler/Project.fs index 59a247d4..75d61ab8 100644 --- a/src/Terrabuild.Configuration/Transpiler/Project.fs +++ b/src/Terrabuild.Configuration/Transpiler/Project.fs @@ -75,7 +75,7 @@ let toProject (block: Block) = let toTarget (block: Block) = block - |> checkAllowedAttributes ["outputs"; "depends_on"; "build"; "artifacts"] + |> checkAllowedAttributes ["outputs"; "depends_on"; "build"; "artifacts"; "batch"] |> ignore let outputs = block |> tryFindAttribute "outputs" @@ -89,6 +89,7 @@ let toTarget (block: Block) = | _ -> raiseInvalidArg $"Invalid target dependency '{dependency}'")) let build = block |> tryFindAttribute "build" let cache = block |> tryFindAttribute "artifacts" + let batch = block |> tryFindAttribute "batch" let steps = block.Blocks |> List.map (fun step -> @@ -114,6 +115,7 @@ let toTarget (block: Block) = TargetBlock.DependsOn = dependsOn TargetBlock.Build = build TargetBlock.Cache = cache + TargetBlock.Batch = batch TargetBlock.Steps = steps } diff --git a/src/Terrabuild.Configuration/Transpiler/Workspace.fs b/src/Terrabuild.Configuration/Transpiler/Workspace.fs index 01b476d9..0d22c3d8 100644 --- a/src/Terrabuild.Configuration/Transpiler/Workspace.fs +++ b/src/Terrabuild.Configuration/Transpiler/Workspace.fs @@ -65,7 +65,7 @@ let toWorkspace (block: Block) = let toTarget (block: Block) = block - |> checkAllowedAttributes ["depends_on"; "build"; "artifacts"] + |> checkAllowedAttributes ["depends_on"; "build"; "artifacts"; "batch"] |> checkNoNestedBlocks |> ignore @@ -79,9 +79,11 @@ let toTarget (block: Block) = | _ -> raiseInvalidArg $"Invalid target dependency '{dependency}'")) let build = block |> tryFindAttribute "build" let cache = block |> tryFindAttribute "artifacts" + let batch = block |> tryFindAttribute "batch" { TargetBlock.DependsOn = dependsOn TargetBlock.Build = build - TargetBlock.Cache = cache } + TargetBlock.Cache = cache + TargetBlock.Batch = batch } let toVariable (block: Block) = diff --git a/src/Terrabuild.Tests/Core/GraphPipeline/Batch.fs b/src/Terrabuild.Tests/Core/GraphPipeline/Batch.fs index 7d313e62..9fcb9985 100644 --- a/src/Terrabuild.Tests/Core/GraphPipeline/Batch.fs +++ b/src/Terrabuild.Tests/Core/GraphPipeline/Batch.fs @@ -20,7 +20,8 @@ let ``check batch computation``() = Node.Operations = [] Node.Artifacts = Artifacts.Workspace Node.Action = action - Node.Build = Build.Auto } + Node.Build = Build.Auto + Node.Batch = Batch.Partition } let addNode (node: Node) nodes = nodes |> Map.add node.Id node diff --git a/src/Terrabuild/Core/Configuration.fs b/src/Terrabuild/Core/Configuration.fs index cfec7fd8..d9510dce 100644 --- a/src/Terrabuild/Core/Configuration.fs +++ b/src/Terrabuild/Core/Configuration.fs @@ -30,7 +30,7 @@ type TargetOperation = { type Target = { Hash: string Build: Build option - Batch: bool + Batch: Batch DependsOn: string set Outputs: string set Cache: Artifacts option @@ -521,7 +521,7 @@ let private finalizeProject workspaceDir projectDir evaluationContext (projectDe | Ok x -> raiseParseError $"Invalid build value '{x}'" | Error error -> raiseParseError error - let targetBatch, targetOperations = + let canBatch, targetOperations = target.Steps |> List.fold (fun (targetBatch, targetOperations) step -> let extension = match projectDef.Extensions |> Map.tryFind step.Extension with @@ -628,6 +628,20 @@ let private finalizeProject workspaceDir projectDir evaluationContext (projectDe |> List.map (fun ope -> ope.Hash) |> Hash.sha256strings + let targetBatch = + let targetBatch = + target.Batch + |> Option.map (fun batch -> batch |> Eval.eval evaluationContext |> Eval.asEnum) + match targetBatch with + | Some batch -> + match batch with + | Ok "none" -> Batch.None + | Ok "partition" -> Batch.Partition + | Ok "global" -> Batch.Global + | Ok x -> raiseParseError $"Invalid batch value '{x}'" + | Error error -> raiseParseError error + | _ -> Batch.None + let target = { Target.Hash = targetHash Target.Build = targetBuild diff --git a/src/Terrabuild/Core/GraphDef.fs b/src/Terrabuild/Core/GraphDef.fs index 2a74642a..270c00ef 100644 --- a/src/Terrabuild/Core/GraphDef.fs +++ b/src/Terrabuild/Core/GraphDef.fs @@ -13,6 +13,12 @@ type ContaineredShellOperation = { ErrorLevel: int } +[] +type Batch = + | None + | Partition + | Global + [] type Artifacts = | None @@ -53,6 +59,7 @@ type Node = { Operations: ContaineredShellOperation list Artifacts: Artifacts Build: Build + Batch: Batch Action: NodeAction } diff --git a/src/Terrabuild/Core/GraphPipeline/Batch.fs b/src/Terrabuild/Core/GraphPipeline/Batch.fs index 7382c70c..56b711ef 100644 --- a/src/Terrabuild/Core/GraphPipeline/Batch.fs +++ b/src/Terrabuild/Core/GraphPipeline/Batch.fs @@ -179,7 +179,8 @@ let private createBatchNodes (options: ConfigOptions.Options) (configuration: Co GraphDef.Node.ProjectHash = batch.BatchId GraphDef.Node.TargetHash = headNode.TargetHash GraphDef.Node.Action = NodeAction.Build - GraphDef.Node.Build = headNode.Build } + GraphDef.Node.Build = headNode.Build + GraphDef.Node.Batch = headNode.Batch } Some (batch.BatchId, batchNode) ) diff --git a/src/Terrabuild/Core/GraphPipeline/Node.fs b/src/Terrabuild/Core/GraphPipeline/Node.fs index db834e6a..748e4e55 100644 --- a/src/Terrabuild/Core/GraphPipeline/Node.fs +++ b/src/Terrabuild/Core/GraphPipeline/Node.fs @@ -127,7 +127,7 @@ let build (options: ConfigOptions.Options) (configuration: Configuration.Workspa | _ -> false cacheability, batchable, ops @ newops - ) (Artifacts.Managed, targetConfig.Batch, []) + ) (Artifacts.Managed, true, []) let opsCmds = ops |> List.map Json.Serialize @@ -155,15 +155,17 @@ let build (options: ConfigOptions.Options) (configuration: Configuration.Workspa if cache = Artifacts.None then Set.empty else targetConfig.Outputs - let batchContent = [ - targetConfig.Hash - $"{buildAction}" - ] - let batchHash = batchContent |> Hash.sha256strings - let targetClusterHash = - if targetConfig.Batch && batchable then Some batchHash - else None + match targetConfig.Batch, batchable with + | Batch.None, _ + | _, false -> None + | _, true -> + let batchContent = [ + targetConfig.Hash + $"{buildAction}" + ] + let batchHash = batchContent |> Hash.sha256strings + Some batchHash let node = { Node.Id = nodeId @@ -175,6 +177,7 @@ let build (options: ConfigOptions.Options) (configuration: Configuration.Workspa Node.Operations = ops Node.Artifacts = cache Node.Build = build + Node.Batch = targetConfig.Batch Node.Dependencies = children Node.Outputs = targetOutput From 4c6942532636ad9f50165879653bea0f48fb9ab4 Mon Sep 17 00:00:00 2001 From: Pierre Chalamet Date: Sun, 14 Dec 2025 20:38:27 +0100 Subject: [PATCH 2/7] use group for target --- src/Terrabuild.Configuration.Tests/Project.fs | 8 ++++---- .../TestFiles/Success_PROJECT | 2 +- .../TestFiles/Success_WORKSPACE | 2 +- src/Terrabuild.Configuration.Tests/Workspace.fs | 12 ++++++------ src/Terrabuild.Configuration/AST/Project.fs | 2 +- src/Terrabuild.Configuration/AST/Workspace.fs | 2 +- src/Terrabuild.Configuration/Transpiler/Project.fs | 6 +++--- src/Terrabuild.Configuration/Transpiler/Workspace.fs | 6 +++--- src/Terrabuild/Core/Configuration.fs | 5 ++--- src/Terrabuild/Core/GraphDef.fs | 1 - src/Terrabuild/Core/GraphPipeline/Batch.fs | 7 +++++++ 11 files changed, 29 insertions(+), 24 deletions(-) diff --git a/src/Terrabuild.Configuration.Tests/Project.fs b/src/Terrabuild.Configuration.Tests/Project.fs index 2c545e9a..57945149 100644 --- a/src/Terrabuild.Configuration.Tests/Project.fs +++ b/src/Terrabuild.Configuration.Tests/Project.fs @@ -54,14 +54,14 @@ let parseProject() = TargetBlock.Build = None TargetBlock.Outputs = None TargetBlock.Cache = None - TargetBlock.Batch = Expr.Enum "none" |> Some + TargetBlock.Group = Expr.Enum "partition" |> Some TargetBlock.Steps = [ { Extension = "@dotnet"; Command = "build"; Parameters = Map.empty } ] } let targetDist = { TargetBlock.DependsOn = None TargetBlock.Build = None TargetBlock.Outputs = None TargetBlock.Cache = None - TargetBlock.Batch = None + TargetBlock.Group = None TargetBlock.Steps = [ { Extension = "@dotnet"; Command = "build"; Parameters = Map.empty } { Extension = "@dotnet"; Command = "publish"; Parameters = Map.empty } ] } let targetDocker = @@ -69,7 +69,7 @@ let parseProject() = TargetBlock.Build = "auto" |> Expr.Enum |> Some TargetBlock.Outputs = None TargetBlock.Cache = "remote" |> Expr.Enum |> Some - TargetBlock.Batch = None + TargetBlock.Group = None TargetBlock.Steps = [ { Extension = "@shell"; Command = "echo" Parameters = Map [ "arguments", Expr.Function (Function.Trim, [ Expr.Function (Function.Plus, @@ -128,7 +128,7 @@ let parseProject2() = Expr.String ".dll" ])] |> Some TargetBlock.DependsOn = None TargetBlock.Cache = None - TargetBlock.Batch = None + TargetBlock.Group = None TargetBlock.Steps = [ { Extension = "@dotnet"; Command = "build"; Parameters = Map.empty } ] } let locals = diff --git a/src/Terrabuild.Configuration.Tests/TestFiles/Success_PROJECT b/src/Terrabuild.Configuration.Tests/TestFiles/Success_PROJECT index dc688537..d67f7b40 100644 --- a/src/Terrabuild.Configuration.Tests/TestFiles/Success_PROJECT +++ b/src/Terrabuild.Configuration.Tests/TestFiles/Success_PROJECT @@ -36,7 +36,7 @@ project id { target build { depends_on = [ target.dist ] - batch = ~none + group = ~partition @dotnet build { } } diff --git a/src/Terrabuild.Configuration.Tests/TestFiles/Success_WORKSPACE b/src/Terrabuild.Configuration.Tests/TestFiles/Success_WORKSPACE index f578ed57..887ae301 100644 --- a/src/Terrabuild.Configuration.Tests/TestFiles/Success_WORKSPACE +++ b/src/Terrabuild.Configuration.Tests/TestFiles/Success_WORKSPACE @@ -18,7 +18,7 @@ target dist { depends_on = [ target.build ] build = ~auto artifacts = ~none - batch = ~global + group = ~none } target dummy { } diff --git a/src/Terrabuild.Configuration.Tests/Workspace.fs b/src/Terrabuild.Configuration.Tests/Workspace.fs index 0c178fff..7e4a02ae 100644 --- a/src/Terrabuild.Configuration.Tests/Workspace.fs +++ b/src/Terrabuild.Configuration.Tests/Workspace.fs @@ -15,17 +15,17 @@ let parseWorkspace() = { TargetBlock.DependsOn = Set [ "install"; "^build" ] |> Some TargetBlock.Build = None TargetBlock.Cache = None - TargetBlock.Batch = None } + TargetBlock.Group = None } let targetDist = { TargetBlock.DependsOn = Set [ "build" ] |> Some TargetBlock.Build = "auto" |> Expr.Enum |> Some TargetBlock.Cache = "none" |> Expr.Enum |> Some - TargetBlock.Batch = "global" |> Expr.Enum |> Some } + TargetBlock.Group = "none" |> Expr.Enum |> Some } let targetDummy = { TargetBlock.DependsOn = None TargetBlock.Build = None TargetBlock.Cache = None - TargetBlock.Batch = None } + TargetBlock.Group = None } let extDotnet = { Image = Some (Expr.String "mcr.microsoft.com/dotnet/sdk:8.0.101") @@ -81,17 +81,17 @@ let parseWorkspace2() = { TargetBlock.DependsOn = Set [ "^build" ] |> Some TargetBlock.Build = None TargetBlock.Cache = None - TargetBlock.Batch = None } + TargetBlock.Group = None } let targetDist = { TargetBlock.DependsOn = Set [ "build" ] |> Some TargetBlock.Build = None TargetBlock.Cache = None - TargetBlock.Batch = None } + TargetBlock.Group = None } let targetDummy = { TargetBlock.DependsOn = None TargetBlock.Build = None TargetBlock.Cache = None - TargetBlock.Batch = None } + TargetBlock.Group = None } let extDotnet = { Image = Expr.String "mcr.microsoft.com/dotnet/sdk:8.0.101" |> Some diff --git a/src/Terrabuild.Configuration/AST/Project.fs b/src/Terrabuild.Configuration/AST/Project.fs index b943a094..d68d9ff0 100644 --- a/src/Terrabuild.Configuration/AST/Project.fs +++ b/src/Terrabuild.Configuration/AST/Project.fs @@ -27,7 +27,7 @@ type TargetBlock = DependsOn: Set option Build: Expr option Cache: Expr option - Batch: Expr option + Group: Expr option Steps: Step list } [] diff --git a/src/Terrabuild.Configuration/AST/Workspace.fs b/src/Terrabuild.Configuration/AST/Workspace.fs index 36e3c09d..49401e0d 100644 --- a/src/Terrabuild.Configuration/AST/Workspace.fs +++ b/src/Terrabuild.Configuration/AST/Workspace.fs @@ -18,7 +18,7 @@ type TargetBlock = { DependsOn: Set option Build: Expr option Cache: Expr option - Batch: Expr option } + Group: Expr option } [] type WorkspaceFile = diff --git a/src/Terrabuild.Configuration/Transpiler/Project.fs b/src/Terrabuild.Configuration/Transpiler/Project.fs index 75d61ab8..a20c3660 100644 --- a/src/Terrabuild.Configuration/Transpiler/Project.fs +++ b/src/Terrabuild.Configuration/Transpiler/Project.fs @@ -75,7 +75,7 @@ let toProject (block: Block) = let toTarget (block: Block) = block - |> checkAllowedAttributes ["outputs"; "depends_on"; "build"; "artifacts"; "batch"] + |> checkAllowedAttributes ["outputs"; "depends_on"; "build"; "artifacts"; "group"] |> ignore let outputs = block |> tryFindAttribute "outputs" @@ -89,7 +89,7 @@ let toTarget (block: Block) = | _ -> raiseInvalidArg $"Invalid target dependency '{dependency}'")) let build = block |> tryFindAttribute "build" let cache = block |> tryFindAttribute "artifacts" - let batch = block |> tryFindAttribute "batch" + let group = block |> tryFindAttribute "group" let steps = block.Blocks |> List.map (fun step -> @@ -115,7 +115,7 @@ let toTarget (block: Block) = TargetBlock.DependsOn = dependsOn TargetBlock.Build = build TargetBlock.Cache = cache - TargetBlock.Batch = batch + TargetBlock.Group = group TargetBlock.Steps = steps } diff --git a/src/Terrabuild.Configuration/Transpiler/Workspace.fs b/src/Terrabuild.Configuration/Transpiler/Workspace.fs index 0d22c3d8..ba7c38ae 100644 --- a/src/Terrabuild.Configuration/Transpiler/Workspace.fs +++ b/src/Terrabuild.Configuration/Transpiler/Workspace.fs @@ -65,7 +65,7 @@ let toWorkspace (block: Block) = let toTarget (block: Block) = block - |> checkAllowedAttributes ["depends_on"; "build"; "artifacts"; "batch"] + |> checkAllowedAttributes ["depends_on"; "build"; "artifacts"; "group"] |> checkNoNestedBlocks |> ignore @@ -79,11 +79,11 @@ let toTarget (block: Block) = | _ -> raiseInvalidArg $"Invalid target dependency '{dependency}'")) let build = block |> tryFindAttribute "build" let cache = block |> tryFindAttribute "artifacts" - let batch = block |> tryFindAttribute "batch" + let group = block |> tryFindAttribute "group" { TargetBlock.DependsOn = dependsOn TargetBlock.Build = build TargetBlock.Cache = cache - TargetBlock.Batch = batch } + TargetBlock.Group = group } let toVariable (block: Block) = diff --git a/src/Terrabuild/Core/Configuration.fs b/src/Terrabuild/Core/Configuration.fs index d9510dce..fc7078f2 100644 --- a/src/Terrabuild/Core/Configuration.fs +++ b/src/Terrabuild/Core/Configuration.fs @@ -630,17 +630,16 @@ let private finalizeProject workspaceDir projectDir evaluationContext (projectDe let targetBatch = let targetBatch = - target.Batch + target.Group |> Option.map (fun batch -> batch |> Eval.eval evaluationContext |> Eval.asEnum) match targetBatch with | Some batch -> match batch with | Ok "none" -> Batch.None | Ok "partition" -> Batch.Partition - | Ok "global" -> Batch.Global | Ok x -> raiseParseError $"Invalid batch value '{x}'" | Error error -> raiseParseError error - | _ -> Batch.None + | _ -> Batch.Partition let target = { Target.Hash = targetHash diff --git a/src/Terrabuild/Core/GraphDef.fs b/src/Terrabuild/Core/GraphDef.fs index 270c00ef..65046d68 100644 --- a/src/Terrabuild/Core/GraphDef.fs +++ b/src/Terrabuild/Core/GraphDef.fs @@ -17,7 +17,6 @@ type ContaineredShellOperation = { type Batch = | None | Partition - | Global [] type Artifacts = diff --git a/src/Terrabuild/Core/GraphPipeline/Batch.fs b/src/Terrabuild/Core/GraphPipeline/Batch.fs index 56b711ef..d69e7e83 100644 --- a/src/Terrabuild/Core/GraphPipeline/Batch.fs +++ b/src/Terrabuild/Core/GraphPipeline/Batch.fs @@ -16,6 +16,13 @@ let private computeBatchId (clusterHash: string) (nodes: Node list) = Hash.sha256strings content let private partitionByDependencies (bucketNodes: Node list) = + let bucketModes = + bucketNodes + |> List.groupBy (fun node -> node.Batch) + |> Map.ofSeq + + + // Undirected connectivity inside the bucket: // edge A—B if A depends on B or B depends on A (restricted to bucket) let ids = bucketNodes |> List.map (fun n -> n.Id) |> Set.ofList From d8fa3a0ad63959cb4c3a46487107befb10cb0347 Mon Sep 17 00:00:00 2001 From: Pierre Chalamet Date: Sun, 14 Dec 2025 20:40:12 +0100 Subject: [PATCH 3/7] rename Group in node --- .../Core/GraphPipeline/Batch.fs | 2 +- src/Terrabuild/Core/Configuration.fs | 18 +++++++++--------- src/Terrabuild/Core/GraphDef.fs | 4 ++-- src/Terrabuild/Core/GraphPipeline/Batch.fs | 4 ++-- src/Terrabuild/Core/GraphPipeline/Node.fs | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Terrabuild.Tests/Core/GraphPipeline/Batch.fs b/src/Terrabuild.Tests/Core/GraphPipeline/Batch.fs index 9fcb9985..6c5eb79f 100644 --- a/src/Terrabuild.Tests/Core/GraphPipeline/Batch.fs +++ b/src/Terrabuild.Tests/Core/GraphPipeline/Batch.fs @@ -21,7 +21,7 @@ let ``check batch computation``() = Node.Artifacts = Artifacts.Workspace Node.Action = action Node.Build = Build.Auto - Node.Batch = Batch.Partition } + Node.Group = Group.Partition } let addNode (node: Node) nodes = nodes |> Map.add node.Id node diff --git a/src/Terrabuild/Core/Configuration.fs b/src/Terrabuild/Core/Configuration.fs index fc7078f2..a7265ad2 100644 --- a/src/Terrabuild/Core/Configuration.fs +++ b/src/Terrabuild/Core/Configuration.fs @@ -30,7 +30,7 @@ type TargetOperation = { type Target = { Hash: string Build: Build option - Batch: Batch + Batch: Group DependsOn: string set Outputs: string set Cache: Artifacts option @@ -629,17 +629,17 @@ let private finalizeProject workspaceDir projectDir evaluationContext (projectDe |> Hash.sha256strings let targetBatch = - let targetBatch = + let targetGroup = target.Group |> Option.map (fun batch -> batch |> Eval.eval evaluationContext |> Eval.asEnum) - match targetBatch with - | Some batch -> - match batch with - | Ok "none" -> Batch.None - | Ok "partition" -> Batch.Partition - | Ok x -> raiseParseError $"Invalid batch value '{x}'" + match targetGroup with + | Some group -> + match group with + | Ok "none" -> Group.None + | Ok "partition" -> Group.Partition + | Ok x -> raiseParseError $"Invalid group value '{x}'" | Error error -> raiseParseError error - | _ -> Batch.Partition + | _ -> Group.Partition let target = { Target.Hash = targetHash diff --git a/src/Terrabuild/Core/GraphDef.fs b/src/Terrabuild/Core/GraphDef.fs index 65046d68..a0ae195e 100644 --- a/src/Terrabuild/Core/GraphDef.fs +++ b/src/Terrabuild/Core/GraphDef.fs @@ -14,7 +14,7 @@ type ContaineredShellOperation = { } [] -type Batch = +type Group = | None | Partition @@ -58,7 +58,7 @@ type Node = { Operations: ContaineredShellOperation list Artifacts: Artifacts Build: Build - Batch: Batch + Group: Group Action: NodeAction } diff --git a/src/Terrabuild/Core/GraphPipeline/Batch.fs b/src/Terrabuild/Core/GraphPipeline/Batch.fs index d69e7e83..e42bbc99 100644 --- a/src/Terrabuild/Core/GraphPipeline/Batch.fs +++ b/src/Terrabuild/Core/GraphPipeline/Batch.fs @@ -18,7 +18,7 @@ let private computeBatchId (clusterHash: string) (nodes: Node list) = let private partitionByDependencies (bucketNodes: Node list) = let bucketModes = bucketNodes - |> List.groupBy (fun node -> node.Batch) + |> List.groupBy (fun node -> node.Group) |> Map.ofSeq @@ -187,7 +187,7 @@ let private createBatchNodes (options: ConfigOptions.Options) (configuration: Co GraphDef.Node.TargetHash = headNode.TargetHash GraphDef.Node.Action = NodeAction.Build GraphDef.Node.Build = headNode.Build - GraphDef.Node.Batch = headNode.Batch } + GraphDef.Node.Group = headNode.Group } Some (batch.BatchId, batchNode) ) diff --git a/src/Terrabuild/Core/GraphPipeline/Node.fs b/src/Terrabuild/Core/GraphPipeline/Node.fs index 748e4e55..5c611ae8 100644 --- a/src/Terrabuild/Core/GraphPipeline/Node.fs +++ b/src/Terrabuild/Core/GraphPipeline/Node.fs @@ -157,7 +157,7 @@ let build (options: ConfigOptions.Options) (configuration: Configuration.Workspa let targetClusterHash = match targetConfig.Batch, batchable with - | Batch.None, _ + | Group.None, _ | _, false -> None | _, true -> let batchContent = [ @@ -177,7 +177,7 @@ let build (options: ConfigOptions.Options) (configuration: Configuration.Workspa Node.Operations = ops Node.Artifacts = cache Node.Build = build - Node.Batch = targetConfig.Batch + Node.Group = targetConfig.Batch Node.Dependencies = children Node.Outputs = targetOutput From 926cea314b18bf4e976e37b9b90c194fdfad877a Mon Sep 17 00:00:00 2001 From: Pierre Chalamet Date: Sun, 14 Dec 2025 21:02:20 +0100 Subject: [PATCH 4/7] implement group --- .../Core/GraphPipeline/Batch.fs | 71 ++++++++++++++++++- src/Terrabuild/Core/GraphPipeline/Batch.fs | 18 ++--- 2 files changed, 80 insertions(+), 9 deletions(-) diff --git a/src/Terrabuild.Tests/Core/GraphPipeline/Batch.fs b/src/Terrabuild.Tests/Core/GraphPipeline/Batch.fs index 6c5eb79f..c47bf387 100644 --- a/src/Terrabuild.Tests/Core/GraphPipeline/Batch.fs +++ b/src/Terrabuild.Tests/Core/GraphPipeline/Batch.fs @@ -5,7 +5,7 @@ open GraphDef open GraphPipeline.Batch [] -let ``check batch computation``() = +let ``check partition computation``() = let buildNode id clusterHash action deps = { Node.Id = id Node.ProjectId = id @@ -76,3 +76,72 @@ let ``check batch computation``() = expected |> List.map (fun b -> b.BatchId, b.ClusterHash, (b.Nodes |> List.map (fun n -> n.Id) |> Set.ofList)) |> Set.ofList ) + + + +[] +let ``check none/partition computation``() = + let buildNode id clusterHash action deps group = + { Node.Id = id + Node.ProjectId = id + Node.ProjectName = None + Node.ProjectDir = $"/src/project{id}" + Node.Target = "build" + Node.Dependencies = deps + Node.Outputs = Set.empty + Node.ProjectHash = "" + Node.TargetHash = "" + Node.ClusterHash = clusterHash + Node.Operations = [] + Node.Artifacts = Artifacts.Workspace + Node.Action = action + Node.Build = Build.Auto + Node.Group = group } + + let addNode (node: Node) nodes = nodes |> Map.add node.Id node + + // Bucket hash-A: connected via A1 -> A2 (in-bucket edge) + let nodeA1 = buildNode "A1" (Some "hash-A") NodeAction.Build (Set ["A2"; "B1"]) Group.Partition + let nodeA2 = buildNode "A2" (Some "hash-A") NodeAction.Restore Set.empty Group.Partition + + // Bucket hash-B: connected via B1 -> B2 (in-bucket edge) + let nodeB1 = buildNode "B1" (Some "hash-B") NodeAction.Build (Set ["B2"]) Group.None + let nodeB2 = buildNode "B2" (Some "hash-B") NodeAction.Build Set.empty Group.None + let nodeC1 = buildNode "C1" (Some "hash-B") NodeAction.Build (Set ["C2"]) Group.None + let nodeC2 = buildNode "C2" (Some "hash-B") NodeAction.Build Set.empty Group.None + + // Not batchable + let nodeD1 = buildNode "D1" None NodeAction.Build Set.empty Group.Partition + + let nodes = + Map.empty + |> addNode nodeA1 |> addNode nodeA2 + |> addNode nodeB1 |> addNode nodeB2 + |> addNode nodeC1 |> addNode nodeC2 + |> addNode nodeD1 + + let graph = + { Graph.Nodes = nodes + Graph.RootNodes = Set [ "A1"; "B1"; "D1" ] + Graph.Batches = Map.empty } + + let batches = computeBatches graph + + let expectedBatchIdA = Hash.sha256strings ("hash-A" :: [ "A1"; "A2" ]) + let expectedBatchIdB = Hash.sha256strings ("hash-B" :: [ "B1"; "B2"; "C1"; "C2" ]) + + let expected = + [ { BatchId = expectedBatchIdA + ClusterHash = "hash-A" + Nodes = [ nodeA1; nodeA2 ] } + { BatchId = expectedBatchIdB + ClusterHash = "hash-B" + Nodes = [ nodeB1; nodeB2; nodeC1; nodeC2 ] } ] + + // Order is not guaranteed; compare as sets + batches |> List.map (fun b -> b.BatchId, b.ClusterHash, (b.Nodes |> List.map (fun n -> n.Id) |> Set.ofList)) + |> Set.ofList + |> should equal ( + expected |> List.map (fun b -> b.BatchId, b.ClusterHash, (b.Nodes |> List.map (fun n -> n.Id) |> Set.ofList)) + |> Set.ofList + ) diff --git a/src/Terrabuild/Core/GraphPipeline/Batch.fs b/src/Terrabuild/Core/GraphPipeline/Batch.fs index e42bbc99..997910a0 100644 --- a/src/Terrabuild/Core/GraphPipeline/Batch.fs +++ b/src/Terrabuild/Core/GraphPipeline/Batch.fs @@ -16,13 +16,6 @@ let private computeBatchId (clusterHash: string) (nodes: Node list) = Hash.sha256strings content let private partitionByDependencies (bucketNodes: Node list) = - let bucketModes = - bucketNodes - |> List.groupBy (fun node -> node.Group) - |> Map.ofSeq - - - // Undirected connectivity inside the bucket: // edge A—B if A depends on B or B depends on A (restricted to bucket) let ids = bucketNodes |> List.map (fun n -> n.Id) |> Set.ofList @@ -91,8 +84,17 @@ let computeBatches (graph: Graph) = // if fewer than 2, no possible batch if bucketNodes.Length <= 1 then Seq.empty else - bucketNodes + let bucketModes = + bucketNodes + |> List.groupBy (fun node -> node.Group) + |> Map.ofSeq + + let noneGroup = bucketModes |> Map.tryFind Group.None |> Option.defaultValue [] + let partitionGroups = bucketModes |> Map.tryFind Group.Partition |> Option.defaultValue [] + + partitionGroups |> partitionByDependencies + |> (fun partitionGroups -> noneGroup :: partitionGroups) |> Seq.choose (fun comp -> // only batch if > 1 node and at least one member is actually executing if comp.Length <= 1 then None From edc0f463cd1dc00df9967d20680157425d0991a5 Mon Sep 17 00:00:00 2001 From: Pierre Chalamet Date: Sun, 14 Dec 2025 21:39:19 +0100 Subject: [PATCH 5/7] rename group as batch --- src/Terrabuild.Configuration.Tests/Project.fs | 8 ++++---- .../TestFiles/Success_PROJECT | 2 +- .../TestFiles/Success_WORKSPACE | 2 +- src/Terrabuild.Configuration.Tests/Workspace.fs | 12 ++++++------ src/Terrabuild.Configuration/AST/Project.fs | 2 +- src/Terrabuild.Configuration/AST/Workspace.fs | 2 +- src/Terrabuild.Configuration/Transpiler/Project.fs | 6 +++--- src/Terrabuild.Configuration/Transpiler/Workspace.fs | 6 +++--- src/Terrabuild.Tests/Core/GraphPipeline/Batch.fs | 4 ++-- src/Terrabuild/Core/Configuration.fs | 6 ++++-- src/Terrabuild/Core/GraphDef.fs | 2 +- src/Terrabuild/Core/GraphPipeline/Batch.fs | 10 +++++----- src/Terrabuild/Core/GraphPipeline/Node.fs | 9 ++++----- 13 files changed, 36 insertions(+), 35 deletions(-) diff --git a/src/Terrabuild.Configuration.Tests/Project.fs b/src/Terrabuild.Configuration.Tests/Project.fs index 57945149..fbd1d11d 100644 --- a/src/Terrabuild.Configuration.Tests/Project.fs +++ b/src/Terrabuild.Configuration.Tests/Project.fs @@ -54,14 +54,14 @@ let parseProject() = TargetBlock.Build = None TargetBlock.Outputs = None TargetBlock.Cache = None - TargetBlock.Group = Expr.Enum "partition" |> Some + TargetBlock.Batch = Expr.Enum "partition" |> Some TargetBlock.Steps = [ { Extension = "@dotnet"; Command = "build"; Parameters = Map.empty } ] } let targetDist = { TargetBlock.DependsOn = None TargetBlock.Build = None TargetBlock.Outputs = None TargetBlock.Cache = None - TargetBlock.Group = None + TargetBlock.Batch = None TargetBlock.Steps = [ { Extension = "@dotnet"; Command = "build"; Parameters = Map.empty } { Extension = "@dotnet"; Command = "publish"; Parameters = Map.empty } ] } let targetDocker = @@ -69,7 +69,7 @@ let parseProject() = TargetBlock.Build = "auto" |> Expr.Enum |> Some TargetBlock.Outputs = None TargetBlock.Cache = "remote" |> Expr.Enum |> Some - TargetBlock.Group = None + TargetBlock.Batch = None TargetBlock.Steps = [ { Extension = "@shell"; Command = "echo" Parameters = Map [ "arguments", Expr.Function (Function.Trim, [ Expr.Function (Function.Plus, @@ -128,7 +128,7 @@ let parseProject2() = Expr.String ".dll" ])] |> Some TargetBlock.DependsOn = None TargetBlock.Cache = None - TargetBlock.Group = None + TargetBlock.Batch = None TargetBlock.Steps = [ { Extension = "@dotnet"; Command = "build"; Parameters = Map.empty } ] } let locals = diff --git a/src/Terrabuild.Configuration.Tests/TestFiles/Success_PROJECT b/src/Terrabuild.Configuration.Tests/TestFiles/Success_PROJECT index d67f7b40..67f9f03e 100644 --- a/src/Terrabuild.Configuration.Tests/TestFiles/Success_PROJECT +++ b/src/Terrabuild.Configuration.Tests/TestFiles/Success_PROJECT @@ -36,7 +36,7 @@ project id { target build { depends_on = [ target.dist ] - group = ~partition + batch = ~partition @dotnet build { } } diff --git a/src/Terrabuild.Configuration.Tests/TestFiles/Success_WORKSPACE b/src/Terrabuild.Configuration.Tests/TestFiles/Success_WORKSPACE index 887ae301..394f0858 100644 --- a/src/Terrabuild.Configuration.Tests/TestFiles/Success_WORKSPACE +++ b/src/Terrabuild.Configuration.Tests/TestFiles/Success_WORKSPACE @@ -18,7 +18,7 @@ target dist { depends_on = [ target.build ] build = ~auto artifacts = ~none - group = ~none + batch = ~none } target dummy { } diff --git a/src/Terrabuild.Configuration.Tests/Workspace.fs b/src/Terrabuild.Configuration.Tests/Workspace.fs index 7e4a02ae..051129c1 100644 --- a/src/Terrabuild.Configuration.Tests/Workspace.fs +++ b/src/Terrabuild.Configuration.Tests/Workspace.fs @@ -15,17 +15,17 @@ let parseWorkspace() = { TargetBlock.DependsOn = Set [ "install"; "^build" ] |> Some TargetBlock.Build = None TargetBlock.Cache = None - TargetBlock.Group = None } + TargetBlock.Batch = None } let targetDist = { TargetBlock.DependsOn = Set [ "build" ] |> Some TargetBlock.Build = "auto" |> Expr.Enum |> Some TargetBlock.Cache = "none" |> Expr.Enum |> Some - TargetBlock.Group = "none" |> Expr.Enum |> Some } + TargetBlock.Batch = "none" |> Expr.Enum |> Some } let targetDummy = { TargetBlock.DependsOn = None TargetBlock.Build = None TargetBlock.Cache = None - TargetBlock.Group = None } + TargetBlock.Batch = None } let extDotnet = { Image = Some (Expr.String "mcr.microsoft.com/dotnet/sdk:8.0.101") @@ -81,17 +81,17 @@ let parseWorkspace2() = { TargetBlock.DependsOn = Set [ "^build" ] |> Some TargetBlock.Build = None TargetBlock.Cache = None - TargetBlock.Group = None } + TargetBlock.Batch = None } let targetDist = { TargetBlock.DependsOn = Set [ "build" ] |> Some TargetBlock.Build = None TargetBlock.Cache = None - TargetBlock.Group = None } + TargetBlock.Batch = None } let targetDummy = { TargetBlock.DependsOn = None TargetBlock.Build = None TargetBlock.Cache = None - TargetBlock.Group = None } + TargetBlock.Batch = None } let extDotnet = { Image = Expr.String "mcr.microsoft.com/dotnet/sdk:8.0.101" |> Some diff --git a/src/Terrabuild.Configuration/AST/Project.fs b/src/Terrabuild.Configuration/AST/Project.fs index d68d9ff0..b943a094 100644 --- a/src/Terrabuild.Configuration/AST/Project.fs +++ b/src/Terrabuild.Configuration/AST/Project.fs @@ -27,7 +27,7 @@ type TargetBlock = DependsOn: Set option Build: Expr option Cache: Expr option - Group: Expr option + Batch: Expr option Steps: Step list } [] diff --git a/src/Terrabuild.Configuration/AST/Workspace.fs b/src/Terrabuild.Configuration/AST/Workspace.fs index 49401e0d..36e3c09d 100644 --- a/src/Terrabuild.Configuration/AST/Workspace.fs +++ b/src/Terrabuild.Configuration/AST/Workspace.fs @@ -18,7 +18,7 @@ type TargetBlock = { DependsOn: Set option Build: Expr option Cache: Expr option - Group: Expr option } + Batch: Expr option } [] type WorkspaceFile = diff --git a/src/Terrabuild.Configuration/Transpiler/Project.fs b/src/Terrabuild.Configuration/Transpiler/Project.fs index a20c3660..75d61ab8 100644 --- a/src/Terrabuild.Configuration/Transpiler/Project.fs +++ b/src/Terrabuild.Configuration/Transpiler/Project.fs @@ -75,7 +75,7 @@ let toProject (block: Block) = let toTarget (block: Block) = block - |> checkAllowedAttributes ["outputs"; "depends_on"; "build"; "artifacts"; "group"] + |> checkAllowedAttributes ["outputs"; "depends_on"; "build"; "artifacts"; "batch"] |> ignore let outputs = block |> tryFindAttribute "outputs" @@ -89,7 +89,7 @@ let toTarget (block: Block) = | _ -> raiseInvalidArg $"Invalid target dependency '{dependency}'")) let build = block |> tryFindAttribute "build" let cache = block |> tryFindAttribute "artifacts" - let group = block |> tryFindAttribute "group" + let batch = block |> tryFindAttribute "batch" let steps = block.Blocks |> List.map (fun step -> @@ -115,7 +115,7 @@ let toTarget (block: Block) = TargetBlock.DependsOn = dependsOn TargetBlock.Build = build TargetBlock.Cache = cache - TargetBlock.Group = group + TargetBlock.Batch = batch TargetBlock.Steps = steps } diff --git a/src/Terrabuild.Configuration/Transpiler/Workspace.fs b/src/Terrabuild.Configuration/Transpiler/Workspace.fs index ba7c38ae..0d22c3d8 100644 --- a/src/Terrabuild.Configuration/Transpiler/Workspace.fs +++ b/src/Terrabuild.Configuration/Transpiler/Workspace.fs @@ -65,7 +65,7 @@ let toWorkspace (block: Block) = let toTarget (block: Block) = block - |> checkAllowedAttributes ["depends_on"; "build"; "artifacts"; "group"] + |> checkAllowedAttributes ["depends_on"; "build"; "artifacts"; "batch"] |> checkNoNestedBlocks |> ignore @@ -79,11 +79,11 @@ let toTarget (block: Block) = | _ -> raiseInvalidArg $"Invalid target dependency '{dependency}'")) let build = block |> tryFindAttribute "build" let cache = block |> tryFindAttribute "artifacts" - let group = block |> tryFindAttribute "group" + let batch = block |> tryFindAttribute "batch" { TargetBlock.DependsOn = dependsOn TargetBlock.Build = build TargetBlock.Cache = cache - TargetBlock.Group = group } + TargetBlock.Batch = batch } let toVariable (block: Block) = diff --git a/src/Terrabuild.Tests/Core/GraphPipeline/Batch.fs b/src/Terrabuild.Tests/Core/GraphPipeline/Batch.fs index c47bf387..dd49dd74 100644 --- a/src/Terrabuild.Tests/Core/GraphPipeline/Batch.fs +++ b/src/Terrabuild.Tests/Core/GraphPipeline/Batch.fs @@ -21,7 +21,7 @@ let ``check partition computation``() = Node.Artifacts = Artifacts.Workspace Node.Action = action Node.Build = Build.Auto - Node.Group = Group.Partition } + Node.Batch = Group.Partition } let addNode (node: Node) nodes = nodes |> Map.add node.Id node @@ -96,7 +96,7 @@ let ``check none/partition computation``() = Node.Artifacts = Artifacts.Workspace Node.Action = action Node.Build = Build.Auto - Node.Group = group } + Node.Batch = group } let addNode (node: Node) nodes = nodes |> Map.add node.Id node diff --git a/src/Terrabuild/Core/Configuration.fs b/src/Terrabuild/Core/Configuration.fs index a7265ad2..4da00057 100644 --- a/src/Terrabuild/Core/Configuration.fs +++ b/src/Terrabuild/Core/Configuration.fs @@ -346,10 +346,12 @@ let private loadProjectDef (options: ConfigOptions.Options) (workspaceConfig: AS let build = targetBlock.Build |> Option.orElseWith (fun () -> workspaceTarget |> Option.bind _.Build) let dependsOn = targetBlock.DependsOn |> Option.orElseWith (fun () -> workspaceTarget |> Option.bind _.DependsOn) let cache = targetBlock.Cache |> Option.orElseWith (fun () -> workspaceTarget |> Option.bind _.Cache) + let group = targetBlock.Batch |> Option.orElseWith (fun () -> workspaceTarget |> Option.bind _.Batch) { targetBlock with Build = build DependsOn = dependsOn - Cache = cache }) + Cache = cache + Batch = group }) let environments = projectConfig.Project.Environments |> Option.bind (Eval.asStringSetOption << Eval.eval evaluationContext) @@ -630,7 +632,7 @@ let private finalizeProject workspaceDir projectDir evaluationContext (projectDe let targetBatch = let targetGroup = - target.Group + target.Batch |> Option.map (fun batch -> batch |> Eval.eval evaluationContext |> Eval.asEnum) match targetGroup with | Some group -> diff --git a/src/Terrabuild/Core/GraphDef.fs b/src/Terrabuild/Core/GraphDef.fs index a0ae195e..974212a5 100644 --- a/src/Terrabuild/Core/GraphDef.fs +++ b/src/Terrabuild/Core/GraphDef.fs @@ -58,7 +58,7 @@ type Node = { Operations: ContaineredShellOperation list Artifacts: Artifacts Build: Build - Group: Group + Batch: Group Action: NodeAction } diff --git a/src/Terrabuild/Core/GraphPipeline/Batch.fs b/src/Terrabuild/Core/GraphPipeline/Batch.fs index 997910a0..5a4f5df9 100644 --- a/src/Terrabuild/Core/GraphPipeline/Batch.fs +++ b/src/Terrabuild/Core/GraphPipeline/Batch.fs @@ -84,13 +84,13 @@ let computeBatches (graph: Graph) = // if fewer than 2, no possible batch if bucketNodes.Length <= 1 then Seq.empty else - let bucketModes = + let batchModes = bucketNodes - |> List.groupBy (fun node -> node.Group) + |> List.groupBy (fun node -> node.Batch) |> Map.ofSeq - let noneGroup = bucketModes |> Map.tryFind Group.None |> Option.defaultValue [] - let partitionGroups = bucketModes |> Map.tryFind Group.Partition |> Option.defaultValue [] + let noneGroup = batchModes |> Map.tryFind Group.None |> Option.defaultValue [] + let partitionGroups = batchModes |> Map.tryFind Group.Partition |> Option.defaultValue [] partitionGroups |> partitionByDependencies @@ -189,7 +189,7 @@ let private createBatchNodes (options: ConfigOptions.Options) (configuration: Co GraphDef.Node.TargetHash = headNode.TargetHash GraphDef.Node.Action = NodeAction.Build GraphDef.Node.Build = headNode.Build - GraphDef.Node.Group = headNode.Group } + GraphDef.Node.Batch = headNode.Batch } Some (batch.BatchId, batchNode) ) diff --git a/src/Terrabuild/Core/GraphPipeline/Node.fs b/src/Terrabuild/Core/GraphPipeline/Node.fs index 5c611ae8..4e293f57 100644 --- a/src/Terrabuild/Core/GraphPipeline/Node.fs +++ b/src/Terrabuild/Core/GraphPipeline/Node.fs @@ -156,16 +156,15 @@ let build (options: ConfigOptions.Options) (configuration: Configuration.Workspa else targetConfig.Outputs let targetClusterHash = - match targetConfig.Batch, batchable with - | Group.None, _ - | _, false -> None - | _, true -> + if batchable then let batchContent = [ targetConfig.Hash $"{buildAction}" ] let batchHash = batchContent |> Hash.sha256strings Some batchHash + else + None let node = { Node.Id = nodeId @@ -177,7 +176,7 @@ let build (options: ConfigOptions.Options) (configuration: Configuration.Workspa Node.Operations = ops Node.Artifacts = cache Node.Build = build - Node.Group = targetConfig.Batch + Node.Batch = targetConfig.Batch Node.Dependencies = children Node.Outputs = targetOutput From ac6cb11f0bc1e1247103f44c05db583076631d0b Mon Sep 17 00:00:00 2001 From: Pierre Chalamet Date: Sun, 14 Dec 2025 21:50:14 +0100 Subject: [PATCH 6/7] none is default batch mode --- src/Terrabuild/Core/Configuration.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Terrabuild/Core/Configuration.fs b/src/Terrabuild/Core/Configuration.fs index 4da00057..db277c2e 100644 --- a/src/Terrabuild/Core/Configuration.fs +++ b/src/Terrabuild/Core/Configuration.fs @@ -641,7 +641,7 @@ let private finalizeProject workspaceDir projectDir evaluationContext (projectDe | Ok "partition" -> Group.Partition | Ok x -> raiseParseError $"Invalid group value '{x}'" | Error error -> raiseParseError error - | _ -> Group.Partition + | _ -> Group.None let target = { Target.Hash = targetHash From 8de4abf4150db4898e476d55410da3925c671155 Mon Sep 17 00:00:00 2001 From: Pierre Chalamet Date: Sun, 14 Dec 2025 22:01:37 +0100 Subject: [PATCH 7/7] update smoke tests --- .../terrabuild-debug.action-graph.json | 1 + .../results/terrabuild-debug.batch-graph.json | 1 + .../results/terrabuild-debug.config.json | 2 +- .../results/terrabuild-debug.node-graph.json | 1 + .../terrabuild-debug.action-graph.json | 53 ++++++++++++++++++- .../results/terrabuild-debug.batch-graph.json | 53 ++++++++++++++++++- .../results/terrabuild-debug.config.json | 14 ++--- .../results/terrabuild-debug.info.md | 4 ++ .../results/terrabuild-debug.node-graph.json | 9 ++++ .../terrabuild-debug.action-graph.json | 4 ++ .../results/terrabuild-debug.batch-graph.json | 4 ++ .../results/terrabuild-debug.config.json | 12 ++--- .../results/terrabuild-debug.node-graph.json | 4 ++ .../terrabuild-debug.action-graph.json | 3 ++ .../results/terrabuild-debug.batch-graph.json | 3 ++ .../results/terrabuild-debug.config.json | 6 +-- .../results/terrabuild-debug.node-graph.json | 3 ++ .../terrabuild-debug.action-graph.json | 12 +++++ .../results/terrabuild-debug.batch-graph.json | 12 +++++ .../results/terrabuild-debug.config.json | 26 ++++----- .../results/terrabuild-debug.node-graph.json | 10 ++++ 21 files changed, 205 insertions(+), 32 deletions(-) diff --git a/tests/basic/results/terrabuild-debug.action-graph.json b/tests/basic/results/terrabuild-debug.action-graph.json index eebd3e7f..c5d07a54 100644 --- a/tests/basic/results/terrabuild-debug.action-graph.json +++ b/tests/basic/results/terrabuild-debug.action-graph.json @@ -24,6 +24,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" } }, diff --git a/tests/basic/results/terrabuild-debug.batch-graph.json b/tests/basic/results/terrabuild-debug.batch-graph.json index eebd3e7f..c5d07a54 100644 --- a/tests/basic/results/terrabuild-debug.batch-graph.json +++ b/tests/basic/results/terrabuild-debug.batch-graph.json @@ -24,6 +24,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" } }, diff --git a/tests/basic/results/terrabuild-debug.config.json b/tests/basic/results/terrabuild-debug.config.json index 6f63b6c1..747bd4c9 100644 --- a/tests/basic/results/terrabuild-debug.config.json +++ b/tests/basic/results/terrabuild-debug.config.json @@ -35,7 +35,7 @@ "targets": { "build": { "hash": "8B56DAA76BB451252D58A9AFF5D2E5A77D0568D8681204549E53A422C9FBDBF0", - "batch": false, + "batch": "none", "dependsOn": [ "^build" ], diff --git a/tests/basic/results/terrabuild-debug.node-graph.json b/tests/basic/results/terrabuild-debug.node-graph.json index eebd3e7f..c5d07a54 100644 --- a/tests/basic/results/terrabuild-debug.node-graph.json +++ b/tests/basic/results/terrabuild-debug.node-graph.json @@ -24,6 +24,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" } }, diff --git a/tests/cluster-layers/results/terrabuild-debug.action-graph.json b/tests/cluster-layers/results/terrabuild-debug.action-graph.json index 80d89cdd..c5622350 100644 --- a/tests/cluster-layers/results/terrabuild-debug.action-graph.json +++ b/tests/cluster-layers/results/terrabuild-debug.action-graph.json @@ -1,5 +1,42 @@ { "nodes": { + "4DCEF7C171D3D0820AE9FD0F8C05527BB1C2D7CA1C11F74EF560B4128AC8C047": { + "id": "4DCEF7C171D3D0820AE9FD0F8C05527BB1C2D7CA1C11F74EF560B4128AC8C047", + "projectId": "4DCEF7C171D3D0820AE9FD0F8C05527BB1C2D7CA1C11F74EF560B4128AC8C047", + "projectDir": ".", + "target": "build", + "dependencies": [ + "workspace/path#c:build" + ], + "outputs": [], + "projectHash": "4DCEF7C171D3D0820AE9FD0F8C05527BB1C2D7CA1C11F74EF560B4128AC8C047", + "targetHash": "F59792CEAF216E5D8146633727BF9C85E5B5D86F6806D1424676E0100DA55430", + "clusterHash": "42A52C6423E3FBBA706DFA59745D17388DDA7201E18525EE728783E9EC7C75AB", + "operations": [ + { + "image": "mcr.microsoft.com/dotnet/sdk:9.0.202", + "variables": [], + "envs": {}, + "metaCommand": "@dotnet restore", + "command": "dotnet", + "arguments": "restore .terrabuild/4DCEF7C171D3D0820AE9FD0F8C05527BB1C2D7CA1C11F74EF560B4128AC8C047.sln", + "errorLevel": 0 + }, + { + "image": "mcr.microsoft.com/dotnet/sdk:9.0.202", + "variables": [], + "envs": {}, + "metaCommand": "@dotnet build", + "command": "dotnet", + "arguments": "build .terrabuild/4DCEF7C171D3D0820AE9FD0F8C05527BB1C2D7CA1C11F74EF560B4128AC8C047.sln --no-restore --configuration Debug", + "errorLevel": 0 + } + ], + "artifacts": "managed", + "build": "always", + "batch": "none", + "action": "build" + }, "workspace/path#a:build": { "id": "workspace/path#a:build", "projectId": "workspace/path#a", @@ -44,6 +81,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#b:build": { @@ -90,6 +128,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#c:build": { @@ -137,6 +176,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#d:build": { @@ -155,6 +195,7 @@ ], "projectHash": "E27EE8CFF9BD151E97E09A8A953929B6DC5E4E242F0EB1BD94FD92562DFC1EB6", "targetHash": "F59792CEAF216E5D8146633727BF9C85E5B5D86F6806D1424676E0100DA55430", + "clusterHash": "42A52C6423E3FBBA706DFA59745D17388DDA7201E18525EE728783E9EC7C75AB", "operations": [ { "image": "mcr.microsoft.com/dotnet/sdk:9.0.202", @@ -177,6 +218,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#e:build": { @@ -195,6 +237,7 @@ ], "projectHash": "0913D77CAAD0C42E3E5521DA44216CEEB02C56ADB452C6F1999EA983DC9C9BFB", "targetHash": "DF61287AD8999932BA40DAB1C891C748A8210C4D6648EE24113F45428CE8A63C", + "clusterHash": "42A52C6423E3FBBA706DFA59745D17388DDA7201E18525EE728783E9EC7C75AB", "operations": [ { "image": "mcr.microsoft.com/dotnet/sdk:9.0.202", @@ -217,6 +260,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#f:build": { @@ -256,6 +300,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#g:build": { @@ -294,6 +339,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" } }, @@ -301,5 +347,10 @@ "workspace/path#f:build", "workspace/path#g:build" ], - "batches": {} + "batches": { + "4DCEF7C171D3D0820AE9FD0F8C05527BB1C2D7CA1C11F74EF560B4128AC8C047": [ + "workspace/path#d:build", + "workspace/path#e:build" + ] + } } \ No newline at end of file diff --git a/tests/cluster-layers/results/terrabuild-debug.batch-graph.json b/tests/cluster-layers/results/terrabuild-debug.batch-graph.json index 80d89cdd..c5622350 100644 --- a/tests/cluster-layers/results/terrabuild-debug.batch-graph.json +++ b/tests/cluster-layers/results/terrabuild-debug.batch-graph.json @@ -1,5 +1,42 @@ { "nodes": { + "4DCEF7C171D3D0820AE9FD0F8C05527BB1C2D7CA1C11F74EF560B4128AC8C047": { + "id": "4DCEF7C171D3D0820AE9FD0F8C05527BB1C2D7CA1C11F74EF560B4128AC8C047", + "projectId": "4DCEF7C171D3D0820AE9FD0F8C05527BB1C2D7CA1C11F74EF560B4128AC8C047", + "projectDir": ".", + "target": "build", + "dependencies": [ + "workspace/path#c:build" + ], + "outputs": [], + "projectHash": "4DCEF7C171D3D0820AE9FD0F8C05527BB1C2D7CA1C11F74EF560B4128AC8C047", + "targetHash": "F59792CEAF216E5D8146633727BF9C85E5B5D86F6806D1424676E0100DA55430", + "clusterHash": "42A52C6423E3FBBA706DFA59745D17388DDA7201E18525EE728783E9EC7C75AB", + "operations": [ + { + "image": "mcr.microsoft.com/dotnet/sdk:9.0.202", + "variables": [], + "envs": {}, + "metaCommand": "@dotnet restore", + "command": "dotnet", + "arguments": "restore .terrabuild/4DCEF7C171D3D0820AE9FD0F8C05527BB1C2D7CA1C11F74EF560B4128AC8C047.sln", + "errorLevel": 0 + }, + { + "image": "mcr.microsoft.com/dotnet/sdk:9.0.202", + "variables": [], + "envs": {}, + "metaCommand": "@dotnet build", + "command": "dotnet", + "arguments": "build .terrabuild/4DCEF7C171D3D0820AE9FD0F8C05527BB1C2D7CA1C11F74EF560B4128AC8C047.sln --no-restore --configuration Debug", + "errorLevel": 0 + } + ], + "artifacts": "managed", + "build": "always", + "batch": "none", + "action": "build" + }, "workspace/path#a:build": { "id": "workspace/path#a:build", "projectId": "workspace/path#a", @@ -44,6 +81,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#b:build": { @@ -90,6 +128,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#c:build": { @@ -137,6 +176,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#d:build": { @@ -155,6 +195,7 @@ ], "projectHash": "E27EE8CFF9BD151E97E09A8A953929B6DC5E4E242F0EB1BD94FD92562DFC1EB6", "targetHash": "F59792CEAF216E5D8146633727BF9C85E5B5D86F6806D1424676E0100DA55430", + "clusterHash": "42A52C6423E3FBBA706DFA59745D17388DDA7201E18525EE728783E9EC7C75AB", "operations": [ { "image": "mcr.microsoft.com/dotnet/sdk:9.0.202", @@ -177,6 +218,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#e:build": { @@ -195,6 +237,7 @@ ], "projectHash": "0913D77CAAD0C42E3E5521DA44216CEEB02C56ADB452C6F1999EA983DC9C9BFB", "targetHash": "DF61287AD8999932BA40DAB1C891C748A8210C4D6648EE24113F45428CE8A63C", + "clusterHash": "42A52C6423E3FBBA706DFA59745D17388DDA7201E18525EE728783E9EC7C75AB", "operations": [ { "image": "mcr.microsoft.com/dotnet/sdk:9.0.202", @@ -217,6 +260,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#f:build": { @@ -256,6 +300,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#g:build": { @@ -294,6 +339,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" } }, @@ -301,5 +347,10 @@ "workspace/path#f:build", "workspace/path#g:build" ], - "batches": {} + "batches": { + "4DCEF7C171D3D0820AE9FD0F8C05527BB1C2D7CA1C11F74EF560B4128AC8C047": [ + "workspace/path#d:build", + "workspace/path#e:build" + ] + } } \ No newline at end of file diff --git a/tests/cluster-layers/results/terrabuild-debug.config.json b/tests/cluster-layers/results/terrabuild-debug.config.json index a0d92bf8..6a123f65 100644 --- a/tests/cluster-layers/results/terrabuild-debug.config.json +++ b/tests/cluster-layers/results/terrabuild-debug.config.json @@ -27,7 +27,7 @@ "targets": { "build": { "hash": "81599BD76CC256A0E9C3CF927869F3FD30AB37AED7714178F2D390BDD477E590", - "batch": false, + "batch": "none", "dependsOn": [ "^build" ], @@ -111,7 +111,7 @@ "targets": { "build": { "hash": "81599BD76CC256A0E9C3CF927869F3FD30AB37AED7714178F2D390BDD477E590", - "batch": false, + "batch": "none", "dependsOn": [ "^build" ], @@ -199,7 +199,7 @@ "targets": { "build": { "hash": "23CD6C07165F99D32FB02EF8EC9817467A787E3C2040F3FC9CB0AEC056F3E478", - "batch": false, + "batch": "none", "dependsOn": [ "^build" ], @@ -273,7 +273,7 @@ "targets": { "build": { "hash": "89F54C1D6CCEDA2279E58F176EEC7D265891E610EFCBC76C9725473565B6A245", - "batch": false, + "batch": "none", "dependsOn": [ "^build" ], @@ -342,7 +342,7 @@ "targets": { "build": { "hash": "89F54C1D6CCEDA2279E58F176EEC7D265891E610EFCBC76C9725473565B6A245", - "batch": false, + "batch": "none", "dependsOn": [ "^build" ], @@ -413,7 +413,7 @@ "targets": { "build": { "hash": "304D5C1EA81C44255643B0F217F738283ACA731523F690F8472125D3B3363073", - "batch": false, + "batch": "none", "dependsOn": [ "^build" ], @@ -471,7 +471,7 @@ "targets": { "build": { "hash": "304D5C1EA81C44255643B0F217F738283ACA731523F690F8472125D3B3363073", - "batch": false, + "batch": "none", "dependsOn": [ "^build" ], diff --git a/tests/cluster-layers/results/terrabuild-debug.info.md b/tests/cluster-layers/results/terrabuild-debug.info.md index abc6892c..e0958fd8 100644 --- a/tests/cluster-layers/results/terrabuild-debug.info.md +++ b/tests/cluster-layers/results/terrabuild-debug.info.md @@ -16,6 +16,8 @@ flowchart TD classDef build stroke:red,stroke-width:3px classDef restore stroke:orange,stroke-width:3px classDef ignore stroke:black,stroke-width:3px +4DCEF7C171D3D0820AE9FD0F8C05527BB1C2D7CA1C11F74EF560B4128AC8C047("build +.") workspace/path#a:build("build a A") workspace/path#b:build("build b @@ -30,6 +32,8 @@ workspace/path#f:build("build f F") workspace/path#g:build("build g G") +4DCEF7C171D3D0820AE9FD0F8C05527BB1C2D7CA1C11F74EF560B4128AC8C047 --> workspace/path#c:build +class 4DCEF7C171D3D0820AE9FD0F8C05527BB1C2D7CA1C11F74EF560B4128AC8C047 ignore class workspace/path#a:build ignore class workspace/path#b:build ignore workspace/path#c:build --> workspace/path#a:build diff --git a/tests/cluster-layers/results/terrabuild-debug.node-graph.json b/tests/cluster-layers/results/terrabuild-debug.node-graph.json index 80d89cdd..d7fad787 100644 --- a/tests/cluster-layers/results/terrabuild-debug.node-graph.json +++ b/tests/cluster-layers/results/terrabuild-debug.node-graph.json @@ -44,6 +44,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#b:build": { @@ -90,6 +91,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#c:build": { @@ -137,6 +139,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#d:build": { @@ -155,6 +158,7 @@ ], "projectHash": "E27EE8CFF9BD151E97E09A8A953929B6DC5E4E242F0EB1BD94FD92562DFC1EB6", "targetHash": "F59792CEAF216E5D8146633727BF9C85E5B5D86F6806D1424676E0100DA55430", + "clusterHash": "42A52C6423E3FBBA706DFA59745D17388DDA7201E18525EE728783E9EC7C75AB", "operations": [ { "image": "mcr.microsoft.com/dotnet/sdk:9.0.202", @@ -177,6 +181,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#e:build": { @@ -195,6 +200,7 @@ ], "projectHash": "0913D77CAAD0C42E3E5521DA44216CEEB02C56ADB452C6F1999EA983DC9C9BFB", "targetHash": "DF61287AD8999932BA40DAB1C891C748A8210C4D6648EE24113F45428CE8A63C", + "clusterHash": "42A52C6423E3FBBA706DFA59745D17388DDA7201E18525EE728783E9EC7C75AB", "operations": [ { "image": "mcr.microsoft.com/dotnet/sdk:9.0.202", @@ -217,6 +223,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#f:build": { @@ -256,6 +263,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#g:build": { @@ -294,6 +302,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" } }, diff --git a/tests/indirect-target/results/terrabuild-debug.action-graph.json b/tests/indirect-target/results/terrabuild-debug.action-graph.json index 80f71e1c..425a71f2 100644 --- a/tests/indirect-target/results/terrabuild-debug.action-graph.json +++ b/tests/indirect-target/results/terrabuild-debug.action-graph.json @@ -22,6 +22,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#b:apply": { @@ -48,6 +49,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#b:plan": { @@ -72,6 +74,7 @@ ], "artifacts": "none", "build": "auto", + "batch": "none", "action": "build" }, "workspace/path#c:build": { @@ -96,6 +99,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" } }, diff --git a/tests/indirect-target/results/terrabuild-debug.batch-graph.json b/tests/indirect-target/results/terrabuild-debug.batch-graph.json index 14b14cb0..1cb2602c 100644 --- a/tests/indirect-target/results/terrabuild-debug.batch-graph.json +++ b/tests/indirect-target/results/terrabuild-debug.batch-graph.json @@ -22,6 +22,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#b:apply": { @@ -48,6 +49,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#b:plan": { @@ -72,6 +74,7 @@ ], "artifacts": "none", "build": "auto", + "batch": "none", "action": "ignore" }, "workspace/path#c:build": { @@ -96,6 +99,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" } }, diff --git a/tests/indirect-target/results/terrabuild-debug.config.json b/tests/indirect-target/results/terrabuild-debug.config.json index dcd1f639..ccfae1da 100644 --- a/tests/indirect-target/results/terrabuild-debug.config.json +++ b/tests/indirect-target/results/terrabuild-debug.config.json @@ -37,7 +37,7 @@ "targets": { "build": { "hash": "8B56DAA76BB451252D58A9AFF5D2E5A77D0568D8681204549E53A422C9FBDBF0", - "batch": false, + "batch": "none", "dependsOn": [ "^build" ], @@ -64,7 +64,7 @@ }, "dist": { "hash": "8B56DAA76BB451252D58A9AFF5D2E5A77D0568D8681204549E53A422C9FBDBF0", - "batch": false, + "batch": "none", "dependsOn": [ "^dist", "build" @@ -108,7 +108,7 @@ "targets": { "apply": { "hash": "8B56DAA76BB451252D58A9AFF5D2E5A77D0568D8681204549E53A422C9FBDBF0", - "batch": false, + "batch": "none", "dependsOn": [ "^apply", "plan" @@ -137,7 +137,7 @@ "plan": { "hash": "8B56DAA76BB451252D58A9AFF5D2E5A77D0568D8681204549E53A422C9FBDBF0", "build": "auto", - "batch": false, + "batch": "none", "dependsOn": [ "^plan", "dist" @@ -179,7 +179,7 @@ "targets": { "build": { "hash": "8B56DAA76BB451252D58A9AFF5D2E5A77D0568D8681204549E53A422C9FBDBF0", - "batch": false, + "batch": "none", "dependsOn": [ "^build" ], @@ -206,7 +206,7 @@ }, "dist": { "hash": "8B56DAA76BB451252D58A9AFF5D2E5A77D0568D8681204549E53A422C9FBDBF0", - "batch": false, + "batch": "none", "dependsOn": [ "^dist", "build" diff --git a/tests/indirect-target/results/terrabuild-debug.node-graph.json b/tests/indirect-target/results/terrabuild-debug.node-graph.json index 14b14cb0..1cb2602c 100644 --- a/tests/indirect-target/results/terrabuild-debug.node-graph.json +++ b/tests/indirect-target/results/terrabuild-debug.node-graph.json @@ -22,6 +22,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#b:apply": { @@ -48,6 +49,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#b:plan": { @@ -72,6 +74,7 @@ ], "artifacts": "none", "build": "auto", + "batch": "none", "action": "ignore" }, "workspace/path#c:build": { @@ -96,6 +99,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" } }, diff --git a/tests/multirefs/results/terrabuild-debug.action-graph.json b/tests/multirefs/results/terrabuild-debug.action-graph.json index 527d6808..2a6175ce 100644 --- a/tests/multirefs/results/terrabuild-debug.action-graph.json +++ b/tests/multirefs/results/terrabuild-debug.action-graph.json @@ -25,6 +25,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#b:build": { @@ -51,6 +52,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#c:build": { @@ -75,6 +77,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" } }, diff --git a/tests/multirefs/results/terrabuild-debug.batch-graph.json b/tests/multirefs/results/terrabuild-debug.batch-graph.json index 527d6808..2a6175ce 100644 --- a/tests/multirefs/results/terrabuild-debug.batch-graph.json +++ b/tests/multirefs/results/terrabuild-debug.batch-graph.json @@ -25,6 +25,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#b:build": { @@ -51,6 +52,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#c:build": { @@ -75,6 +77,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" } }, diff --git a/tests/multirefs/results/terrabuild-debug.config.json b/tests/multirefs/results/terrabuild-debug.config.json index 11278978..5e4015f5 100644 --- a/tests/multirefs/results/terrabuild-debug.config.json +++ b/tests/multirefs/results/terrabuild-debug.config.json @@ -35,7 +35,7 @@ "targets": { "build": { "hash": "8B56DAA76BB451252D58A9AFF5D2E5A77D0568D8681204549E53A422C9FBDBF0", - "batch": false, + "batch": "none", "dependsOn": [ "^build" ], @@ -78,7 +78,7 @@ "targets": { "build": { "hash": "8B56DAA76BB451252D58A9AFF5D2E5A77D0568D8681204549E53A422C9FBDBF0", - "batch": false, + "batch": "none", "dependsOn": [ "^build" ], @@ -119,7 +119,7 @@ "targets": { "build": { "hash": "8B56DAA76BB451252D58A9AFF5D2E5A77D0568D8681204549E53A422C9FBDBF0", - "batch": false, + "batch": "none", "dependsOn": [ "^build" ], diff --git a/tests/multirefs/results/terrabuild-debug.node-graph.json b/tests/multirefs/results/terrabuild-debug.node-graph.json index 527d6808..2a6175ce 100644 --- a/tests/multirefs/results/terrabuild-debug.node-graph.json +++ b/tests/multirefs/results/terrabuild-debug.node-graph.json @@ -25,6 +25,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#b:build": { @@ -51,6 +52,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#c:build": { @@ -75,6 +77,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" } }, diff --git a/tests/simple/results/terrabuild-debug.action-graph.json b/tests/simple/results/terrabuild-debug.action-graph.json index 4533a437..2636fa1a 100644 --- a/tests/simple/results/terrabuild-debug.action-graph.json +++ b/tests/simple/results/terrabuild-debug.action-graph.json @@ -38,6 +38,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "@pnpm#npm-app:build": { @@ -83,6 +84,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "@pnpm#npm-lib:build": { @@ -126,6 +128,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "AE38E14C3291D31EC47622AD76BB934AF3E6000DB633CD196D1563779150CB2C": { @@ -162,6 +165,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#deployments/terraform-deploy:build": { @@ -202,6 +206,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#libraries/dotnet-lib:build": { @@ -242,6 +247,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#libraries/shell-lib:build": { @@ -266,6 +272,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#projects/dotnet-app:build": { @@ -309,6 +316,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#projects/make-app:build": { @@ -342,6 +350,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#projects/open-api:build": { @@ -367,6 +376,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#projects/rust-app:build": { @@ -395,6 +405,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#tests/playwright:test": { @@ -430,6 +441,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" } }, diff --git a/tests/simple/results/terrabuild-debug.batch-graph.json b/tests/simple/results/terrabuild-debug.batch-graph.json index 4533a437..2636fa1a 100644 --- a/tests/simple/results/terrabuild-debug.batch-graph.json +++ b/tests/simple/results/terrabuild-debug.batch-graph.json @@ -38,6 +38,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "@pnpm#npm-app:build": { @@ -83,6 +84,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "@pnpm#npm-lib:build": { @@ -126,6 +128,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "AE38E14C3291D31EC47622AD76BB934AF3E6000DB633CD196D1563779150CB2C": { @@ -162,6 +165,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#deployments/terraform-deploy:build": { @@ -202,6 +206,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#libraries/dotnet-lib:build": { @@ -242,6 +247,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#libraries/shell-lib:build": { @@ -266,6 +272,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#projects/dotnet-app:build": { @@ -309,6 +316,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#projects/make-app:build": { @@ -342,6 +350,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#projects/open-api:build": { @@ -367,6 +376,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#projects/rust-app:build": { @@ -395,6 +405,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#tests/playwright:test": { @@ -430,6 +441,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" } }, diff --git a/tests/simple/results/terrabuild-debug.config.json b/tests/simple/results/terrabuild-debug.config.json index 5ac43f2f..1e06ea07 100644 --- a/tests/simple/results/terrabuild-debug.config.json +++ b/tests/simple/results/terrabuild-debug.config.json @@ -59,7 +59,7 @@ "targets": { "build": { "hash": "F8D51FB2860142179111E84F61779ED89C44532A76FF7B0A82854EEC9A268DFD", - "batch": true, + "batch": "none", "dependsOn": [ "^build" ], @@ -128,7 +128,7 @@ "targets": { "build": { "hash": "F8D51FB2860142179111E84F61779ED89C44532A76FF7B0A82854EEC9A268DFD", - "batch": true, + "batch": "none", "dependsOn": [ "^build" ], @@ -197,7 +197,7 @@ "targets": { "build": { "hash": "05C9D17B824DB3A4EC6F7597B38455361E19FD2BAAF4B940B6AD3B02019998E1", - "batch": false, + "batch": "none", "dependsOn": [ "^build" ], @@ -260,7 +260,7 @@ }, "deploy": { "hash": "B3E1E648F36E350D97062C1E7799E556783366AC32DB75B59BCD8ADF32A7A696", - "batch": false, + "batch": "none", "dependsOn": [ "push" ], @@ -329,7 +329,7 @@ "targets": { "build": { "hash": "3CA5AE131AA04144ED0B54B7683F5A2B8972393E71713DC586BBF94F53BA3BDD", - "batch": true, + "batch": "none", "dependsOn": [ "^build" ], @@ -401,7 +401,7 @@ "targets": { "build": { "hash": "8B56DAA76BB451252D58A9AFF5D2E5A77D0568D8681204549E53A422C9FBDBF0", - "batch": false, + "batch": "none", "dependsOn": [ "^build" ], @@ -448,7 +448,7 @@ "targets": { "build": { "hash": "3CA5AE131AA04144ED0B54B7683F5A2B8972393E71713DC586BBF94F53BA3BDD", - "batch": true, + "batch": "none", "dependsOn": [ "^build" ], @@ -508,7 +508,7 @@ }, "dist": { "hash": "71B04C660C84F005AA77AE72F1B798B933FC718D638C3DEEBC029BA8451DCA24", - "batch": true, + "batch": "none", "dependsOn": [ "build" ], @@ -564,7 +564,7 @@ }, "docker": { "hash": "284192E5967E8DFA22895ABD89017A46E3516D76DEAE8AFE28318C78921D8A23", - "batch": false, + "batch": "none", "dependsOn": [ "dist" ], @@ -625,7 +625,7 @@ "targets": { "build": { "hash": "C6337486788B3103E3C2737C5C465A151569678B0F79EDBAF65D6409D1FDDCB4", - "batch": false, + "batch": "none", "dependsOn": [ "^build" ], @@ -693,7 +693,7 @@ "targets": { "build": { "hash": "368590893C4C4CB86F11CE435BED211B8E67BBAA776E88A26BA9786A25B48841", - "batch": false, + "batch": "none", "dependsOn": [ "^build" ], @@ -748,7 +748,7 @@ "targets": { "build": { "hash": "5F97E6095B871F9045214CFE08ABC4C8E778379ACCA4D34A94079C508D24D5C4", - "batch": false, + "batch": "none", "dependsOn": [ "^build" ], @@ -799,7 +799,7 @@ "targets": { "test": { "hash": "7E353E272E8F3286607C89C806E14336C15B07A72D13193C02D31EC3B11DE9A9", - "batch": false, + "batch": "none", "dependsOn": [ "build" ], diff --git a/tests/simple/results/terrabuild-debug.node-graph.json b/tests/simple/results/terrabuild-debug.node-graph.json index ee822b6d..22d849b4 100644 --- a/tests/simple/results/terrabuild-debug.node-graph.json +++ b/tests/simple/results/terrabuild-debug.node-graph.json @@ -43,6 +43,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "@pnpm#npm-lib:build": { @@ -86,6 +87,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#deployments/terraform-deploy:build": { @@ -126,6 +128,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#libraries/dotnet-lib:build": { @@ -166,6 +169,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#libraries/shell-lib:build": { @@ -190,6 +194,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#projects/dotnet-app:build": { @@ -233,6 +238,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#projects/make-app:build": { @@ -266,6 +272,7 @@ ], "artifacts": "none", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#projects/open-api:build": { @@ -291,6 +298,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#projects/rust-app:build": { @@ -319,6 +327,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" }, "workspace/path#tests/playwright:test": { @@ -354,6 +363,7 @@ ], "artifacts": "managed", "build": "always", + "batch": "none", "action": "build" } },