| syntax = "proto3"; |
| package status; |
| option go_package = "go.skia.org/infra/status/go/rpc"; |
| |
| import "google/protobuf/timestamp.proto"; |
| |
| // API (non-page, non-resource) endpoints for Status. |
| service StatusService { |
| // Method to get updates to the lists of recent commits, their tasks, etc. |
| rpc GetIncrementalCommits(GetIncrementalCommitsRequest) returns (GetIncrementalCommitsResponse); |
| // Method to add a comment to a task, commit, or task spec. |
| rpc AddComment(AddCommentRequest) returns (AddCommentResponse); |
| // Method to delete a comment to a task, commit, or task spec. |
| rpc DeleteComment(DeleteCommentRequest) returns (DeleteCommentResponse); |
| // Method to get latest status of various autorollers. |
| rpc GetAutorollerStatuses(GetAutorollerStatusesRequest) returns (GetAutorollerStatusesResponse); |
| // Method to get latest bot usage / capacity metrics. |
| rpc GetBotUsage(GetBotUsageRequest) returns (GetBotUsageResponse); |
| } |
| |
| // Request for updated commit/task/comment/branch/etc data. |
| message GetIncrementalCommitsRequest { |
| google.protobuf.Timestamp from = 1; |
| google.protobuf.Timestamp to = 2; |
| int64 n = 3; |
| string pod = 4; |
| string repo_path = 5; |
| } |
| |
| // Response containing recent commit/task/comment/branch/etc data. |
| message GetIncrementalCommitsResponse { |
| ResponseMetadata metadata = 1; |
| IncrementalUpdate update = 2; |
| } |
| |
| // The (possible incremental) data comprising Status's table of |
| // commits and their tasks. |
| message IncrementalUpdate { |
| repeated LongCommit commits = 1; |
| repeated Branch branch_heads = 2; |
| repeated Task tasks = 3; |
| repeated Comment comments = 4; |
| } |
| |
| // Branch names and their associated HEAD commit hash. |
| message Branch { |
| string name = 1; |
| string head = 2; |
| } |
| |
| // Represents a single task, what commits it covered, its status and results. |
| message Task { |
| repeated string commits = 1; |
| string name = 2; |
| string id = 3; |
| string revision = 4; |
| string status = 5; |
| string swarming_task_id = 6; |
| } |
| |
| // Represents a single commit in repo. |
| message LongCommit { |
| string hash = 1; |
| string author = 2; |
| string subject = 3; |
| repeated string parents = 4; |
| string body = 5; |
| google.protobuf.Timestamp timestamp = 6; |
| } |
| |
| // Represents one of 3 types of human-written comment submitted on Status: |
| // 1) Specific task comment |
| // 2) Entire commit comment |
| // 3) Entire task spec comment |
| message Comment { |
| string id = 1; |
| string repo = 2; |
| google.protobuf.Timestamp timestamp = 3; |
| string user = 4; |
| string message = 5; |
| bool deleted = 6; |
| bool ignore_failure = 7; // Only for commit and taskSpec comments. |
| bool flaky = 8; // Only for taskSpec comments. |
| string task_spec_name = 9; // Only for task and taskSpec comments |
| string task_id = 10; // Only for task comments |
| string commit = 11; // Only for commit comments. |
| } |
| |
| // Data about the response and how to apply its contents. |
| message ResponseMetadata { |
| bool start_over = 1; |
| string pod = 2; |
| google.protobuf.Timestamp timestamp = 3; |
| } |
| |
| // Request for adding a comment. this, along with timestamp, represent the comment in the DB. |
| message AddCommentRequest { |
| string repo = 1; |
| // Only one of commit, task_spec, and task_id will be set, based on if the comment is for a |
| // commit, task spec, or task. Oneof not used since TypeScript doesn't support it. |
| string commit = 2; |
| string task_spec = 3; |
| string task_id = 4; |
| string message = 5; |
| bool flaky = 6; // Only valid when task_spec is set. |
| bool ignore_failure = 7; |
| } |
| // Response to AddComment, only success/failure needs to be conveyed. |
| message AddCommentResponse{ |
| // We provide the timestamp used for the comment so the UI can immediately update, rather than |
| // waiting on polling to pick up the new comment. |
| google.protobuf.Timestamp timestamp = 1; |
| } |
| // Request for deleting a comment. All fields used to identify the comment in the DB. |
| message DeleteCommentRequest { |
| string repo = 1; |
| string commit = 2; |
| string task_spec = 3; |
| string task_id = 4; |
| google.protobuf.Timestamp timestamp = 5; |
| } |
| // Empty, valid response to DeleteComment, only success/failure needs to be conveyed. |
| message DeleteCommentResponse{} |
| |
| // Empty, no parameters needed to ask for latest autoroller status info. |
| message GetAutorollerStatusesRequest{} |
| |
| message GetAutorollerStatusesResponse { |
| repeated AutorollerStatus rollers = 1; |
| } |
| |
| message AutorollerStatus { |
| string name = 1; |
| string current_roll_rev = 2; |
| string last_roll_rev = 3; |
| string mode = 4; |
| int32 num_failed = 5; |
| int32 num_behind = 6; |
| string url = 7; |
| } |
| |
| // Empty, no parameters needed to ask for latest bot usage data. |
| message GetBotUsageRequest {} |
| // Machine/device types, with associated tasks that run on them and data about those tasks. |
| message GetBotUsageResponse { |
| repeated BotSet bot_sets = 1; |
| } |
| |
| message BotSet { |
| map<string,string> dimensions = 1; |
| int32 bot_count = 2; |
| int32 cq_tasks = 3; |
| int64 ms_per_cq = 4; |
| int32 total_tasks = 5; |
| int64 ms_per_commit = 6; |
| } |