Share artifact dependency queries across consumers

This commit is contained in:
2026-12-02 21:20:01 +00:00
parent 0965b7c7ac
commit 19b720742e
27 changed files with 194 additions and 205 deletions

View File

@@ -70,6 +70,7 @@ func TestProjectionUsesInjectedSnapshotAndSchedulesPrerequisites(t *testing.T) {
"prerequisite": {Enabled: false, PromptID: "parent", OutputPath: "artifacts/parent.md"},
"target": {Enabled: true, PromptID: "child", OutputPath: "artifacts/child.md", DependsOn: []string{"prerequisite"}},
}
rebuildTestArtifactGraph(t, cfg)
selection := []string{"target"}
effective, err := resolveEffectiveArtifacts(cfg, selection)
if err != nil {
@@ -310,3 +311,12 @@ func planFixtureFiles(t *testing.T, root string) []string {
}
return files
}
func rebuildTestArtifactGraph(t *testing.T, cfg *config.Config) {
t.Helper()
graph, err := config.BuildArtifactGraph(cfg.ArtifactCatalog.Artifacts)
if err != nil {
t.Fatal(err)
}
cfg.ArtifactCatalog.Graph = graph
}