Skip to content

Commit

Permalink
Import Proto from o5-pb
Browse files Browse the repository at this point in the history
  • Loading branch information
daemonl committed May 9, 2024
1 parent 26493b3 commit 1f05fb9
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions proto/o5/builder/v1/builder.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
syntax = "proto3";

package o5.builder.v1;

import "buf/validate/validate.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "j5/source/v1/config.proto";
import "o5/messaging/v1/annotations.proto";

option go_package = "github.com/pentops/o5-go/builder/v1/builder_pb";

service BuilderTopic {
option (o5.messaging.v1.config).unicast.name = "j5-builder-input";
rpc BuildProto(BuildProtoMessage) returns (google.protobuf.Empty) {}
rpc BuildAPI(BuildAPIMessage) returns (google.protobuf.Empty) {}
}

message CommitInfo {
string owner = 1 [(buf.validate.field).required = true];
string repo = 2 [(buf.validate.field).required = true];
string hash = 3 [(buf.validate.field).required = true];

google.protobuf.Timestamp time = 4 [(buf.validate.field).required = true];
repeated string aliases = 5;
}

message CheckRun {
string name = 1;
int64 id = 2;
}

message BuildProtoMessage {
CommitInfo commit = 1 [(buf.validate.field).required = true];
CheckRun check_run = 2 [(buf.validate.field).required = true];

// contains one single proto build definition, otherwise is the config
// as pulled from the source.
j5.source.v1.Config config = 3 [(buf.validate.field).required = true];
}

message BuildAPIMessage {
CommitInfo commit = 1 [(buf.validate.field).required = true];
CheckRun check_run = 2 [(buf.validate.field).required = true];

// contains fields relating to JSON API build, i.e. excludes other build
// configs.
j5.source.v1.Config config = 3 [(buf.validate.field).required = true];
}

0 comments on commit 1f05fb9

Please sign in to comment.