Skip to content

Commit

Permalink
validate pipeline description character limit to be 250 characters
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamHaffar committed Oct 17, 2023
1 parent 03c9b3b commit fbdad7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/web/api/connector_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (c *ConnectorAPIv1) CreateConnector(
return nil, status.ConnectorError(cerrors.Errorf("failed to create connector: %w", err))
}
if created.Config.Name == "" {
return nil, status.ConnectorError(cerrors.Errorf("failed to create connector: name must not be empty"))
return nil, status.ConnectorError(cerrors.Errorf("failed to create connector: connector name must not be empty"))
}

co := toproto.Connector(created)
Expand Down
3 changes: 3 additions & 0 deletions pkg/web/api/pipeline_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ func (p *PipelineAPIv1) CreatePipeline(
if err != nil {
return nil, status.PipelineError(cerrors.Errorf("failed to create pipeline: %w", err))
}
if len(created.Config.Description) > 250 {
return nil, status.PipelineError(cerrors.Errorf("failed to create pipeline: pipeline description character limit is 250"))
}

// translate persisted config to proto response
pl := toproto.Pipeline(created)
Expand Down

0 comments on commit fbdad7a

Please sign in to comment.