Switch commands to ConfigKit configuration
This commit is contained in:
@@ -40,6 +40,9 @@ func normalizeDocumentPaths(document *Document, resolution *configkit.Resolution
|
||||
if profile.Output != nil {
|
||||
normalizeDocumentBindingReferencePaths(profile.Output, path.Key("output"), resolution, state)
|
||||
}
|
||||
if documentStepsContainRelativeReferencePaths(profile.Steps) {
|
||||
resolution.Record(path.Key("steps"), configkit.ChangeNormalization, "resolved configured paths in ordered steps")
|
||||
}
|
||||
for laneID, lane := range profile.Artifacts {
|
||||
normalizeDocumentLaneReferencePaths(&lane, path.Key("artifacts").Key(laneID), resolution, state)
|
||||
profile.Artifacts[laneID] = lane
|
||||
@@ -57,6 +60,31 @@ func normalizeDocumentPaths(document *Document, resolution *configkit.Resolution
|
||||
}
|
||||
}
|
||||
|
||||
func documentStepsContainRelativeReferencePaths(steps []PipelineStepDocument) bool {
|
||||
for _, step := range steps {
|
||||
if documentReferencesContainRelativePath(step.References) {
|
||||
return true
|
||||
}
|
||||
for _, lane := range step.Artifacts {
|
||||
if documentReferencesContainRelativePath(lane.Extract.References) ||
|
||||
(lane.Merge != nil && documentReferencesContainRelativePath(lane.Merge.References)) ||
|
||||
(lane.Normalize != nil && documentReferencesContainRelativePath(lane.Normalize.References)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func documentReferencesContainRelativePath(references map[string]ReferenceDocument) bool {
|
||||
for _, source := range references {
|
||||
if source.Path != nil && *source.Path != "" && !filepath.IsAbs(*source.Path) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func initializeDocumentMainDirectory(resolution *configkit.Resolution, state *documentLoadState) {
|
||||
if state == nil || state.mainDirectory != "" {
|
||||
return
|
||||
|
||||
@@ -41,6 +41,7 @@ type Invocation struct {
|
||||
InputPath string `json:"input_path,omitempty"`
|
||||
ConfigPath string `json:"config_path,omitempty"`
|
||||
ConfigSource string `json:"config_source,omitempty"`
|
||||
ConfigProfile string `json:"config_profile,omitempty"`
|
||||
OnlyLanes []string `json:"only_lanes,omitempty"`
|
||||
ChunkCacheOverride string `json:"chunk_cache_override,omitempty"`
|
||||
ReasoningEffortOverride *string `json:"reasoning_effort_override,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user