Wire native pipeline run commands and invocation-wide overrides
This commit is contained in:
@@ -176,7 +176,7 @@ type PipelineProfile struct {
|
||||
type ResolveOptions struct {
|
||||
CacheOverride *contracts.CacheMode
|
||||
Only []string
|
||||
LLMProfileOverride string
|
||||
LLMProfileOverride *string
|
||||
ReferenceOverrides []ReferenceBinding
|
||||
ReferenceUnbinds []ReferenceUnbind
|
||||
}
|
||||
@@ -345,7 +345,7 @@ func ResolvePipeline(profile PipelineProfile, options ResolveOptions, catalog Mo
|
||||
return ResolvedPipeline{}, fmt.Errorf("pipeline %q must not declare both artifacts and steps", pipelineID)
|
||||
}
|
||||
if explicitSteps && len(options.Only) > 0 {
|
||||
return ResolvedPipeline{}, fmt.Errorf("pipeline %q --only is not supported for explicit ordered steps", pipelineID)
|
||||
return ResolvedPipeline{}, fmt.Errorf("pipeline %q lane selection is not supported for explicit ordered steps", pipelineID)
|
||||
}
|
||||
steps := profile.Steps
|
||||
if !explicitSteps {
|
||||
@@ -1367,9 +1367,8 @@ func resolveModuleKey(module string, defaultModule string) string {
|
||||
return module
|
||||
}
|
||||
|
||||
func applyEffectiveLLMProfiles(resolved *ResolvedPipeline, pipelineProfile, overrideProfile string) error {
|
||||
func applyEffectiveLLMProfiles(resolved *ResolvedPipeline, pipelineProfile string, overrideProfile *string) error {
|
||||
pipelineProfile = strings.TrimSpace(pipelineProfile)
|
||||
overrideProfile = strings.TrimSpace(overrideProfile)
|
||||
|
||||
apply := func(stage ModuleStage, laneID, module string, binding *ModuleBinding, executionClass contracts.ExecutionClass, kind string) error {
|
||||
binding.LLMProfile = strings.TrimSpace(binding.LLMProfile)
|
||||
@@ -1382,8 +1381,8 @@ func applyEffectiveLLMProfiles(resolved *ResolvedPipeline, pipelineProfile, over
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if overrideProfile != "" {
|
||||
binding.LLMProfile = overrideProfile
|
||||
if overrideProfile != nil {
|
||||
binding.LLMProfile = strings.TrimSpace(*overrideProfile)
|
||||
return nil
|
||||
}
|
||||
if binding.LLMProfile == "" {
|
||||
|
||||
@@ -381,6 +381,7 @@ func TestResolvePipelineRejectsEmptyReferenceSlotAfterTrimming(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestResolvePipelineAppliesEffectiveLLMProfiles(t *testing.T) {
|
||||
runtimeProfile := " runtime "
|
||||
for _, test := range []struct {
|
||||
name string
|
||||
profile PipelineProfile
|
||||
@@ -395,7 +396,7 @@ func TestResolvePipelineAppliesEffectiveLLMProfiles(t *testing.T) {
|
||||
profile.Chunk.LLMProfile = "binding"
|
||||
return profile
|
||||
}(),
|
||||
options: ResolveOptions{LLMProfileOverride: " runtime "},
|
||||
options: ResolveOptions{LLMProfileOverride: &runtimeProfile},
|
||||
want: llmProfileValues("runtime"),
|
||||
},
|
||||
{
|
||||
@@ -464,10 +465,11 @@ func TestResolvePipelineAppliesProfilesOnlyToSelectedLLMBackedBindings(t *testin
|
||||
}
|
||||
|
||||
func TestResolvePipelineLeavesUnusedProfilesOffDeterministicBindings(t *testing.T) {
|
||||
override := "also-unused"
|
||||
profile := baselineProfile()
|
||||
profile.LLMProfile = "unused"
|
||||
|
||||
resolved, err := ResolvePipeline(profile, ResolveOptions{LLMProfileOverride: "also-unused"}, newProfileCatalog(t))
|
||||
resolved, err := ResolvePipeline(profile, ResolveOptions{LLMProfileOverride: &override}, newProfileCatalog(t))
|
||||
if err != nil {
|
||||
t.Fatalf("ResolvePipeline() error = %v, want nil", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user