Skip to content

Commit

Permalink
feat: Validation should happen before first steps in deploy
Browse files Browse the repository at this point in the history
The validation if the configs are valid happened after the deployment-graph was build, and the caches were preloaded. This does not make sense, so this change moves the validation up.
  • Loading branch information
Laubi committed Dec 17, 2024
1 parent ae4cec8 commit 5865d92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ func Deploy(ctx context.Context, projects []project.Project, environmentClients
log.Info("%s set, limiting concurrent deployments to %d", environment.ConcurrentDeploymentsEnvKey, maxConcurrentDeployments)
concurrentDeploymentsLimiter = rest.NewConcurrentRequestLimiter(maxConcurrentDeployments)
}

preloadCaches(ctx, projects, environmentClients)
g := graph.New(projects, environmentClients.Names())
deploymentErrors := make(deployErrors.EnvironmentDeploymentErrors)

// note: Currently the validation works 'environment-independent', but that might be something we should reconsider to improve error messages
Expand All @@ -86,6 +83,9 @@ func Deploy(ctx context.Context, projects []project.Project, environmentClients
errors.As(validationErrs, &deploymentErrors)
}

preloadCaches(ctx, projects, environmentClients)
g := graph.New(projects, environmentClients.Names())

for env, clientset := range environmentClients {
ctx := newContextWithEnvironment(ctx, env)
log.WithCtxFields(ctx).Info("Deploying configurations to environment %q...", env.Name)
Expand Down

0 comments on commit 5865d92

Please sign in to comment.