prepare first attempt on the builder pipeline

This commit is contained in:
2026-03-24 13:42:13 +00:00
parent f61200f8ef
commit e8afc8ea0d
47 changed files with 271 additions and 139 deletions
@@ -2,8 +2,8 @@ package p.studio.compiler.workspaces;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import p.studio.compiler.model.DependencyPipelineConfig;
import p.studio.compiler.model.ResolvedWorkspace;
import p.studio.compiler.messages.DependencyConfig;
import p.studio.compiler.models.ResolvedWorkspace;
import p.studio.compiler.workspaces.phases.*;
import java.io.IOException;
@@ -13,7 +13,7 @@ import java.util.List;
import static org.junit.jupiter.api.Assertions.*;
class DependencyPipelineServiceTest {
class DependencyServiceTest {
@Test
void canonical_pipeline_e2e(@TempDir Path tempDir) throws IOException {
@@ -26,7 +26,7 @@ class DependencyPipelineServiceTest {
writeManifest(root, "root-proj", "0.1.0", new String[]{"depA"});
writeManifest(depA, "dep-a", "0.1.0", new String[]{});
final var cfg = new DependencyPipelineConfig(false, root, List.of());
final var cfg = new DependencyConfig(false, root, List.of());
final var phases = List.of(
new SeedPhase(),
new DiscoverPhase(),
@@ -37,7 +37,7 @@ class DependencyPipelineServiceTest {
new PolicyPhase()
);
final var service = new DependencyPipelineService(phases);
final var service = new DependencyService(phases);
final ResolvedWorkspace ws = service.run(cfg);
assertNotNull(ws);
@@ -2,7 +2,8 @@ package p.studio.compiler.workspaces;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import p.studio.compiler.model.DependencyPipelineConfig;
import p.studio.compiler.messages.DependencyConfig;
import p.studio.compiler.models.DependencyContext;
import p.studio.compiler.workspaces.phases.DiscoverPhase;
import p.studio.compiler.workspaces.phases.SeedPhase;
import p.studio.utilities.structures.ReadOnlyCollection;
@@ -25,8 +26,8 @@ class DiscoverPhaseTest {
writeManifest(root, "root-proj", "0.1.0", new String[]{"depA"}, null);
writeManifest(depA, "dep-a", "0.1.0", new String[]{}, null);
final var cfg = new DependencyPipelineConfig(false, root, java.util.List.of());
final var ctx = DependencyPipelineContext.seed(cfg);
final var cfg = new DependencyConfig(false, root, java.util.List.of());
final var ctx = DependencyContext.seed(cfg);
assertTrue(ReadOnlyCollection.isEmpty(new SeedPhase().run(ctx)));
final var issues = new DiscoverPhase().run(ctx);
@@ -2,7 +2,8 @@ package p.studio.compiler.workspaces;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import p.studio.compiler.model.DependencyPipelineConfig;
import p.studio.compiler.messages.DependencyConfig;
import p.studio.compiler.models.DependencyContext;
import p.studio.compiler.workspaces.phases.*;
import p.studio.utilities.structures.ReadOnlyCollection;
@@ -25,8 +26,8 @@ class LocalizePhaseTest {
writeManifest(root, "root-proj", "0.1.0", new String[]{"depA"});
writeManifest(depA, "dep-a", "0.1.0", new String[]{});
final var cfg = new DependencyPipelineConfig(false, root, java.util.List.of());
final var ctx = DependencyPipelineContext.seed(cfg);
final var cfg = new DependencyConfig(false, root, java.util.List.of());
final var ctx = DependencyContext.seed(cfg);
assertTrue(ReadOnlyCollection.isEmpty(new SeedPhase().run(ctx)));
assertTrue(ReadOnlyCollection.isEmpty(new DiscoverPhase().run(ctx)));
assertTrue(ReadOnlyCollection.isEmpty(new MaterializePhase().run(ctx)));
@@ -2,7 +2,8 @@ package p.studio.compiler.workspaces;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import p.studio.compiler.model.DependencyPipelineConfig;
import p.studio.compiler.messages.DependencyConfig;
import p.studio.compiler.models.DependencyContext;
import p.studio.compiler.workspaces.phases.DiscoverPhase;
import p.studio.compiler.workspaces.phases.MaterializePhase;
import p.studio.compiler.workspaces.phases.SeedPhase;
@@ -27,8 +28,8 @@ class MaterializePhaseTest {
writeManifest(root, "root-proj", "0.1.0", new String[]{"depA"});
writeManifest(depA, "dep-a", "0.1.0", new String[]{});
final var cfg = new DependencyPipelineConfig(false, root, java.util.List.of());
final var ctx = DependencyPipelineContext.seed(cfg);
final var cfg = new DependencyConfig(false, root, java.util.List.of());
final var ctx = DependencyContext.seed(cfg);
assertTrue(ReadOnlyCollection.isEmpty(new SeedPhase().run(ctx)));
assertTrue(ReadOnlyCollection.isEmpty(new DiscoverPhase().run(ctx)));
@@ -2,7 +2,8 @@ package p.studio.compiler.workspaces;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import p.studio.compiler.model.DependencyPipelineConfig;
import p.studio.compiler.messages.DependencyConfig;
import p.studio.compiler.models.DependencyContext;
import p.studio.compiler.workspaces.phases.SeedPhase;
import p.studio.utilities.structures.ReadOnlyCollection;
@@ -14,8 +15,8 @@ class SeedPhaseTest {
@Test
void seed_initializes_root_and_pending(@TempDir Path tempDir) throws Exception {
final var cfg = new DependencyPipelineConfig(false, tempDir, java.util.List.of());
final var ctx = DependencyPipelineContext.seed(cfg);
final var cfg = new DependencyConfig(false, tempDir, java.util.List.of());
final var ctx = DependencyContext.seed(cfg);
final var issues = new SeedPhase().run(ctx);
assertTrue(ReadOnlyCollection.isEmpty(issues), "Nenhum issue esperado na SeedPhase");
@@ -2,7 +2,8 @@ package p.studio.compiler.workspaces;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import p.studio.compiler.model.DependencyPipelineConfig;
import p.studio.compiler.messages.DependencyConfig;
import p.studio.compiler.models.DependencyContext;
import p.studio.compiler.workspaces.phases.*;
import p.studio.utilities.structures.ReadOnlyCollection;
@@ -25,8 +26,8 @@ class StackPhaseTest {
writeManifest(root, "root-proj", "0.1.0", new String[]{"depA"});
writeManifest(depA, "dep-a", "0.1.0", new String[]{});
final var cfg = new DependencyPipelineConfig(false, root, java.util.List.of());
final var ctx = DependencyPipelineContext.seed(cfg);
final var cfg = new DependencyConfig(false, root, java.util.List.of());
final var ctx = DependencyContext.seed(cfg);
assertTrue(ReadOnlyCollection.isEmpty(new SeedPhase().run(ctx)));
assertTrue(ReadOnlyCollection.isEmpty(new DiscoverPhase().run(ctx)));
assertTrue(ReadOnlyCollection.isEmpty(new MaterializePhase().run(ctx)));
@@ -2,7 +2,8 @@ package p.studio.compiler.workspaces;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import p.studio.compiler.model.DependencyPipelineConfig;
import p.studio.compiler.messages.DependencyConfig;
import p.studio.compiler.models.DependencyContext;
import p.studio.compiler.workspaces.phases.*;
import p.studio.utilities.structures.ReadOnlyCollection;
@@ -25,8 +26,8 @@ class ValidateAndPolicyPhasesTest {
writeManifest(root, "root-proj", "0.1.0", new String[]{"depA"});
writeManifest(depA, "dep-a", "0.1.0", new String[]{});
final var cfg = new DependencyPipelineConfig(false, root, java.util.List.of());
final var ctx = DependencyPipelineContext.seed(cfg);
final var cfg = new DependencyConfig(false, root, java.util.List.of());
final var ctx = DependencyContext.seed(cfg);
assertTrue(ReadOnlyCollection.isEmpty(new SeedPhase().run(ctx)));
assertTrue(ReadOnlyCollection.isEmpty(new DiscoverPhase().run(ctx)));
assertTrue(ReadOnlyCollection.isEmpty(new MaterializePhase().run(ctx)));
@@ -38,8 +39,8 @@ class ValidateAndPolicyPhasesTest {
@Test
void policy_is_noop(@TempDir Path tempDir) {
final var cfg = new DependencyPipelineConfig(false, tempDir, java.util.List.of());
final var ctx = DependencyPipelineContext.seed(cfg);
final var cfg = new DependencyConfig(false, tempDir, java.util.List.of());
final var ctx = DependencyContext.seed(cfg);
final var issues = new PolicyPhase().run(ctx);
assertTrue(ReadOnlyCollection.isEmpty(issues), "PolicyPhase atualmente é no-op");
}