Enforce bounded run prerequisites
This commit is contained in:
@@ -12,7 +12,6 @@ import (
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/artifacts"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/config"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/logging"
|
||||
"gitea.maximumdirect.net/eric/narratio/internal/manifest"
|
||||
)
|
||||
|
||||
// Plan validates configuration, prepares the local workdir, and prints stage order.
|
||||
@@ -37,6 +36,13 @@ func Plan(ctx context.Context, args []string, out io.Writer) error {
|
||||
if _, err := resolveEffectiveArtifacts(cfg, request.SelectedArtifacts); err != nil {
|
||||
return fmt.Errorf("plan: %w", err)
|
||||
}
|
||||
m, err := loadManifestIfPresent(ctx, cfg)
|
||||
if err != nil {
|
||||
return fmt.Errorf("plan: %w", err)
|
||||
}
|
||||
if err := validateBoundedPrerequisites(request.Plan, m); err != nil {
|
||||
return fmt.Errorf("plan: %w", err)
|
||||
}
|
||||
if _, err := loadSecretsFromConfig(cfg, logging.NewLogger(os.Stderr, slog.LevelInfo)); err != nil {
|
||||
return fmt.Errorf("plan: %w", err)
|
||||
}
|
||||
@@ -48,11 +54,6 @@ func Plan(ctx context.Context, args []string, out io.Writer) error {
|
||||
}
|
||||
|
||||
stages := request.Plan.Stages()
|
||||
var m *manifest.Manifest
|
||||
m, err = loadManifestIfPresent(ctx, cfg)
|
||||
if err != nil {
|
||||
return fmt.Errorf("plan: %w", err)
|
||||
}
|
||||
decisions := decideStageActions(stages, m, request.Force)
|
||||
|
||||
runCount := 0
|
||||
|
||||
Reference in New Issue
Block a user