Track latest stage attempt diagnostics
This commit is contained in:
@@ -3,6 +3,7 @@ package app
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/artifacts"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/config"
|
||||
@@ -174,11 +175,21 @@ func initializeLockedInvocation(runtime *invocationRuntime) error {
|
||||
}
|
||||
|
||||
func (runtime *invocationRuntime) ensureRunWorkspaceFor(selected stage.Stage) error {
|
||||
if policy, ok := selected.(stage.RunWorkspacePolicy); ok && !policy.RequiresRunWorkspace() {
|
||||
if !needsAttemptViews(selected, runtime.env) {
|
||||
return nil
|
||||
}
|
||||
if err := fileops.EnsureWorkspaceDirectory(runtime.identity.LocalWorkDir); err != nil {
|
||||
if err := fileops.EnsureWorkspaceDirectoryUnderRoot(runtime.paths.Root, filepath.Join("runs", runtime.identity.RunID)); err != nil {
|
||||
return fmt.Errorf("create run directory %q: %w", runtime.identity.LocalWorkDir, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func needsAttemptViews(selected stage.Stage, env *stage.Env) bool {
|
||||
if policy, ok := selected.(stage.RunWorkspacePolicy); ok && !policy.RequiresRunWorkspace() {
|
||||
return false
|
||||
}
|
||||
if policy, ok := selected.(stage.AttemptViewPolicy); ok && !policy.NeedsAttemptViews(env) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user