Move attempt views to workspace path ownership
This commit is contained in:
@@ -14,7 +14,6 @@ import (
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/adapters/storage"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/artifacts"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/config"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/fileops"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/manifest"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/stage"
|
||||
)
|
||||
@@ -319,7 +318,7 @@ func TestCleanupLifecycleReusesCleanStateAndRemovesLaterAttempts(t *testing.T) {
|
||||
t.Fatalf("reused execution = %#v", summary)
|
||||
}
|
||||
checkClean()
|
||||
if _, err := fileops.BeginAttemptViews(paths.Root, "later-run", "extract"); err != nil {
|
||||
if _, err := artifacts.BeginAttemptViews(paths.Root, "later-run", "extract"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
cleanupOnly := BoundedPlan{stages: []stage.Stage{selectedCleanupStage(t)}}
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/artifacts"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/config"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/fileops"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/manifest"
|
||||
"go.maximumdirect.net/commandkit"
|
||||
)
|
||||
@@ -131,7 +130,7 @@ func restoreSessionState(ctx context.Context, cfg *config.Config, opts RestorePl
|
||||
return diagnostic, fmt.Errorf("restore: generate diagnostic run id: %w", err)
|
||||
}
|
||||
sessionPaths := artifactStore.SessionPathsFor(cfg.Session.Campaign, cfg.Session.SessionID)
|
||||
if _, err := fileops.BeginAttemptViews(sessionPaths.Root, restoreRunID, "restore"); err != nil {
|
||||
if _, err := artifacts.BeginAttemptViews(sessionPaths.Root, restoreRunID, "restore"); err != nil {
|
||||
return diagnostic, fmt.Errorf("restore: prepare diagnostic views: %w", err)
|
||||
}
|
||||
report.reportPathRel = filepath.ToSlash(filepath.Join("runs", restoreRunID, "restore", "logs", "restore.json"))
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/fileops"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/artifacts"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/stage"
|
||||
)
|
||||
|
||||
@@ -97,9 +97,9 @@ func executeSelectedStage(runtime *invocationRuntime, selected stage.Stage) (out
|
||||
return outcome, operationErr
|
||||
}
|
||||
env.Debug("manifest saved", "stage", selected.Name(), "transition", "running", "path", runtime.manifestPath)
|
||||
var views *fileops.AttemptViews
|
||||
var views *artifacts.AttemptViews
|
||||
if needsAttemptViews(selected, env) {
|
||||
views, err = fileops.BeginAttemptViews(runtime.paths.Root, runtime.identity.RunID, selected.Name())
|
||||
views, err = artifacts.BeginAttemptViews(runtime.paths.Root, runtime.identity.RunID, selected.Name())
|
||||
if err != nil {
|
||||
return outcome, fmt.Errorf("prepare latest-attempt views for %q: %w", selected.Name(), err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user