Remove unused helpers and retired path fields
This commit is contained in:
@@ -33,7 +33,6 @@ const (
|
||||
|
||||
DefaultScriptoriumBinary = "scriptorium"
|
||||
DefaultScriptoriumTimeout = "10m"
|
||||
DefaultScriptoriumArtifactOutputRoot = "artifacts"
|
||||
DefaultScriptoriumStickySessionVarName = "session_id"
|
||||
DefaultScriptoriumStickySessionVarPrefix = "narratio-session-"
|
||||
|
||||
@@ -65,24 +64,17 @@ const (
|
||||
PathTranscriptsSegment = "transcripts"
|
||||
PathTranscriptsRaw = "transcripts/raw"
|
||||
PathArtifactsDirSegment = "artifacts"
|
||||
PathReportsDirSegment = "reports"
|
||||
PathConfigDirSegment = "config"
|
||||
PathLogsDirSegment = "logs"
|
||||
PathRunsDirSegment = "runs"
|
||||
PathPreviousDirSegment = "previous"
|
||||
PathManifestFile = "manifest.json"
|
||||
PathLockFile = ".lock"
|
||||
PathTranscriptBase = artifactmodel.TranscriptPathBase
|
||||
PathTranscriptPolished = artifactmodel.TranscriptPathPolished
|
||||
PathTranscriptFinal = artifactmodel.TranscriptPathFinal
|
||||
PathTranscriptFinalTrimmed = artifactmodel.TranscriptPathFinalTrimmed
|
||||
|
||||
S3CampaignsSegment = "campaigns"
|
||||
S3SessionsSegment = "sessions"
|
||||
S3RunsSegment = "runs"
|
||||
S3CurrentSegment = "current"
|
||||
S3ManifestFile = "manifest.json"
|
||||
S3RunIDFile = "run_id.txt"
|
||||
S3CommitFile = "commit.json"
|
||||
S3CommitPointerFile = "commit-pointer.json"
|
||||
S3SessionSnapshotFile = "session-manifest.json"
|
||||
|
||||
@@ -2,8 +2,6 @@ package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
@@ -27,12 +25,6 @@ func EffectivePipelineImports(cfg *PipelineConfig) []string {
|
||||
return append([]string(nil), cfg.resolution.imports...)
|
||||
}
|
||||
|
||||
// NormalizedConfigurationPath returns a clean absolute path when possible for
|
||||
// display-only configuration provenance.
|
||||
func NormalizedConfigurationPath(path string) string {
|
||||
return normalizedProvenancePath(path)
|
||||
}
|
||||
|
||||
// MarshalEffectivePipeline materializes completed configuration for persistence.
|
||||
// Credentials retain reference names; domain catalogs remain separate.
|
||||
func MarshalEffectivePipeline(cfg *PipelineConfig) ([]byte, error) {
|
||||
@@ -61,14 +53,3 @@ func MarshalEffectivePipeline(cfg *PipelineConfig) ([]byte, error) {
|
||||
}
|
||||
return output, nil
|
||||
}
|
||||
|
||||
func normalizedProvenancePath(path string) string {
|
||||
if strings.TrimSpace(path) == "" {
|
||||
return ""
|
||||
}
|
||||
abs, err := filepath.Abs(path)
|
||||
if err != nil {
|
||||
return filepath.Clean(path)
|
||||
}
|
||||
return filepath.Clean(abs)
|
||||
}
|
||||
|
||||
@@ -119,7 +119,6 @@ func TestProductDestinationsPreserveExplicitRemotePaths(t *testing.T) {
|
||||
Notarius: &NotariusConfig{Enabled: true, Outputs: map[string]NotariusOutputConfig{"people": {LaneID: "people", Filename: "people-local.json"}}},
|
||||
Publish: &PublishConfig{Outputs: []PublishOutputRule{{Source: "narratio.extraction.people", Dest: "archive/session/people.json"}}},
|
||||
}
|
||||
applyMissingPublishDestinations(cfg.Publish, nil, cfg.Notarius)
|
||||
if got := cfg.Publish.Outputs[0].Dest; got != "archive/session/people.json" {
|
||||
t.Fatalf("remote destination = %q", got)
|
||||
}
|
||||
|
||||
@@ -38,18 +38,6 @@ func validateRelativeSafePath(fieldName, value string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func validatePathWithinRoot(fieldName, value, root string) error {
|
||||
normalizedValue := filepath.ToSlash(filepath.Clean(strings.TrimSpace(value)))
|
||||
normalizedRoot := filepath.ToSlash(filepath.Clean(strings.TrimSpace(root)))
|
||||
if normalizedValue == normalizedRoot {
|
||||
return nil
|
||||
}
|
||||
if strings.HasPrefix(normalizedValue, normalizedRoot+"/") {
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("%s must be under %s/", fieldName, normalizedRoot)
|
||||
}
|
||||
|
||||
func validateDuration(fieldName, value string) error {
|
||||
trimmed := strings.TrimSpace(value)
|
||||
if trimmed == "" {
|
||||
|
||||
@@ -33,12 +33,6 @@ func deriveMissingPublishDestinations(cfg *PublishConfig, scriptorium *Scriptori
|
||||
return derived
|
||||
}
|
||||
|
||||
func applyMissingPublishDestinations(cfg *PublishConfig, scriptorium *ScriptoriumConfig, notarius *NotariusConfig) {
|
||||
for _, derived := range deriveMissingPublishDestinations(cfg, scriptorium, notarius) {
|
||||
cfg.Outputs[derived.index].Dest = derived.dest
|
||||
}
|
||||
}
|
||||
|
||||
func validateStorage(cfg StorageConfig) error {
|
||||
backend := strings.ToLower(strings.TrimSpace(cfg.Backend))
|
||||
switch backend {
|
||||
|
||||
Reference in New Issue
Block a user