Skip to content

Commit

Permalink
cli: Validate data sources before server calls (#5074)
Browse files Browse the repository at this point in the history
This pre-emptively validates data source structures from the client
before we do the actual call to the server. This avoids a round-trip and
gives results a lot faster.

Signed-off-by: Juan Antonio Osorio <[email protected]>
  • Loading branch information
JAORMX authored Nov 28, 2024
1 parent 7e41aa9 commit 37cd413
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/cli/app/datasource/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ func executeOnOneDataSource(
ds.Context.ProjectId = proj
}

if err := ds.Validate(); err != nil {
return fmt.Errorf("error validating data source: %w", err)
}

// create or update the data source
createdDS, err := exec(ctx, f, ds)
if err != nil {
Expand Down

0 comments on commit 37cd413

Please sign in to comment.