Collect previous history for artifact prerequisites
This commit is contained in:
@@ -510,9 +510,9 @@ func manifestPathFor(cfg *config.Config) string {
|
||||
)
|
||||
}
|
||||
|
||||
func needsObjectStoreForRun(cfg *config.Config, stages []stage.Stage, effectiveSets ...artifacts.EffectiveArtifactSet) bool {
|
||||
func needsObjectStoreForRun(cfg *config.Config, stages []stage.Stage, effectiveSets ...artifacts.EffectiveArtifactSet) (bool, error) {
|
||||
if cfg == nil || cfg.Pipeline == nil || cfg.Session == nil {
|
||||
return false
|
||||
return false, nil
|
||||
}
|
||||
effective := artifacts.EffectiveArtifactSet{}
|
||||
if len(effectiveSets) > 0 {
|
||||
@@ -525,7 +525,7 @@ func needsObjectStoreForRun(cfg *config.Config, stages []stage.Stage, effectiveS
|
||||
nil,
|
||||
)
|
||||
if err != nil {
|
||||
return false
|
||||
return false, err
|
||||
}
|
||||
}
|
||||
stageRequested := func(name string) bool {
|
||||
@@ -538,27 +538,30 @@ func needsObjectStoreForRun(cfg *config.Config, stages []stage.Stage, effectiveS
|
||||
}
|
||||
|
||||
if cfg.Session.Inputs.AudioS3 != nil && stageRequested("prepare") {
|
||||
return true
|
||||
return true, nil
|
||||
}
|
||||
if stageRequested("prepare") {
|
||||
requirements := artifacts.CollectPreviousArtifactRequirements(configuredScriptoriumArtifacts(cfg), effective)
|
||||
requirements, err := artifacts.CollectPreviousArtifactRequirements(configuredScriptoriumArtifacts(cfg), effective)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if len(requirements) > 0 && strings.TrimSpace(cfg.Session.PreviousSessionID) != "" {
|
||||
return true
|
||||
return true, nil
|
||||
}
|
||||
}
|
||||
if !stageRequested("publish") {
|
||||
return false
|
||||
return false, nil
|
||||
}
|
||||
if cfg.Pipeline.Publish == nil {
|
||||
return false
|
||||
return false, nil
|
||||
}
|
||||
if cfg.Pipeline.Publish.Enabled != nil && !*cfg.Pipeline.Publish.Enabled {
|
||||
return false
|
||||
return false, nil
|
||||
}
|
||||
if cfg.Pipeline.Publish.UploadRun != nil && !*cfg.Pipeline.Publish.UploadRun {
|
||||
return false
|
||||
return false, nil
|
||||
}
|
||||
return true
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func needsNotariusForRun(cfg *config.Config, stages []stage.Stage) bool {
|
||||
|
||||
Reference in New Issue
Block a user