Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BEAM-13543][Playground] Add logic of sending validation's output on the backend side #16361

Merged
merged 7 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions playground/api/v1/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ message CheckStatusResponse {
Status status = 1;
}

// GetValidationOutputRequest contains information of the pipeline uuid.
message GetValidationOutputRequest {
string pipeline_uuid = 1;
}

// GetValidationOutputResponse represents the result of the code validation.
message GetValidationOutputResponse {
string output = 1;
}

// GetPreparationOutputRequest contains information of the pipeline uuid.
message GetPreparationOutputRequest {
string pipeline_uuid = 1;
Expand Down Expand Up @@ -211,6 +221,9 @@ service PlaygroundService {
// Get the error of pipeline execution.
rpc GetRunError(GetRunErrorRequest) returns (GetRunErrorResponse);

// Get the result of pipeline validation.
rpc GetValidationOutput(GetValidationOutputRequest) returns (GetValidationOutputResponse);

// Get the result of pipeline preparation.
rpc GetPreparationOutput(GetPreparationOutputRequest) returns (GetPreparationOutputResponse);

Expand Down
15 changes: 15 additions & 0 deletions playground/backend/cmd/server/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,21 @@ func (controller *playgroundController) GetRunError(ctx context.Context, info *p
return &pb.GetRunErrorResponse{Output: runError}, nil
}

//GetValidationOutput is returning output of validation for specific pipeline by PipelineUuid
func (controller *playgroundController) GetValidationOutput(ctx context.Context, info *pb.GetValidationOutputRequest) (*pb.GetValidationOutputResponse, error) {
pipelineId, err := uuid.Parse(info.PipelineUuid)
errorMessage := "Error during getting compilation output"
if err != nil {
logger.Errorf("%s: GetValidationOutput(): pipelineId has incorrect value and couldn't be parsed as uuid value: %s", info.PipelineUuid, err.Error())
return nil, errors.InvalidArgumentError(errorMessage, "pipelineId has incorrect value and couldn't be parsed as uuid value: %s", info.PipelineUuid)
}
validationOutput, err := code_processing.GetProcessingOutput(ctx, controller.cacheService, pipelineId, cache.ValidationOutput, errorMessage)
if err != nil {
return nil, err
}
return &pb.GetValidationOutputResponse{Output: validationOutput}, nil
}

//GetPreparationOutput is returning output of prepare step for specific pipeline by PipelineUuid
func (controller *playgroundController) GetPreparationOutput(ctx context.Context, info *pb.GetPreparationOutputRequest) (*pb.GetPreparationOutputResponse, error) {
pipelineId, err := uuid.Parse(info.PipelineUuid)
Expand Down