Merge pull request 'feat(api): add the CI runner and run services' (#5) from feat/ci-protocol into main
13 files · +6934 -34
M README.md +4 -2
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | 3 | The public API contract of [ermite](https://git.bnema.dev/bnema/ermite), a single-user Git forge: protobuf definitions for its ConnectRPC services and the Go code generated from them. | |
| 4 | 4 | ||
| 5 | - | Status: early development. The contract defines seven services (below); the server that implements them is being built. | |
| 5 | + | Status: early development. The contract defines nine services (below); the server that implements them is being built. | |
| 6 | 6 | ||
| 7 | 7 | ```go | |
| 8 | 8 | import "bnema.dev/ermite-api/gen/ermite" | |
| @@ -22,13 +22,15 @@ Handlers are mounted under `/-/api/` by the server. Errors are Connect codes. | |||
| 22 | 22 | | `MergeRequestService` | `CreateMergeRequest`, `ListMergeRequests`, `GetMergeRequest` (commits, diff, comments), `AddComment`, `ResolveComment`, `CloseMergeRequest`, `MergeMergeRequest`, `MarkRead` | | |
| 23 | 23 | | `SessionService` | `CreateLoginLink`, `SignOutEverywhere` (owner only) | | |
| 24 | 24 | | `EventService` | `Watch` (streamed, resumable) | | |
| 25 | + | | `RunnerService` | `RegisterRunner`, `FetchJob` (long poll), `UpdateJob`, `AppendLog` (offset-idempotent), `Heartbeat`, `WatchJob` (cancel requests, streamed), `CompleteJob` (idempotent); for CI runners | | |
| 26 | + | | `RunService` | `ListRuns`, `GetRun`, `GetJob`, `GetJobLog` (streamed, follow), `CancelRun`, `RerunRun`, `ListChecks`, `ListRunners`, `RemoveRunner` | | |
| 25 | 27 | | `ServerService` | `GetVersion` (server version and feature list), `GetSigningKey` (commit signing key) | | |
| 26 | 28 | ||
| 27 | 29 | Tokens carry scopes only; presets such as `cli` or `agent` are a client concern. | |
| 28 | 30 | ||
| 29 | 31 | ## Layout | |
| 30 | 32 | ||
| 31 | - | - `proto/ermite/`: `.proto` files of the `ermite` package, one per service (`repo`, `git`, `merge_request`, `token`, `session`, `event`, `server`) plus shared `types`. Checked by `buf lint` and `buf breaking`. | |
| 33 | + | - `proto/ermite/`: `.proto` files of the `ermite` package, one per service (`repo`, `git`, `merge_request`, `token`, `session`, `event`, `server`, `runner`, `run`) plus shared `types`. Checked by `buf lint` and `buf breaking`. | |
| 32 | 34 | - `gen/ermite/`: generated Go messages. `gen/ermite/ermiteconnect/`: generated Connect clients and handlers. Committed, never edited by hand. | |
| 33 | 35 | ||
| 34 | 36 | ## Generate | |
M gen/ermite/ermiteconnect/event.connect.go +22 -2
| @@ -49,7 +49,17 @@ type EventServiceClient interface { | |||
| 49 | 49 | // for merge requests, merge_request_opened, merge_request_merged, | |
| 50 | 50 | // merge_request_closed and comment_added. Each one is delivered on the | |
| 51 | 51 | // "repo:<name>" topic of its repository and on "home", subject to the | |
| 52 | - | // visibility of the repository. There is no event for a change of title or | |
| 52 | + | // visibility of the repository. | |
| 53 | + | // | |
| 54 | + | // Servers with the feature "ci.runs" also publish run_updated and | |
| 55 | + | // job_updated, only on the "repo:<name>" topic of their repository (never on | |
| 56 | + | // "home"), subject to the same visibility. They carry the state after the | |
| 57 | + | // change and are published when a run or a job is created, changes status | |
| 58 | + | // or conclusion, or when one of its steps starts or ends (never per log | |
| 59 | + | // line: follow a log with RunService.GetJobLog). The order of these events | |
| 60 | + | // is not guaranteed, between jobs and runs or between two updates of the same | |
| 61 | + | // one: a client keeps the copy with the higher Run.version or | |
| 62 | + | // RunJob.version and drops the other. There is no event for a change of title or | |
| 53 | 63 | // description, nor for a resolved comment: after a gap, or to see such | |
| 54 | 64 | // changes, clients read the merge request again. A merge publishes | |
| 55 | 65 | // merge_request_merged, then pushed for the target branch. | |
| @@ -111,7 +121,17 @@ type EventServiceHandler interface { | |||
| 111 | 121 | // for merge requests, merge_request_opened, merge_request_merged, | |
| 112 | 122 | // merge_request_closed and comment_added. Each one is delivered on the | |
| 113 | 123 | // "repo:<name>" topic of its repository and on "home", subject to the | |
| 114 | - | // visibility of the repository. There is no event for a change of title or | |
| 124 | + | // visibility of the repository. | |
| 125 | + | // | |
| 126 | + | // Servers with the feature "ci.runs" also publish run_updated and | |
| 127 | + | // job_updated, only on the "repo:<name>" topic of their repository (never on | |
| 128 | + | // "home"), subject to the same visibility. They carry the state after the | |
| 129 | + | // change and are published when a run or a job is created, changes status | |
| 130 | + | // or conclusion, or when one of its steps starts or ends (never per log | |
| 131 | + | // line: follow a log with RunService.GetJobLog). The order of these events | |
| 132 | + | // is not guaranteed, between jobs and runs or between two updates of the same | |
| 133 | + | // one: a client keeps the copy with the higher Run.version or | |
| 134 | + | // RunJob.version and drops the other. There is no event for a change of title or | |
| 115 | 135 | // description, nor for a resolved comment: after a gap, or to see such | |
| 116 | 136 | // changes, clients read the merge request again. A merge publishes | |
| 117 | 137 | // merge_request_merged, then pushed for the target branch. | |
A gen/ermite/ermiteconnect/run.connect.go +436 -0
| @@ -0,0 +1,436 @@ | |||
| 1 | + | // SPDX-License-Identifier: MIT | |
| 2 | + | ||
| 3 | + | // Code generated by protoc-gen-connect-go. DO NOT EDIT. | |
| 4 | + | // | |
| 5 | + | // Source: ermite/run.proto | |
| 6 | + | ||
| 7 | + | package ermiteconnect | |
| 8 | + | ||
| 9 | + | import ( | |
| 10 | + | ermite "bnema.dev/ermite-api/gen/ermite" | |
| 11 | + | connect "connectrpc.com/connect" | |
| 12 | + | context "context" | |
| 13 | + | errors "errors" | |
| 14 | + | http "net/http" | |
| 15 | + | strings "strings" | |
| 16 | + | ) | |
| 17 | + | ||
| 18 | + | // This is a compile-time assertion to ensure that this generated file and the connect package are | |
| 19 | + | // compatible. If you get a compiler error that this constant is not defined, this code was | |
| 20 | + | // generated with a version of connect newer than the one compiled into your binary. You can fix the | |
| 21 | + | // problem by either regenerating this code with an older version of connect or updating the connect | |
| 22 | + | // version compiled into your binary. | |
| 23 | + | const _ = connect.IsAtLeastVersion1_13_0 | |
| 24 | + | ||
| 25 | + | const ( | |
| 26 | + | // RunServiceName is the fully-qualified name of the RunService service. | |
| 27 | + | RunServiceName = "ermite.RunService" | |
| 28 | + | ) | |
| 29 | + | ||
| 30 | + | // These constants are the fully-qualified names of the RPCs defined in this package. They're | |
| 31 | + | // exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. | |
| 32 | + | // | |
| 33 | + | // Note that these are different from the fully-qualified method names used by | |
| 34 | + | // google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to | |
| 35 | + | // reflection-formatted method names, remove the leading slash and convert the remaining slash to a | |
| 36 | + | // period. | |
| 37 | + | const ( | |
| 38 | + | // RunServiceListRunsProcedure is the fully-qualified name of the RunService's ListRuns RPC. | |
| 39 | + | RunServiceListRunsProcedure = "/ermite.RunService/ListRuns" | |
| 40 | + | // RunServiceGetRunProcedure is the fully-qualified name of the RunService's GetRun RPC. | |
| 41 | + | RunServiceGetRunProcedure = "/ermite.RunService/GetRun" | |
| 42 | + | // RunServiceGetJobProcedure is the fully-qualified name of the RunService's GetJob RPC. | |
| 43 | + | RunServiceGetJobProcedure = "/ermite.RunService/GetJob" | |
| 44 | + | // RunServiceGetJobLogProcedure is the fully-qualified name of the RunService's GetJobLog RPC. | |
| 45 | + | RunServiceGetJobLogProcedure = "/ermite.RunService/GetJobLog" | |
| 46 | + | // RunServiceCancelRunProcedure is the fully-qualified name of the RunService's CancelRun RPC. | |
| 47 | + | RunServiceCancelRunProcedure = "/ermite.RunService/CancelRun" | |
| 48 | + | // RunServiceRerunRunProcedure is the fully-qualified name of the RunService's RerunRun RPC. | |
| 49 | + | RunServiceRerunRunProcedure = "/ermite.RunService/RerunRun" | |
| 50 | + | // RunServiceListChecksProcedure is the fully-qualified name of the RunService's ListChecks RPC. | |
| 51 | + | RunServiceListChecksProcedure = "/ermite.RunService/ListChecks" | |
| 52 | + | // RunServiceListRunnersProcedure is the fully-qualified name of the RunService's ListRunners RPC. | |
| 53 | + | RunServiceListRunnersProcedure = "/ermite.RunService/ListRunners" | |
| 54 | + | // RunServiceRemoveRunnerProcedure is the fully-qualified name of the RunService's RemoveRunner RPC. | |
| 55 | + | RunServiceRemoveRunnerProcedure = "/ermite.RunService/RemoveRunner" | |
| 56 | + | ) | |
| 57 | + | ||
| 58 | + | // RunServiceClient is a client for the ermite.RunService service. | |
| 59 | + | type RunServiceClient interface { | |
| 60 | + | // ListRuns lists the runs of a repository, highest id (newest) first. Each | |
| 61 | + | // run is described by its latest attempt. The filters narrow the result; a | |
| 62 | + | // server without the feature "ci.runs.filters" ignores them and returns | |
| 63 | + | // every run, so a client that needs them checks the feature. Fails with | |
| 64 | + | // invalid_argument if a filter is malformed. | |
| 65 | + | ListRuns(context.Context, *connect.Request[ermite.ListRunsRequest]) (*connect.Response[ermite.ListRunsResponse], error) | |
| 66 | + | // GetRun returns a run with its jobs and their steps, for the latest attempt | |
| 67 | + | // or for the one asked. Fails with not_found if the run or the attempt does | |
| 68 | + | // not exist. | |
| 69 | + | GetRun(context.Context, *connect.Request[ermite.GetRunRequest]) (*connect.Response[ermite.GetRunResponse], error) | |
| 70 | + | // GetJob returns one job with its steps. Fails with not_found if the job | |
| 71 | + | // or the attempt does not exist. | |
| 72 | + | GetJob(context.Context, *connect.Request[ermite.GetJobRequest]) (*connect.Response[ermite.GetJobResponse], error) | |
| 73 | + | // GetJobLog streams the lines of the log of a job, from a line number. The | |
| 74 | + | // server sends them in order in messages of at most 1,000 lines and 64 KiB of | |
| 75 | + | // text each. | |
| 76 | + | // | |
| 77 | + | // Without follow, the stream ends after the last line stored when the call | |
| 78 | + | // was made. With follow, it goes on as lines arrive, with at most 1 second of | |
| 79 | + | // delay after the runner's AppendLog, and ends without error once the job has | |
| 80 | + | // completed and all its lines were sent; on a completed job follow changes | |
| 81 | + | // nothing. A client that loses the stream calls again with the offset after | |
| 82 | + | // the last line it received. The client may cancel at any time. | |
| 83 | + | // | |
| 84 | + | // Fails with not_found if the job, the attempt or its log does not exist (the | |
| 85 | + | // log is removed by the retention sweep, and a queued job has none: with | |
| 86 | + | // follow, the call waits for the first line instead), with out_of_range if | |
| 87 | + | // offset is beyond the end of the log of a job without follow, and with | |
| 88 | + | // resource_exhausted when there are too many concurrent log streams, in | |
| 89 | + | // total or from one client. Like Watch, a stream ends with unauthenticated | |
| 90 | + | // when the token was revoked or expired. | |
| 91 | + | GetJobLog(context.Context, *connect.Request[ermite.GetJobLogRequest]) (*connect.ServerStreamForClient[ermite.GetJobLogResponse], error) | |
| 92 | + | // CancelRun asks to cancel the latest attempt of a run. Needs the ci:write | |
| 93 | + | // scope. Jobs that have not started are cancelled at once; jobs in progress | |
| 94 | + | // get a CANCEL_REASON_USER request through WatchJob, and the run completes | |
| 95 | + | // when they have ended, so the returned run may still be IN_PROGRESS. | |
| 96 | + | // Cancelling a run that already has a cancellation requested succeeds and | |
| 97 | + | // changes nothing. Fails with failed_precondition if the run has completed. | |
| 98 | + | CancelRun(context.Context, *connect.Request[ermite.CancelRunRequest]) (*connect.Response[ermite.CancelRunResponse], error) | |
| 99 | + | // RerunRun starts a new attempt of a completed run: same run id and number, | |
| 100 | + | // attempt + 1, same commit and same workflow file as at the original run (the | |
| 101 | + | // file of the repository is not read again). Needs the ci:write scope. Fails | |
| 102 | + | // with failed_precondition if the latest attempt has not completed, or if | |
| 103 | + | // failed_only is set and no job failed. The new attempt is returned QUEUED. | |
| 104 | + | RerunRun(context.Context, *connect.Request[ermite.RerunRunRequest]) (*connect.Response[ermite.RerunRunResponse], error) | |
| 105 | + | // ListChecks lists the checks of a commit: for each job of each run on that | |
| 106 | + | // sha, the one of the latest attempt, ordered by creation time then name. | |
| 107 | + | // A commit without a run has no check: the list is empty, which is not an | |
| 108 | + | // error, and the server does not verify that the commit exists. Returns at | |
| 109 | + | // most 1,000 checks (truncated tells). | |
| 110 | + | ListChecks(context.Context, *connect.Request[ermite.ListChecksRequest]) (*connect.Response[ermite.ListChecksResponse], error) | |
| 111 | + | // ListRunners lists the registered runners, ordered by name. Needs the | |
| 112 | + | // runner:register scope. | |
| 113 | + | ListRunners(context.Context, *connect.Request[ermite.ListRunnersRequest]) (*connect.Response[ermite.ListRunnersResponse], error) | |
| 114 | + | // RemoveRunner removes a runner: its runner token stops working at once (a | |
| 115 | + | // FetchJob in progress ends with unauthenticated) and it no longer gets | |
| 116 | + | // jobs. A job it is running is not affected: it ends normally, or fails as | |
| 117 | + | // a lost runner without heartbeats. Needs the runner:register scope. Fails | |
| 118 | + | // with not_found if the id is unknown. | |
| 119 | + | RemoveRunner(context.Context, *connect.Request[ermite.RemoveRunnerRequest]) (*connect.Response[ermite.RemoveRunnerResponse], error) | |
| 120 | + | } | |
| 121 | + | ||
| 122 | + | // NewRunServiceClient constructs a client for the ermite.RunService service. By default, it uses | |
| 123 | + | // the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends | |
| 124 | + | // uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or | |
| 125 | + | // connect.WithGRPCWeb() options. | |
| 126 | + | // | |
| 127 | + | // The URL supplied here should be the base URL for the Connect or gRPC server (for example, | |
| 128 | + | // http://api.acme.com or https://acme.com/grpc). | |
| 129 | + | func NewRunServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) RunServiceClient { | |
| 130 | + | baseURL = strings.TrimRight(baseURL, "/") | |
| 131 | + | runServiceMethods := ermite.File_ermite_run_proto.Services().ByName("RunService").Methods() | |
| 132 | + | return &runServiceClient{ | |
| 133 | + | listRuns: connect.NewClient[ermite.ListRunsRequest, ermite.ListRunsResponse]( | |
| 134 | + | httpClient, | |
| 135 | + | baseURL+RunServiceListRunsProcedure, | |
| 136 | + | connect.WithSchema(runServiceMethods.ByName("ListRuns")), | |
| 137 | + | connect.WithClientOptions(opts...), | |
| 138 | + | ), | |
| 139 | + | getRun: connect.NewClient[ermite.GetRunRequest, ermite.GetRunResponse]( | |
| 140 | + | httpClient, | |
| 141 | + | baseURL+RunServiceGetRunProcedure, | |
| 142 | + | connect.WithSchema(runServiceMethods.ByName("GetRun")), | |
| 143 | + | connect.WithClientOptions(opts...), | |
| 144 | + | ), | |
| 145 | + | getJob: connect.NewClient[ermite.GetJobRequest, ermite.GetJobResponse]( | |
| 146 | + | httpClient, | |
| 147 | + | baseURL+RunServiceGetJobProcedure, | |
| 148 | + | connect.WithSchema(runServiceMethods.ByName("GetJob")), | |
| 149 | + | connect.WithClientOptions(opts...), | |
| 150 | + | ), | |
| 151 | + | getJobLog: connect.NewClient[ermite.GetJobLogRequest, ermite.GetJobLogResponse]( | |
| 152 | + | httpClient, | |
| 153 | + | baseURL+RunServiceGetJobLogProcedure, | |
| 154 | + | connect.WithSchema(runServiceMethods.ByName("GetJobLog")), | |
| 155 | + | connect.WithClientOptions(opts...), | |
| 156 | + | ), | |
| 157 | + | cancelRun: connect.NewClient[ermite.CancelRunRequest, ermite.CancelRunResponse]( | |
| 158 | + | httpClient, | |
| 159 | + | baseURL+RunServiceCancelRunProcedure, | |
| 160 | + | connect.WithSchema(runServiceMethods.ByName("CancelRun")), | |
| 161 | + | connect.WithClientOptions(opts...), | |
| 162 | + | ), | |
| 163 | + | rerunRun: connect.NewClient[ermite.RerunRunRequest, ermite.RerunRunResponse]( | |
| 164 | + | httpClient, | |
| 165 | + | baseURL+RunServiceRerunRunProcedure, | |
| 166 | + | connect.WithSchema(runServiceMethods.ByName("RerunRun")), | |
| 167 | + | connect.WithClientOptions(opts...), | |
| 168 | + | ), | |
| 169 | + | listChecks: connect.NewClient[ermite.ListChecksRequest, ermite.ListChecksResponse]( | |
| 170 | + | httpClient, | |
| 171 | + | baseURL+RunServiceListChecksProcedure, | |
| 172 | + | connect.WithSchema(runServiceMethods.ByName("ListChecks")), | |
| 173 | + | connect.WithClientOptions(opts...), | |
| 174 | + | ), | |
| 175 | + | listRunners: connect.NewClient[ermite.ListRunnersRequest, ermite.ListRunnersResponse]( | |
| 176 | + | httpClient, | |
| 177 | + | baseURL+RunServiceListRunnersProcedure, | |
| 178 | + | connect.WithSchema(runServiceMethods.ByName("ListRunners")), | |
| 179 | + | connect.WithClientOptions(opts...), | |
| 180 | + | ), | |
| 181 | + | removeRunner: connect.NewClient[ermite.RemoveRunnerRequest, ermite.RemoveRunnerResponse]( | |
| 182 | + | httpClient, | |
| 183 | + | baseURL+RunServiceRemoveRunnerProcedure, | |
| 184 | + | connect.WithSchema(runServiceMethods.ByName("RemoveRunner")), | |
| 185 | + | connect.WithClientOptions(opts...), | |
| 186 | + | ), | |
| 187 | + | } | |
| 188 | + | } | |
| 189 | + | ||
| 190 | + | // runServiceClient implements RunServiceClient. | |
| 191 | + | type runServiceClient struct { | |
| 192 | + | listRuns *connect.Client[ermite.ListRunsRequest, ermite.ListRunsResponse] | |
| 193 | + | getRun *connect.Client[ermite.GetRunRequest, ermite.GetRunResponse] | |
| 194 | + | getJob *connect.Client[ermite.GetJobRequest, ermite.GetJobResponse] | |
| 195 | + | getJobLog *connect.Client[ermite.GetJobLogRequest, ermite.GetJobLogResponse] | |
| 196 | + | cancelRun *connect.Client[ermite.CancelRunRequest, ermite.CancelRunResponse] | |
| 197 | + | rerunRun *connect.Client[ermite.RerunRunRequest, ermite.RerunRunResponse] | |
| 198 | + | listChecks *connect.Client[ermite.ListChecksRequest, ermite.ListChecksResponse] | |
| 199 | + | listRunners *connect.Client[ermite.ListRunnersRequest, ermite.ListRunnersResponse] | |
| 200 | + | removeRunner *connect.Client[ermite.RemoveRunnerRequest, ermite.RemoveRunnerResponse] | |
| 201 | + | } | |
| 202 | + | ||
| 203 | + | // ListRuns calls ermite.RunService.ListRuns. | |
| 204 | + | func (c *runServiceClient) ListRuns(ctx context.Context, req *connect.Request[ermite.ListRunsRequest]) (*connect.Response[ermite.ListRunsResponse], error) { | |
| 205 | + | return c.listRuns.CallUnary(ctx, req) | |
| 206 | + | } | |
| 207 | + | ||
| 208 | + | // GetRun calls ermite.RunService.GetRun. | |
| 209 | + | func (c *runServiceClient) GetRun(ctx context.Context, req *connect.Request[ermite.GetRunRequest]) (*connect.Response[ermite.GetRunResponse], error) { | |
| 210 | + | return c.getRun.CallUnary(ctx, req) | |
| 211 | + | } | |
| 212 | + | ||
| 213 | + | // GetJob calls ermite.RunService.GetJob. | |
| 214 | + | func (c *runServiceClient) GetJob(ctx context.Context, req *connect.Request[ermite.GetJobRequest]) (*connect.Response[ermite.GetJobResponse], error) { | |
| 215 | + | return c.getJob.CallUnary(ctx, req) | |
| 216 | + | } | |
| 217 | + | ||
| 218 | + | // GetJobLog calls ermite.RunService.GetJobLog. | |
| 219 | + | func (c *runServiceClient) GetJobLog(ctx context.Context, req *connect.Request[ermite.GetJobLogRequest]) (*connect.ServerStreamForClient[ermite.GetJobLogResponse], error) { | |
| 220 | + | return c.getJobLog.CallServerStream(ctx, req) | |
| 221 | + | } | |
| 222 | + | ||
| 223 | + | // CancelRun calls ermite.RunService.CancelRun. | |
| 224 | + | func (c *runServiceClient) CancelRun(ctx context.Context, req *connect.Request[ermite.CancelRunRequest]) (*connect.Response[ermite.CancelRunResponse], error) { | |
| 225 | + | return c.cancelRun.CallUnary(ctx, req) | |
| 226 | + | } | |
| 227 | + | ||
| 228 | + | // RerunRun calls ermite.RunService.RerunRun. | |
| 229 | + | func (c *runServiceClient) RerunRun(ctx context.Context, req *connect.Request[ermite.RerunRunRequest]) (*connect.Response[ermite.RerunRunResponse], error) { | |
| 230 | + | return c.rerunRun.CallUnary(ctx, req) | |
| 231 | + | } | |
| 232 | + | ||
| 233 | + | // ListChecks calls ermite.RunService.ListChecks. | |
| 234 | + | func (c *runServiceClient) ListChecks(ctx context.Context, req *connect.Request[ermite.ListChecksRequest]) (*connect.Response[ermite.ListChecksResponse], error) { | |
| 235 | + | return c.listChecks.CallUnary(ctx, req) | |
| 236 | + | } | |
| 237 | + | ||
| 238 | + | // ListRunners calls ermite.RunService.ListRunners. | |
| 239 | + | func (c *runServiceClient) ListRunners(ctx context.Context, req *connect.Request[ermite.ListRunnersRequest]) (*connect.Response[ermite.ListRunnersResponse], error) { | |
| 240 | + | return c.listRunners.CallUnary(ctx, req) | |
| 241 | + | } | |
| 242 | + | ||
| 243 | + | // RemoveRunner calls ermite.RunService.RemoveRunner. | |
| 244 | + | func (c *runServiceClient) RemoveRunner(ctx context.Context, req *connect.Request[ermite.RemoveRunnerRequest]) (*connect.Response[ermite.RemoveRunnerResponse], error) { | |
| 245 | + | return c.removeRunner.CallUnary(ctx, req) | |
| 246 | + | } | |
| 247 | + | ||
| 248 | + | // RunServiceHandler is an implementation of the ermite.RunService service. | |
| 249 | + | type RunServiceHandler interface { | |
| 250 | + | // ListRuns lists the runs of a repository, highest id (newest) first. Each | |
| 251 | + | // run is described by its latest attempt. The filters narrow the result; a | |
| 252 | + | // server without the feature "ci.runs.filters" ignores them and returns | |
| 253 | + | // every run, so a client that needs them checks the feature. Fails with | |
| 254 | + | // invalid_argument if a filter is malformed. | |
| 255 | + | ListRuns(context.Context, *connect.Request[ermite.ListRunsRequest]) (*connect.Response[ermite.ListRunsResponse], error) | |
| 256 | + | // GetRun returns a run with its jobs and their steps, for the latest attempt | |
| 257 | + | // or for the one asked. Fails with not_found if the run or the attempt does | |
| 258 | + | // not exist. | |
| 259 | + | GetRun(context.Context, *connect.Request[ermite.GetRunRequest]) (*connect.Response[ermite.GetRunResponse], error) | |
| 260 | + | // GetJob returns one job with its steps. Fails with not_found if the job | |
| 261 | + | // or the attempt does not exist. | |
| 262 | + | GetJob(context.Context, *connect.Request[ermite.GetJobRequest]) (*connect.Response[ermite.GetJobResponse], error) | |
| 263 | + | // GetJobLog streams the lines of the log of a job, from a line number. The | |
| 264 | + | // server sends them in order in messages of at most 1,000 lines and 64 KiB of | |
| 265 | + | // text each. | |
| 266 | + | // | |
| 267 | + | // Without follow, the stream ends after the last line stored when the call | |
| 268 | + | // was made. With follow, it goes on as lines arrive, with at most 1 second of | |
| 269 | + | // delay after the runner's AppendLog, and ends without error once the job has | |
| 270 | + | // completed and all its lines were sent; on a completed job follow changes | |
| 271 | + | // nothing. A client that loses the stream calls again with the offset after | |
| 272 | + | // the last line it received. The client may cancel at any time. | |
| 273 | + | // | |
| 274 | + | // Fails with not_found if the job, the attempt or its log does not exist (the | |
| 275 | + | // log is removed by the retention sweep, and a queued job has none: with | |
| 276 | + | // follow, the call waits for the first line instead), with out_of_range if | |
| 277 | + | // offset is beyond the end of the log of a job without follow, and with | |
| 278 | + | // resource_exhausted when there are too many concurrent log streams, in | |
| 279 | + | // total or from one client. Like Watch, a stream ends with unauthenticated | |
| 280 | + | // when the token was revoked or expired. | |
| 281 | + | GetJobLog(context.Context, *connect.Request[ermite.GetJobLogRequest], *connect.ServerStream[ermite.GetJobLogResponse]) error | |
| 282 | + | // CancelRun asks to cancel the latest attempt of a run. Needs the ci:write | |
| 283 | + | // scope. Jobs that have not started are cancelled at once; jobs in progress | |
| 284 | + | // get a CANCEL_REASON_USER request through WatchJob, and the run completes | |
| 285 | + | // when they have ended, so the returned run may still be IN_PROGRESS. | |
| 286 | + | // Cancelling a run that already has a cancellation requested succeeds and | |
| 287 | + | // changes nothing. Fails with failed_precondition if the run has completed. | |
| 288 | + | CancelRun(context.Context, *connect.Request[ermite.CancelRunRequest]) (*connect.Response[ermite.CancelRunResponse], error) | |
| 289 | + | // RerunRun starts a new attempt of a completed run: same run id and number, | |
| 290 | + | // attempt + 1, same commit and same workflow file as at the original run (the | |
| 291 | + | // file of the repository is not read again). Needs the ci:write scope. Fails | |
| 292 | + | // with failed_precondition if the latest attempt has not completed, or if | |
| 293 | + | // failed_only is set and no job failed. The new attempt is returned QUEUED. | |
| 294 | + | RerunRun(context.Context, *connect.Request[ermite.RerunRunRequest]) (*connect.Response[ermite.RerunRunResponse], error) | |
| 295 | + | // ListChecks lists the checks of a commit: for each job of each run on that | |
| 296 | + | // sha, the one of the latest attempt, ordered by creation time then name. | |
| 297 | + | // A commit without a run has no check: the list is empty, which is not an | |
| 298 | + | // error, and the server does not verify that the commit exists. Returns at | |
| 299 | + | // most 1,000 checks (truncated tells). | |
| 300 | + | ListChecks(context.Context, *connect.Request[ermite.ListChecksRequest]) (*connect.Response[ermite.ListChecksResponse], error) | |
| 301 | + | // ListRunners lists the registered runners, ordered by name. Needs the | |
| 302 | + | // runner:register scope. | |
| 303 | + | ListRunners(context.Context, *connect.Request[ermite.ListRunnersRequest]) (*connect.Response[ermite.ListRunnersResponse], error) | |
| 304 | + | // RemoveRunner removes a runner: its runner token stops working at once (a | |
| 305 | + | // FetchJob in progress ends with unauthenticated) and it no longer gets | |
| 306 | + | // jobs. A job it is running is not affected: it ends normally, or fails as | |
| 307 | + | // a lost runner without heartbeats. Needs the runner:register scope. Fails | |
| 308 | + | // with not_found if the id is unknown. | |
| 309 | + | RemoveRunner(context.Context, *connect.Request[ermite.RemoveRunnerRequest]) (*connect.Response[ermite.RemoveRunnerResponse], error) | |
| 310 | + | } | |
| 311 | + | ||
| 312 | + | // NewRunServiceHandler builds an HTTP handler from the service implementation. It returns the path | |
| 313 | + | // on which to mount the handler and the handler itself. | |
| 314 | + | // | |
| 315 | + | // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf | |
| 316 | + | // and JSON codecs. They also support gzip compression. | |
| 317 | + | func NewRunServiceHandler(svc RunServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { | |
| 318 | + | runServiceMethods := ermite.File_ermite_run_proto.Services().ByName("RunService").Methods() | |
| 319 | + | runServiceListRunsHandler := connect.NewUnaryHandler( | |
| 320 | + | RunServiceListRunsProcedure, | |
| 321 | + | svc.ListRuns, | |
| 322 | + | connect.WithSchema(runServiceMethods.ByName("ListRuns")), | |
| 323 | + | connect.WithHandlerOptions(opts...), | |
| 324 | + | ) | |
| 325 | + | runServiceGetRunHandler := connect.NewUnaryHandler( | |
| 326 | + | RunServiceGetRunProcedure, | |
| 327 | + | svc.GetRun, | |
| 328 | + | connect.WithSchema(runServiceMethods.ByName("GetRun")), | |
| 329 | + | connect.WithHandlerOptions(opts...), | |
| 330 | + | ) | |
| 331 | + | runServiceGetJobHandler := connect.NewUnaryHandler( | |
| 332 | + | RunServiceGetJobProcedure, | |
| 333 | + | svc.GetJob, | |
| 334 | + | connect.WithSchema(runServiceMethods.ByName("GetJob")), | |
| 335 | + | connect.WithHandlerOptions(opts...), | |
| 336 | + | ) | |
| 337 | + | runServiceGetJobLogHandler := connect.NewServerStreamHandler( | |
| 338 | + | RunServiceGetJobLogProcedure, | |
| 339 | + | svc.GetJobLog, | |
| 340 | + | connect.WithSchema(runServiceMethods.ByName("GetJobLog")), | |
| 341 | + | connect.WithHandlerOptions(opts...), | |
| 342 | + | ) | |
| 343 | + | runServiceCancelRunHandler := connect.NewUnaryHandler( | |
| 344 | + | RunServiceCancelRunProcedure, | |
| 345 | + | svc.CancelRun, | |
| 346 | + | connect.WithSchema(runServiceMethods.ByName("CancelRun")), | |
| 347 | + | connect.WithHandlerOptions(opts...), | |
| 348 | + | ) | |
| 349 | + | runServiceRerunRunHandler := connect.NewUnaryHandler( | |
| 350 | + | RunServiceRerunRunProcedure, | |
| 351 | + | svc.RerunRun, | |
| 352 | + | connect.WithSchema(runServiceMethods.ByName("RerunRun")), | |
| 353 | + | connect.WithHandlerOptions(opts...), | |
| 354 | + | ) | |
| 355 | + | runServiceListChecksHandler := connect.NewUnaryHandler( | |
| 356 | + | RunServiceListChecksProcedure, | |
| 357 | + | svc.ListChecks, | |
| 358 | + | connect.WithSchema(runServiceMethods.ByName("ListChecks")), | |
| 359 | + | connect.WithHandlerOptions(opts...), | |
| 360 | + | ) | |
| 361 | + | runServiceListRunnersHandler := connect.NewUnaryHandler( | |
| 362 | + | RunServiceListRunnersProcedure, | |
| 363 | + | svc.ListRunners, | |
| 364 | + | connect.WithSchema(runServiceMethods.ByName("ListRunners")), | |
| 365 | + | connect.WithHandlerOptions(opts...), | |
| 366 | + | ) | |
| 367 | + | runServiceRemoveRunnerHandler := connect.NewUnaryHandler( | |
| 368 | + | RunServiceRemoveRunnerProcedure, | |
| 369 | + | svc.RemoveRunner, | |
| 370 | + | connect.WithSchema(runServiceMethods.ByName("RemoveRunner")), | |
| 371 | + | connect.WithHandlerOptions(opts...), | |
| 372 | + | ) | |
| 373 | + | return "/ermite.RunService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |
| 374 | + | switch r.URL.Path { | |
| 375 | + | case RunServiceListRunsProcedure: | |
| 376 | + | runServiceListRunsHandler.ServeHTTP(w, r) | |
| 377 | + | case RunServiceGetRunProcedure: | |
| 378 | + | runServiceGetRunHandler.ServeHTTP(w, r) | |
| 379 | + | case RunServiceGetJobProcedure: | |
| 380 | + | runServiceGetJobHandler.ServeHTTP(w, r) | |
| 381 | + | case RunServiceGetJobLogProcedure: | |
| 382 | + | runServiceGetJobLogHandler.ServeHTTP(w, r) | |
| 383 | + | case RunServiceCancelRunProcedure: | |
| 384 | + | runServiceCancelRunHandler.ServeHTTP(w, r) | |
| 385 | + | case RunServiceRerunRunProcedure: | |
| 386 | + | runServiceRerunRunHandler.ServeHTTP(w, r) | |
| 387 | + | case RunServiceListChecksProcedure: | |
| 388 | + | runServiceListChecksHandler.ServeHTTP(w, r) | |
| 389 | + | case RunServiceListRunnersProcedure: | |
| 390 | + | runServiceListRunnersHandler.ServeHTTP(w, r) | |
| 391 | + | case RunServiceRemoveRunnerProcedure: | |
| 392 | + | runServiceRemoveRunnerHandler.ServeHTTP(w, r) | |
| 393 | + | default: | |
| 394 | + | http.NotFound(w, r) | |
| 395 | + | } | |
| 396 | + | }) | |
| 397 | + | } | |
| 398 | + | ||
| 399 | + | // UnimplementedRunServiceHandler returns CodeUnimplemented from all methods. | |
| 400 | + | type UnimplementedRunServiceHandler struct{} | |
| 401 | + | ||
| 402 | + | func (UnimplementedRunServiceHandler) ListRuns(context.Context, *connect.Request[ermite.ListRunsRequest]) (*connect.Response[ermite.ListRunsResponse], error) { | |
| 403 | + | return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.ListRuns is not implemented")) | |
| 404 | + | } | |
| 405 | + | ||
| 406 | + | func (UnimplementedRunServiceHandler) GetRun(context.Context, *connect.Request[ermite.GetRunRequest]) (*connect.Response[ermite.GetRunResponse], error) { | |
| 407 | + | return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.GetRun is not implemented")) | |
| 408 | + | } | |
| 409 | + | ||
| 410 | + | func (UnimplementedRunServiceHandler) GetJob(context.Context, *connect.Request[ermite.GetJobRequest]) (*connect.Response[ermite.GetJobResponse], error) { | |
| 411 | + | return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.GetJob is not implemented")) | |
| 412 | + | } | |
| 413 | + | ||
| 414 | + | func (UnimplementedRunServiceHandler) GetJobLog(context.Context, *connect.Request[ermite.GetJobLogRequest], *connect.ServerStream[ermite.GetJobLogResponse]) error { | |
| 415 | + | return connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.GetJobLog is not implemented")) | |
| 416 | + | } | |
| 417 | + | ||
| 418 | + | func (UnimplementedRunServiceHandler) CancelRun(context.Context, *connect.Request[ermite.CancelRunRequest]) (*connect.Response[ermite.CancelRunResponse], error) { | |
| 419 | + | return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.CancelRun is not implemented")) | |
| 420 | + | } | |
| 421 | + | ||
| 422 | + | func (UnimplementedRunServiceHandler) RerunRun(context.Context, *connect.Request[ermite.RerunRunRequest]) (*connect.Response[ermite.RerunRunResponse], error) { | |
| 423 | + | return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.RerunRun is not implemented")) | |
| 424 | + | } | |
| 425 | + | ||
| 426 | + | func (UnimplementedRunServiceHandler) ListChecks(context.Context, *connect.Request[ermite.ListChecksRequest]) (*connect.Response[ermite.ListChecksResponse], error) { | |
| 427 | + | return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.ListChecks is not implemented")) | |
| 428 | + | } | |
| 429 | + | ||
| 430 | + | func (UnimplementedRunServiceHandler) ListRunners(context.Context, *connect.Request[ermite.ListRunnersRequest]) (*connect.Response[ermite.ListRunnersResponse], error) { | |
| 431 | + | return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.ListRunners is not implemented")) | |
| 432 | + | } | |
| 433 | + | ||
| 434 | + | func (UnimplementedRunServiceHandler) RemoveRunner(context.Context, *connect.Request[ermite.RemoveRunnerRequest]) (*connect.Response[ermite.RemoveRunnerResponse], error) { | |
| 435 | + | return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunService.RemoveRunner is not implemented")) | |
| 436 | + | } | |
A gen/ermite/ermiteconnect/runner.connect.go +588 -0
| @@ -0,0 +1,588 @@ | |||
| 1 | + | // SPDX-License-Identifier: MIT | |
| 2 | + | ||
| 3 | + | // Code generated by protoc-gen-connect-go. DO NOT EDIT. | |
| 4 | + | // | |
| 5 | + | // Source: ermite/runner.proto | |
| 6 | + | ||
| 7 | + | package ermiteconnect | |
| 8 | + | ||
| 9 | + | import ( | |
| 10 | + | ermite "bnema.dev/ermite-api/gen/ermite" | |
| 11 | + | connect "connectrpc.com/connect" | |
| 12 | + | context "context" | |
| 13 | + | errors "errors" | |
| 14 | + | http "net/http" | |
| 15 | + | strings "strings" | |
| 16 | + | ) | |
| 17 | + | ||
| 18 | + | // This is a compile-time assertion to ensure that this generated file and the connect package are | |
| 19 | + | // compatible. If you get a compiler error that this constant is not defined, this code was | |
| 20 | + | // generated with a version of connect newer than the one compiled into your binary. You can fix the | |
| 21 | + | // problem by either regenerating this code with an older version of connect or updating the connect | |
| 22 | + | // version compiled into your binary. | |
| 23 | + | const _ = connect.IsAtLeastVersion1_13_0 | |
| 24 | + | ||
| 25 | + | const ( | |
| 26 | + | // RunnerServiceName is the fully-qualified name of the RunnerService service. | |
| 27 | + | RunnerServiceName = "ermite.RunnerService" | |
| 28 | + | ) | |
| 29 | + | ||
| 30 | + | // These constants are the fully-qualified names of the RPCs defined in this package. They're | |
| 31 | + | // exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. | |
| 32 | + | // | |
| 33 | + | // Note that these are different from the fully-qualified method names used by | |
| 34 | + | // google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to | |
| 35 | + | // reflection-formatted method names, remove the leading slash and convert the remaining slash to a | |
| 36 | + | // period. | |
| 37 | + | const ( | |
| 38 | + | // RunnerServiceRegisterRunnerProcedure is the fully-qualified name of the RunnerService's | |
| 39 | + | // RegisterRunner RPC. | |
| 40 | + | RunnerServiceRegisterRunnerProcedure = "/ermite.RunnerService/RegisterRunner" | |
| 41 | + | // RunnerServiceFetchJobProcedure is the fully-qualified name of the RunnerService's FetchJob RPC. | |
| 42 | + | RunnerServiceFetchJobProcedure = "/ermite.RunnerService/FetchJob" | |
| 43 | + | // RunnerServiceUpdateJobProcedure is the fully-qualified name of the RunnerService's UpdateJob RPC. | |
| 44 | + | RunnerServiceUpdateJobProcedure = "/ermite.RunnerService/UpdateJob" | |
| 45 | + | // RunnerServiceAppendLogProcedure is the fully-qualified name of the RunnerService's AppendLog RPC. | |
| 46 | + | RunnerServiceAppendLogProcedure = "/ermite.RunnerService/AppendLog" | |
| 47 | + | // RunnerServiceHeartbeatProcedure is the fully-qualified name of the RunnerService's Heartbeat RPC. | |
| 48 | + | RunnerServiceHeartbeatProcedure = "/ermite.RunnerService/Heartbeat" | |
| 49 | + | // RunnerServiceWatchJobProcedure is the fully-qualified name of the RunnerService's WatchJob RPC. | |
| 50 | + | RunnerServiceWatchJobProcedure = "/ermite.RunnerService/WatchJob" | |
| 51 | + | // RunnerServiceCompleteJobProcedure is the fully-qualified name of the RunnerService's CompleteJob | |
| 52 | + | // RPC. | |
| 53 | + | RunnerServiceCompleteJobProcedure = "/ermite.RunnerService/CompleteJob" | |
| 54 | + | ) | |
| 55 | + | ||
| 56 | + | // RunnerServiceClient is a client for the ermite.RunnerService service. | |
| 57 | + | type RunnerServiceClient interface { | |
| 58 | + | // RegisterRunner registers a runner and returns its runner token, which is | |
| 59 | + | // shown only in this response; the runner keeps it. The caller needs the | |
| 60 | + | // runner:register scope on a token that is not restricted to repositories | |
| 61 | + | // (a runner serves every repository), or the root token. Fails with | |
| 62 | + | // unauthenticated without a valid token, permission_denied without the | |
| 63 | + | // scope or with a repository-restricted token, invalid_argument if a field | |
| 64 | + | // breaks a rule, and already_exists if name is taken by another runner and | |
| 65 | + | // replace is not set. | |
| 66 | + | RegisterRunner(context.Context, *connect.Request[ermite.RegisterRunnerRequest]) (*connect.Response[ermite.RegisterRunnerResponse], error) | |
| 67 | + | // FetchJob asks for a job to run (long poll). The server holds the call | |
| 68 | + | // until a queued job matches the runner, or about 50 seconds (never more | |
| 69 | + | // than 50) pass, then answers; without a job the response has no job and the | |
| 70 | + | // runner calls again after retry_after. Clients set a call timeout above 50 | |
| 71 | + | // seconds (60 is suggested) and must not poll when they have no free | |
| 72 | + | // capacity. | |
| 73 | + | // | |
| 74 | + | // A job matches when every label of its runs-on is among the labels of the | |
| 75 | + | // runner (case-insensitive). A job is given to exactly one runner, even when | |
| 76 | + | // many runners and many polls compete; the assignment is recorded before | |
| 77 | + | // the response is sent. The job stays QUEUED for the owner until it is | |
| 78 | + | // acknowledged. | |
| 79 | + | // | |
| 80 | + | // Acknowledgement. The runner's first Heartbeat for the job is the | |
| 81 | + | // acknowledgement, and the runner sends it as soon as it has the job, before | |
| 82 | + | // anything else. If none arrives within 30 seconds of the assignment (the | |
| 83 | + | // response was lost, or the runner died), the server cancels the assignment: | |
| 84 | + | // the job token is revoked, the job goes back to QUEUED with a fresh token | |
| 85 | + | // and can be given to any runner, the same one included; nothing the old | |
| 86 | + | // assignment stored is kept. This is not a failure of the job. A job whose | |
| 87 | + | // assignment is cancelled 3 times in a row is failed with CI_CONCLUSION_FAILURE | |
| 88 | + | // and an error saying so. | |
| 89 | + | // | |
| 90 | + | // Retry after a lost response. poll_id lets a client retry a poll safely: | |
| 91 | + | // a call with the same poll_id as an earlier call of the same runner that | |
| 92 | + | // assigned a job returns that same assignment (same Job, same token) as long | |
| 93 | + | // as it has not been acknowledged or cancelled, instead of taking another. | |
| 94 | + | // | |
| 95 | + | // A runner that crashed or whose host restarted cannot resume a job: it does | |
| 96 | + | // not keep the job token, so the job fails with the lost-runner error after | |
| 97 | + | // the heartbeat timeout (see Heartbeat). | |
| 98 | + | // | |
| 99 | + | // Needs the runner token. Fails with unauthenticated when the runner was | |
| 100 | + | // removed (also ending a call in progress) and invalid_argument if labels | |
| 101 | + | // or poll_id break a rule. | |
| 102 | + | FetchJob(context.Context, *connect.Request[ermite.FetchJobRequest]) (*connect.Response[ermite.FetchJobResponse], error) | |
| 103 | + | // UpdateJob reports the state of the steps of a job while it runs. Needs the | |
| 104 | + | // job token. Each call is applied whole or not at all, and repeating an | |
| 105 | + | // identical call changes nothing, so a runner may retry after a network | |
| 106 | + | // error. To end the job use CompleteJob. | |
| 107 | + | // | |
| 108 | + | // Fails with invalid_argument if a rule is broken, with failed_precondition | |
| 109 | + | // if a step goes back (a COMPLETED step cannot change, a step cannot go from | |
| 110 | + | // IN_PROGRESS to PENDING) and with failed_precondition and a JobEnded detail | |
| 111 | + | // if the job has ended. | |
| 112 | + | UpdateJob(context.Context, *connect.Request[ermite.UpdateJobRequest]) (*connect.Response[ermite.UpdateJobResponse], error) | |
| 113 | + | // AppendLog appends lines to the log of a job. Needs the job token. | |
| 114 | + | // | |
| 115 | + | // The log of a job is one sequence of lines, numbered from 0 across all | |
| 116 | + | // steps; offset is the number of lines the server holds when the request is | |
| 117 | + | // applied, that is the number of the first line of the request. Calls must | |
| 118 | + | // go in order, one at a time, and are idempotent: | |
| 119 | + | // | |
| 120 | + | // - offset equal to the server's line count: the lines are appended; | |
| 121 | + | // - offset below it: the first (count - offset) lines were already stored | |
| 122 | + | // (a retry after a lost response) and are skipped, and the rest is | |
| 123 | + | // appended; a request entirely stored changes nothing. The skipped lines | |
| 124 | + | // are not compared with the stored ones: a retry whose lines differ from | |
| 125 | + | // the first attempt is silently dropped, so a client must resend the | |
| 126 | + | // same lines at the same offset; | |
| 127 | + | // - offset above it: out_of_range (a gap is a bug of the client; the | |
| 128 | + | // message gives the line count the server holds). | |
| 129 | + | // | |
| 130 | + | // The response gives the line count after the call, so a client can check | |
| 131 | + | // itself. Offsets resume only after a network error within the same runner | |
| 132 | + | // process; they are not a way to resume a job after a crash. | |
| 133 | + | // | |
| 134 | + | // A request has at most 1,000 lines whose text adds up to at most 64 KiB | |
| 135 | + | // (65,536 bytes), all in the same step; more is invalid_argument. A line | |
| 136 | + | // longer than that is cut by the client into pieces, see LogLine.continued. | |
| 137 | + | // | |
| 138 | + | // Steps. The step of a request must be at least the step of the last line | |
| 139 | + | // the server holds, because the log is ordered by step (applied lines only: | |
| 140 | + | // lines skipped as already stored are not checked); a lower step is | |
| 141 | + | // failed_precondition. Lines for a step that UpdateJob has not announced | |
| 142 | + | // create it: it starts IN_PROGRESS at the time of its first line, with an | |
| 143 | + | // empty name until an UpdateJob gives one. | |
| 144 | + | // | |
| 145 | + | // The log of a job is limited to 512 MiB (536,870,912 bytes) as stored by | |
| 146 | + | // the server (text, timestamps and separators). The call that would exceed | |
| 147 | + | // it appends nothing; the server adds a last line saying that the limit was | |
| 148 | + | // reached, ends the job with CI_CONCLUSION_FAILURE and RunJob.error set, and | |
| 149 | + | // answers failed_precondition with a JobEnded detail like any call after the | |
| 150 | + | // end of a job. The runner then stops the job. | |
| 151 | + | // | |
| 152 | + | // Lines sent after the end of the job are rejected, so a runner flushes all | |
| 153 | + | // its AppendLog lines before it calls CompleteJob. | |
| 154 | + | // | |
| 155 | + | // Fails with invalid_argument if a rule is broken (step number, text with a | |
| 156 | + | // line feed or invalid UTF-8, missing time, a continued first line). | |
| 157 | + | AppendLog(context.Context, *connect.Request[ermite.AppendLogRequest]) (*connect.Response[ermite.AppendLogResponse], error) | |
| 158 | + | // Heartbeat tells the server that the runner is alive and still working on | |
| 159 | + | // the job. Needs the job token. The first one acknowledges the assignment | |
| 160 | + | // (see FetchJob). The runner then calls it every 30 seconds for as long as | |
| 161 | + | // the job runs. The deadline is 2 minutes after the later of the last | |
| 162 | + | // heartbeat and the start of the server (so a server restart does not fail | |
| 163 | + | // the jobs of runners that could not reach it): past it the server ends the | |
| 164 | + | // job with CI_CONCLUSION_FAILURE and the message "The self-hosted runner: | |
| 165 | + | // <name> lost communication with the server...". Only Heartbeat counts: | |
| 166 | + | // other calls do not keep a job alive. | |
| 167 | + | // | |
| 168 | + | // A runner that gets unavailable (or any network error) retries Heartbeat | |
| 169 | + | // every 5 seconds until it succeeds, instead of waiting for its next 30 | |
| 170 | + | // second tick, and keeps the job running meanwhile. | |
| 171 | + | Heartbeat(context.Context, *connect.Request[ermite.HeartbeatRequest]) (*connect.Response[ermite.HeartbeatResponse], error) | |
| 172 | + | // WatchJob streams what the runner must react to. Needs the job token. The | |
| 173 | + | // runner opens it when it starts the job and keeps it open; it reopens it | |
| 174 | + | // after any error other than unauthenticated and the failed_precondition | |
| 175 | + | // that says the job ended, and after a clean close of | |
| 176 | + | // the stream that did not end with a JobEnded message. | |
| 177 | + | // | |
| 178 | + | // When the stream opens and a cancellation has already been requested, the | |
| 179 | + | // first message is that request, so a reconnect never misses one. Only the | |
| 180 | + | // first reason is sent: a job already cancelled by the owner does not get a | |
| 181 | + | // second message when its time budget expires. The server also sends a | |
| 182 | + | // Keepalive at least every 30 seconds, which the client ignores. When the | |
| 183 | + | // job ends the server sends JobEnded, then closes the stream without error. | |
| 184 | + | // On a job that has already ended the call fails like the other RPCs | |
| 185 | + | // (failed_precondition with a JobEnded detail). | |
| 186 | + | // | |
| 187 | + | // On a CancelRequest the runner stops the job as the official runner does | |
| 188 | + | // (interrupt, then terminate, then kill) and reports the conclusion given | |
| 189 | + | // for the reason with CompleteJob. | |
| 190 | + | // | |
| 191 | + | // The server does not trust the runner to obey. If no conclusion arrives | |
| 192 | + | // within 60 seconds after a cancellation request, whatever the reason (user, | |
| 193 | + | // fail-fast, timeout), the server ends the job itself: CI_CONCLUSION_CANCELLED | |
| 194 | + | // for user and fail-fast, CI_CONCLUSION_TIMED_OUT for timeout, with an error | |
| 195 | + | // saying that the runner did not answer, and the steps not completed are | |
| 196 | + | // completed as cancelled. The runner's later CompleteJob returns that result. | |
| 197 | + | WatchJob(context.Context, *connect.Request[ermite.WatchJobRequest]) (*connect.ServerStreamForClient[ermite.WatchJobResponse], error) | |
| 198 | + | // CompleteJob ends a job: it reports the final steps, the outputs and the | |
| 199 | + | // conclusion. Needs the job token, which stays valid for this RPC for 24 | |
| 200 | + | // hours after the end of the job, however it ended. The call is applied whole | |
| 201 | + | // or not at all. Once the job has ended, the token works for no other RPC | |
| 202 | + | // (they answer failed_precondition with a JobEnded detail). | |
| 203 | + | // | |
| 204 | + | // It is idempotent. The first call that finds the job running ends it and | |
| 205 | + | // answers applied = true. Any later call, a retry after a lost response or a | |
| 206 | + | // call after the server ended the job itself, is not validated and changes | |
| 207 | + | // nothing: it answers OK with the stored conclusion and error and | |
| 208 | + | // applied = false (a runner whose conclusion differs from the stored one | |
| 209 | + | // simply logs it; the outputs it sent are dropped). | |
| 210 | + | // | |
| 211 | + | // Lines sent with AppendLog after this call are rejected: a runner flushes | |
| 212 | + | // all its log lines first. Steps that were not reported COMPLETED when the job | |
| 213 | + | // ends are completed by the server as CI_CONCLUSION_CANCELLED (or SKIPPED when | |
| 214 | + | // they never started and the job did not end by cancellation). | |
| 215 | + | // | |
| 216 | + | // Fails with invalid_argument if a rule is broken (including the output | |
| 217 | + | // limits) and failed_precondition if a step goes back, as in UpdateJob. | |
| 218 | + | CompleteJob(context.Context, *connect.Request[ermite.CompleteJobRequest]) (*connect.Response[ermite.CompleteJobResponse], error) | |
| 219 | + | } | |
| 220 | + | ||
| 221 | + | // NewRunnerServiceClient constructs a client for the ermite.RunnerService service. By default, it | |
| 222 | + | // uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends | |
| 223 | + | // uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or | |
| 224 | + | // connect.WithGRPCWeb() options. | |
| 225 | + | // | |
| 226 | + | // The URL supplied here should be the base URL for the Connect or gRPC server (for example, | |
| 227 | + | // http://api.acme.com or https://acme.com/grpc). | |
| 228 | + | func NewRunnerServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) RunnerServiceClient { | |
| 229 | + | baseURL = strings.TrimRight(baseURL, "/") | |
| 230 | + | runnerServiceMethods := ermite.File_ermite_runner_proto.Services().ByName("RunnerService").Methods() | |
| 231 | + | return &runnerServiceClient{ | |
| 232 | + | registerRunner: connect.NewClient[ermite.RegisterRunnerRequest, ermite.RegisterRunnerResponse]( | |
| 233 | + | httpClient, | |
| 234 | + | baseURL+RunnerServiceRegisterRunnerProcedure, | |
| 235 | + | connect.WithSchema(runnerServiceMethods.ByName("RegisterRunner")), | |
| 236 | + | connect.WithClientOptions(opts...), | |
| 237 | + | ), | |
| 238 | + | fetchJob: connect.NewClient[ermite.FetchJobRequest, ermite.FetchJobResponse]( | |
| 239 | + | httpClient, | |
| 240 | + | baseURL+RunnerServiceFetchJobProcedure, | |
| 241 | + | connect.WithSchema(runnerServiceMethods.ByName("FetchJob")), | |
| 242 | + | connect.WithClientOptions(opts...), | |
| 243 | + | ), | |
| 244 | + | updateJob: connect.NewClient[ermite.UpdateJobRequest, ermite.UpdateJobResponse]( | |
| 245 | + | httpClient, | |
| 246 | + | baseURL+RunnerServiceUpdateJobProcedure, | |
| 247 | + | connect.WithSchema(runnerServiceMethods.ByName("UpdateJob")), | |
| 248 | + | connect.WithClientOptions(opts...), | |
| 249 | + | ), | |
| 250 | + | appendLog: connect.NewClient[ermite.AppendLogRequest, ermite.AppendLogResponse]( | |
| 251 | + | httpClient, | |
| 252 | + | baseURL+RunnerServiceAppendLogProcedure, | |
| 253 | + | connect.WithSchema(runnerServiceMethods.ByName("AppendLog")), | |
| 254 | + | connect.WithClientOptions(opts...), | |
| 255 | + | ), | |
| 256 | + | heartbeat: connect.NewClient[ermite.HeartbeatRequest, ermite.HeartbeatResponse]( | |
| 257 | + | httpClient, | |
| 258 | + | baseURL+RunnerServiceHeartbeatProcedure, | |
| 259 | + | connect.WithSchema(runnerServiceMethods.ByName("Heartbeat")), | |
| 260 | + | connect.WithClientOptions(opts...), | |
| 261 | + | ), | |
| 262 | + | watchJob: connect.NewClient[ermite.WatchJobRequest, ermite.WatchJobResponse]( | |
| 263 | + | httpClient, | |
| 264 | + | baseURL+RunnerServiceWatchJobProcedure, | |
| 265 | + | connect.WithSchema(runnerServiceMethods.ByName("WatchJob")), | |
| 266 | + | connect.WithClientOptions(opts...), | |
| 267 | + | ), | |
| 268 | + | completeJob: connect.NewClient[ermite.CompleteJobRequest, ermite.CompleteJobResponse]( | |
| 269 | + | httpClient, | |
| 270 | + | baseURL+RunnerServiceCompleteJobProcedure, | |
| 271 | + | connect.WithSchema(runnerServiceMethods.ByName("CompleteJob")), | |
| 272 | + | connect.WithClientOptions(opts...), | |
| 273 | + | ), | |
| 274 | + | } | |
| 275 | + | } | |
| 276 | + | ||
| 277 | + | // runnerServiceClient implements RunnerServiceClient. | |
| 278 | + | type runnerServiceClient struct { | |
| 279 | + | registerRunner *connect.Client[ermite.RegisterRunnerRequest, ermite.RegisterRunnerResponse] | |
| 280 | + | fetchJob *connect.Client[ermite.FetchJobRequest, ermite.FetchJobResponse] | |
| 281 | + | updateJob *connect.Client[ermite.UpdateJobRequest, ermite.UpdateJobResponse] | |
| 282 | + | appendLog *connect.Client[ermite.AppendLogRequest, ermite.AppendLogResponse] | |
| 283 | + | heartbeat *connect.Client[ermite.HeartbeatRequest, ermite.HeartbeatResponse] | |
| 284 | + | watchJob *connect.Client[ermite.WatchJobRequest, ermite.WatchJobResponse] | |
| 285 | + | completeJob *connect.Client[ermite.CompleteJobRequest, ermite.CompleteJobResponse] | |
| 286 | + | } | |
| 287 | + | ||
| 288 | + | // RegisterRunner calls ermite.RunnerService.RegisterRunner. | |
| 289 | + | func (c *runnerServiceClient) RegisterRunner(ctx context.Context, req *connect.Request[ermite.RegisterRunnerRequest]) (*connect.Response[ermite.RegisterRunnerResponse], error) { | |
| 290 | + | return c.registerRunner.CallUnary(ctx, req) | |
| 291 | + | } | |
| 292 | + | ||
| 293 | + | // FetchJob calls ermite.RunnerService.FetchJob. | |
| 294 | + | func (c *runnerServiceClient) FetchJob(ctx context.Context, req *connect.Request[ermite.FetchJobRequest]) (*connect.Response[ermite.FetchJobResponse], error) { | |
| 295 | + | return c.fetchJob.CallUnary(ctx, req) | |
| 296 | + | } | |
| 297 | + | ||
| 298 | + | // UpdateJob calls ermite.RunnerService.UpdateJob. | |
| 299 | + | func (c *runnerServiceClient) UpdateJob(ctx context.Context, req *connect.Request[ermite.UpdateJobRequest]) (*connect.Response[ermite.UpdateJobResponse], error) { | |
| 300 | + | return c.updateJob.CallUnary(ctx, req) | |
| 301 | + | } | |
| 302 | + | ||
| 303 | + | // AppendLog calls ermite.RunnerService.AppendLog. | |
| 304 | + | func (c *runnerServiceClient) AppendLog(ctx context.Context, req *connect.Request[ermite.AppendLogRequest]) (*connect.Response[ermite.AppendLogResponse], error) { | |
| 305 | + | return c.appendLog.CallUnary(ctx, req) | |
| 306 | + | } | |
| 307 | + | ||
| 308 | + | // Heartbeat calls ermite.RunnerService.Heartbeat. | |
| 309 | + | func (c *runnerServiceClient) Heartbeat(ctx context.Context, req *connect.Request[ermite.HeartbeatRequest]) (*connect.Response[ermite.HeartbeatResponse], error) { | |
| 310 | + | return c.heartbeat.CallUnary(ctx, req) | |
| 311 | + | } | |
| 312 | + | ||
| 313 | + | // WatchJob calls ermite.RunnerService.WatchJob. | |
| 314 | + | func (c *runnerServiceClient) WatchJob(ctx context.Context, req *connect.Request[ermite.WatchJobRequest]) (*connect.ServerStreamForClient[ermite.WatchJobResponse], error) { | |
| 315 | + | return c.watchJob.CallServerStream(ctx, req) | |
| 316 | + | } | |
| 317 | + | ||
| 318 | + | // CompleteJob calls ermite.RunnerService.CompleteJob. | |
| 319 | + | func (c *runnerServiceClient) CompleteJob(ctx context.Context, req *connect.Request[ermite.CompleteJobRequest]) (*connect.Response[ermite.CompleteJobResponse], error) { | |
| 320 | + | return c.completeJob.CallUnary(ctx, req) | |
| 321 | + | } | |
| 322 | + | ||
| 323 | + | // RunnerServiceHandler is an implementation of the ermite.RunnerService service. | |
| 324 | + | type RunnerServiceHandler interface { | |
| 325 | + | // RegisterRunner registers a runner and returns its runner token, which is | |
| 326 | + | // shown only in this response; the runner keeps it. The caller needs the | |
| 327 | + | // runner:register scope on a token that is not restricted to repositories | |
| 328 | + | // (a runner serves every repository), or the root token. Fails with | |
| 329 | + | // unauthenticated without a valid token, permission_denied without the | |
| 330 | + | // scope or with a repository-restricted token, invalid_argument if a field | |
| 331 | + | // breaks a rule, and already_exists if name is taken by another runner and | |
| 332 | + | // replace is not set. | |
| 333 | + | RegisterRunner(context.Context, *connect.Request[ermite.RegisterRunnerRequest]) (*connect.Response[ermite.RegisterRunnerResponse], error) | |
| 334 | + | // FetchJob asks for a job to run (long poll). The server holds the call | |
| 335 | + | // until a queued job matches the runner, or about 50 seconds (never more | |
| 336 | + | // than 50) pass, then answers; without a job the response has no job and the | |
| 337 | + | // runner calls again after retry_after. Clients set a call timeout above 50 | |
| 338 | + | // seconds (60 is suggested) and must not poll when they have no free | |
| 339 | + | // capacity. | |
| 340 | + | // | |
| 341 | + | // A job matches when every label of its runs-on is among the labels of the | |
| 342 | + | // runner (case-insensitive). A job is given to exactly one runner, even when | |
| 343 | + | // many runners and many polls compete; the assignment is recorded before | |
| 344 | + | // the response is sent. The job stays QUEUED for the owner until it is | |
| 345 | + | // acknowledged. | |
| 346 | + | // | |
| 347 | + | // Acknowledgement. The runner's first Heartbeat for the job is the | |
| 348 | + | // acknowledgement, and the runner sends it as soon as it has the job, before | |
| 349 | + | // anything else. If none arrives within 30 seconds of the assignment (the | |
| 350 | + | // response was lost, or the runner died), the server cancels the assignment: | |
| 351 | + | // the job token is revoked, the job goes back to QUEUED with a fresh token | |
| 352 | + | // and can be given to any runner, the same one included; nothing the old | |
| 353 | + | // assignment stored is kept. This is not a failure of the job. A job whose | |
| 354 | + | // assignment is cancelled 3 times in a row is failed with CI_CONCLUSION_FAILURE | |
| 355 | + | // and an error saying so. | |
| 356 | + | // | |
| 357 | + | // Retry after a lost response. poll_id lets a client retry a poll safely: | |
| 358 | + | // a call with the same poll_id as an earlier call of the same runner that | |
| 359 | + | // assigned a job returns that same assignment (same Job, same token) as long | |
| 360 | + | // as it has not been acknowledged or cancelled, instead of taking another. | |
| 361 | + | // | |
| 362 | + | // A runner that crashed or whose host restarted cannot resume a job: it does | |
| 363 | + | // not keep the job token, so the job fails with the lost-runner error after | |
| 364 | + | // the heartbeat timeout (see Heartbeat). | |
| 365 | + | // | |
| 366 | + | // Needs the runner token. Fails with unauthenticated when the runner was | |
| 367 | + | // removed (also ending a call in progress) and invalid_argument if labels | |
| 368 | + | // or poll_id break a rule. | |
| 369 | + | FetchJob(context.Context, *connect.Request[ermite.FetchJobRequest]) (*connect.Response[ermite.FetchJobResponse], error) | |
| 370 | + | // UpdateJob reports the state of the steps of a job while it runs. Needs the | |
| 371 | + | // job token. Each call is applied whole or not at all, and repeating an | |
| 372 | + | // identical call changes nothing, so a runner may retry after a network | |
| 373 | + | // error. To end the job use CompleteJob. | |
| 374 | + | // | |
| 375 | + | // Fails with invalid_argument if a rule is broken, with failed_precondition | |
| 376 | + | // if a step goes back (a COMPLETED step cannot change, a step cannot go from | |
| 377 | + | // IN_PROGRESS to PENDING) and with failed_precondition and a JobEnded detail | |
| 378 | + | // if the job has ended. | |
| 379 | + | UpdateJob(context.Context, *connect.Request[ermite.UpdateJobRequest]) (*connect.Response[ermite.UpdateJobResponse], error) | |
| 380 | + | // AppendLog appends lines to the log of a job. Needs the job token. | |
| 381 | + | // | |
| 382 | + | // The log of a job is one sequence of lines, numbered from 0 across all | |
| 383 | + | // steps; offset is the number of lines the server holds when the request is | |
| 384 | + | // applied, that is the number of the first line of the request. Calls must | |
| 385 | + | // go in order, one at a time, and are idempotent: | |
| 386 | + | // | |
| 387 | + | // - offset equal to the server's line count: the lines are appended; | |
| 388 | + | // - offset below it: the first (count - offset) lines were already stored | |
| 389 | + | // (a retry after a lost response) and are skipped, and the rest is | |
| 390 | + | // appended; a request entirely stored changes nothing. The skipped lines | |
| 391 | + | // are not compared with the stored ones: a retry whose lines differ from | |
| 392 | + | // the first attempt is silently dropped, so a client must resend the | |
| 393 | + | // same lines at the same offset; | |
| 394 | + | // - offset above it: out_of_range (a gap is a bug of the client; the | |
| 395 | + | // message gives the line count the server holds). | |
| 396 | + | // | |
| 397 | + | // The response gives the line count after the call, so a client can check | |
| 398 | + | // itself. Offsets resume only after a network error within the same runner | |
| 399 | + | // process; they are not a way to resume a job after a crash. | |
| 400 | + | // | |
| 401 | + | // A request has at most 1,000 lines whose text adds up to at most 64 KiB | |
| 402 | + | // (65,536 bytes), all in the same step; more is invalid_argument. A line | |
| 403 | + | // longer than that is cut by the client into pieces, see LogLine.continued. | |
| 404 | + | // | |
| 405 | + | // Steps. The step of a request must be at least the step of the last line | |
| 406 | + | // the server holds, because the log is ordered by step (applied lines only: | |
| 407 | + | // lines skipped as already stored are not checked); a lower step is | |
| 408 | + | // failed_precondition. Lines for a step that UpdateJob has not announced | |
| 409 | + | // create it: it starts IN_PROGRESS at the time of its first line, with an | |
| 410 | + | // empty name until an UpdateJob gives one. | |
| 411 | + | // | |
| 412 | + | // The log of a job is limited to 512 MiB (536,870,912 bytes) as stored by | |
| 413 | + | // the server (text, timestamps and separators). The call that would exceed | |
| 414 | + | // it appends nothing; the server adds a last line saying that the limit was | |
| 415 | + | // reached, ends the job with CI_CONCLUSION_FAILURE and RunJob.error set, and | |
| 416 | + | // answers failed_precondition with a JobEnded detail like any call after the | |
| 417 | + | // end of a job. The runner then stops the job. | |
| 418 | + | // | |
| 419 | + | // Lines sent after the end of the job are rejected, so a runner flushes all | |
| 420 | + | // its AppendLog lines before it calls CompleteJob. | |
| 421 | + | // | |
| 422 | + | // Fails with invalid_argument if a rule is broken (step number, text with a | |
| 423 | + | // line feed or invalid UTF-8, missing time, a continued first line). | |
| 424 | + | AppendLog(context.Context, *connect.Request[ermite.AppendLogRequest]) (*connect.Response[ermite.AppendLogResponse], error) | |
| 425 | + | // Heartbeat tells the server that the runner is alive and still working on | |
| 426 | + | // the job. Needs the job token. The first one acknowledges the assignment | |
| 427 | + | // (see FetchJob). The runner then calls it every 30 seconds for as long as | |
| 428 | + | // the job runs. The deadline is 2 minutes after the later of the last | |
| 429 | + | // heartbeat and the start of the server (so a server restart does not fail | |
| 430 | + | // the jobs of runners that could not reach it): past it the server ends the | |
| 431 | + | // job with CI_CONCLUSION_FAILURE and the message "The self-hosted runner: | |
| 432 | + | // <name> lost communication with the server...". Only Heartbeat counts: | |
| 433 | + | // other calls do not keep a job alive. | |
| 434 | + | // | |
| 435 | + | // A runner that gets unavailable (or any network error) retries Heartbeat | |
| 436 | + | // every 5 seconds until it succeeds, instead of waiting for its next 30 | |
| 437 | + | // second tick, and keeps the job running meanwhile. | |
| 438 | + | Heartbeat(context.Context, *connect.Request[ermite.HeartbeatRequest]) (*connect.Response[ermite.HeartbeatResponse], error) | |
| 439 | + | // WatchJob streams what the runner must react to. Needs the job token. The | |
| 440 | + | // runner opens it when it starts the job and keeps it open; it reopens it | |
| 441 | + | // after any error other than unauthenticated and the failed_precondition | |
| 442 | + | // that says the job ended, and after a clean close of | |
| 443 | + | // the stream that did not end with a JobEnded message. | |
| 444 | + | // | |
| 445 | + | // When the stream opens and a cancellation has already been requested, the | |
| 446 | + | // first message is that request, so a reconnect never misses one. Only the | |
| 447 | + | // first reason is sent: a job already cancelled by the owner does not get a | |
| 448 | + | // second message when its time budget expires. The server also sends a | |
| 449 | + | // Keepalive at least every 30 seconds, which the client ignores. When the | |
| 450 | + | // job ends the server sends JobEnded, then closes the stream without error. | |
| 451 | + | // On a job that has already ended the call fails like the other RPCs | |
| 452 | + | // (failed_precondition with a JobEnded detail). | |
| 453 | + | // | |
| 454 | + | // On a CancelRequest the runner stops the job as the official runner does | |
| 455 | + | // (interrupt, then terminate, then kill) and reports the conclusion given | |
| 456 | + | // for the reason with CompleteJob. | |
| 457 | + | // | |
| 458 | + | // The server does not trust the runner to obey. If no conclusion arrives | |
| 459 | + | // within 60 seconds after a cancellation request, whatever the reason (user, | |
| 460 | + | // fail-fast, timeout), the server ends the job itself: CI_CONCLUSION_CANCELLED | |
| 461 | + | // for user and fail-fast, CI_CONCLUSION_TIMED_OUT for timeout, with an error | |
| 462 | + | // saying that the runner did not answer, and the steps not completed are | |
| 463 | + | // completed as cancelled. The runner's later CompleteJob returns that result. | |
| 464 | + | WatchJob(context.Context, *connect.Request[ermite.WatchJobRequest], *connect.ServerStream[ermite.WatchJobResponse]) error | |
| 465 | + | // CompleteJob ends a job: it reports the final steps, the outputs and the | |
| 466 | + | // conclusion. Needs the job token, which stays valid for this RPC for 24 | |
| 467 | + | // hours after the end of the job, however it ended. The call is applied whole | |
| 468 | + | // or not at all. Once the job has ended, the token works for no other RPC | |
| 469 | + | // (they answer failed_precondition with a JobEnded detail). | |
| 470 | + | // | |
| 471 | + | // It is idempotent. The first call that finds the job running ends it and | |
| 472 | + | // answers applied = true. Any later call, a retry after a lost response or a | |
| 473 | + | // call after the server ended the job itself, is not validated and changes | |
| 474 | + | // nothing: it answers OK with the stored conclusion and error and | |
| 475 | + | // applied = false (a runner whose conclusion differs from the stored one | |
| 476 | + | // simply logs it; the outputs it sent are dropped). | |
| 477 | + | // | |
| 478 | + | // Lines sent with AppendLog after this call are rejected: a runner flushes | |
| 479 | + | // all its log lines first. Steps that were not reported COMPLETED when the job | |
| 480 | + | // ends are completed by the server as CI_CONCLUSION_CANCELLED (or SKIPPED when | |
| 481 | + | // they never started and the job did not end by cancellation). | |
| 482 | + | // | |
| 483 | + | // Fails with invalid_argument if a rule is broken (including the output | |
| 484 | + | // limits) and failed_precondition if a step goes back, as in UpdateJob. | |
| 485 | + | CompleteJob(context.Context, *connect.Request[ermite.CompleteJobRequest]) (*connect.Response[ermite.CompleteJobResponse], error) | |
| 486 | + | } | |
| 487 | + | ||
| 488 | + | // NewRunnerServiceHandler builds an HTTP handler from the service implementation. It returns the | |
| 489 | + | // path on which to mount the handler and the handler itself. | |
| 490 | + | // | |
| 491 | + | // By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf | |
| 492 | + | // and JSON codecs. They also support gzip compression. | |
| 493 | + | func NewRunnerServiceHandler(svc RunnerServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { | |
| 494 | + | runnerServiceMethods := ermite.File_ermite_runner_proto.Services().ByName("RunnerService").Methods() | |
| 495 | + | runnerServiceRegisterRunnerHandler := connect.NewUnaryHandler( | |
| 496 | + | RunnerServiceRegisterRunnerProcedure, | |
| 497 | + | svc.RegisterRunner, | |
| 498 | + | connect.WithSchema(runnerServiceMethods.ByName("RegisterRunner")), | |
| 499 | + | connect.WithHandlerOptions(opts...), | |
| 500 | + | ) | |
| 501 | + | runnerServiceFetchJobHandler := connect.NewUnaryHandler( | |
| 502 | + | RunnerServiceFetchJobProcedure, | |
| 503 | + | svc.FetchJob, | |
| 504 | + | connect.WithSchema(runnerServiceMethods.ByName("FetchJob")), | |
| 505 | + | connect.WithHandlerOptions(opts...), | |
| 506 | + | ) | |
| 507 | + | runnerServiceUpdateJobHandler := connect.NewUnaryHandler( | |
| 508 | + | RunnerServiceUpdateJobProcedure, | |
| 509 | + | svc.UpdateJob, | |
| 510 | + | connect.WithSchema(runnerServiceMethods.ByName("UpdateJob")), | |
| 511 | + | connect.WithHandlerOptions(opts...), | |
| 512 | + | ) | |
| 513 | + | runnerServiceAppendLogHandler := connect.NewUnaryHandler( | |
| 514 | + | RunnerServiceAppendLogProcedure, | |
| 515 | + | svc.AppendLog, | |
| 516 | + | connect.WithSchema(runnerServiceMethods.ByName("AppendLog")), | |
| 517 | + | connect.WithHandlerOptions(opts...), | |
| 518 | + | ) | |
| 519 | + | runnerServiceHeartbeatHandler := connect.NewUnaryHandler( | |
| 520 | + | RunnerServiceHeartbeatProcedure, | |
| 521 | + | svc.Heartbeat, | |
| 522 | + | connect.WithSchema(runnerServiceMethods.ByName("Heartbeat")), | |
| 523 | + | connect.WithHandlerOptions(opts...), | |
| 524 | + | ) | |
| 525 | + | runnerServiceWatchJobHandler := connect.NewServerStreamHandler( | |
| 526 | + | RunnerServiceWatchJobProcedure, | |
| 527 | + | svc.WatchJob, | |
| 528 | + | connect.WithSchema(runnerServiceMethods.ByName("WatchJob")), | |
| 529 | + | connect.WithHandlerOptions(opts...), | |
| 530 | + | ) | |
| 531 | + | runnerServiceCompleteJobHandler := connect.NewUnaryHandler( | |
| 532 | + | RunnerServiceCompleteJobProcedure, | |
| 533 | + | svc.CompleteJob, | |
| 534 | + | connect.WithSchema(runnerServiceMethods.ByName("CompleteJob")), | |
| 535 | + | connect.WithHandlerOptions(opts...), | |
| 536 | + | ) | |
| 537 | + | return "/ermite.RunnerService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | |
| 538 | + | switch r.URL.Path { | |
| 539 | + | case RunnerServiceRegisterRunnerProcedure: | |
| 540 | + | runnerServiceRegisterRunnerHandler.ServeHTTP(w, r) | |
| 541 | + | case RunnerServiceFetchJobProcedure: | |
| 542 | + | runnerServiceFetchJobHandler.ServeHTTP(w, r) | |
| 543 | + | case RunnerServiceUpdateJobProcedure: | |
| 544 | + | runnerServiceUpdateJobHandler.ServeHTTP(w, r) | |
| 545 | + | case RunnerServiceAppendLogProcedure: | |
| 546 | + | runnerServiceAppendLogHandler.ServeHTTP(w, r) | |
| 547 | + | case RunnerServiceHeartbeatProcedure: | |
| 548 | + | runnerServiceHeartbeatHandler.ServeHTTP(w, r) | |
| 549 | + | case RunnerServiceWatchJobProcedure: | |
| 550 | + | runnerServiceWatchJobHandler.ServeHTTP(w, r) | |
| 551 | + | case RunnerServiceCompleteJobProcedure: | |
| 552 | + | runnerServiceCompleteJobHandler.ServeHTTP(w, r) | |
| 553 | + | default: | |
| 554 | + | http.NotFound(w, r) | |
| 555 | + | } | |
| 556 | + | }) | |
| 557 | + | } | |
| 558 | + | ||
| 559 | + | // UnimplementedRunnerServiceHandler returns CodeUnimplemented from all methods. | |
| 560 | + | type UnimplementedRunnerServiceHandler struct{} | |
| 561 | + | ||
| 562 | + | func (UnimplementedRunnerServiceHandler) RegisterRunner(context.Context, *connect.Request[ermite.RegisterRunnerRequest]) (*connect.Response[ermite.RegisterRunnerResponse], error) { | |
| 563 | + | return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunnerService.RegisterRunner is not implemented")) | |
| 564 | + | } | |
| 565 | + | ||
| 566 | + | func (UnimplementedRunnerServiceHandler) FetchJob(context.Context, *connect.Request[ermite.FetchJobRequest]) (*connect.Response[ermite.FetchJobResponse], error) { | |
| 567 | + | return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunnerService.FetchJob is not implemented")) | |
| 568 | + | } | |
| 569 | + | ||
| 570 | + | func (UnimplementedRunnerServiceHandler) UpdateJob(context.Context, *connect.Request[ermite.UpdateJobRequest]) (*connect.Response[ermite.UpdateJobResponse], error) { | |
| 571 | + | return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunnerService.UpdateJob is not implemented")) | |
| 572 | + | } | |
| 573 | + | ||
| 574 | + | func (UnimplementedRunnerServiceHandler) AppendLog(context.Context, *connect.Request[ermite.AppendLogRequest]) (*connect.Response[ermite.AppendLogResponse], error) { | |
| 575 | + | return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunnerService.AppendLog is not implemented")) | |
| 576 | + | } | |
| 577 | + | ||
| 578 | + | func (UnimplementedRunnerServiceHandler) Heartbeat(context.Context, *connect.Request[ermite.HeartbeatRequest]) (*connect.Response[ermite.HeartbeatResponse], error) { | |
| 579 | + | return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunnerService.Heartbeat is not implemented")) | |
| 580 | + | } | |
| 581 | + | ||
| 582 | + | func (UnimplementedRunnerServiceHandler) WatchJob(context.Context, *connect.Request[ermite.WatchJobRequest], *connect.ServerStream[ermite.WatchJobResponse]) error { | |
| 583 | + | return connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunnerService.WatchJob is not implemented")) | |
| 584 | + | } | |
| 585 | + | ||
| 586 | + | func (UnimplementedRunnerServiceHandler) CompleteJob(context.Context, *connect.Request[ermite.CompleteJobRequest]) (*connect.Response[ermite.CompleteJobResponse], error) { | |
| 587 | + | return nil, connect.NewError(connect.CodeUnimplemented, errors.New("ermite.RunnerService.CompleteJob is not implemented")) | |
| 588 | + | } | |
M gen/ermite/event.pb.go +175 -26 generated file: collapsed
A gen/ermite/run.pb.go +2318 -0
| @@ -0,0 +1,2318 @@ | |||
| 1 | + | // SPDX-License-Identifier: MIT | |
| 2 | + | ||
| 3 | + | // Code generated by protoc-gen-go. DO NOT EDIT. | |
| 4 | + | // versions: | |
| 5 | + | // protoc-gen-go v1.36.12 | |
| 6 | + | // protoc (unknown) | |
| 7 | + | // source: ermite/run.proto | |
| 8 | + | ||
| 9 | + | package ermite | |
| 10 | + | ||
| 11 | + | import ( | |
| 12 | + | protoreflect "google.golang.org/protobuf/reflect/protoreflect" | |
| 13 | + | protoimpl "google.golang.org/protobuf/runtime/protoimpl" | |
| 14 | + | timestamppb "google.golang.org/protobuf/types/known/timestamppb" | |
| 15 | + | reflect "reflect" | |
| 16 | + | sync "sync" | |
| 17 | + | unsafe "unsafe" | |
| 18 | + | ) | |
| 19 | + | ||
| 20 | + | const ( | |
| 21 | + | // Verify that this generated code is sufficiently up-to-date. | |
| 22 | + | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) | |
| 23 | + | // Verify that runtime/protoimpl is sufficiently up-to-date. | |
| 24 | + | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) | |
| 25 | + | ) | |
| 26 | + | ||
| 27 | + | // Run is one execution of one workflow file for one event, like a GitHub | |
| 28 | + | // workflow run. A re-run keeps the run and adds an attempt. | |
| 29 | + | type Run struct { | |
| 30 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 31 | + | // Repo is the name of the repository. | |
| 32 | + | Repo string `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"` | |
| 33 | + | // Id identifies the run on the whole server: it is the "github.run_id". | |
| 34 | + | // Increasing, never reused. | |
| 35 | + | Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` | |
| 36 | + | // Number counts the runs of the same workflow file in the repository, | |
| 37 | + | // starting at 1, never reused: it is the "github.run_number". It does not | |
| 38 | + | // change on a re-run. | |
| 39 | + | Number int64 `protobuf:"varint,3,opt,name=number,proto3" json:"number,omitempty"` | |
| 40 | + | // Attempt is the attempt this message describes: 1 for the first, one more | |
| 41 | + | // after each RerunRun. ListRuns and events describe the latest attempt; | |
| 42 | + | // GetRun can ask for another one. | |
| 43 | + | Attempt int32 `protobuf:"varint,4,opt,name=attempt,proto3" json:"attempt,omitempty"` | |
| 44 | + | // WorkflowPath is the path of the workflow file at sha, for example | |
| 45 | + | // ".github/workflows/ci.yml". | |
| 46 | + | WorkflowPath string `protobuf:"bytes,5,opt,name=workflow_path,json=workflowPath,proto3" json:"workflow_path,omitempty"` | |
| 47 | + | // WorkflowName is the "name" of the workflow, or workflow_path when it has | |
| 48 | + | // none (as GitHub does). | |
| 49 | + | WorkflowName string `protobuf:"bytes,6,opt,name=workflow_name,json=workflowName,proto3" json:"workflow_name,omitempty"` | |
| 50 | + | // Title is the first line of the message of the commit sha, at most 256 | |
| 51 | + | // characters (GitHub's display title). | |
| 52 | + | Title string `protobuf:"bytes,7,opt,name=title,proto3" json:"title,omitempty"` | |
| 53 | + | // Event is the event that triggered the run, in GitHub's name: "push" (the | |
| 54 | + | // only one for now; push to a branch or a tag, and merge of a merge | |
| 55 | + | // request). New values may be added; clients show the ones they do not | |
| 56 | + | // know as they are. | |
| 57 | + | Event string `protobuf:"bytes,8,opt,name=event,proto3" json:"event,omitempty"` | |
| 58 | + | // Ref is the full ref name that was pushed, for example "refs/heads/main" | |
| 59 | + | // or "refs/tags/v1.0.0". | |
| 60 | + | Ref string `protobuf:"bytes,9,opt,name=ref,proto3" json:"ref,omitempty"` | |
| 61 | + | // Sha is the full id of the commit the run is for. | |
| 62 | + | Sha string `protobuf:"bytes,10,opt,name=sha,proto3" json:"sha,omitempty"` | |
| 63 | + | // Actor names who triggered the run: the label of the token that pushed, or | |
| 64 | + | // "root", or "owner" (a web session, a merge of the web UI), as | |
| 65 | + | // MergeRequest.author. It is informational. | |
| 66 | + | Actor string `protobuf:"bytes,11,opt,name=actor,proto3" json:"actor,omitempty"` | |
| 67 | + | // Status is where this attempt is: QUEUED until a job starts, IN_PROGRESS | |
| 68 | + | // while jobs run or wait, COMPLETED when every job is over. | |
| 69 | + | Status CiStatus `protobuf:"varint,12,opt,name=status,proto3,enum=ermite.CiStatus" json:"status,omitempty"` | |
| 70 | + | // Conclusion is how this attempt ended, from its jobs' conclusions like | |
| 71 | + | // GitHub: CANCELLED if it was cancelled, else FAILURE if a job failed or | |
| 72 | + | // timed out, else SUCCESS (also when jobs were skipped). Unset until | |
| 73 | + | // status is COMPLETED. | |
| 74 | + | Conclusion CiConclusion `protobuf:"varint,13,opt,name=conclusion,proto3,enum=ermite.CiConclusion" json:"conclusion,omitempty"` | |
| 75 | + | // Error is set when the run failed without running a job because the | |
| 76 | + | // workflow could not be used: an invalid workflow file (the run then has | |
| 77 | + | // no jobs and conclusion FAILURE), as GitHub's "Invalid workflow file". | |
| 78 | + | // It holds the errors with their positions, one per line, at most 8 KiB. | |
| 79 | + | // Empty otherwise. | |
| 80 | + | Error string `protobuf:"bytes,14,opt,name=error,proto3" json:"error,omitempty"` | |
| 81 | + | // CreatedAt is when this attempt was created: for attempt 1 when the | |
| 82 | + | // trigger was planned, for later ones when RerunRun was called. | |
| 83 | + | CreatedAt *timestamppb.Timestamp `protobuf:"bytes,15,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` | |
| 84 | + | // StartedAt is when the first job of this attempt was given to a runner. | |
| 85 | + | // Unset until then. | |
| 86 | + | StartedAt *timestamppb.Timestamp `protobuf:"bytes,16,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"` | |
| 87 | + | // CompletedAt is when this attempt completed. Unset until then. | |
| 88 | + | CompletedAt *timestamppb.Timestamp `protobuf:"bytes,17,opt,name=completed_at,json=completedAt,proto3" json:"completed_at,omitempty"` | |
| 89 | + | // Version counts the changes of this run on the server: it grows by at least | |
| 90 | + | // one at every change and never goes back, also across attempts. Events are | |
| 91 | + | // not delivered in order, and a client that holds two copies of a run keeps | |
| 92 | + | // the one with the higher version and drops the other. | |
| 93 | + | Version int64 `protobuf:"varint,18,opt,name=version,proto3" json:"version,omitempty"` | |
| 94 | + | unknownFields protoimpl.UnknownFields | |
| 95 | + | sizeCache protoimpl.SizeCache | |
| 96 | + | } | |
| 97 | + | ||
| 98 | + | func (x *Run) Reset() { | |
| 99 | + | *x = Run{} | |
| 100 | + | mi := &file_ermite_run_proto_msgTypes[0] | |
| 101 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 102 | + | ms.StoreMessageInfo(mi) | |
| 103 | + | } | |
| 104 | + | ||
| 105 | + | func (x *Run) String() string { | |
| 106 | + | return protoimpl.X.MessageStringOf(x) | |
| 107 | + | } | |
| 108 | + | ||
| 109 | + | func (*Run) ProtoMessage() {} | |
| 110 | + | ||
| 111 | + | func (x *Run) ProtoReflect() protoreflect.Message { | |
| 112 | + | mi := &file_ermite_run_proto_msgTypes[0] | |
| 113 | + | if x != nil { | |
| 114 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 115 | + | if ms.LoadMessageInfo() == nil { | |
| 116 | + | ms.StoreMessageInfo(mi) | |
| 117 | + | } | |
| 118 | + | return ms | |
| 119 | + | } | |
| 120 | + | return mi.MessageOf(x) | |
| 121 | + | } | |
| 122 | + | ||
| 123 | + | // Deprecated: Use Run.ProtoReflect.Descriptor instead. | |
| 124 | + | func (*Run) Descriptor() ([]byte, []int) { | |
| 125 | + | return file_ermite_run_proto_rawDescGZIP(), []int{0} | |
| 126 | + | } | |
| 127 | + | ||
| 128 | + | func (x *Run) GetRepo() string { | |
| 129 | + | if x != nil { | |
| 130 | + | return x.Repo | |
| 131 | + | } | |
| 132 | + | return "" | |
| 133 | + | } | |
| 134 | + | ||
| 135 | + | func (x *Run) GetId() int64 { | |
| 136 | + | if x != nil { | |
| 137 | + | return x.Id | |
| 138 | + | } | |
| 139 | + | return 0 | |
| 140 | + | } | |
| 141 | + | ||
| 142 | + | func (x *Run) GetNumber() int64 { | |
| 143 | + | if x != nil { | |
| 144 | + | return x.Number | |
| 145 | + | } | |
| 146 | + | return 0 | |
| 147 | + | } | |
| 148 | + | ||
| 149 | + | func (x *Run) GetAttempt() int32 { | |
| 150 | + | if x != nil { | |
| 151 | + | return x.Attempt | |
| 152 | + | } | |
| 153 | + | return 0 | |
| 154 | + | } | |
| 155 | + | ||
| 156 | + | func (x *Run) GetWorkflowPath() string { | |
| 157 | + | if x != nil { | |
| 158 | + | return x.WorkflowPath | |
| 159 | + | } | |
| 160 | + | return "" | |
| 161 | + | } | |
| 162 | + | ||
| 163 | + | func (x *Run) GetWorkflowName() string { | |
| 164 | + | if x != nil { | |
| 165 | + | return x.WorkflowName | |
| 166 | + | } | |
| 167 | + | return "" | |
| 168 | + | } | |
| 169 | + | ||
| 170 | + | func (x *Run) GetTitle() string { | |
| 171 | + | if x != nil { | |
| 172 | + | return x.Title | |
| 173 | + | } | |
| 174 | + | return "" | |
| 175 | + | } | |
| 176 | + | ||
| 177 | + | func (x *Run) GetEvent() string { | |
| 178 | + | if x != nil { | |
| 179 | + | return x.Event | |
| 180 | + | } | |
| 181 | + | return "" | |
| 182 | + | } | |
| 183 | + | ||
| 184 | + | func (x *Run) GetRef() string { | |
| 185 | + | if x != nil { | |
| 186 | + | return x.Ref | |
| 187 | + | } | |
| 188 | + | return "" | |
| 189 | + | } | |
| 190 | + | ||
| 191 | + | func (x *Run) GetSha() string { | |
| 192 | + | if x != nil { | |
| 193 | + | return x.Sha | |
| 194 | + | } | |
| 195 | + | return "" | |
| 196 | + | } | |
| 197 | + | ||
| 198 | + | func (x *Run) GetActor() string { | |
| 199 | + | if x != nil { | |
| 200 | + | return x.Actor | |
| 201 | + | } | |
| 202 | + | return "" | |
| 203 | + | } | |
| 204 | + | ||
| 205 | + | func (x *Run) GetStatus() CiStatus { | |
| 206 | + | if x != nil { | |
| 207 | + | return x.Status | |
| 208 | + | } | |
| 209 | + | return CiStatus_CI_STATUS_UNSPECIFIED | |
| 210 | + | } | |
| 211 | + | ||
| 212 | + | func (x *Run) GetConclusion() CiConclusion { | |
| 213 | + | if x != nil { | |
| 214 | + | return x.Conclusion | |
| 215 | + | } | |
| 216 | + | return CiConclusion_CI_CONCLUSION_UNSPECIFIED | |
| 217 | + | } | |
| 218 | + | ||
| 219 | + | func (x *Run) GetError() string { | |
| 220 | + | if x != nil { | |
| 221 | + | return x.Error | |
| 222 | + | } | |
| 223 | + | return "" | |
| 224 | + | } | |
| 225 | + | ||
| 226 | + | func (x *Run) GetCreatedAt() *timestamppb.Timestamp { | |
| 227 | + | if x != nil { | |
| 228 | + | return x.CreatedAt | |
| 229 | + | } | |
| 230 | + | return nil | |
| 231 | + | } | |
| 232 | + | ||
| 233 | + | func (x *Run) GetStartedAt() *timestamppb.Timestamp { | |
| 234 | + | if x != nil { | |
| 235 | + | return x.StartedAt | |
| 236 | + | } | |
| 237 | + | return nil | |
| 238 | + | } | |
| 239 | + | ||
| 240 | + | func (x *Run) GetCompletedAt() *timestamppb.Timestamp { | |
| 241 | + | if x != nil { | |
| 242 | + | return x.CompletedAt | |
| 243 | + | } | |
| 244 | + | return nil | |
| 245 | + | } | |
| 246 | + | ||
| 247 | + | func (x *Run) GetVersion() int64 { | |
| 248 | + | if x != nil { | |
| 249 | + | return x.Version | |
| 250 | + | } | |
| 251 | + | return 0 | |
| 252 | + | } | |
| 253 | + | ||
| 254 | + | // RunJob is a job of a run as people see it: the state of one job instance | |
| 255 | + | // (one matrix combination is one job) in one attempt. It is not Job, which is | |
| 256 | + | // what a runner receives. | |
| 257 | + | type RunJob struct { | |
| 258 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 259 | + | // Id is the Job.job_id. It is the same in every attempt. | |
| 260 | + | Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` | |
| 261 | + | // RunId is the run the job belongs to. | |
| 262 | + | RunId int64 `protobuf:"varint,2,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"` | |
| 263 | + | // Attempt is the attempt of the run in which this job executed. It is lower | |
| 264 | + | // than the attempt of the run when the job was kept from an earlier attempt | |
| 265 | + | // by a re-run of the failed jobs only; the log and steps are then those of | |
| 266 | + | // that earlier attempt. Pass it to GetJob and GetJobLog. | |
| 267 | + | Attempt int32 `protobuf:"varint,3,opt,name=attempt,proto3" json:"attempt,omitempty"` | |
| 268 | + | // Repo is the name of the repository. | |
| 269 | + | Repo string `protobuf:"bytes,4,opt,name=repo,proto3" json:"repo,omitempty"` | |
| 270 | + | // Key is the key of the job under "jobs:" in the workflow (the | |
| 271 | + | // "github.job"). Matrix instances of one job share it. | |
| 272 | + | Key string `protobuf:"bytes,5,opt,name=key,proto3" json:"key,omitempty"` | |
| 273 | + | // Name is the display name of the job, evaluated, with the matrix suffix as | |
| 274 | + | // GitHub names them, for example "build (linux, 1.27)". It is also the | |
| 275 | + | // name of the job's check. | |
| 276 | + | Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` | |
| 277 | + | // Status is where the job is. A job waits QUEUED for a runner and for the | |
| 278 | + | // jobs it needs. | |
| 279 | + | Status CiStatus `protobuf:"varint,7,opt,name=status,proto3,enum=ermite.CiStatus" json:"status,omitempty"` | |
| 280 | + | // Conclusion is how the job ended. Unset until status is COMPLETED. | |
| 281 | + | Conclusion CiConclusion `protobuf:"varint,8,opt,name=conclusion,proto3,enum=ermite.CiConclusion" json:"conclusion,omitempty"` | |
| 282 | + | // Error explains a FAILURE, CANCELLED or TIMED_OUT that no step explains, in | |
| 283 | + | // GitHub's words where it has them: the runner was lost ("The self-hosted | |
| 284 | + | // runner: <name> lost communication with the server..."), it received a | |
| 285 | + | // shutdown signal, no runner took the job within 24 hours, the log limit | |
| 286 | + | // was reached, the workflow uses a feature that is not supported yet | |
| 287 | + | // ("not supported yet: <feature>"). At most 4 KiB. Empty otherwise. | |
| 288 | + | Error string `protobuf:"bytes,9,opt,name=error,proto3" json:"error,omitempty"` | |
| 289 | + | // Labels are the runs-on labels of the job, evaluated. Empty while the job | |
| 290 | + | // is not planned yet. | |
| 291 | + | Labels []string `protobuf:"bytes,10,rep,name=labels,proto3" json:"labels,omitempty"` | |
| 292 | + | // Needs are the keys of the jobs this job needs, for drawing the graph. | |
| 293 | + | Needs []string `protobuf:"bytes,11,rep,name=needs,proto3" json:"needs,omitempty"` | |
| 294 | + | // RunnerId is the id of the runner that executed or is executing the job. | |
| 295 | + | // Empty while queued, and when the runner has since been removed (runner_name | |
| 296 | + | // and isolation are kept). | |
| 297 | + | RunnerId string `protobuf:"bytes,12,opt,name=runner_id,json=runnerId,proto3" json:"runner_id,omitempty"` | |
| 298 | + | // RunnerName is the name of that runner. Empty while queued. | |
| 299 | + | RunnerName string `protobuf:"bytes,13,opt,name=runner_name,json=runnerName,proto3" json:"runner_name,omitempty"` | |
| 300 | + | // Isolation is how that runner isolated the job. UNSPECIFIED while queued. | |
| 301 | + | Isolation RunnerIsolation `protobuf:"varint,14,opt,name=isolation,proto3,enum=ermite.RunnerIsolation" json:"isolation,omitempty"` | |
| 302 | + | // Steps are the steps reported so far, ordered by number, including the | |
| 303 | + | // implicit "Set up job" and "Complete job". Empty while queued. Always | |
| 304 | + | // set, including in JobUpdated events. | |
| 305 | + | Steps []*Step `protobuf:"bytes,15,rep,name=steps,proto3" json:"steps,omitempty"` | |
| 306 | + | // CreatedAt is when the job was created (planned). | |
| 307 | + | CreatedAt *timestamppb.Timestamp `protobuf:"bytes,16,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` | |
| 308 | + | // StartedAt is when the job was given to a runner. Unset until then. | |
| 309 | + | StartedAt *timestamppb.Timestamp `protobuf:"bytes,17,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"` | |
| 310 | + | // CompletedAt is when the job completed. Unset until then. | |
| 311 | + | CompletedAt *timestamppb.Timestamp `protobuf:"bytes,18,opt,name=completed_at,json=completedAt,proto3" json:"completed_at,omitempty"` | |
| 312 | + | // Version counts the changes of this job on the server (status, conclusion, | |
| 313 | + | // runner, steps, with any attempt): it grows by at least one at every change | |
| 314 | + | // and never goes back. A client that holds two copies of a job keeps the | |
| 315 | + | // one with the higher version and drops the other, as for Run.version. | |
| 316 | + | Version int64 `protobuf:"varint,19,opt,name=version,proto3" json:"version,omitempty"` | |
| 317 | + | unknownFields protoimpl.UnknownFields | |
| 318 | + | sizeCache protoimpl.SizeCache | |
| 319 | + | } | |
| 320 | + | ||
| 321 | + | func (x *RunJob) Reset() { | |
| 322 | + | *x = RunJob{} | |
| 323 | + | mi := &file_ermite_run_proto_msgTypes[1] | |
| 324 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 325 | + | ms.StoreMessageInfo(mi) | |
| 326 | + | } | |
| 327 | + | ||
| 328 | + | func (x *RunJob) String() string { | |
| 329 | + | return protoimpl.X.MessageStringOf(x) | |
| 330 | + | } | |
| 331 | + | ||
| 332 | + | func (*RunJob) ProtoMessage() {} | |
| 333 | + | ||
| 334 | + | func (x *RunJob) ProtoReflect() protoreflect.Message { | |
| 335 | + | mi := &file_ermite_run_proto_msgTypes[1] | |
| 336 | + | if x != nil { | |
| 337 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 338 | + | if ms.LoadMessageInfo() == nil { | |
| 339 | + | ms.StoreMessageInfo(mi) | |
| 340 | + | } | |
| 341 | + | return ms | |
| 342 | + | } | |
| 343 | + | return mi.MessageOf(x) | |
| 344 | + | } | |
| 345 | + | ||
| 346 | + | // Deprecated: Use RunJob.ProtoReflect.Descriptor instead. | |
| 347 | + | func (*RunJob) Descriptor() ([]byte, []int) { | |
| 348 | + | return file_ermite_run_proto_rawDescGZIP(), []int{1} | |
| 349 | + | } | |
| 350 | + | ||
| 351 | + | func (x *RunJob) GetId() string { | |
| 352 | + | if x != nil { | |
| 353 | + | return x.Id | |
| 354 | + | } | |
| 355 | + | return "" | |
| 356 | + | } | |
| 357 | + | ||
| 358 | + | func (x *RunJob) GetRunId() int64 { | |
| 359 | + | if x != nil { | |
| 360 | + | return x.RunId | |
| 361 | + | } | |
| 362 | + | return 0 | |
| 363 | + | } | |
| 364 | + | ||
| 365 | + | func (x *RunJob) GetAttempt() int32 { | |
| 366 | + | if x != nil { | |
| 367 | + | return x.Attempt | |
| 368 | + | } | |
| 369 | + | return 0 | |
| 370 | + | } | |
| 371 | + | ||
| 372 | + | func (x *RunJob) GetRepo() string { | |
| 373 | + | if x != nil { | |
| 374 | + | return x.Repo | |
| 375 | + | } | |
| 376 | + | return "" | |
| 377 | + | } | |
| 378 | + | ||
| 379 | + | func (x *RunJob) GetKey() string { | |
| 380 | + | if x != nil { | |
| 381 | + | return x.Key | |
| 382 | + | } | |
| 383 | + | return "" | |
| 384 | + | } | |
| 385 | + | ||
| 386 | + | func (x *RunJob) GetName() string { | |
| 387 | + | if x != nil { | |
| 388 | + | return x.Name | |
| 389 | + | } | |
| 390 | + | return "" | |
| 391 | + | } | |
| 392 | + | ||
| 393 | + | func (x *RunJob) GetStatus() CiStatus { | |
| 394 | + | if x != nil { | |
| 395 | + | return x.Status | |
| 396 | + | } | |
| 397 | + | return CiStatus_CI_STATUS_UNSPECIFIED | |
| 398 | + | } | |
| 399 | + | ||
| 400 | + | func (x *RunJob) GetConclusion() CiConclusion { | |
| 401 | + | if x != nil { | |
| 402 | + | return x.Conclusion | |
| 403 | + | } | |
| 404 | + | return CiConclusion_CI_CONCLUSION_UNSPECIFIED | |
| 405 | + | } | |
| 406 | + | ||
| 407 | + | func (x *RunJob) GetError() string { | |
| 408 | + | if x != nil { | |
| 409 | + | return x.Error | |
| 410 | + | } | |
| 411 | + | return "" | |
| 412 | + | } | |
| 413 | + | ||
| 414 | + | func (x *RunJob) GetLabels() []string { | |
| 415 | + | if x != nil { | |
| 416 | + | return x.Labels | |
| 417 | + | } | |
| 418 | + | return nil | |
| 419 | + | } | |
| 420 | + | ||
| 421 | + | func (x *RunJob) GetNeeds() []string { | |
| 422 | + | if x != nil { | |
| 423 | + | return x.Needs | |
| 424 | + | } | |
| 425 | + | return nil | |
| 426 | + | } | |
| 427 | + | ||
| 428 | + | func (x *RunJob) GetRunnerId() string { | |
| 429 | + | if x != nil { | |
| 430 | + | return x.RunnerId | |
| 431 | + | } | |
| 432 | + | return "" | |
| 433 | + | } | |
| 434 | + | ||
| 435 | + | func (x *RunJob) GetRunnerName() string { | |
| 436 | + | if x != nil { | |
| 437 | + | return x.RunnerName | |
| 438 | + | } | |
| 439 | + | return "" | |
| 440 | + | } | |
| 441 | + | ||
| 442 | + | func (x *RunJob) GetIsolation() RunnerIsolation { | |
| 443 | + | if x != nil { | |
| 444 | + | return x.Isolation | |
| 445 | + | } | |
| 446 | + | return RunnerIsolation_RUNNER_ISOLATION_UNSPECIFIED | |
| 447 | + | } | |
| 448 | + | ||
| 449 | + | func (x *RunJob) GetSteps() []*Step { | |
| 450 | + | if x != nil { | |
| 451 | + | return x.Steps | |
| 452 | + | } | |
| 453 | + | return nil | |
| 454 | + | } | |
| 455 | + | ||
| 456 | + | func (x *RunJob) GetCreatedAt() *timestamppb.Timestamp { | |
| 457 | + | if x != nil { | |
| 458 | + | return x.CreatedAt | |
| 459 | + | } | |
| 460 | + | return nil | |
| 461 | + | } | |
| 462 | + | ||
| 463 | + | func (x *RunJob) GetStartedAt() *timestamppb.Timestamp { | |
| 464 | + | if x != nil { | |
| 465 | + | return x.StartedAt | |
| 466 | + | } | |
| 467 | + | return nil | |
| 468 | + | } | |
| 469 | + | ||
| 470 | + | func (x *RunJob) GetCompletedAt() *timestamppb.Timestamp { | |
| 471 | + | if x != nil { | |
| 472 | + | return x.CompletedAt | |
| 473 | + | } | |
| 474 | + | return nil | |
| 475 | + | } | |
| 476 | + | ||
| 477 | + | func (x *RunJob) GetVersion() int64 { | |
| 478 | + | if x != nil { | |
| 479 | + | return x.Version | |
| 480 | + | } | |
| 481 | + | return 0 | |
| 482 | + | } | |
| 483 | + | ||
| 484 | + | // Step is one step of a job, with where its lines are in the job log. | |
| 485 | + | type Step struct { | |
| 486 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 487 | + | // Number is the 1-based number of the step in the job, the one the runner | |
| 488 | + | // uses in UpdateJob and AppendLog. | |
| 489 | + | Number int32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` | |
| 490 | + | // Name is the display name of the step. | |
| 491 | + | Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` | |
| 492 | + | // State is where the step is. | |
| 493 | + | State StepState `protobuf:"varint,3,opt,name=state,proto3,enum=ermite.StepState" json:"state,omitempty"` | |
| 494 | + | // Conclusion is how the step ended. Unset until state is COMPLETED. | |
| 495 | + | Conclusion CiConclusion `protobuf:"varint,4,opt,name=conclusion,proto3,enum=ermite.CiConclusion" json:"conclusion,omitempty"` | |
| 496 | + | // StartedAt is when the step started. Unset while PENDING. | |
| 497 | + | StartedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"` | |
| 498 | + | // CompletedAt is when the step ended. Unset until COMPLETED. | |
| 499 | + | CompletedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=completed_at,json=completedAt,proto3" json:"completed_at,omitempty"` | |
| 500 | + | // LogStart is the number of the first line of the step in the job log (the | |
| 501 | + | // offset of GetJobLogRequest and AppendLogRequest), counted from 0. | |
| 502 | + | LogStart int64 `protobuf:"varint,7,opt,name=log_start,json=logStart,proto3" json:"log_start,omitempty"` | |
| 503 | + | // LogEnd is the number of the line after the last one of the step. For an | |
| 504 | + | // IN_PROGRESS step it is the number of lines held at the time of the | |
| 505 | + | // call and grows; for a step without a line it equals log_start. | |
| 506 | + | LogEnd int64 `protobuf:"varint,8,opt,name=log_end,json=logEnd,proto3" json:"log_end,omitempty"` | |
| 507 | + | unknownFields protoimpl.UnknownFields | |
| 508 | + | sizeCache protoimpl.SizeCache | |
| 509 | + | } | |
| 510 | + | ||
| 511 | + | func (x *Step) Reset() { | |
| 512 | + | *x = Step{} | |
| 513 | + | mi := &file_ermite_run_proto_msgTypes[2] | |
| 514 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 515 | + | ms.StoreMessageInfo(mi) | |
| 516 | + | } | |
| 517 | + | ||
| 518 | + | func (x *Step) String() string { | |
| 519 | + | return protoimpl.X.MessageStringOf(x) | |
| 520 | + | } | |
| 521 | + | ||
| 522 | + | func (*Step) ProtoMessage() {} | |
| 523 | + | ||
| 524 | + | func (x *Step) ProtoReflect() protoreflect.Message { | |
| 525 | + | mi := &file_ermite_run_proto_msgTypes[2] | |
| 526 | + | if x != nil { | |
| 527 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 528 | + | if ms.LoadMessageInfo() == nil { | |
| 529 | + | ms.StoreMessageInfo(mi) | |
| 530 | + | } | |
| 531 | + | return ms | |
| 532 | + | } | |
| 533 | + | return mi.MessageOf(x) | |
| 534 | + | } | |
| 535 | + | ||
| 536 | + | // Deprecated: Use Step.ProtoReflect.Descriptor instead. | |
| 537 | + | func (*Step) Descriptor() ([]byte, []int) { | |
| 538 | + | return file_ermite_run_proto_rawDescGZIP(), []int{2} | |
| 539 | + | } | |
| 540 | + | ||
| 541 | + | func (x *Step) GetNumber() int32 { | |
| 542 | + | if x != nil { | |
| 543 | + | return x.Number | |
| 544 | + | } | |
| 545 | + | return 0 | |
| 546 | + | } | |
| 547 | + | ||
| 548 | + | func (x *Step) GetName() string { | |
| 549 | + | if x != nil { | |
| 550 | + | return x.Name | |
| 551 | + | } | |
| 552 | + | return "" | |
| 553 | + | } | |
| 554 | + | ||
| 555 | + | func (x *Step) GetState() StepState { | |
| 556 | + | if x != nil { | |
| 557 | + | return x.State | |
| 558 | + | } | |
| 559 | + | return StepState_STEP_STATE_UNSPECIFIED | |
| 560 | + | } | |
| 561 | + | ||
| 562 | + | func (x *Step) GetConclusion() CiConclusion { | |
| 563 | + | if x != nil { | |
| 564 | + | return x.Conclusion | |
| 565 | + | } | |
| 566 | + | return CiConclusion_CI_CONCLUSION_UNSPECIFIED | |
| 567 | + | } | |
| 568 | + | ||
| 569 | + | func (x *Step) GetStartedAt() *timestamppb.Timestamp { | |
| 570 | + | if x != nil { | |
| 571 | + | return x.StartedAt | |
| 572 | + | } | |
| 573 | + | return nil | |
| 574 | + | } | |
| 575 | + | ||
| 576 | + | func (x *Step) GetCompletedAt() *timestamppb.Timestamp { | |
| 577 | + | if x != nil { | |
| 578 | + | return x.CompletedAt | |
| 579 | + | } | |
| 580 | + | return nil | |
| 581 | + | } | |
| 582 | + | ||
| 583 | + | func (x *Step) GetLogStart() int64 { | |
| 584 | + | if x != nil { | |
| 585 | + | return x.LogStart | |
| 586 | + | } | |
| 587 | + | return 0 | |
| 588 | + | } | |
| 589 | + | ||
| 590 | + | func (x *Step) GetLogEnd() int64 { | |
| 591 | + | if x != nil { | |
| 592 | + | return x.LogEnd | |
| 593 | + | } | |
| 594 | + | return 0 | |
| 595 | + | } | |
| 596 | + | ||
| 597 | + | // Check is the result of one job on one commit, the unit shown next to a | |
| 598 | + | // commit or a merge request and counted by the merge rules. There is one per | |
| 599 | + | // job instance, named like GitHub's checks. | |
| 600 | + | type Check struct { | |
| 601 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 602 | + | // Id identifies the check. It is opaque and stable across attempts. | |
| 603 | + | Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` | |
| 604 | + | // Repo is the name of the repository. | |
| 605 | + | Repo string `protobuf:"bytes,2,opt,name=repo,proto3" json:"repo,omitempty"` | |
| 606 | + | // Sha is the full id of the commit. | |
| 607 | + | Sha string `protobuf:"bytes,3,opt,name=sha,proto3" json:"sha,omitempty"` | |
| 608 | + | // Name is the name of the check: the RunJob.name of the job. | |
| 609 | + | Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` | |
| 610 | + | // Status is where the check is. | |
| 611 | + | Status CiStatus `protobuf:"varint,5,opt,name=status,proto3,enum=ermite.CiStatus" json:"status,omitempty"` | |
| 612 | + | // Conclusion is how the check ended. Unset until status is COMPLETED. The | |
| 613 | + | // value "stale" of GitHub is never used. | |
| 614 | + | Conclusion CiConclusion `protobuf:"varint,6,opt,name=conclusion,proto3,enum=ermite.CiConclusion" json:"conclusion,omitempty"` | |
| 615 | + | // RunId is the run of the job. | |
| 616 | + | RunId int64 `protobuf:"varint,7,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"` | |
| 617 | + | // JobId is the RunJob.id of the job, to open its page and log. | |
| 618 | + | JobId string `protobuf:"bytes,8,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` | |
| 619 | + | // Attempt is the attempt the check describes: the latest attempt of the run. | |
| 620 | + | Attempt int32 `protobuf:"varint,9,opt,name=attempt,proto3" json:"attempt,omitempty"` | |
| 621 | + | // WorkflowName is the Run.workflow_name of the run. | |
| 622 | + | WorkflowName string `protobuf:"bytes,10,opt,name=workflow_name,json=workflowName,proto3" json:"workflow_name,omitempty"` | |
| 623 | + | // StartedAt is when the job was given to a runner. Unset while queued. | |
| 624 | + | StartedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"` | |
| 625 | + | // CompletedAt is when the job completed. Unset until then. | |
| 626 | + | CompletedAt *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=completed_at,json=completedAt,proto3" json:"completed_at,omitempty"` | |
| 627 | + | unknownFields protoimpl.UnknownFields | |
| 628 | + | sizeCache protoimpl.SizeCache | |
| 629 | + | } | |
| 630 | + | ||
| 631 | + | func (x *Check) Reset() { | |
| 632 | + | *x = Check{} | |
| 633 | + | mi := &file_ermite_run_proto_msgTypes[3] | |
| 634 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 635 | + | ms.StoreMessageInfo(mi) | |
| 636 | + | } | |
| 637 | + | ||
| 638 | + | func (x *Check) String() string { | |
| 639 | + | return protoimpl.X.MessageStringOf(x) | |
| 640 | + | } | |
| 641 | + | ||
| 642 | + | func (*Check) ProtoMessage() {} | |
| 643 | + | ||
| 644 | + | func (x *Check) ProtoReflect() protoreflect.Message { | |
| 645 | + | mi := &file_ermite_run_proto_msgTypes[3] | |
| 646 | + | if x != nil { | |
| 647 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 648 | + | if ms.LoadMessageInfo() == nil { | |
| 649 | + | ms.StoreMessageInfo(mi) | |
| 650 | + | } | |
| 651 | + | return ms | |
| 652 | + | } | |
| 653 | + | return mi.MessageOf(x) | |
| 654 | + | } | |
| 655 | + | ||
| 656 | + | // Deprecated: Use Check.ProtoReflect.Descriptor instead. | |
| 657 | + | func (*Check) Descriptor() ([]byte, []int) { | |
| 658 | + | return file_ermite_run_proto_rawDescGZIP(), []int{3} | |
| 659 | + | } | |
| 660 | + | ||
| 661 | + | func (x *Check) GetId() string { | |
| 662 | + | if x != nil { | |
| 663 | + | return x.Id | |
| 664 | + | } | |
| 665 | + | return "" | |
| 666 | + | } | |
| 667 | + | ||
| 668 | + | func (x *Check) GetRepo() string { | |
| 669 | + | if x != nil { | |
| 670 | + | return x.Repo | |
| 671 | + | } | |
| 672 | + | return "" | |
| 673 | + | } | |
| 674 | + | ||
| 675 | + | func (x *Check) GetSha() string { | |
| 676 | + | if x != nil { | |
| 677 | + | return x.Sha | |
| 678 | + | } | |
| 679 | + | return "" | |
| 680 | + | } | |
| 681 | + | ||
| 682 | + | func (x *Check) GetName() string { | |
| 683 | + | if x != nil { | |
| 684 | + | return x.Name | |
| 685 | + | } | |
| 686 | + | return "" | |
| 687 | + | } | |
| 688 | + | ||
| 689 | + | func (x *Check) GetStatus() CiStatus { | |
| 690 | + | if x != nil { | |
| 691 | + | return x.Status | |
| 692 | + | } | |
| 693 | + | return CiStatus_CI_STATUS_UNSPECIFIED | |
| 694 | + | } | |
| 695 | + | ||
| 696 | + | func (x *Check) GetConclusion() CiConclusion { | |
| 697 | + | if x != nil { | |
| 698 | + | return x.Conclusion | |
| 699 | + | } | |
| 700 | + | return CiConclusion_CI_CONCLUSION_UNSPECIFIED | |
| 701 | + | } | |
| 702 | + | ||
| 703 | + | func (x *Check) GetRunId() int64 { | |
| 704 | + | if x != nil { | |
| 705 | + | return x.RunId | |
| 706 | + | } | |
| 707 | + | return 0 | |
| 708 | + | } | |
| 709 | + | ||
| 710 | + | func (x *Check) GetJobId() string { | |
| 711 | + | if x != nil { | |
| 712 | + | return x.JobId | |
| 713 | + | } | |
| 714 | + | return "" | |
| 715 | + | } | |
| 716 | + | ||
| 717 | + | func (x *Check) GetAttempt() int32 { | |
| 718 | + | if x != nil { | |
| 719 | + | return x.Attempt | |
| 720 | + | } | |
| 721 | + | return 0 | |
| 722 | + | } | |
| 723 | + | ||
| 724 | + | func (x *Check) GetWorkflowName() string { | |
| 725 | + | if x != nil { | |
| 726 | + | return x.WorkflowName | |
| 727 | + | } | |
| 728 | + | return "" | |
| 729 | + | } | |
| 730 | + | ||
| 731 | + | func (x *Check) GetStartedAt() *timestamppb.Timestamp { | |
| 732 | + | if x != nil { | |
| 733 | + | return x.StartedAt | |
| 734 | + | } | |
| 735 | + | return nil | |
| 736 | + | } | |
| 737 | + | ||
| 738 | + | func (x *Check) GetCompletedAt() *timestamppb.Timestamp { | |
| 739 | + | if x != nil { | |
| 740 | + | return x.CompletedAt | |
| 741 | + | } | |
| 742 | + | return nil | |
| 743 | + | } | |
| 744 | + | ||
| 745 | + | // Runner is a registered CI runner. It never contains the runner token nor its | |
| 746 | + | // hash. | |
| 747 | + | type Runner struct { | |
| 748 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 749 | + | // Id identifies the runner in RemoveRunner. It is not a secret. | |
| 750 | + | Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` | |
| 751 | + | // Name is the unique name chosen at registration. | |
| 752 | + | Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` | |
| 753 | + | // Labels are all the labels the runner can match: the ones chosen at | |
| 754 | + | // registration plus the implicit ones ("self-hosted", the os and the arch), | |
| 755 | + | // lowercase, sorted. | |
| 756 | + | Labels []string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty"` | |
| 757 | + | // Isolation is how the runner isolates jobs. | |
| 758 | + | Isolation RunnerIsolation `protobuf:"varint,4,opt,name=isolation,proto3,enum=ermite.RunnerIsolation" json:"isolation,omitempty"` | |
| 759 | + | // Version is the version of the runner software. | |
| 760 | + | Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"` | |
| 761 | + | // Arch is "x64" or "arm64". | |
| 762 | + | Arch string `protobuf:"bytes,6,opt,name=arch,proto3" json:"arch,omitempty"` | |
| 763 | + | // Os is "linux". | |
| 764 | + | Os string `protobuf:"bytes,7,opt,name=os,proto3" json:"os,omitempty"` | |
| 765 | + | // RegisteredAt is when the runner was registered. | |
| 766 | + | RegisteredAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=registered_at,json=registeredAt,proto3" json:"registered_at,omitempty"` | |
| 767 | + | // LastSeen is when the server last heard from the runner: a FetchJob poll or | |
| 768 | + | // a heartbeat of one of its jobs. Unset if never. It may lag behind the real | |
| 769 | + | // time by a short delay. A runner not seen for more than about 2 minutes is | |
| 770 | + | // offline. | |
| 771 | + | LastSeen *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"` | |
| 772 | + | // Busy is true while the runner has a job in progress. | |
| 773 | + | Busy bool `protobuf:"varint,10,opt,name=busy,proto3" json:"busy,omitempty"` | |
| 774 | + | unknownFields protoimpl.UnknownFields | |
| 775 | + | sizeCache protoimpl.SizeCache | |
| 776 | + | } | |
| 777 | + | ||
| 778 | + | func (x *Runner) Reset() { | |
| 779 | + | *x = Runner{} | |
| 780 | + | mi := &file_ermite_run_proto_msgTypes[4] | |
| 781 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 782 | + | ms.StoreMessageInfo(mi) | |
| 783 | + | } | |
| 784 | + | ||
| 785 | + | func (x *Runner) String() string { | |
| 786 | + | return protoimpl.X.MessageStringOf(x) | |
| 787 | + | } | |
| 788 | + | ||
| 789 | + | func (*Runner) ProtoMessage() {} | |
| 790 | + | ||
| 791 | + | func (x *Runner) ProtoReflect() protoreflect.Message { | |
| 792 | + | mi := &file_ermite_run_proto_msgTypes[4] | |
| 793 | + | if x != nil { | |
| 794 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 795 | + | if ms.LoadMessageInfo() == nil { | |
| 796 | + | ms.StoreMessageInfo(mi) | |
| 797 | + | } | |
| 798 | + | return ms | |
| 799 | + | } | |
| 800 | + | return mi.MessageOf(x) | |
| 801 | + | } | |
| 802 | + | ||
| 803 | + | // Deprecated: Use Runner.ProtoReflect.Descriptor instead. | |
| 804 | + | func (*Runner) Descriptor() ([]byte, []int) { | |
| 805 | + | return file_ermite_run_proto_rawDescGZIP(), []int{4} | |
| 806 | + | } | |
| 807 | + | ||
| 808 | + | func (x *Runner) GetId() string { | |
| 809 | + | if x != nil { | |
| 810 | + | return x.Id | |
| 811 | + | } | |
| 812 | + | return "" | |
| 813 | + | } | |
| 814 | + | ||
| 815 | + | func (x *Runner) GetName() string { | |
| 816 | + | if x != nil { | |
| 817 | + | return x.Name | |
| 818 | + | } | |
| 819 | + | return "" | |
| 820 | + | } | |
| 821 | + | ||
| 822 | + | func (x *Runner) GetLabels() []string { | |
| 823 | + | if x != nil { | |
| 824 | + | return x.Labels | |
| 825 | + | } | |
| 826 | + | return nil | |
| 827 | + | } | |
| 828 | + | ||
| 829 | + | func (x *Runner) GetIsolation() RunnerIsolation { | |
| 830 | + | if x != nil { | |
| 831 | + | return x.Isolation | |
| 832 | + | } | |
| 833 | + | return RunnerIsolation_RUNNER_ISOLATION_UNSPECIFIED | |
| 834 | + | } | |
| 835 | + | ||
| 836 | + | func (x *Runner) GetVersion() string { | |
| 837 | + | if x != nil { | |
| 838 | + | return x.Version | |
| 839 | + | } | |
| 840 | + | return "" | |
| 841 | + | } | |
| 842 | + | ||
| 843 | + | func (x *Runner) GetArch() string { | |
| 844 | + | if x != nil { | |
| 845 | + | return x.Arch | |
| 846 | + | } | |
| 847 | + | return "" | |
| 848 | + | } | |
| 849 | + | ||
| 850 | + | func (x *Runner) GetOs() string { | |
| 851 | + | if x != nil { | |
| 852 | + | return x.Os | |
| 853 | + | } | |
| 854 | + | return "" | |
| 855 | + | } | |
| 856 | + | ||
| 857 | + | func (x *Runner) GetRegisteredAt() *timestamppb.Timestamp { | |
| 858 | + | if x != nil { | |
| 859 | + | return x.RegisteredAt | |
| 860 | + | } | |
| 861 | + | return nil | |
| 862 | + | } | |
| 863 | + | ||
| 864 | + | func (x *Runner) GetLastSeen() *timestamppb.Timestamp { | |
| 865 | + | if x != nil { | |
| 866 | + | return x.LastSeen | |
| 867 | + | } | |
| 868 | + | return nil | |
| 869 | + | } | |
| 870 | + | ||
| 871 | + | func (x *Runner) GetBusy() bool { | |
| 872 | + | if x != nil { | |
| 873 | + | return x.Busy | |
| 874 | + | } | |
| 875 | + | return false | |
| 876 | + | } | |
| 877 | + | ||
| 878 | + | // ListRunsRequest selects a page of runs. | |
| 879 | + | type ListRunsRequest struct { | |
| 880 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 881 | + | // Repo is the repository name. | |
| 882 | + | Repo string `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"` | |
| 883 | + | // PageSize is the maximum number of runs to return. | |
| 884 | + | PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` | |
| 885 | + | // PageToken is the next_page_token of a previous response. Empty for the | |
| 886 | + | // first page. | |
| 887 | + | PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` | |
| 888 | + | // Workflow restricts the result to one workflow file: its path | |
| 889 | + | // (".github/workflows/ci.yml") or its file name ("ci.yml"). Empty means | |
| 890 | + | // every workflow. Ignored by servers without "ci.runs.filters". | |
| 891 | + | Workflow string `protobuf:"bytes,4,opt,name=workflow,proto3" json:"workflow,omitempty"` | |
| 892 | + | // Branch restricts the result to the runs whose ref is this branch, by | |
| 893 | + | // short name ("main"). Empty means every ref. Ignored by servers without | |
| 894 | + | // "ci.runs.filters". | |
| 895 | + | Branch string `protobuf:"bytes,5,opt,name=branch,proto3" json:"branch,omitempty"` | |
| 896 | + | // Status restricts the result to the runs whose latest attempt has this | |
| 897 | + | // status. CI_STATUS_UNSPECIFIED means every status. Ignored by servers | |
| 898 | + | // without "ci.runs.filters". | |
| 899 | + | Status CiStatus `protobuf:"varint,6,opt,name=status,proto3,enum=ermite.CiStatus" json:"status,omitempty"` | |
| 900 | + | unknownFields protoimpl.UnknownFields | |
| 901 | + | sizeCache protoimpl.SizeCache | |
| 902 | + | } | |
| 903 | + | ||
| 904 | + | func (x *ListRunsRequest) Reset() { | |
| 905 | + | *x = ListRunsRequest{} | |
| 906 | + | mi := &file_ermite_run_proto_msgTypes[5] | |
| 907 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 908 | + | ms.StoreMessageInfo(mi) | |
| 909 | + | } | |
| 910 | + | ||
| 911 | + | func (x *ListRunsRequest) String() string { | |
| 912 | + | return protoimpl.X.MessageStringOf(x) | |
| 913 | + | } | |
| 914 | + | ||
| 915 | + | func (*ListRunsRequest) ProtoMessage() {} | |
| 916 | + | ||
| 917 | + | func (x *ListRunsRequest) ProtoReflect() protoreflect.Message { | |
| 918 | + | mi := &file_ermite_run_proto_msgTypes[5] | |
| 919 | + | if x != nil { | |
| 920 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 921 | + | if ms.LoadMessageInfo() == nil { | |
| 922 | + | ms.StoreMessageInfo(mi) | |
| 923 | + | } | |
| 924 | + | return ms | |
| 925 | + | } | |
| 926 | + | return mi.MessageOf(x) | |
| 927 | + | } | |
| 928 | + | ||
| 929 | + | // Deprecated: Use ListRunsRequest.ProtoReflect.Descriptor instead. | |
| 930 | + | func (*ListRunsRequest) Descriptor() ([]byte, []int) { | |
| 931 | + | return file_ermite_run_proto_rawDescGZIP(), []int{5} | |
| 932 | + | } | |
| 933 | + | ||
| 934 | + | func (x *ListRunsRequest) GetRepo() string { | |
| 935 | + | if x != nil { | |
| 936 | + | return x.Repo | |
| 937 | + | } | |
| 938 | + | return "" | |
| 939 | + | } | |
| 940 | + | ||
| 941 | + | func (x *ListRunsRequest) GetPageSize() int32 { | |
| 942 | + | if x != nil { | |
| 943 | + | return x.PageSize | |
| 944 | + | } | |
| 945 | + | return 0 | |
| 946 | + | } | |
| 947 | + | ||
| 948 | + | func (x *ListRunsRequest) GetPageToken() string { | |
| 949 | + | if x != nil { | |
| 950 | + | return x.PageToken | |
| 951 | + | } | |
| 952 | + | return "" | |
| 953 | + | } | |
| 954 | + | ||
| 955 | + | func (x *ListRunsRequest) GetWorkflow() string { | |
| 956 | + | if x != nil { | |
| 957 | + | return x.Workflow | |
| 958 | + | } | |
| 959 | + | return "" | |
| 960 | + | } | |
| 961 | + | ||
| 962 | + | func (x *ListRunsRequest) GetBranch() string { | |
| 963 | + | if x != nil { | |
| 964 | + | return x.Branch | |
| 965 | + | } | |
| 966 | + | return "" | |
| 967 | + | } | |
| 968 | + | ||
| 969 | + | func (x *ListRunsRequest) GetStatus() CiStatus { | |
| 970 | + | if x != nil { | |
| 971 | + | return x.Status | |
| 972 | + | } | |
| 973 | + | return CiStatus_CI_STATUS_UNSPECIFIED | |
| 974 | + | } | |
| 975 | + | ||
| 976 | + | // ListRunsResponse is one page of runs. | |
| 977 | + | type ListRunsResponse struct { | |
| 978 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 979 | + | // Runs are the runs of this page, highest id first, without jobs. | |
| 980 | + | Runs []*Run `protobuf:"bytes,1,rep,name=runs,proto3" json:"runs,omitempty"` | |
| 981 | + | // NextPageToken is passed as page_token to get the next page. Empty when | |
| 982 | + | // there is no next page. | |
| 983 | + | NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` | |
| 984 | + | unknownFields protoimpl.UnknownFields | |
| 985 | + | sizeCache protoimpl.SizeCache | |
| 986 | + | } | |
| 987 | + | ||
| 988 | + | func (x *ListRunsResponse) Reset() { | |
| 989 | + | *x = ListRunsResponse{} | |
| 990 | + | mi := &file_ermite_run_proto_msgTypes[6] | |
| 991 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 992 | + | ms.StoreMessageInfo(mi) | |
| 993 | + | } | |
| 994 | + | ||
| 995 | + | func (x *ListRunsResponse) String() string { | |
| 996 | + | return protoimpl.X.MessageStringOf(x) | |
| 997 | + | } | |
| 998 | + | ||
| 999 | + | func (*ListRunsResponse) ProtoMessage() {} | |
| 1000 | + | ||
| 1001 | + | func (x *ListRunsResponse) ProtoReflect() protoreflect.Message { | |
| 1002 | + | mi := &file_ermite_run_proto_msgTypes[6] | |
| 1003 | + | if x != nil { | |
| 1004 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1005 | + | if ms.LoadMessageInfo() == nil { | |
| 1006 | + | ms.StoreMessageInfo(mi) | |
| 1007 | + | } | |
| 1008 | + | return ms | |
| 1009 | + | } | |
| 1010 | + | return mi.MessageOf(x) | |
| 1011 | + | } | |
| 1012 | + | ||
| 1013 | + | // Deprecated: Use ListRunsResponse.ProtoReflect.Descriptor instead. | |
| 1014 | + | func (*ListRunsResponse) Descriptor() ([]byte, []int) { | |
| 1015 | + | return file_ermite_run_proto_rawDescGZIP(), []int{6} | |
| 1016 | + | } | |
| 1017 | + | ||
| 1018 | + | func (x *ListRunsResponse) GetRuns() []*Run { | |
| 1019 | + | if x != nil { | |
| 1020 | + | return x.Runs | |
| 1021 | + | } | |
| 1022 | + | return nil | |
| 1023 | + | } | |
| 1024 | + | ||
| 1025 | + | func (x *ListRunsResponse) GetNextPageToken() string { | |
| 1026 | + | if x != nil { | |
| 1027 | + | return x.NextPageToken | |
| 1028 | + | } | |
| 1029 | + | return "" | |
| 1030 | + | } | |
| 1031 | + | ||
| 1032 | + | // GetRunRequest selects a run. | |
| 1033 | + | type GetRunRequest struct { | |
| 1034 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 1035 | + | // Repo is the repository name. | |
| 1036 | + | Repo string `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"` | |
| 1037 | + | // RunId is the Run.id. | |
| 1038 | + | RunId int64 `protobuf:"varint,2,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"` | |
| 1039 | + | // Attempt is the attempt to read. 0 means the latest. | |
| 1040 | + | Attempt int32 `protobuf:"varint,3,opt,name=attempt,proto3" json:"attempt,omitempty"` | |
| 1041 | + | unknownFields protoimpl.UnknownFields | |
| 1042 | + | sizeCache protoimpl.SizeCache | |
| 1043 | + | } | |
| 1044 | + | ||
| 1045 | + | func (x *GetRunRequest) Reset() { | |
| 1046 | + | *x = GetRunRequest{} | |
| 1047 | + | mi := &file_ermite_run_proto_msgTypes[7] | |
| 1048 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1049 | + | ms.StoreMessageInfo(mi) | |
| 1050 | + | } | |
| 1051 | + | ||
| 1052 | + | func (x *GetRunRequest) String() string { | |
| 1053 | + | return protoimpl.X.MessageStringOf(x) | |
| 1054 | + | } | |
| 1055 | + | ||
| 1056 | + | func (*GetRunRequest) ProtoMessage() {} | |
| 1057 | + | ||
| 1058 | + | func (x *GetRunRequest) ProtoReflect() protoreflect.Message { | |
| 1059 | + | mi := &file_ermite_run_proto_msgTypes[7] | |
| 1060 | + | if x != nil { | |
| 1061 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1062 | + | if ms.LoadMessageInfo() == nil { | |
| 1063 | + | ms.StoreMessageInfo(mi) | |
| 1064 | + | } | |
| 1065 | + | return ms | |
| 1066 | + | } | |
| 1067 | + | return mi.MessageOf(x) | |
| 1068 | + | } | |
| 1069 | + | ||
| 1070 | + | // Deprecated: Use GetRunRequest.ProtoReflect.Descriptor instead. | |
| 1071 | + | func (*GetRunRequest) Descriptor() ([]byte, []int) { | |
| 1072 | + | return file_ermite_run_proto_rawDescGZIP(), []int{7} | |
| 1073 | + | } | |
| 1074 | + | ||
| 1075 | + | func (x *GetRunRequest) GetRepo() string { | |
| 1076 | + | if x != nil { | |
| 1077 | + | return x.Repo | |
| 1078 | + | } | |
| 1079 | + | return "" | |
| 1080 | + | } | |
| 1081 | + | ||
| 1082 | + | func (x *GetRunRequest) GetRunId() int64 { | |
| 1083 | + | if x != nil { | |
| 1084 | + | return x.RunId | |
| 1085 | + | } | |
| 1086 | + | return 0 | |
| 1087 | + | } | |
| 1088 | + | ||
| 1089 | + | func (x *GetRunRequest) GetAttempt() int32 { | |
| 1090 | + | if x != nil { | |
| 1091 | + | return x.Attempt | |
| 1092 | + | } | |
| 1093 | + | return 0 | |
| 1094 | + | } | |
| 1095 | + | ||
| 1096 | + | // GetRunResponse holds a run with its jobs. | |
| 1097 | + | type GetRunResponse struct { | |
| 1098 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 1099 | + | // Run is the run, as of the attempt asked. | |
| 1100 | + | Run *Run `protobuf:"bytes,1,opt,name=run,proto3" json:"run,omitempty"` | |
| 1101 | + | // Jobs are the jobs of that attempt, with their steps, in the order of the | |
| 1102 | + | // workflow file (matrix instances in the order of the matrix). Jobs kept from | |
| 1103 | + | // an earlier attempt by a re-run of failed jobs are included, with their own | |
| 1104 | + | // RunJob.attempt. Empty for a run that failed on an invalid workflow file. | |
| 1105 | + | Jobs []*RunJob `protobuf:"bytes,2,rep,name=jobs,proto3" json:"jobs,omitempty"` | |
| 1106 | + | // LatestAttempt is the latest attempt of the run, to offer the other ones. | |
| 1107 | + | LatestAttempt int32 `protobuf:"varint,3,opt,name=latest_attempt,json=latestAttempt,proto3" json:"latest_attempt,omitempty"` | |
| 1108 | + | unknownFields protoimpl.UnknownFields | |
| 1109 | + | sizeCache protoimpl.SizeCache | |
| 1110 | + | } | |
| 1111 | + | ||
| 1112 | + | func (x *GetRunResponse) Reset() { | |
| 1113 | + | *x = GetRunResponse{} | |
| 1114 | + | mi := &file_ermite_run_proto_msgTypes[8] | |
| 1115 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1116 | + | ms.StoreMessageInfo(mi) | |
| 1117 | + | } | |
| 1118 | + | ||
| 1119 | + | func (x *GetRunResponse) String() string { | |
| 1120 | + | return protoimpl.X.MessageStringOf(x) | |
| 1121 | + | } | |
| 1122 | + | ||
| 1123 | + | func (*GetRunResponse) ProtoMessage() {} | |
| 1124 | + | ||
| 1125 | + | func (x *GetRunResponse) ProtoReflect() protoreflect.Message { | |
| 1126 | + | mi := &file_ermite_run_proto_msgTypes[8] | |
| 1127 | + | if x != nil { | |
| 1128 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1129 | + | if ms.LoadMessageInfo() == nil { | |
| 1130 | + | ms.StoreMessageInfo(mi) | |
| 1131 | + | } | |
| 1132 | + | return ms | |
| 1133 | + | } | |
| 1134 | + | return mi.MessageOf(x) | |
| 1135 | + | } | |
| 1136 | + | ||
| 1137 | + | // Deprecated: Use GetRunResponse.ProtoReflect.Descriptor instead. | |
| 1138 | + | func (*GetRunResponse) Descriptor() ([]byte, []int) { | |
| 1139 | + | return file_ermite_run_proto_rawDescGZIP(), []int{8} | |
| 1140 | + | } | |
| 1141 | + | ||
| 1142 | + | func (x *GetRunResponse) GetRun() *Run { | |
| 1143 | + | if x != nil { | |
| 1144 | + | return x.Run | |
| 1145 | + | } | |
| 1146 | + | return nil | |
| 1147 | + | } | |
| 1148 | + | ||
| 1149 | + | func (x *GetRunResponse) GetJobs() []*RunJob { | |
| 1150 | + | if x != nil { | |
| 1151 | + | return x.Jobs | |
| 1152 | + | } | |
| 1153 | + | return nil | |
| 1154 | + | } | |
| 1155 | + | ||
| 1156 | + | func (x *GetRunResponse) GetLatestAttempt() int32 { | |
| 1157 | + | if x != nil { | |
| 1158 | + | return x.LatestAttempt | |
| 1159 | + | } | |
| 1160 | + | return 0 | |
| 1161 | + | } | |
| 1162 | + | ||
| 1163 | + | // GetJobRequest selects a job. | |
| 1164 | + | type GetJobRequest struct { | |
| 1165 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 1166 | + | // Repo is the repository name. | |
| 1167 | + | Repo string `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"` | |
| 1168 | + | // JobId is the RunJob.id. | |
| 1169 | + | JobId string `protobuf:"bytes,2,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` | |
| 1170 | + | // Attempt is the RunJob.attempt to read. 0 means the latest. | |
| 1171 | + | Attempt int32 `protobuf:"varint,3,opt,name=attempt,proto3" json:"attempt,omitempty"` | |
| 1172 | + | unknownFields protoimpl.UnknownFields | |
| 1173 | + | sizeCache protoimpl.SizeCache | |
| 1174 | + | } | |
| 1175 | + | ||
| 1176 | + | func (x *GetJobRequest) Reset() { | |
| 1177 | + | *x = GetJobRequest{} | |
| 1178 | + | mi := &file_ermite_run_proto_msgTypes[9] | |
| 1179 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1180 | + | ms.StoreMessageInfo(mi) | |
| 1181 | + | } | |
| 1182 | + | ||
| 1183 | + | func (x *GetJobRequest) String() string { | |
| 1184 | + | return protoimpl.X.MessageStringOf(x) | |
| 1185 | + | } | |
| 1186 | + | ||
| 1187 | + | func (*GetJobRequest) ProtoMessage() {} | |
| 1188 | + | ||
| 1189 | + | func (x *GetJobRequest) ProtoReflect() protoreflect.Message { | |
| 1190 | + | mi := &file_ermite_run_proto_msgTypes[9] | |
| 1191 | + | if x != nil { | |
| 1192 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1193 | + | if ms.LoadMessageInfo() == nil { | |
| 1194 | + | ms.StoreMessageInfo(mi) | |
| 1195 | + | } | |
| 1196 | + | return ms | |
| 1197 | + | } | |
| 1198 | + | return mi.MessageOf(x) | |
| 1199 | + | } | |
| 1200 | + | ||
| 1201 | + | // Deprecated: Use GetJobRequest.ProtoReflect.Descriptor instead. | |
| 1202 | + | func (*GetJobRequest) Descriptor() ([]byte, []int) { | |
| 1203 | + | return file_ermite_run_proto_rawDescGZIP(), []int{9} | |
| 1204 | + | } | |
| 1205 | + | ||
| 1206 | + | func (x *GetJobRequest) GetRepo() string { | |
| 1207 | + | if x != nil { | |
| 1208 | + | return x.Repo | |
| 1209 | + | } | |
| 1210 | + | return "" | |
| 1211 | + | } | |
| 1212 | + | ||
| 1213 | + | func (x *GetJobRequest) GetJobId() string { | |
| 1214 | + | if x != nil { | |
| 1215 | + | return x.JobId | |
| 1216 | + | } | |
| 1217 | + | return "" | |
| 1218 | + | } | |
| 1219 | + | ||
| 1220 | + | func (x *GetJobRequest) GetAttempt() int32 { | |
| 1221 | + | if x != nil { | |
| 1222 | + | return x.Attempt | |
| 1223 | + | } | |
| 1224 | + | return 0 | |
| 1225 | + | } | |
| 1226 | + | ||
| 1227 | + | // GetJobResponse holds a job. | |
| 1228 | + | type GetJobResponse struct { | |
| 1229 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 1230 | + | // Job is the job with its steps. | |
| 1231 | + | Job *RunJob `protobuf:"bytes,1,opt,name=job,proto3" json:"job,omitempty"` | |
| 1232 | + | unknownFields protoimpl.UnknownFields | |
| 1233 | + | sizeCache protoimpl.SizeCache | |
| 1234 | + | } | |
| 1235 | + | ||
| 1236 | + | func (x *GetJobResponse) Reset() { | |
| 1237 | + | *x = GetJobResponse{} | |
| 1238 | + | mi := &file_ermite_run_proto_msgTypes[10] | |
| 1239 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1240 | + | ms.StoreMessageInfo(mi) | |
| 1241 | + | } | |
| 1242 | + | ||
| 1243 | + | func (x *GetJobResponse) String() string { | |
| 1244 | + | return protoimpl.X.MessageStringOf(x) | |
| 1245 | + | } | |
| 1246 | + | ||
| 1247 | + | func (*GetJobResponse) ProtoMessage() {} | |
| 1248 | + | ||
| 1249 | + | func (x *GetJobResponse) ProtoReflect() protoreflect.Message { | |
| 1250 | + | mi := &file_ermite_run_proto_msgTypes[10] | |
| 1251 | + | if x != nil { | |
| 1252 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1253 | + | if ms.LoadMessageInfo() == nil { | |
| 1254 | + | ms.StoreMessageInfo(mi) | |
| 1255 | + | } | |
| 1256 | + | return ms | |
| 1257 | + | } | |
| 1258 | + | return mi.MessageOf(x) | |
| 1259 | + | } | |
| 1260 | + | ||
| 1261 | + | // Deprecated: Use GetJobResponse.ProtoReflect.Descriptor instead. | |
| 1262 | + | func (*GetJobResponse) Descriptor() ([]byte, []int) { | |
| 1263 | + | return file_ermite_run_proto_rawDescGZIP(), []int{10} | |
| 1264 | + | } | |
| 1265 | + | ||
| 1266 | + | func (x *GetJobResponse) GetJob() *RunJob { | |
| 1267 | + | if x != nil { | |
| 1268 | + | return x.Job | |
| 1269 | + | } | |
| 1270 | + | return nil | |
| 1271 | + | } | |
| 1272 | + | ||
| 1273 | + | // GetJobLogRequest selects the lines to stream. | |
| 1274 | + | type GetJobLogRequest struct { | |
| 1275 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 1276 | + | // Repo is the repository name. | |
| 1277 | + | Repo string `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"` | |
| 1278 | + | // JobId is the RunJob.id. | |
| 1279 | + | JobId string `protobuf:"bytes,2,opt,name=job_id,json=jobId,proto3" json:"job_id,omitempty"` | |
| 1280 | + | // Attempt is the RunJob.attempt whose log to read. 0 means the latest. | |
| 1281 | + | Attempt int32 `protobuf:"varint,3,opt,name=attempt,proto3" json:"attempt,omitempty"` | |
| 1282 | + | // Offset is the number of the first line to send, counted from 0 across all | |
| 1283 | + | // steps (see Step.log_start). Negative is invalid_argument. | |
| 1284 | + | Offset int64 `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"` | |
| 1285 | + | // Follow keeps the stream open while the job runs. See GetJobLog. | |
| 1286 | + | Follow bool `protobuf:"varint,5,opt,name=follow,proto3" json:"follow,omitempty"` | |
| 1287 | + | unknownFields protoimpl.UnknownFields | |
| 1288 | + | sizeCache protoimpl.SizeCache | |
| 1289 | + | } | |
| 1290 | + | ||
| 1291 | + | func (x *GetJobLogRequest) Reset() { | |
| 1292 | + | *x = GetJobLogRequest{} | |
| 1293 | + | mi := &file_ermite_run_proto_msgTypes[11] | |
| 1294 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1295 | + | ms.StoreMessageInfo(mi) | |
| 1296 | + | } | |
| 1297 | + | ||
| 1298 | + | func (x *GetJobLogRequest) String() string { | |
| 1299 | + | return protoimpl.X.MessageStringOf(x) | |
| 1300 | + | } | |
| 1301 | + | ||
| 1302 | + | func (*GetJobLogRequest) ProtoMessage() {} | |
| 1303 | + | ||
| 1304 | + | func (x *GetJobLogRequest) ProtoReflect() protoreflect.Message { | |
| 1305 | + | mi := &file_ermite_run_proto_msgTypes[11] | |
| 1306 | + | if x != nil { | |
| 1307 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1308 | + | if ms.LoadMessageInfo() == nil { | |
| 1309 | + | ms.StoreMessageInfo(mi) | |
| 1310 | + | } | |
| 1311 | + | return ms | |
| 1312 | + | } | |
| 1313 | + | return mi.MessageOf(x) | |
| 1314 | + | } | |
| 1315 | + | ||
| 1316 | + | // Deprecated: Use GetJobLogRequest.ProtoReflect.Descriptor instead. | |
| 1317 | + | func (*GetJobLogRequest) Descriptor() ([]byte, []int) { | |
| 1318 | + | return file_ermite_run_proto_rawDescGZIP(), []int{11} | |
| 1319 | + | } | |
| 1320 | + | ||
| 1321 | + | func (x *GetJobLogRequest) GetRepo() string { | |
| 1322 | + | if x != nil { | |
| 1323 | + | return x.Repo | |
| 1324 | + | } | |
| 1325 | + | return "" | |
| 1326 | + | } | |
| 1327 | + | ||
| 1328 | + | func (x *GetJobLogRequest) GetJobId() string { | |
| 1329 | + | if x != nil { | |
| 1330 | + | return x.JobId | |
| 1331 | + | } | |
| 1332 | + | return "" | |
| 1333 | + | } | |
| 1334 | + | ||
| 1335 | + | func (x *GetJobLogRequest) GetAttempt() int32 { | |
| 1336 | + | if x != nil { | |
| 1337 | + | return x.Attempt | |
| 1338 | + | } | |
| 1339 | + | return 0 | |
| 1340 | + | } | |
| 1341 | + | ||
| 1342 | + | func (x *GetJobLogRequest) GetOffset() int64 { | |
| 1343 | + | if x != nil { | |
| 1344 | + | return x.Offset | |
| 1345 | + | } | |
| 1346 | + | return 0 | |
| 1347 | + | } | |
| 1348 | + | ||
| 1349 | + | func (x *GetJobLogRequest) GetFollow() bool { | |
| 1350 | + | if x != nil { | |
| 1351 | + | return x.Follow | |
| 1352 | + | } | |
| 1353 | + | return false | |
| 1354 | + | } | |
| 1355 | + | ||
| 1356 | + | // GetJobLogResponse is one message of the log stream. | |
| 1357 | + | type GetJobLogResponse struct { | |
| 1358 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 1359 | + | // Offset is the number of the first line of lines. | |
| 1360 | + | Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` | |
| 1361 | + | // Lines are consecutive lines of the log, at most 1,000, at most 64 KiB of | |
| 1362 | + | // text in total. Never empty. | |
| 1363 | + | Lines []*JobLogLine `protobuf:"bytes,2,rep,name=lines,proto3" json:"lines,omitempty"` | |
| 1364 | + | unknownFields protoimpl.UnknownFields | |
| 1365 | + | sizeCache protoimpl.SizeCache | |
| 1366 | + | } | |
| 1367 | + | ||
| 1368 | + | func (x *GetJobLogResponse) Reset() { | |
| 1369 | + | *x = GetJobLogResponse{} | |
| 1370 | + | mi := &file_ermite_run_proto_msgTypes[12] | |
| 1371 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1372 | + | ms.StoreMessageInfo(mi) | |
| 1373 | + | } | |
| 1374 | + | ||
| 1375 | + | func (x *GetJobLogResponse) String() string { | |
| 1376 | + | return protoimpl.X.MessageStringOf(x) | |
| 1377 | + | } | |
| 1378 | + | ||
| 1379 | + | func (*GetJobLogResponse) ProtoMessage() {} | |
| 1380 | + | ||
| 1381 | + | func (x *GetJobLogResponse) ProtoReflect() protoreflect.Message { | |
| 1382 | + | mi := &file_ermite_run_proto_msgTypes[12] | |
| 1383 | + | if x != nil { | |
| 1384 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1385 | + | if ms.LoadMessageInfo() == nil { | |
| 1386 | + | ms.StoreMessageInfo(mi) | |
| 1387 | + | } | |
| 1388 | + | return ms | |
| 1389 | + | } | |
| 1390 | + | return mi.MessageOf(x) | |
| 1391 | + | } | |
| 1392 | + | ||
| 1393 | + | // Deprecated: Use GetJobLogResponse.ProtoReflect.Descriptor instead. | |
| 1394 | + | func (*GetJobLogResponse) Descriptor() ([]byte, []int) { | |
| 1395 | + | return file_ermite_run_proto_rawDescGZIP(), []int{12} | |
| 1396 | + | } | |
| 1397 | + | ||
| 1398 | + | func (x *GetJobLogResponse) GetOffset() int64 { | |
| 1399 | + | if x != nil { | |
| 1400 | + | return x.Offset | |
| 1401 | + | } | |
| 1402 | + | return 0 | |
| 1403 | + | } | |
| 1404 | + | ||
| 1405 | + | func (x *GetJobLogResponse) GetLines() []*JobLogLine { | |
| 1406 | + | if x != nil { | |
| 1407 | + | return x.Lines | |
| 1408 | + | } | |
| 1409 | + | return nil | |
| 1410 | + | } | |
| 1411 | + | ||
| 1412 | + | // JobLogLine is one line of a job log, as the runner sent it. | |
| 1413 | + | type JobLogLine struct { | |
| 1414 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 1415 | + | // Step is the number of the step the line belongs to. | |
| 1416 | + | Step int32 `protobuf:"varint,1,opt,name=step,proto3" json:"step,omitempty"` | |
| 1417 | + | // Time is when the runner produced the line, with nanosecond precision. | |
| 1418 | + | Time *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=time,proto3" json:"time,omitempty"` | |
| 1419 | + | // Text is the line without its terminator, as in LogLine.text, including the | |
| 1420 | + | // "##[group]" and "##[endgroup]" markers. Clients show it escaped. | |
| 1421 | + | Text string `protobuf:"bytes,3,opt,name=text,proto3" json:"text,omitempty"` | |
| 1422 | + | // Continued is true when the line continues the line before it, which was | |
| 1423 | + | // too long for the runner to send whole (see LogLine.continued). Pieces keep | |
| 1424 | + | // their own line numbers, so offsets are the same as the runner's; a client | |
| 1425 | + | // that shows lines joins a continued line to the previous one. The raw log | |
| 1426 | + | // file already has them joined. | |
| 1427 | + | Continued bool `protobuf:"varint,4,opt,name=continued,proto3" json:"continued,omitempty"` | |
| 1428 | + | unknownFields protoimpl.UnknownFields | |
| 1429 | + | sizeCache protoimpl.SizeCache | |
| 1430 | + | } | |
| 1431 | + | ||
| 1432 | + | func (x *JobLogLine) Reset() { | |
| 1433 | + | *x = JobLogLine{} | |
| 1434 | + | mi := &file_ermite_run_proto_msgTypes[13] | |
| 1435 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1436 | + | ms.StoreMessageInfo(mi) | |
| 1437 | + | } | |
| 1438 | + | ||
| 1439 | + | func (x *JobLogLine) String() string { | |
| 1440 | + | return protoimpl.X.MessageStringOf(x) | |
| 1441 | + | } | |
| 1442 | + | ||
| 1443 | + | func (*JobLogLine) ProtoMessage() {} | |
| 1444 | + | ||
| 1445 | + | func (x *JobLogLine) ProtoReflect() protoreflect.Message { | |
| 1446 | + | mi := &file_ermite_run_proto_msgTypes[13] | |
| 1447 | + | if x != nil { | |
| 1448 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1449 | + | if ms.LoadMessageInfo() == nil { | |
| 1450 | + | ms.StoreMessageInfo(mi) | |
| 1451 | + | } | |
| 1452 | + | return ms | |
| 1453 | + | } | |
| 1454 | + | return mi.MessageOf(x) | |
| 1455 | + | } | |
| 1456 | + | ||
| 1457 | + | // Deprecated: Use JobLogLine.ProtoReflect.Descriptor instead. | |
| 1458 | + | func (*JobLogLine) Descriptor() ([]byte, []int) { | |
| 1459 | + | return file_ermite_run_proto_rawDescGZIP(), []int{13} | |
| 1460 | + | } | |
| 1461 | + | ||
| 1462 | + | func (x *JobLogLine) GetStep() int32 { | |
| 1463 | + | if x != nil { | |
| 1464 | + | return x.Step | |
| 1465 | + | } | |
| 1466 | + | return 0 | |
| 1467 | + | } | |
| 1468 | + | ||
| 1469 | + | func (x *JobLogLine) GetTime() *timestamppb.Timestamp { | |
| 1470 | + | if x != nil { | |
| 1471 | + | return x.Time | |
| 1472 | + | } | |
| 1473 | + | return nil | |
| 1474 | + | } | |
| 1475 | + | ||
| 1476 | + | func (x *JobLogLine) GetText() string { | |
| 1477 | + | if x != nil { | |
| 1478 | + | return x.Text | |
| 1479 | + | } | |
| 1480 | + | return "" | |
| 1481 | + | } | |
| 1482 | + | ||
| 1483 | + | func (x *JobLogLine) GetContinued() bool { | |
| 1484 | + | if x != nil { | |
| 1485 | + | return x.Continued | |
| 1486 | + | } | |
| 1487 | + | return false | |
| 1488 | + | } | |
| 1489 | + | ||
| 1490 | + | // CancelRunRequest names the run to cancel. | |
| 1491 | + | type CancelRunRequest struct { | |
| 1492 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 1493 | + | // Repo is the repository name. | |
| 1494 | + | Repo string `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"` | |
| 1495 | + | // RunId is the Run.id. | |
| 1496 | + | RunId int64 `protobuf:"varint,2,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"` | |
| 1497 | + | unknownFields protoimpl.UnknownFields | |
| 1498 | + | sizeCache protoimpl.SizeCache | |
| 1499 | + | } | |
| 1500 | + | ||
| 1501 | + | func (x *CancelRunRequest) Reset() { | |
| 1502 | + | *x = CancelRunRequest{} | |
| 1503 | + | mi := &file_ermite_run_proto_msgTypes[14] | |
| 1504 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1505 | + | ms.StoreMessageInfo(mi) | |
| 1506 | + | } | |
| 1507 | + | ||
| 1508 | + | func (x *CancelRunRequest) String() string { | |
| 1509 | + | return protoimpl.X.MessageStringOf(x) | |
| 1510 | + | } | |
| 1511 | + | ||
| 1512 | + | func (*CancelRunRequest) ProtoMessage() {} | |
| 1513 | + | ||
| 1514 | + | func (x *CancelRunRequest) ProtoReflect() protoreflect.Message { | |
| 1515 | + | mi := &file_ermite_run_proto_msgTypes[14] | |
| 1516 | + | if x != nil { | |
| 1517 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1518 | + | if ms.LoadMessageInfo() == nil { | |
| 1519 | + | ms.StoreMessageInfo(mi) | |
| 1520 | + | } | |
| 1521 | + | return ms | |
| 1522 | + | } | |
| 1523 | + | return mi.MessageOf(x) | |
| 1524 | + | } | |
| 1525 | + | ||
| 1526 | + | // Deprecated: Use CancelRunRequest.ProtoReflect.Descriptor instead. | |
| 1527 | + | func (*CancelRunRequest) Descriptor() ([]byte, []int) { | |
| 1528 | + | return file_ermite_run_proto_rawDescGZIP(), []int{14} | |
| 1529 | + | } | |
| 1530 | + | ||
| 1531 | + | func (x *CancelRunRequest) GetRepo() string { | |
| 1532 | + | if x != nil { | |
| 1533 | + | return x.Repo | |
| 1534 | + | } | |
| 1535 | + | return "" | |
| 1536 | + | } | |
| 1537 | + | ||
| 1538 | + | func (x *CancelRunRequest) GetRunId() int64 { | |
| 1539 | + | if x != nil { | |
| 1540 | + | return x.RunId | |
| 1541 | + | } | |
| 1542 | + | return 0 | |
| 1543 | + | } | |
| 1544 | + | ||
| 1545 | + | // CancelRunResponse holds the run after the request. | |
| 1546 | + | type CancelRunResponse struct { | |
| 1547 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 1548 | + | // Run is the latest attempt of the run. | |
| 1549 | + | Run *Run `protobuf:"bytes,1,opt,name=run,proto3" json:"run,omitempty"` | |
| 1550 | + | unknownFields protoimpl.UnknownFields | |
| 1551 | + | sizeCache protoimpl.SizeCache | |
| 1552 | + | } | |
| 1553 | + | ||
| 1554 | + | func (x *CancelRunResponse) Reset() { | |
| 1555 | + | *x = CancelRunResponse{} | |
| 1556 | + | mi := &file_ermite_run_proto_msgTypes[15] | |
| 1557 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1558 | + | ms.StoreMessageInfo(mi) | |
| 1559 | + | } | |
| 1560 | + | ||
| 1561 | + | func (x *CancelRunResponse) String() string { | |
| 1562 | + | return protoimpl.X.MessageStringOf(x) | |
| 1563 | + | } | |
| 1564 | + | ||
| 1565 | + | func (*CancelRunResponse) ProtoMessage() {} | |
| 1566 | + | ||
| 1567 | + | func (x *CancelRunResponse) ProtoReflect() protoreflect.Message { | |
| 1568 | + | mi := &file_ermite_run_proto_msgTypes[15] | |
| 1569 | + | if x != nil { | |
| 1570 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1571 | + | if ms.LoadMessageInfo() == nil { | |
| 1572 | + | ms.StoreMessageInfo(mi) | |
| 1573 | + | } | |
| 1574 | + | return ms | |
| 1575 | + | } | |
| 1576 | + | return mi.MessageOf(x) | |
| 1577 | + | } | |
| 1578 | + | ||
| 1579 | + | // Deprecated: Use CancelRunResponse.ProtoReflect.Descriptor instead. | |
| 1580 | + | func (*CancelRunResponse) Descriptor() ([]byte, []int) { | |
| 1581 | + | return file_ermite_run_proto_rawDescGZIP(), []int{15} | |
| 1582 | + | } | |
| 1583 | + | ||
| 1584 | + | func (x *CancelRunResponse) GetRun() *Run { | |
| 1585 | + | if x != nil { | |
| 1586 | + | return x.Run | |
| 1587 | + | } | |
| 1588 | + | return nil | |
| 1589 | + | } | |
| 1590 | + | ||
| 1591 | + | // RerunRunRequest names the run to run again. | |
| 1592 | + | type RerunRunRequest struct { | |
| 1593 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 1594 | + | // Repo is the repository name. | |
| 1595 | + | Repo string `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"` | |
| 1596 | + | // RunId is the Run.id. | |
| 1597 | + | RunId int64 `protobuf:"varint,2,opt,name=run_id,json=runId,proto3" json:"run_id,omitempty"` | |
| 1598 | + | // FailedOnly runs again only the jobs of the latest attempt that did not | |
| 1599 | + | // succeed (conclusion FAILURE, CANCELLED, TIMED_OUT or ACTION_REQUIRED) and | |
| 1600 | + | // the jobs that need them, directly or not, even if they were skipped. The | |
| 1601 | + | // other jobs keep their result, steps and log from the earlier attempt. When | |
| 1602 | + | // false, every job runs again. | |
| 1603 | + | FailedOnly bool `protobuf:"varint,3,opt,name=failed_only,json=failedOnly,proto3" json:"failed_only,omitempty"` | |
| 1604 | + | unknownFields protoimpl.UnknownFields | |
| 1605 | + | sizeCache protoimpl.SizeCache | |
| 1606 | + | } | |
| 1607 | + | ||
| 1608 | + | func (x *RerunRunRequest) Reset() { | |
| 1609 | + | *x = RerunRunRequest{} | |
| 1610 | + | mi := &file_ermite_run_proto_msgTypes[16] | |
| 1611 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1612 | + | ms.StoreMessageInfo(mi) | |
| 1613 | + | } | |
| 1614 | + | ||
| 1615 | + | func (x *RerunRunRequest) String() string { | |
| 1616 | + | return protoimpl.X.MessageStringOf(x) | |
| 1617 | + | } | |
| 1618 | + | ||
| 1619 | + | func (*RerunRunRequest) ProtoMessage() {} | |
| 1620 | + | ||
| 1621 | + | func (x *RerunRunRequest) ProtoReflect() protoreflect.Message { | |
| 1622 | + | mi := &file_ermite_run_proto_msgTypes[16] | |
| 1623 | + | if x != nil { | |
| 1624 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1625 | + | if ms.LoadMessageInfo() == nil { | |
| 1626 | + | ms.StoreMessageInfo(mi) | |
| 1627 | + | } | |
| 1628 | + | return ms | |
| 1629 | + | } | |
| 1630 | + | return mi.MessageOf(x) | |
| 1631 | + | } | |
| 1632 | + | ||
| 1633 | + | // Deprecated: Use RerunRunRequest.ProtoReflect.Descriptor instead. | |
| 1634 | + | func (*RerunRunRequest) Descriptor() ([]byte, []int) { | |
| 1635 | + | return file_ermite_run_proto_rawDescGZIP(), []int{16} | |
| 1636 | + | } | |
| 1637 | + | ||
| 1638 | + | func (x *RerunRunRequest) GetRepo() string { | |
| 1639 | + | if x != nil { | |
| 1640 | + | return x.Repo | |
| 1641 | + | } | |
| 1642 | + | return "" | |
| 1643 | + | } | |
| 1644 | + | ||
| 1645 | + | func (x *RerunRunRequest) GetRunId() int64 { | |
| 1646 | + | if x != nil { | |
| 1647 | + | return x.RunId | |
| 1648 | + | } | |
| 1649 | + | return 0 | |
| 1650 | + | } | |
| 1651 | + | ||
| 1652 | + | func (x *RerunRunRequest) GetFailedOnly() bool { | |
| 1653 | + | if x != nil { | |
| 1654 | + | return x.FailedOnly | |
| 1655 | + | } | |
| 1656 | + | return false | |
| 1657 | + | } | |
| 1658 | + | ||
| 1659 | + | // RerunRunResponse holds the new attempt. | |
| 1660 | + | type RerunRunResponse struct { | |
| 1661 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 1662 | + | // Run is the run as of the new attempt, QUEUED. | |
| 1663 | + | Run *Run `protobuf:"bytes,1,opt,name=run,proto3" json:"run,omitempty"` | |
| 1664 | + | unknownFields protoimpl.UnknownFields | |
| 1665 | + | sizeCache protoimpl.SizeCache | |
| 1666 | + | } | |
| 1667 | + | ||
| 1668 | + | func (x *RerunRunResponse) Reset() { | |
| 1669 | + | *x = RerunRunResponse{} | |
| 1670 | + | mi := &file_ermite_run_proto_msgTypes[17] | |
| 1671 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1672 | + | ms.StoreMessageInfo(mi) | |
| 1673 | + | } | |
| 1674 | + | ||
| 1675 | + | func (x *RerunRunResponse) String() string { | |
| 1676 | + | return protoimpl.X.MessageStringOf(x) | |
| 1677 | + | } | |
| 1678 | + | ||
| 1679 | + | func (*RerunRunResponse) ProtoMessage() {} | |
| 1680 | + | ||
| 1681 | + | func (x *RerunRunResponse) ProtoReflect() protoreflect.Message { | |
| 1682 | + | mi := &file_ermite_run_proto_msgTypes[17] | |
| 1683 | + | if x != nil { | |
| 1684 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1685 | + | if ms.LoadMessageInfo() == nil { | |
| 1686 | + | ms.StoreMessageInfo(mi) | |
| 1687 | + | } | |
| 1688 | + | return ms | |
| 1689 | + | } | |
| 1690 | + | return mi.MessageOf(x) | |
| 1691 | + | } | |
| 1692 | + | ||
| 1693 | + | // Deprecated: Use RerunRunResponse.ProtoReflect.Descriptor instead. | |
| 1694 | + | func (*RerunRunResponse) Descriptor() ([]byte, []int) { | |
| 1695 | + | return file_ermite_run_proto_rawDescGZIP(), []int{17} | |
| 1696 | + | } | |
| 1697 | + | ||
| 1698 | + | func (x *RerunRunResponse) GetRun() *Run { | |
| 1699 | + | if x != nil { | |
| 1700 | + | return x.Run | |
| 1701 | + | } | |
| 1702 | + | return nil | |
| 1703 | + | } | |
| 1704 | + | ||
| 1705 | + | // ListChecksRequest names the commit. | |
| 1706 | + | type ListChecksRequest struct { | |
| 1707 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 1708 | + | // Repo is the repository name. | |
| 1709 | + | Repo string `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"` | |
| 1710 | + | // Sha is the full commit id (40 lowercase hexadecimal characters for SHA-1). | |
| 1711 | + | // Abbreviations and names are invalid_argument. | |
| 1712 | + | Sha string `protobuf:"bytes,2,opt,name=sha,proto3" json:"sha,omitempty"` | |
| 1713 | + | unknownFields protoimpl.UnknownFields | |
| 1714 | + | sizeCache protoimpl.SizeCache | |
| 1715 | + | } | |
| 1716 | + | ||
| 1717 | + | func (x *ListChecksRequest) Reset() { | |
| 1718 | + | *x = ListChecksRequest{} | |
| 1719 | + | mi := &file_ermite_run_proto_msgTypes[18] | |
| 1720 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1721 | + | ms.StoreMessageInfo(mi) | |
| 1722 | + | } | |
| 1723 | + | ||
| 1724 | + | func (x *ListChecksRequest) String() string { | |
| 1725 | + | return protoimpl.X.MessageStringOf(x) | |
| 1726 | + | } | |
| 1727 | + | ||
| 1728 | + | func (*ListChecksRequest) ProtoMessage() {} | |
| 1729 | + | ||
| 1730 | + | func (x *ListChecksRequest) ProtoReflect() protoreflect.Message { | |
| 1731 | + | mi := &file_ermite_run_proto_msgTypes[18] | |
| 1732 | + | if x != nil { | |
| 1733 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1734 | + | if ms.LoadMessageInfo() == nil { | |
| 1735 | + | ms.StoreMessageInfo(mi) | |
| 1736 | + | } | |
| 1737 | + | return ms | |
| 1738 | + | } | |
| 1739 | + | return mi.MessageOf(x) | |
| 1740 | + | } | |
| 1741 | + | ||
| 1742 | + | // Deprecated: Use ListChecksRequest.ProtoReflect.Descriptor instead. | |
| 1743 | + | func (*ListChecksRequest) Descriptor() ([]byte, []int) { | |
| 1744 | + | return file_ermite_run_proto_rawDescGZIP(), []int{18} | |
| 1745 | + | } | |
| 1746 | + | ||
| 1747 | + | func (x *ListChecksRequest) GetRepo() string { | |
| 1748 | + | if x != nil { | |
| 1749 | + | return x.Repo | |
| 1750 | + | } | |
| 1751 | + | return "" | |
| 1752 | + | } | |
| 1753 | + | ||
| 1754 | + | func (x *ListChecksRequest) GetSha() string { | |
| 1755 | + | if x != nil { | |
| 1756 | + | return x.Sha | |
| 1757 | + | } | |
| 1758 | + | return "" | |
| 1759 | + | } | |
| 1760 | + | ||
| 1761 | + | // ListChecksResponse holds the checks of a commit. | |
| 1762 | + | type ListChecksResponse struct { | |
| 1763 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 1764 | + | // Checks are the checks of the commit, one per job of the latest attempt of | |
| 1765 | + | // each run, ordered by creation time then name. | |
| 1766 | + | Checks []*Check `protobuf:"bytes,1,rep,name=checks,proto3" json:"checks,omitempty"` | |
| 1767 | + | // Truncated is true when the commit has more checks than checks holds. | |
| 1768 | + | Truncated bool `protobuf:"varint,2,opt,name=truncated,proto3" json:"truncated,omitempty"` | |
| 1769 | + | unknownFields protoimpl.UnknownFields | |
| 1770 | + | sizeCache protoimpl.SizeCache | |
| 1771 | + | } | |
| 1772 | + | ||
| 1773 | + | func (x *ListChecksResponse) Reset() { | |
| 1774 | + | *x = ListChecksResponse{} | |
| 1775 | + | mi := &file_ermite_run_proto_msgTypes[19] | |
| 1776 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1777 | + | ms.StoreMessageInfo(mi) | |
| 1778 | + | } | |
| 1779 | + | ||
| 1780 | + | func (x *ListChecksResponse) String() string { | |
| 1781 | + | return protoimpl.X.MessageStringOf(x) | |
| 1782 | + | } | |
| 1783 | + | ||
| 1784 | + | func (*ListChecksResponse) ProtoMessage() {} | |
| 1785 | + | ||
| 1786 | + | func (x *ListChecksResponse) ProtoReflect() protoreflect.Message { | |
| 1787 | + | mi := &file_ermite_run_proto_msgTypes[19] | |
| 1788 | + | if x != nil { | |
| 1789 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1790 | + | if ms.LoadMessageInfo() == nil { | |
| 1791 | + | ms.StoreMessageInfo(mi) | |
| 1792 | + | } | |
| 1793 | + | return ms | |
| 1794 | + | } | |
| 1795 | + | return mi.MessageOf(x) | |
| 1796 | + | } | |
| 1797 | + | ||
| 1798 | + | // Deprecated: Use ListChecksResponse.ProtoReflect.Descriptor instead. | |
| 1799 | + | func (*ListChecksResponse) Descriptor() ([]byte, []int) { | |
| 1800 | + | return file_ermite_run_proto_rawDescGZIP(), []int{19} | |
| 1801 | + | } | |
| 1802 | + | ||
| 1803 | + | func (x *ListChecksResponse) GetChecks() []*Check { | |
| 1804 | + | if x != nil { | |
| 1805 | + | return x.Checks | |
| 1806 | + | } | |
| 1807 | + | return nil | |
| 1808 | + | } | |
| 1809 | + | ||
| 1810 | + | func (x *ListChecksResponse) GetTruncated() bool { | |
| 1811 | + | if x != nil { | |
| 1812 | + | return x.Truncated | |
| 1813 | + | } | |
| 1814 | + | return false | |
| 1815 | + | } | |
| 1816 | + | ||
| 1817 | + | // ListRunnersRequest selects a page of runners. | |
| 1818 | + | type ListRunnersRequest struct { | |
| 1819 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 1820 | + | // PageSize is the maximum number of runners to return. | |
| 1821 | + | PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` | |
| 1822 | + | // PageToken is the next_page_token of a previous response. Empty for the | |
| 1823 | + | // first page. | |
| 1824 | + | PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` | |
| 1825 | + | unknownFields protoimpl.UnknownFields | |
| 1826 | + | sizeCache protoimpl.SizeCache | |
| 1827 | + | } | |
| 1828 | + | ||
| 1829 | + | func (x *ListRunnersRequest) Reset() { | |
| 1830 | + | *x = ListRunnersRequest{} | |
| 1831 | + | mi := &file_ermite_run_proto_msgTypes[20] | |
| 1832 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1833 | + | ms.StoreMessageInfo(mi) | |
| 1834 | + | } | |
| 1835 | + | ||
| 1836 | + | func (x *ListRunnersRequest) String() string { | |
| 1837 | + | return protoimpl.X.MessageStringOf(x) | |
| 1838 | + | } | |
| 1839 | + | ||
| 1840 | + | func (*ListRunnersRequest) ProtoMessage() {} | |
| 1841 | + | ||
| 1842 | + | func (x *ListRunnersRequest) ProtoReflect() protoreflect.Message { | |
| 1843 | + | mi := &file_ermite_run_proto_msgTypes[20] | |
| 1844 | + | if x != nil { | |
| 1845 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1846 | + | if ms.LoadMessageInfo() == nil { | |
| 1847 | + | ms.StoreMessageInfo(mi) | |
| 1848 | + | } | |
| 1849 | + | return ms | |
| 1850 | + | } | |
| 1851 | + | return mi.MessageOf(x) | |
| 1852 | + | } | |
| 1853 | + | ||
| 1854 | + | // Deprecated: Use ListRunnersRequest.ProtoReflect.Descriptor instead. | |
| 1855 | + | func (*ListRunnersRequest) Descriptor() ([]byte, []int) { | |
| 1856 | + | return file_ermite_run_proto_rawDescGZIP(), []int{20} | |
| 1857 | + | } | |
| 1858 | + | ||
| 1859 | + | func (x *ListRunnersRequest) GetPageSize() int32 { | |
| 1860 | + | if x != nil { | |
| 1861 | + | return x.PageSize | |
| 1862 | + | } | |
| 1863 | + | return 0 | |
| 1864 | + | } | |
| 1865 | + | ||
| 1866 | + | func (x *ListRunnersRequest) GetPageToken() string { | |
| 1867 | + | if x != nil { | |
| 1868 | + | return x.PageToken | |
| 1869 | + | } | |
| 1870 | + | return "" | |
| 1871 | + | } | |
| 1872 | + | ||
| 1873 | + | // ListRunnersResponse is one page of runners. | |
| 1874 | + | type ListRunnersResponse struct { | |
| 1875 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 1876 | + | // Runners are the runners of this page, ordered by name. | |
| 1877 | + | Runners []*Runner `protobuf:"bytes,1,rep,name=runners,proto3" json:"runners,omitempty"` | |
| 1878 | + | // NextPageToken is passed as page_token to get the next page. Empty when | |
| 1879 | + | // there is no next page. | |
| 1880 | + | NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` | |
| 1881 | + | unknownFields protoimpl.UnknownFields | |
| 1882 | + | sizeCache protoimpl.SizeCache | |
| 1883 | + | } | |
| 1884 | + | ||
| 1885 | + | func (x *ListRunnersResponse) Reset() { | |
| 1886 | + | *x = ListRunnersResponse{} | |
| 1887 | + | mi := &file_ermite_run_proto_msgTypes[21] | |
| 1888 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1889 | + | ms.StoreMessageInfo(mi) | |
| 1890 | + | } | |
| 1891 | + | ||
| 1892 | + | func (x *ListRunnersResponse) String() string { | |
| 1893 | + | return protoimpl.X.MessageStringOf(x) | |
| 1894 | + | } | |
| 1895 | + | ||
| 1896 | + | func (*ListRunnersResponse) ProtoMessage() {} | |
| 1897 | + | ||
| 1898 | + | func (x *ListRunnersResponse) ProtoReflect() protoreflect.Message { | |
| 1899 | + | mi := &file_ermite_run_proto_msgTypes[21] | |
| 1900 | + | if x != nil { | |
| 1901 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1902 | + | if ms.LoadMessageInfo() == nil { | |
| 1903 | + | ms.StoreMessageInfo(mi) | |
| 1904 | + | } | |
| 1905 | + | return ms | |
| 1906 | + | } | |
| 1907 | + | return mi.MessageOf(x) | |
| 1908 | + | } | |
| 1909 | + | ||
| 1910 | + | // Deprecated: Use ListRunnersResponse.ProtoReflect.Descriptor instead. | |
| 1911 | + | func (*ListRunnersResponse) Descriptor() ([]byte, []int) { | |
| 1912 | + | return file_ermite_run_proto_rawDescGZIP(), []int{21} | |
| 1913 | + | } | |
| 1914 | + | ||
| 1915 | + | func (x *ListRunnersResponse) GetRunners() []*Runner { | |
| 1916 | + | if x != nil { | |
| 1917 | + | return x.Runners | |
| 1918 | + | } | |
| 1919 | + | return nil | |
| 1920 | + | } | |
| 1921 | + | ||
| 1922 | + | func (x *ListRunnersResponse) GetNextPageToken() string { | |
| 1923 | + | if x != nil { | |
| 1924 | + | return x.NextPageToken | |
| 1925 | + | } | |
| 1926 | + | return "" | |
| 1927 | + | } | |
| 1928 | + | ||
| 1929 | + | // RemoveRunnerRequest names the runner to remove. | |
| 1930 | + | type RemoveRunnerRequest struct { | |
| 1931 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 1932 | + | // RunnerId is the Runner.id. | |
| 1933 | + | RunnerId string `protobuf:"bytes,1,opt,name=runner_id,json=runnerId,proto3" json:"runner_id,omitempty"` | |
| 1934 | + | unknownFields protoimpl.UnknownFields | |
| 1935 | + | sizeCache protoimpl.SizeCache | |
| 1936 | + | } | |
| 1937 | + | ||
| 1938 | + | func (x *RemoveRunnerRequest) Reset() { | |
| 1939 | + | *x = RemoveRunnerRequest{} | |
| 1940 | + | mi := &file_ermite_run_proto_msgTypes[22] | |
| 1941 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1942 | + | ms.StoreMessageInfo(mi) | |
| 1943 | + | } | |
| 1944 | + | ||
| 1945 | + | func (x *RemoveRunnerRequest) String() string { | |
| 1946 | + | return protoimpl.X.MessageStringOf(x) | |
| 1947 | + | } | |
| 1948 | + | ||
| 1949 | + | func (*RemoveRunnerRequest) ProtoMessage() {} | |
| 1950 | + | ||
| 1951 | + | func (x *RemoveRunnerRequest) ProtoReflect() protoreflect.Message { | |
| 1952 | + | mi := &file_ermite_run_proto_msgTypes[22] | |
| 1953 | + | if x != nil { | |
| 1954 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1955 | + | if ms.LoadMessageInfo() == nil { | |
| 1956 | + | ms.StoreMessageInfo(mi) | |
| 1957 | + | } | |
| 1958 | + | return ms | |
| 1959 | + | } | |
| 1960 | + | return mi.MessageOf(x) | |
| 1961 | + | } | |
| 1962 | + | ||
| 1963 | + | // Deprecated: Use RemoveRunnerRequest.ProtoReflect.Descriptor instead. | |
| 1964 | + | func (*RemoveRunnerRequest) Descriptor() ([]byte, []int) { | |
| 1965 | + | return file_ermite_run_proto_rawDescGZIP(), []int{22} | |
| 1966 | + | } | |
| 1967 | + | ||
| 1968 | + | func (x *RemoveRunnerRequest) GetRunnerId() string { | |
| 1969 | + | if x != nil { | |
| 1970 | + | return x.RunnerId | |
| 1971 | + | } | |
| 1972 | + | return "" | |
| 1973 | + | } | |
| 1974 | + | ||
| 1975 | + | // RemoveRunnerResponse is empty. | |
| 1976 | + | type RemoveRunnerResponse struct { | |
| 1977 | + | state protoimpl.MessageState `protogen:"open.v1"` | |
| 1978 | + | unknownFields protoimpl.UnknownFields | |
| 1979 | + | sizeCache protoimpl.SizeCache | |
| 1980 | + | } | |
| 1981 | + | ||
| 1982 | + | func (x *RemoveRunnerResponse) Reset() { | |
| 1983 | + | *x = RemoveRunnerResponse{} | |
| 1984 | + | mi := &file_ermite_run_proto_msgTypes[23] | |
| 1985 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1986 | + | ms.StoreMessageInfo(mi) | |
| 1987 | + | } | |
| 1988 | + | ||
| 1989 | + | func (x *RemoveRunnerResponse) String() string { | |
| 1990 | + | return protoimpl.X.MessageStringOf(x) | |
| 1991 | + | } | |
| 1992 | + | ||
| 1993 | + | func (*RemoveRunnerResponse) ProtoMessage() {} | |
| 1994 | + | ||
| 1995 | + | func (x *RemoveRunnerResponse) ProtoReflect() protoreflect.Message { | |
| 1996 | + | mi := &file_ermite_run_proto_msgTypes[23] | |
| 1997 | + | if x != nil { | |
| 1998 | + | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) | |
| 1999 | + | if ms.LoadMessageInfo() == nil { | |
| 2000 | + | ms.StoreMessageInfo(mi) | |
| 2001 | + | } | |
| 2002 | + | return ms | |
| 2003 | + | } | |
| 2004 | + | return mi.MessageOf(x) | |
| 2005 | + | } | |
| 2006 | + | ||
| 2007 | + | // Deprecated: Use RemoveRunnerResponse.ProtoReflect.Descriptor instead. | |
| 2008 | + | func (*RemoveRunnerResponse) Descriptor() ([]byte, []int) { | |
| 2009 | + | return file_ermite_run_proto_rawDescGZIP(), []int{23} | |
| 2010 | + | } | |
| 2011 | + | ||
| 2012 | + | var File_ermite_run_proto protoreflect.FileDescriptor | |
| 2013 | + | ||
| 2014 | + | const file_ermite_run_proto_rawDesc = "" + | |
| 2015 | + | "\n" + | |
| 2016 | + | "\x10ermite/run.proto\x12\x06ermite\x1a\x13ermite/runner.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd0\x04\n" + | |
| 2017 | + | "\x03Run\x12\x12\n" + | |
| 2018 | + | "\x04repo\x18\x01 \x01(\tR\x04repo\x12\x0e\n" + | |
| 2019 | + | "\x02id\x18\x02 \x01(\x03R\x02id\x12\x16\n" + | |
| 2020 | + | "\x06number\x18\x03 \x01(\x03R\x06number\x12\x18\n" + | |
| 2021 | + | "\aattempt\x18\x04 \x01(\x05R\aattempt\x12#\n" + | |
| 2022 | + | "\rworkflow_path\x18\x05 \x01(\tR\fworkflowPath\x12#\n" + | |
| 2023 | + | "\rworkflow_name\x18\x06 \x01(\tR\fworkflowName\x12\x14\n" + | |
| 2024 | + | "\x05title\x18\a \x01(\tR\x05title\x12\x14\n" + | |
| 2025 | + | "\x05event\x18\b \x01(\tR\x05event\x12\x10\n" + | |
| 2026 | + | "\x03ref\x18\t \x01(\tR\x03ref\x12\x10\n" + | |
| 2027 | + | "\x03sha\x18\n" + | |
| 2028 | + | " \x01(\tR\x03sha\x12\x14\n" + | |
| 2029 | + | "\x05actor\x18\v \x01(\tR\x05actor\x12(\n" + | |
| 2030 | + | "\x06status\x18\f \x01(\x0e2\x10.ermite.CiStatusR\x06status\x124\n" + | |
| 2031 | + | "\n" + | |
| 2032 | + | "conclusion\x18\r \x01(\x0e2\x14.ermite.CiConclusionR\n" + | |
| 2033 | + | "conclusion\x12\x14\n" + | |
| 2034 | + | "\x05error\x18\x0e \x01(\tR\x05error\x129\n" + | |
| 2035 | + | "\n" + | |
| 2036 | + | "created_at\x18\x0f \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + | |
| 2037 | + | "\n" + | |
| 2038 | + | "started_at\x18\x10 \x01(\v2\x1a.google.protobuf.TimestampR\tstartedAt\x12=\n" + | |
| 2039 | + | "\fcompleted_at\x18\x11 \x01(\v2\x1a.google.protobuf.TimestampR\vcompletedAt\x12\x18\n" + | |
| 2040 | + | "\aversion\x18\x12 \x01(\x03R\aversion\"\x8f\x05\n" + | |
| 2041 | + | "\x06RunJob\x12\x0e\n" + | |
| 2042 | + | "\x02id\x18\x01 \x01(\tR\x02id\x12\x15\n" + | |
| 2043 | + | "\x06run_id\x18\x02 \x01(\x03R\x05runId\x12\x18\n" + | |
| 2044 | + | "\aattempt\x18\x03 \x01(\x05R\aattempt\x12\x12\n" + | |
| 2045 | + | "\x04repo\x18\x04 \x01(\tR\x04repo\x12\x10\n" + | |
| 2046 | + | "\x03key\x18\x05 \x01(\tR\x03key\x12\x12\n" + | |
| 2047 | + | "\x04name\x18\x06 \x01(\tR\x04name\x12(\n" + | |
| 2048 | + | "\x06status\x18\a \x01(\x0e2\x10.ermite.CiStatusR\x06status\x124\n" + | |
| 2049 | + | "\n" + | |
| 2050 | + | "conclusion\x18\b \x01(\x0e2\x14.ermite.CiConclusionR\n" + | |
| 2051 | + | "conclusion\x12\x14\n" + | |
| 2052 | + | "\x05error\x18\t \x01(\tR\x05error\x12\x16\n" + | |
| 2053 | + | "\x06labels\x18\n" + | |
| 2054 | + | " \x03(\tR\x06labels\x12\x14\n" + | |
| 2055 | + | "\x05needs\x18\v \x03(\tR\x05needs\x12\x1b\n" + | |
| 2056 | + | "\trunner_id\x18\f \x01(\tR\brunnerId\x12\x1f\n" + | |
| 2057 | + | "\vrunner_name\x18\r \x01(\tR\n" + | |
| 2058 | + | "runnerName\x125\n" + | |
| 2059 | + | "\tisolation\x18\x0e \x01(\x0e2\x17.ermite.RunnerIsolationR\tisolation\x12\"\n" + | |
| 2060 | + | "\x05steps\x18\x0f \x03(\v2\f.ermite.StepR\x05steps\x129\n" + | |
| 2061 | + | "\n" + | |
| 2062 | + | "created_at\x18\x10 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" + | |
| 2063 | + | "\n" + | |
| 2064 | + | "started_at\x18\x11 \x01(\v2\x1a.google.protobuf.TimestampR\tstartedAt\x12=\n" + | |
| 2065 | + | "\fcompleted_at\x18\x12 \x01(\v2\x1a.google.protobuf.TimestampR\vcompletedAt\x12\x18\n" + | |
| 2066 | + | "\aversion\x18\x13 \x01(\x03R\aversion\"\xc1\x02\n" + | |
| 2067 | + | "\x04Step\x12\x16\n" + | |
| 2068 | + | "\x06number\x18\x01 \x01(\x05R\x06number\x12\x12\n" + | |
| 2069 | + | "\x04name\x18\x02 \x01(\tR\x04name\x12'\n" + | |
| 2070 | + | "\x05state\x18\x03 \x01(\x0e2\x11.ermite.StepStateR\x05state\x124\n" + | |
| 2071 | + | "\n" + | |
| 2072 | + | "conclusion\x18\x04 \x01(\x0e2\x14.ermite.CiConclusionR\n" + | |
| 2073 | + | "conclusion\x129\n" + | |
| 2074 | + | "\n" + | |
| 2075 | + | "started_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\tstartedAt\x12=\n" + | |
| 2076 | + | "\fcompleted_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\vcompletedAt\x12\x1b\n" + | |
| 2077 | + | "\tlog_start\x18\a \x01(\x03R\blogStart\x12\x17\n" + | |
| 2078 | + | "\alog_end\x18\b \x01(\x03R\x06logEnd\"\x98\x03\n" + | |
| 2079 | + | "\x05Check\x12\x0e\n" + | |
| 2080 | + | "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + | |
| 2081 | + | "\x04repo\x18\x02 \x01(\tR\x04repo\x12\x10\n" + | |
| 2082 | + | "\x03sha\x18\x03 \x01(\tR\x03sha\x12\x12\n" + | |
| 2083 | + | "\x04name\x18\x04 \x01(\tR\x04name\x12(\n" + | |
| 2084 | + | "\x06status\x18\x05 \x01(\x0e2\x10.ermite.CiStatusR\x06status\x124\n" + | |
| 2085 | + | "\n" + | |
| 2086 | + | "conclusion\x18\x06 \x01(\x0e2\x14.ermite.CiConclusionR\n" + | |
| 2087 | + | "conclusion\x12\x15\n" + | |
| 2088 | + | "\x06run_id\x18\a \x01(\x03R\x05runId\x12\x15\n" + | |
| 2089 | + | "\x06job_id\x18\b \x01(\tR\x05jobId\x12\x18\n" + | |
| 2090 | + | "\aattempt\x18\t \x01(\x05R\aattempt\x12#\n" + | |
| 2091 | + | "\rworkflow_name\x18\n" + | |
| 2092 | + | " \x01(\tR\fworkflowName\x129\n" + | |
| 2093 | + | "\n" + | |
| 2094 | + | "started_at\x18\v \x01(\v2\x1a.google.protobuf.TimestampR\tstartedAt\x12=\n" + | |
| 2095 | + | "\fcompleted_at\x18\f \x01(\v2\x1a.google.protobuf.TimestampR\vcompletedAt\"\xc7\x02\n" + | |
| 2096 | + | "\x06Runner\x12\x0e\n" + | |
| 2097 | + | "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + | |
| 2098 | + | "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + | |
| 2099 | + | "\x06labels\x18\x03 \x03(\tR\x06labels\x125\n" + | |
| 2100 | + | "\tisolation\x18\x04 \x01(\x0e2\x17.ermite.RunnerIsolationR\tisolation\x12\x18\n" + | |
| 2101 | + | "\aversion\x18\x05 \x01(\tR\aversion\x12\x12\n" + | |
| 2102 | + | "\x04arch\x18\x06 \x01(\tR\x04arch\x12\x0e\n" + | |
| 2103 | + | "\x02os\x18\a \x01(\tR\x02os\x12?\n" + | |
| 2104 | + | "\rregistered_at\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\fregisteredAt\x127\n" + | |
| 2105 | + | "\tlast_seen\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\blastSeen\x12\x12\n" + | |
| 2106 | + | "\x04busy\x18\n" + | |
| 2107 | + | " \x01(\bR\x04busy\"\xbf\x01\n" + | |
| 2108 | + | "\x0fListRunsRequest\x12\x12\n" + | |
| 2109 | + | "\x04repo\x18\x01 \x01(\tR\x04repo\x12\x1b\n" + | |
| 2110 | + | "\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" + | |
| 2111 | + | "\n" + | |
| 2112 | + | "page_token\x18\x03 \x01(\tR\tpageToken\x12\x1a\n" + | |
| 2113 | + | "\bworkflow\x18\x04 \x01(\tR\bworkflow\x12\x16\n" + | |
| 2114 | + | "\x06branch\x18\x05 \x01(\tR\x06branch\x12(\n" + | |
| 2115 | + | "\x06status\x18\x06 \x01(\x0e2\x10.ermite.CiStatusR\x06status\"[\n" + | |
| 2116 | + | "\x10ListRunsResponse\x12\x1f\n" + | |
| 2117 | + | "\x04runs\x18\x01 \x03(\v2\v.ermite.RunR\x04runs\x12&\n" + | |
| 2118 | + | "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"T\n" + | |
| 2119 | + | "\rGetRunRequest\x12\x12\n" + | |
| 2120 | + | "\x04repo\x18\x01 \x01(\tR\x04repo\x12\x15\n" + | |
| 2121 | + | "\x06run_id\x18\x02 \x01(\x03R\x05runId\x12\x18\n" + | |
| 2122 | + | "\aattempt\x18\x03 \x01(\x05R\aattempt\"z\n" + | |
| 2123 | + | "\x0eGetRunResponse\x12\x1d\n" + | |
| 2124 | + | "\x03run\x18\x01 \x01(\v2\v.ermite.RunR\x03run\x12\"\n" + | |
| 2125 | + | "\x04jobs\x18\x02 \x03(\v2\x0e.ermite.RunJobR\x04jobs\x12%\n" + | |
| 2126 | + | "\x0elatest_attempt\x18\x03 \x01(\x05R\rlatestAttempt\"T\n" + | |
| 2127 | + | "\rGetJobRequest\x12\x12\n" + | |
| 2128 | + | "\x04repo\x18\x01 \x01(\tR\x04repo\x12\x15\n" + | |
| 2129 | + | "\x06job_id\x18\x02 \x01(\tR\x05jobId\x12\x18\n" + | |
| 2130 | + | "\aattempt\x18\x03 \x01(\x05R\aattempt\"2\n" + | |
| 2131 | + | "\x0eGetJobResponse\x12 \n" + | |
| 2132 | + | "\x03job\x18\x01 \x01(\v2\x0e.ermite.RunJobR\x03job\"\x87\x01\n" + | |
| 2133 | + | "\x10GetJobLogRequest\x12\x12\n" + | |
| 2134 | + | "\x04repo\x18\x01 \x01(\tR\x04repo\x12\x15\n" + | |
| 2135 | + | "\x06job_id\x18\x02 \x01(\tR\x05jobId\x12\x18\n" + | |
| 2136 | + | "\aattempt\x18\x03 \x01(\x05R\aattempt\x12\x16\n" + | |
| 2137 | + | "\x06offset\x18\x04 \x01(\x03R\x06offset\x12\x16\n" + | |
| 2138 | + | "\x06follow\x18\x05 \x01(\bR\x06follow\"U\n" + | |
| 2139 | + | "\x11GetJobLogResponse\x12\x16\n" + | |
| 2140 | + | "\x06offset\x18\x01 \x01(\x03R\x06offset\x12(\n" + | |
| 2141 | + | "\x05lines\x18\x02 \x03(\v2\x12.ermite.JobLogLineR\x05lines\"\x82\x01\n" + | |
| 2142 | + | "\n" + | |
| 2143 | + | "JobLogLine\x12\x12\n" + | |
| 2144 | + | "\x04step\x18\x01 \x01(\x05R\x04step\x12.\n" + | |
| 2145 | + | "\x04time\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\x04time\x12\x12\n" + | |
| 2146 | + | "\x04text\x18\x03 \x01(\tR\x04text\x12\x1c\n" + | |
| 2147 | + | "\tcontinued\x18\x04 \x01(\bR\tcontinued\"=\n" + | |
| 2148 | + | "\x10CancelRunRequest\x12\x12\n" + | |
| 2149 | + | "\x04repo\x18\x01 \x01(\tR\x04repo\x12\x15\n" + | |
| 2150 | + | "\x06run_id\x18\x02 \x01(\x03R\x05runId\"2\n" + | |
| 2151 | + | "\x11CancelRunResponse\x12\x1d\n" + | |
| 2152 | + | "\x03run\x18\x01 \x01(\v2\v.ermite.RunR\x03run\"]\n" + | |
| 2153 | + | "\x0fRerunRunRequest\x12\x12\n" + | |
| 2154 | + | "\x04repo\x18\x01 \x01(\tR\x04repo\x12\x15\n" + | |
| 2155 | + | "\x06run_id\x18\x02 \x01(\x03R\x05runId\x12\x1f\n" + | |
| 2156 | + | "\vfailed_only\x18\x03 \x01(\bR\n" + | |
| 2157 | + | "failedOnly\"1\n" + | |
| 2158 | + | "\x10RerunRunResponse\x12\x1d\n" + | |
| 2159 | + | "\x03run\x18\x01 \x01(\v2\v.ermite.RunR\x03run\"9\n" + | |
| 2160 | + | "\x11ListChecksRequest\x12\x12\n" + | |
| 2161 | + | "\x04repo\x18\x01 \x01(\tR\x04repo\x12\x10\n" + | |
| 2162 | + | "\x03sha\x18\x02 \x01(\tR\x03sha\"Y\n" + | |
| 2163 | + | "\x12ListChecksResponse\x12%\n" + | |
| 2164 | + | "\x06checks\x18\x01 \x03(\v2\r.ermite.CheckR\x06checks\x12\x1c\n" + | |
| 2165 | + | "\ttruncated\x18\x02 \x01(\bR\ttruncated\"P\n" + | |
| 2166 | + | "\x12ListRunnersRequest\x12\x1b\n" + | |
| 2167 | + | "\tpage_size\x18\x01 \x01(\x05R\bpageSize\x12\x1d\n" + | |
| 2168 | + | "\n" + | |
| 2169 | + | "page_token\x18\x02 \x01(\tR\tpageToken\"g\n" + | |
| 2170 | + | "\x13ListRunnersResponse\x12(\n" + | |
| 2171 | + | "\arunners\x18\x01 \x03(\v2\x0e.ermite.RunnerR\arunners\x12&\n" + | |
| 2172 | + | "\x0fnext_page_token\x18\x02 \x01(\tR\rnextPageToken\"2\n" + | |
| 2173 | + | "\x13RemoveRunnerRequest\x12\x1b\n" + | |
| 2174 | + | "\trunner_id\x18\x01 \x01(\tR\brunnerId\"\x16\n" + | |
| 2175 | + | "\x14RemoveRunnerResponse2\xda\x04\n" + | |
| 2176 | + | "\n" + | |
| 2177 | + | "RunService\x12=\n" + | |
| 2178 | + | "\bListRuns\x12\x17.ermite.ListRunsRequest\x1a\x18.ermite.ListRunsResponse\x127\n" + | |
| 2179 | + | "\x06GetRun\x12\x15.ermite.GetRunRequest\x1a\x16.ermite.GetRunResponse\x127\n" + | |
| 2180 | + | "\x06GetJob\x12\x15.ermite.GetJobRequest\x1a\x16.ermite.GetJobResponse\x12B\n" + | |
| 2181 | + | "\tGetJobLog\x12\x18.ermite.GetJobLogRequest\x1a\x19.ermite.GetJobLogResponse0\x01\x12@\n" + | |
| 2182 | + | "\tCancelRun\x12\x18.ermite.CancelRunRequest\x1a\x19.ermite.CancelRunResponse\x12=\n" + | |
| 2183 | + | "\bRerunRun\x12\x17.ermite.RerunRunRequest\x1a\x18.ermite.RerunRunResponse\x12C\n" + | |
| 2184 | + | "\n" + | |
| 2185 | + | "ListChecks\x12\x19.ermite.ListChecksRequest\x1a\x1a.ermite.ListChecksResponse\x12F\n" + | |
| 2186 | + | "\vListRunners\x12\x1a.ermite.ListRunnersRequest\x1a\x1b.ermite.ListRunnersResponse\x12I\n" + | |
| 2187 | + | "\fRemoveRunner\x12\x1b.ermite.RemoveRunnerRequest\x1a\x1c.ermite.RemoveRunnerResponseBo\n" + | |
| 2188 | + | "\n" + | |
| 2189 | + | "com.ermiteB\bRunProtoP\x01Z\x1fbnema.dev/ermite-api/gen/ermite\xa2\x02\x03EXX\xaa\x02\x06Ermite\xca\x02\x06Ermite\xe2\x02\x12Ermite\\GPBMetadata\xea\x02\x06Ermiteb\x06proto3" | |
| 2190 | + | ||
| 2191 | + | var ( | |
| 2192 | + | file_ermite_run_proto_rawDescOnce sync.Once | |
| 2193 | + | file_ermite_run_proto_rawDescData []byte | |
| 2194 | + | ) | |
| 2195 | + | ||
| 2196 | + | func file_ermite_run_proto_rawDescGZIP() []byte { | |
| 2197 | + | file_ermite_run_proto_rawDescOnce.Do(func() { | |
| 2198 | + | file_ermite_run_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ermite_run_proto_rawDesc), len(file_ermite_run_proto_rawDesc))) | |
| 2199 | + | }) | |
| 2200 | + | return file_ermite_run_proto_rawDescData | |
| 2201 | + | } | |
| 2202 | + | ||
| 2203 | + | var file_ermite_run_proto_msgTypes = make([]protoimpl.MessageInfo, 24) | |
| 2204 | + | var file_ermite_run_proto_goTypes = []any{ | |
| 2205 | + | (*Run)(nil), // 0: ermite.Run | |
| 2206 | + | (*RunJob)(nil), // 1: ermite.RunJob | |
| 2207 | + | (*Step)(nil), // 2: ermite.Step | |
| 2208 | + | (*Check)(nil), // 3: ermite.Check | |
| 2209 | + | (*Runner)(nil), // 4: ermite.Runner | |
| 2210 | + | (*ListRunsRequest)(nil), // 5: ermite.ListRunsRequest | |
| 2211 | + | (*ListRunsResponse)(nil), // 6: ermite.ListRunsResponse | |
| 2212 | + | (*GetRunRequest)(nil), // 7: ermite.GetRunRequest | |
| 2213 | + | (*GetRunResponse)(nil), // 8: ermite.GetRunResponse | |
| 2214 | + | (*GetJobRequest)(nil), // 9: ermite.GetJobRequest | |
| 2215 | + | (*GetJobResponse)(nil), // 10: ermite.GetJobResponse | |
| 2216 | + | (*GetJobLogRequest)(nil), // 11: ermite.GetJobLogRequest | |
| 2217 | + | (*GetJobLogResponse)(nil), // 12: ermite.GetJobLogResponse | |
| 2218 | + | (*JobLogLine)(nil), // 13: ermite.JobLogLine | |
| 2219 | + | (*CancelRunRequest)(nil), // 14: ermite.CancelRunRequest | |
| 2220 | + | (*CancelRunResponse)(nil), // 15: ermite.CancelRunResponse | |
| 2221 | + | (*RerunRunRequest)(nil), // 16: ermite.RerunRunRequest | |
| 2222 | + | (*RerunRunResponse)(nil), // 17: ermite.RerunRunResponse | |
| 2223 | + | (*ListChecksRequest)(nil), // 18: ermite.ListChecksRequest | |
| 2224 | + | (*ListChecksResponse)(nil), // 19: ermite.ListChecksResponse | |
| 2225 | + | (*ListRunnersRequest)(nil), // 20: ermite.ListRunnersRequest | |
| 2226 | + | (*ListRunnersResponse)(nil), // 21: ermite.ListRunnersResponse | |
| 2227 | + | (*RemoveRunnerRequest)(nil), // 22: ermite.RemoveRunnerRequest | |
| 2228 | + | (*RemoveRunnerResponse)(nil), // 23: ermite.RemoveRunnerResponse | |
| 2229 | + | (CiStatus)(0), // 24: ermite.CiStatus | |
| 2230 | + | (CiConclusion)(0), // 25: ermite.CiConclusion | |
| 2231 | + | (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp | |
| 2232 | + | (RunnerIsolation)(0), // 27: ermite.RunnerIsolation | |
| 2233 | + | (StepState)(0), // 28: ermite.StepState | |
| 2234 | + | } | |
| 2235 | + | var file_ermite_run_proto_depIdxs = []int32{ | |
| 2236 | + | 24, // 0: ermite.Run.status:type_name -> ermite.CiStatus | |
| 2237 | + | 25, // 1: ermite.Run.conclusion:type_name -> ermite.CiConclusion | |
| 2238 | + | 26, // 2: ermite.Run.created_at:type_name -> google.protobuf.Timestamp | |
| 2239 | + | 26, // 3: ermite.Run.started_at:type_name -> google.protobuf.Timestamp | |
| 2240 | + | 26, // 4: ermite.Run.completed_at:type_name -> google.protobuf.Timestamp | |
| 2241 | + | 24, // 5: ermite.RunJob.status:type_name -> ermite.CiStatus | |
| 2242 | + | 25, // 6: ermite.RunJob.conclusion:type_name -> ermite.CiConclusion | |
| 2243 | + | 27, // 7: ermite.RunJob.isolation:type_name -> ermite.RunnerIsolation | |
| 2244 | + | 2, // 8: ermite.RunJob.steps:type_name -> ermite.Step | |
| 2245 | + | 26, // 9: ermite.RunJob.created_at:type_name -> google.protobuf.Timestamp | |
| 2246 | + | 26, // 10: ermite.RunJob.started_at:type_name -> google.protobuf.Timestamp | |
| 2247 | + | 26, // 11: ermite.RunJob.completed_at:type_name -> google.protobuf.Timestamp | |
| 2248 | + | 28, // 12: ermite.Step.state:type_name -> ermite.StepState | |
| 2249 | + | 25, // 13: ermite.Step.conclusion:type_name -> ermite.CiConclusion | |
| 2250 | + | 26, // 14: ermite.Step.started_at:type_name -> google.protobuf.Timestamp | |
| 2251 | + | 26, // 15: ermite.Step.completed_at:type_name -> google.protobuf.Timestamp | |
| 2252 | + | 24, // 16: ermite.Check.status:type_name -> ermite.CiStatus | |
| 2253 | + | 25, // 17: ermite.Check.conclusion:type_name -> ermite.CiConclusion | |
| 2254 | + | 26, // 18: ermite.Check.started_at:type_name -> google.protobuf.Timestamp | |
| 2255 | + | 26, // 19: ermite.Check.completed_at:type_name -> google.protobuf.Timestamp | |
| 2256 | + | 27, // 20: ermite.Runner.isolation:type_name -> ermite.RunnerIsolation | |
| 2257 | + | 26, // 21: ermite.Runner.registered_at:type_name -> google.protobuf.Timestamp | |
| 2258 | + | 26, // 22: ermite.Runner.last_seen:type_name -> google.protobuf.Timestamp | |
| 2259 | + | 24, // 23: ermite.ListRunsRequest.status:type_name -> ermite.CiStatus | |
| 2260 | + | 0, // 24: ermite.ListRunsResponse.runs:type_name -> ermite.Run | |
| 2261 | + | 0, // 25: ermite.GetRunResponse.run:type_name -> ermite.Run | |
| 2262 | + | 1, // 26: ermite.GetRunResponse.jobs:type_name -> ermite.RunJob | |
| 2263 | + | 1, // 27: ermite.GetJobResponse.job:type_name -> ermite.RunJob | |
| 2264 | + | 13, // 28: ermite.GetJobLogResponse.lines:type_name -> ermite.JobLogLine | |
| 2265 | + | 26, // 29: ermite.JobLogLine.time:type_name -> google.protobuf.Timestamp | |
| 2266 | + | 0, // 30: ermite.CancelRunResponse.run:type_name -> ermite.Run | |
| 2267 | + | 0, // 31: ermite.RerunRunResponse.run:type_name -> ermite.Run | |
| 2268 | + | 3, // 32: ermite.ListChecksResponse.checks:type_name -> ermite.Check | |
| 2269 | + | 4, // 33: ermite.ListRunnersResponse.runners:type_name -> ermite.Runner | |
| 2270 | + | 5, // 34: ermite.RunService.ListRuns:input_type -> ermite.ListRunsRequest | |
| 2271 | + | 7, // 35: ermite.RunService.GetRun:input_type -> ermite.GetRunRequest | |
| 2272 | + | 9, // 36: ermite.RunService.GetJob:input_type -> ermite.GetJobRequest | |
| 2273 | + | 11, // 37: ermite.RunService.GetJobLog:input_type -> ermite.GetJobLogRequest | |
| 2274 | + | 14, // 38: ermite.RunService.CancelRun:input_type -> ermite.CancelRunRequest | |
| 2275 | + | 16, // 39: ermite.RunService.RerunRun:input_type -> ermite.RerunRunRequest | |
| 2276 | + | 18, // 40: ermite.RunService.ListChecks:input_type -> ermite.ListChecksRequest | |
| 2277 | + | 20, // 41: ermite.RunService.ListRunners:input_type -> ermite.ListRunnersRequest | |
| 2278 | + | 22, // 42: ermite.RunService.RemoveRunner:input_type -> ermite.RemoveRunnerRequest | |
| 2279 | + | 6, // 43: ermite.RunService.ListRuns:output_type -> ermite.ListRunsResponse | |
| 2280 | + | 8, // 44: ermite.RunService.GetRun:output_type -> ermite.GetRunResponse | |
| 2281 | + | 10, // 45: ermite.RunService.GetJob:output_type -> ermite.GetJobResponse | |
| 2282 | + | 12, // 46: ermite.RunService.GetJobLog:output_type -> ermite.GetJobLogResponse | |
| 2283 | + | 15, // 47: ermite.RunService.CancelRun:output_type -> ermite.CancelRunResponse | |
| 2284 | + | 17, // 48: ermite.RunService.RerunRun:output_type -> ermite.RerunRunResponse | |
| 2285 | + | 19, // 49: ermite.RunService.ListChecks:output_type -> ermite.ListChecksResponse | |
| 2286 | + | 21, // 50: ermite.RunService.ListRunners:output_type -> ermite.ListRunnersResponse | |
| 2287 | + | 23, // 51: ermite.RunService.RemoveRunner:output_type -> ermite.RemoveRunnerResponse | |
| 2288 | + | 43, // [43:52] is the sub-list for method output_type | |
| 2289 | + | 34, // [34:43] is the sub-list for method input_type | |
| 2290 | + | 34, // [34:34] is the sub-list for extension type_name | |
| 2291 | + | 34, // [34:34] is the sub-list for extension extendee | |
| 2292 | + | 0, // [0:34] is the sub-list for field type_name | |
| 2293 | + | } | |
| 2294 | + | ||
| 2295 | + | func init() { file_ermite_run_proto_init() } | |
| 2296 | + | func file_ermite_run_proto_init() { | |
| 2297 | + | if File_ermite_run_proto != nil { | |
| 2298 | + | return | |
| 2299 | + | } | |
| 2300 | + | file_ermite_runner_proto_init() | |
| 2301 | + | type x struct{} | |
| 2302 | + | out := protoimpl.TypeBuilder{ | |
| 2303 | + | File: protoimpl.DescBuilder{ | |
| 2304 | + | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), | |
| 2305 | + | RawDescriptor: unsafe.Slice(unsafe.StringData(file_ermite_run_proto_rawDesc), len(file_ermite_run_proto_rawDesc)), | |
| 2306 | + | NumEnums: 0, | |
| 2307 | + | NumMessages: 24, | |
| 2308 | + | NumExtensions: 0, | |
| 2309 | + | NumServices: 1, | |
| 2310 | + | }, | |
| 2311 | + | GoTypes: file_ermite_run_proto_goTypes, | |
| 2312 | + | DependencyIndexes: file_ermite_run_proto_depIdxs, | |
| 2313 | + | MessageInfos: file_ermite_run_proto_msgTypes, | |
| 2314 | + | }.Build() | |
| 2315 | + | File_ermite_run_proto = out.File | |
| 2316 | + | file_ermite_run_proto_goTypes = nil | |
| 2317 | + | file_ermite_run_proto_depIdxs = nil | |
| 2318 | + | } | |
A gen/ermite/runner.pb.go +2048 -0 generated file: collapsed
M gen/ermite/server.pb.go +5 -1 generated file: collapsed
M gen_test.go +177 -0
| @@ -3,9 +3,13 @@ | |||
| 3 | 3 | package api_test | |
| 4 | 4 | ||
| 5 | 5 | import ( | |
| 6 | + | "errors" | |
| 6 | 7 | "testing" | |
| 7 | 8 | ||
| 9 | + | "connectrpc.com/connect" | |
| 10 | + | ||
| 8 | 11 | "google.golang.org/protobuf/proto" | |
| 12 | + | "google.golang.org/protobuf/reflect/protoreflect" | |
| 9 | 13 | "google.golang.org/protobuf/types/known/fieldmaskpb" | |
| 10 | 14 | ||
| 11 | 15 | "bnema.dev/ermite-api/gen/ermite" | |
| @@ -43,6 +47,22 @@ func TestProcedures(t *testing.T) { | |||
| 43 | 47 | {ermiteconnect.SessionServiceSignOutEverywhereProcedure, "/ermite.SessionService/SignOutEverywhere"}, | |
| 44 | 48 | {ermiteconnect.ServerServiceGetVersionProcedure, "/ermite.ServerService/GetVersion"}, | |
| 45 | 49 | {ermiteconnect.ServerServiceGetSigningKeyProcedure, "/ermite.ServerService/GetSigningKey"}, | |
| 50 | + | {ermiteconnect.RunnerServiceRegisterRunnerProcedure, "/ermite.RunnerService/RegisterRunner"}, | |
| 51 | + | {ermiteconnect.RunnerServiceFetchJobProcedure, "/ermite.RunnerService/FetchJob"}, | |
| 52 | + | {ermiteconnect.RunnerServiceUpdateJobProcedure, "/ermite.RunnerService/UpdateJob"}, | |
| 53 | + | {ermiteconnect.RunnerServiceAppendLogProcedure, "/ermite.RunnerService/AppendLog"}, | |
| 54 | + | {ermiteconnect.RunnerServiceHeartbeatProcedure, "/ermite.RunnerService/Heartbeat"}, | |
| 55 | + | {ermiteconnect.RunnerServiceWatchJobProcedure, "/ermite.RunnerService/WatchJob"}, | |
| 56 | + | {ermiteconnect.RunnerServiceCompleteJobProcedure, "/ermite.RunnerService/CompleteJob"}, | |
| 57 | + | {ermiteconnect.RunServiceListRunsProcedure, "/ermite.RunService/ListRuns"}, | |
| 58 | + | {ermiteconnect.RunServiceGetRunProcedure, "/ermite.RunService/GetRun"}, | |
| 59 | + | {ermiteconnect.RunServiceGetJobProcedure, "/ermite.RunService/GetJob"}, | |
| 60 | + | {ermiteconnect.RunServiceGetJobLogProcedure, "/ermite.RunService/GetJobLog"}, | |
| 61 | + | {ermiteconnect.RunServiceCancelRunProcedure, "/ermite.RunService/CancelRun"}, | |
| 62 | + | {ermiteconnect.RunServiceRerunRunProcedure, "/ermite.RunService/RerunRun"}, | |
| 63 | + | {ermiteconnect.RunServiceListChecksProcedure, "/ermite.RunService/ListChecks"}, | |
| 64 | + | {ermiteconnect.RunServiceListRunnersProcedure, "/ermite.RunService/ListRunners"}, | |
| 65 | + | {ermiteconnect.RunServiceRemoveRunnerProcedure, "/ermite.RunService/RemoveRunner"}, | |
| 46 | 66 | } | |
| 47 | 67 | for _, tt := range tests { | |
| 48 | 68 | if tt.got != tt.want { | |
| @@ -71,6 +91,41 @@ func TestEnumNumbers(t *testing.T) { | |||
| 71 | 91 | if got := ermite.DiffSide_DIFF_SIDE_NEW; got != 2 { | |
| 72 | 92 | t.Errorf("DIFF_SIDE_NEW = %d, want 2", got) | |
| 73 | 93 | } | |
| 94 | + | enums := []struct { | |
| 95 | + | name string | |
| 96 | + | got int32 | |
| 97 | + | want int32 | |
| 98 | + | }{ | |
| 99 | + | {"CI_STATUS_UNSPECIFIED", int32(ermite.CiStatus_CI_STATUS_UNSPECIFIED), 0}, | |
| 100 | + | {"CI_STATUS_QUEUED", int32(ermite.CiStatus_CI_STATUS_QUEUED), 1}, | |
| 101 | + | {"CI_STATUS_IN_PROGRESS", int32(ermite.CiStatus_CI_STATUS_IN_PROGRESS), 2}, | |
| 102 | + | {"CI_STATUS_COMPLETED", int32(ermite.CiStatus_CI_STATUS_COMPLETED), 3}, | |
| 103 | + | {"CI_CONCLUSION_UNSPECIFIED", int32(ermite.CiConclusion_CI_CONCLUSION_UNSPECIFIED), 0}, | |
| 104 | + | {"CI_CONCLUSION_SUCCESS", int32(ermite.CiConclusion_CI_CONCLUSION_SUCCESS), 1}, | |
| 105 | + | {"CI_CONCLUSION_FAILURE", int32(ermite.CiConclusion_CI_CONCLUSION_FAILURE), 2}, | |
| 106 | + | {"CI_CONCLUSION_CANCELLED", int32(ermite.CiConclusion_CI_CONCLUSION_CANCELLED), 3}, | |
| 107 | + | {"CI_CONCLUSION_SKIPPED", int32(ermite.CiConclusion_CI_CONCLUSION_SKIPPED), 4}, | |
| 108 | + | {"CI_CONCLUSION_TIMED_OUT", int32(ermite.CiConclusion_CI_CONCLUSION_TIMED_OUT), 5}, | |
| 109 | + | {"CI_CONCLUSION_NEUTRAL", int32(ermite.CiConclusion_CI_CONCLUSION_NEUTRAL), 6}, | |
| 110 | + | {"CI_CONCLUSION_ACTION_REQUIRED", int32(ermite.CiConclusion_CI_CONCLUSION_ACTION_REQUIRED), 7}, | |
| 111 | + | {"STEP_STATE_UNSPECIFIED", int32(ermite.StepState_STEP_STATE_UNSPECIFIED), 0}, | |
| 112 | + | {"STEP_STATE_PENDING", int32(ermite.StepState_STEP_STATE_PENDING), 1}, | |
| 113 | + | {"STEP_STATE_IN_PROGRESS", int32(ermite.StepState_STEP_STATE_IN_PROGRESS), 2}, | |
| 114 | + | {"STEP_STATE_COMPLETED", int32(ermite.StepState_STEP_STATE_COMPLETED), 3}, | |
| 115 | + | {"RUNNER_ISOLATION_UNSPECIFIED", int32(ermite.RunnerIsolation_RUNNER_ISOLATION_UNSPECIFIED), 0}, | |
| 116 | + | {"RUNNER_ISOLATION_VM", int32(ermite.RunnerIsolation_RUNNER_ISOLATION_VM), 1}, | |
| 117 | + | {"RUNNER_ISOLATION_CONTAINER_SYSBOX", int32(ermite.RunnerIsolation_RUNNER_ISOLATION_CONTAINER_SYSBOX), 2}, | |
| 118 | + | {"RUNNER_ISOLATION_CONTAINER_PRIVILEGED", int32(ermite.RunnerIsolation_RUNNER_ISOLATION_CONTAINER_PRIVILEGED), 3}, | |
| 119 | + | {"CANCEL_REASON_UNSPECIFIED", int32(ermite.CancelReason_CANCEL_REASON_UNSPECIFIED), 0}, | |
| 120 | + | {"CANCEL_REASON_USER", int32(ermite.CancelReason_CANCEL_REASON_USER), 1}, | |
| 121 | + | {"CANCEL_REASON_FAIL_FAST", int32(ermite.CancelReason_CANCEL_REASON_FAIL_FAST), 2}, | |
| 122 | + | {"CANCEL_REASON_TIMEOUT", int32(ermite.CancelReason_CANCEL_REASON_TIMEOUT), 3}, | |
| 123 | + | } | |
| 124 | + | for _, e := range enums { | |
| 125 | + | if e.got != e.want { | |
| 126 | + | t.Errorf("%s = %d, want %d", e.name, e.got, e.want) | |
| 127 | + | } | |
| 128 | + | } | |
| 74 | 129 | } | |
| 75 | 130 | ||
| 76 | 131 | // TestEventRoundTrip checks that an event with a oneof kind survives the wire. | |
| @@ -152,3 +207,125 @@ func TestMergeRequestEventRoundTrip(t *testing.T) { | |||
| 152 | 207 | t.Errorf("modes = %v", got) | |
| 153 | 208 | } | |
| 154 | 209 | } | |
| 210 | + | ||
| 211 | + | // TestCIEventRoundTrip checks that the CI event kinds keep their field numbers | |
| 212 | + | // and survive the wire. | |
| 213 | + | func TestCIEventRoundTrip(t *testing.T) { | |
| 214 | + | in := &ermite.WatchResponse{Event: &ermite.Event{ | |
| 215 | + | Id: "44", | |
| 216 | + | Kind: &ermite.Event_JobUpdated{JobUpdated: &ermite.JobUpdated{Job: &ermite.RunJob{ | |
| 217 | + | Id: "j1", | |
| 218 | + | RunId: 9, | |
| 219 | + | Attempt: 2, | |
| 220 | + | Status: ermite.CiStatus_CI_STATUS_COMPLETED, | |
| 221 | + | Conclusion: ermite.CiConclusion_CI_CONCLUSION_TIMED_OUT, | |
| 222 | + | Isolation: ermite.RunnerIsolation_RUNNER_ISOLATION_VM, | |
| 223 | + | Steps: []*ermite.Step{{Number: 1, Name: "Set up job", LogStart: 0, LogEnd: 3}}, | |
| 224 | + | }}}, | |
| 225 | + | }} | |
| 226 | + | b, err := proto.Marshal(in) | |
| 227 | + | if err != nil { | |
| 228 | + | t.Fatal(err) | |
| 229 | + | } | |
| 230 | + | var out ermite.WatchResponse | |
| 231 | + | if err := proto.Unmarshal(b, &out); err != nil { | |
| 232 | + | t.Fatal(err) | |
| 233 | + | } | |
| 234 | + | if !proto.Equal(in, &out) { | |
| 235 | + | t.Errorf("round trip mismatch: %v != %v", &out, in) | |
| 236 | + | } | |
| 237 | + | f := (&ermite.Event{}).ProtoReflect().Descriptor().Fields() | |
| 238 | + | for name, num := range map[string]int{"run_updated": 12, "job_updated": 13} { | |
| 239 | + | if fd := f.ByName(protoreflect.Name(name)); fd == nil || int(fd.Number()) != num { | |
| 240 | + | t.Errorf("event field %s: %v, want number %d", name, fd, num) | |
| 241 | + | } | |
| 242 | + | } | |
| 243 | + | } | |
| 244 | + | ||
| 245 | + | // TestJobRoundTrip checks the job handed to a runner survives the wire. | |
| 246 | + | func TestJobRoundTrip(t *testing.T) { | |
| 247 | + | in := &ermite.FetchJobResponse{Job: &ermite.Job{ | |
| 248 | + | JobId: "j1", RunId: 9, Attempt: 1, JobToken: "tok", WorkflowPath: ".github/workflows/ci.yml", | |
| 249 | + | WorkflowYaml: "on: push", JobKey: "build", Matrix: "{}", Contexts: "{}", | |
| 250 | + | Labels: []string{"self-hosted"}, TimeoutMinutes: 360, Repo: "ermite", | |
| 251 | + | Sha: "0123456789012345678901234567890123456789", Ref: "refs/heads/main", | |
| 252 | + | }} | |
| 253 | + | b, err := proto.Marshal(in) | |
| 254 | + | if err != nil { | |
| 255 | + | t.Fatal(err) | |
| 256 | + | } | |
| 257 | + | var out ermite.FetchJobResponse | |
| 258 | + | if err := proto.Unmarshal(b, &out); err != nil { | |
| 259 | + | t.Fatal(err) | |
| 260 | + | } | |
| 261 | + | if !proto.Equal(in, &out) { | |
| 262 | + | t.Errorf("round trip mismatch: %v != %v", &out, in) | |
| 263 | + | } | |
| 264 | + | } | |
| 265 | + | ||
| 266 | + | // TestWatchJobRoundTrip checks the three kinds of WatchJob message and the | |
| 267 | + | // JobEnded detail. | |
| 268 | + | func TestWatchJobRoundTrip(t *testing.T) { | |
| 269 | + | msgs := []*ermite.WatchJobResponse{ | |
| 270 | + | {Msg: &ermite.WatchJobResponse_Keepalive{Keepalive: &ermite.Keepalive{}}}, | |
| 271 | + | {Msg: &ermite.WatchJobResponse_Cancel{Cancel: &ermite.CancelRequest{ | |
| 272 | + | Reason: ermite.CancelReason_CANCEL_REASON_FAIL_FAST, Message: "m", | |
| 273 | + | }}}, | |
| 274 | + | {Msg: &ermite.WatchJobResponse_Ended{Ended: &ermite.JobEnded{ | |
| 275 | + | Conclusion: ermite.CiConclusion_CI_CONCLUSION_CANCELLED, Error: "e", | |
| 276 | + | }}}, | |
| 277 | + | } | |
| 278 | + | for _, in := range msgs { | |
| 279 | + | b, err := proto.Marshal(in) | |
| 280 | + | if err != nil { | |
| 281 | + | t.Fatal(err) | |
| 282 | + | } | |
| 283 | + | var out ermite.WatchJobResponse | |
| 284 | + | if err := proto.Unmarshal(b, &out); err != nil { | |
| 285 | + | t.Fatal(err) | |
| 286 | + | } | |
| 287 | + | if !proto.Equal(in, &out) { | |
| 288 | + | t.Errorf("round trip mismatch: %v != %v", &out, in) | |
| 289 | + | } | |
| 290 | + | } | |
| 291 | + | // The detail travels in a Connect error. | |
| 292 | + | d, err := connect.NewErrorDetail(&ermite.JobEnded{Conclusion: ermite.CiConclusion_CI_CONCLUSION_TIMED_OUT}) | |
| 293 | + | if err != nil { | |
| 294 | + | t.Fatal(err) | |
| 295 | + | } | |
| 296 | + | cerr := connect.NewError(connect.CodeFailedPrecondition, errors.New("job ended")) | |
| 297 | + | cerr.AddDetail(d) | |
| 298 | + | v, err := cerr.Details()[0].Value() | |
| 299 | + | if err != nil { | |
| 300 | + | t.Fatal(err) | |
| 301 | + | } | |
| 302 | + | if got := v.(*ermite.JobEnded).GetConclusion(); got != ermite.CiConclusion_CI_CONCLUSION_TIMED_OUT { | |
| 303 | + | t.Errorf("detail conclusion = %v", got) | |
| 304 | + | } | |
| 305 | + | } | |
| 306 | + | ||
| 307 | + | // TestCompleteJobRoundTrip checks the final report of a job and its answer. | |
| 308 | + | func TestCompleteJobRoundTrip(t *testing.T) { | |
| 309 | + | in := &ermite.CompleteJobRequest{ | |
| 310 | + | JobId: "j1", | |
| 311 | + | Conclusion: ermite.CiConclusion_CI_CONCLUSION_CANCELLED, | |
| 312 | + | Outputs: map[string]string{"a": "b"}, | |
| 313 | + | RunnerShutdown: true, | |
| 314 | + | Steps: []*ermite.StepUpdate{{Number: 2, State: ermite.StepState_STEP_STATE_COMPLETED}}, | |
| 315 | + | } | |
| 316 | + | b, err := proto.Marshal(in) | |
| 317 | + | if err != nil { | |
| 318 | + | t.Fatal(err) | |
| 319 | + | } | |
| 320 | + | var out ermite.CompleteJobRequest | |
| 321 | + | if err := proto.Unmarshal(b, &out); err != nil { | |
| 322 | + | t.Fatal(err) | |
| 323 | + | } | |
| 324 | + | if !proto.Equal(in, &out) { | |
| 325 | + | t.Errorf("round trip mismatch: %v != %v", &out, in) | |
| 326 | + | } | |
| 327 | + | r := &ermite.CompleteJobResponse{Applied: false, Conclusion: ermite.CiConclusion_CI_CONCLUSION_TIMED_OUT} | |
| 328 | + | if r.GetApplied() || r.GetConclusion() != ermite.CiConclusion_CI_CONCLUSION_TIMED_OUT { | |
| 329 | + | t.Errorf("unexpected response %v", r) | |
| 330 | + | } | |
| 331 | + | } | |
M proto/ermite/event.proto +31 -2
| @@ -6,6 +6,7 @@ package ermite; | |||
| 6 | 6 | ||
| 7 | 7 | import "ermite/merge_request.proto"; | |
| 8 | 8 | import "ermite/repo.proto"; | |
| 9 | + | import "ermite/run.proto"; | |
| 9 | 10 | import "google/protobuf/timestamp.proto"; | |
| 10 | 11 | ||
| 11 | 12 | // EventService streams what happens on the forge. | |
| @@ -18,7 +19,17 @@ service EventService { | |||
| 18 | 19 | // for merge requests, merge_request_opened, merge_request_merged, | |
| 19 | 20 | // merge_request_closed and comment_added. Each one is delivered on the | |
| 20 | 21 | // "repo:<name>" topic of its repository and on "home", subject to the | |
| 21 | - | // visibility of the repository. There is no event for a change of title or | |
| 22 | + | // visibility of the repository. | |
| 23 | + | // | |
| 24 | + | // Servers with the feature "ci.runs" also publish run_updated and | |
| 25 | + | // job_updated, only on the "repo:<name>" topic of their repository (never on | |
| 26 | + | // "home"), subject to the same visibility. They carry the state after the | |
| 27 | + | // change and are published when a run or a job is created, changes status | |
| 28 | + | // or conclusion, or when one of its steps starts or ends (never per log | |
| 29 | + | // line: follow a log with RunService.GetJobLog). The order of these events | |
| 30 | + | // is not guaranteed, between jobs and runs or between two updates of the same | |
| 31 | + | // one: a client keeps the copy with the higher Run.version or | |
| 32 | + | // RunJob.version and drops the other. There is no event for a change of title or | |
| 22 | 33 | // description, nor for a resolved comment: after a gap, or to see such | |
| 23 | 34 | // changes, clients read the merge request again. A merge publishes | |
| 24 | 35 | // merge_request_merged, then pushed for the target branch. | |
| @@ -87,6 +98,10 @@ message Event { | |||
| 87 | 98 | MergeRequestClosed merge_request_closed = 10; | |
| 88 | 99 | // CommentAdded: a comment was added to a merge request. | |
| 89 | 100 | CommentAdded comment_added = 11; | |
| 101 | + | // RunUpdated: a CI run was created or changed. | |
| 102 | + | RunUpdated run_updated = 12; | |
| 103 | + | // JobUpdated: a CI job was created or changed. | |
| 104 | + | JobUpdated job_updated = 13; | |
| 90 | 105 | } | |
| 91 | 106 | } | |
| 92 | 107 | ||
| @@ -158,5 +173,19 @@ message CommentAdded { | |||
| 158 | 173 | // Gap tells the client that events were lost: the requested resume point is | |
| 159 | 174 | // older than the server's buffer. It has no fields. The client should reload | |
| 160 | 175 | // the state it displays (repositories, refs, merge requests and their | |
| 161 | - | // comments) and carry on with the next events. | |
| 176 | + | // comments, CI runs and their jobs) and carry on with the next events. | |
| 162 | 177 | message Gap {} | |
| 178 | + | ||
| 179 | + | // RunUpdated reports a CI run that was created or whose status, conclusion or | |
| 180 | + | // timestamps changed. It is delivered on the "repo:<name>" topic only. | |
| 181 | + | message RunUpdated { | |
| 182 | + | // Run is the run after the change, as of its latest attempt, without jobs. | |
| 183 | + | Run run = 1; | |
| 184 | + | } | |
| 185 | + | ||
| 186 | + | // JobUpdated reports a CI job that was created or whose status, conclusion, | |
| 187 | + | // runner or steps changed. It is delivered on the "repo:<name>" topic only. | |
| 188 | + | message JobUpdated { | |
| 189 | + | // Job is the job after the change, with its steps. | |
| 190 | + | RunJob job = 1; | |
| 191 | + | } | |
A proto/ermite/run.proto +503 -0
| @@ -0,0 +1,503 @@ | |||
| 1 | + | // SPDX-License-Identifier: MIT | |
| 2 | + | ||
| 3 | + | syntax = "proto3"; | |
| 4 | + | ||
| 5 | + | package ermite; | |
| 6 | + | ||
| 7 | + | import "ermite/runner.proto"; | |
| 8 | + | import "google/protobuf/timestamp.proto"; | |
| 9 | + | ||
| 10 | + | // Run is one execution of one workflow file for one event, like a GitHub | |
| 11 | + | // workflow run. A re-run keeps the run and adds an attempt. | |
| 12 | + | message Run { | |
| 13 | + | // Repo is the name of the repository. | |
| 14 | + | string repo = 1; | |
| 15 | + | // Id identifies the run on the whole server: it is the "github.run_id". | |
| 16 | + | // Increasing, never reused. | |
| 17 | + | int64 id = 2; | |
| 18 | + | // Number counts the runs of the same workflow file in the repository, | |
| 19 | + | // starting at 1, never reused: it is the "github.run_number". It does not | |
| 20 | + | // change on a re-run. | |
| 21 | + | int64 number = 3; | |
| 22 | + | // Attempt is the attempt this message describes: 1 for the first, one more | |
| 23 | + | // after each RerunRun. ListRuns and events describe the latest attempt; | |
| 24 | + | // GetRun can ask for another one. | |
| 25 | + | int32 attempt = 4; | |
| 26 | + | // WorkflowPath is the path of the workflow file at sha, for example | |
| 27 | + | // ".github/workflows/ci.yml". | |
| 28 | + | string workflow_path = 5; | |
| 29 | + | // WorkflowName is the "name" of the workflow, or workflow_path when it has | |
| 30 | + | // none (as GitHub does). | |
| 31 | + | string workflow_name = 6; | |
| 32 | + | // Title is the first line of the message of the commit sha, at most 256 | |
| 33 | + | // characters (GitHub's display title). | |
| 34 | + | string title = 7; | |
| 35 | + | // Event is the event that triggered the run, in GitHub's name: "push" (the | |
| 36 | + | // only one for now; push to a branch or a tag, and merge of a merge | |
| 37 | + | // request). New values may be added; clients show the ones they do not | |
| 38 | + | // know as they are. | |
| 39 | + | string event = 8; | |
| 40 | + | // Ref is the full ref name that was pushed, for example "refs/heads/main" | |
| 41 | + | // or "refs/tags/v1.0.0". | |
| 42 | + | string ref = 9; | |
| 43 | + | // Sha is the full id of the commit the run is for. | |
| 44 | + | string sha = 10; | |
| 45 | + | // Actor names who triggered the run: the label of the token that pushed, or | |
| 46 | + | // "root", or "owner" (a web session, a merge of the web UI), as | |
| 47 | + | // MergeRequest.author. It is informational. | |
| 48 | + | string actor = 11; | |
| 49 | + | // Status is where this attempt is: QUEUED until a job starts, IN_PROGRESS | |
| 50 | + | // while jobs run or wait, COMPLETED when every job is over. | |
| 51 | + | CiStatus status = 12; | |
| 52 | + | // Conclusion is how this attempt ended, from its jobs' conclusions like | |
| 53 | + | // GitHub: CANCELLED if it was cancelled, else FAILURE if a job failed or | |
| 54 | + | // timed out, else SUCCESS (also when jobs were skipped). Unset until | |
| 55 | + | // status is COMPLETED. | |
| 56 | + | CiConclusion conclusion = 13; | |
| 57 | + | // Error is set when the run failed without running a job because the | |
| 58 | + | // workflow could not be used: an invalid workflow file (the run then has | |
| 59 | + | // no jobs and conclusion FAILURE), as GitHub's "Invalid workflow file". | |
| 60 | + | // It holds the errors with their positions, one per line, at most 8 KiB. | |
| 61 | + | // Empty otherwise. | |
| 62 | + | string error = 14; | |
| 63 | + | // CreatedAt is when this attempt was created: for attempt 1 when the | |
| 64 | + | // trigger was planned, for later ones when RerunRun was called. | |
| 65 | + | google.protobuf.Timestamp created_at = 15; | |
| 66 | + | // StartedAt is when the first job of this attempt was given to a runner. | |
| 67 | + | // Unset until then. | |
| 68 | + | google.protobuf.Timestamp started_at = 16; | |
| 69 | + | // CompletedAt is when this attempt completed. Unset until then. | |
| 70 | + | google.protobuf.Timestamp completed_at = 17; | |
| 71 | + | // Version counts the changes of this run on the server: it grows by at least | |
| 72 | + | // one at every change and never goes back, also across attempts. Events are | |
| 73 | + | // not delivered in order, and a client that holds two copies of a run keeps | |
| 74 | + | // the one with the higher version and drops the other. | |
| 75 | + | int64 version = 18; | |
| 76 | + | } | |
| 77 | + | ||
| 78 | + | // RunJob is a job of a run as people see it: the state of one job instance | |
| 79 | + | // (one matrix combination is one job) in one attempt. It is not Job, which is | |
| 80 | + | // what a runner receives. | |
| 81 | + | message RunJob { | |
| 82 | + | // Id is the Job.job_id. It is the same in every attempt. | |
| 83 | + | string id = 1; | |
| 84 | + | // RunId is the run the job belongs to. | |
| 85 | + | int64 run_id = 2; | |
| 86 | + | // Attempt is the attempt of the run in which this job executed. It is lower | |
| 87 | + | // than the attempt of the run when the job was kept from an earlier attempt | |
| 88 | + | // by a re-run of the failed jobs only; the log and steps are then those of | |
| 89 | + | // that earlier attempt. Pass it to GetJob and GetJobLog. | |
| 90 | + | int32 attempt = 3; | |
| 91 | + | // Repo is the name of the repository. | |
| 92 | + | string repo = 4; | |
| 93 | + | // Key is the key of the job under "jobs:" in the workflow (the | |
| 94 | + | // "github.job"). Matrix instances of one job share it. | |
| 95 | + | string key = 5; | |
| 96 | + | // Name is the display name of the job, evaluated, with the matrix suffix as | |
| 97 | + | // GitHub names them, for example "build (linux, 1.27)". It is also the | |
| 98 | + | // name of the job's check. | |
| 99 | + | string name = 6; | |
| 100 | + | // Status is where the job is. A job waits QUEUED for a runner and for the | |
| 101 | + | // jobs it needs. | |
| 102 | + | CiStatus status = 7; | |
| 103 | + | // Conclusion is how the job ended. Unset until status is COMPLETED. | |
| 104 | + | CiConclusion conclusion = 8; | |
| 105 | + | // Error explains a FAILURE, CANCELLED or TIMED_OUT that no step explains, in | |
| 106 | + | // GitHub's words where it has them: the runner was lost ("The self-hosted | |
| 107 | + | // runner: <name> lost communication with the server..."), it received a | |
| 108 | + | // shutdown signal, no runner took the job within 24 hours, the log limit | |
| 109 | + | // was reached, the workflow uses a feature that is not supported yet | |
| 110 | + | // ("not supported yet: <feature>"). At most 4 KiB. Empty otherwise. | |
| 111 | + | string error = 9; | |
| 112 | + | // Labels are the runs-on labels of the job, evaluated. Empty while the job | |
| 113 | + | // is not planned yet. | |
| 114 | + | repeated string labels = 10; | |
| 115 | + | // Needs are the keys of the jobs this job needs, for drawing the graph. | |
| 116 | + | repeated string needs = 11; | |
| 117 | + | // RunnerId is the id of the runner that executed or is executing the job. | |
| 118 | + | // Empty while queued, and when the runner has since been removed (runner_name | |
| 119 | + | // and isolation are kept). | |
| 120 | + | string runner_id = 12; | |
| 121 | + | // RunnerName is the name of that runner. Empty while queued. | |
| 122 | + | string runner_name = 13; | |
| 123 | + | // Isolation is how that runner isolated the job. UNSPECIFIED while queued. | |
| 124 | + | RunnerIsolation isolation = 14; | |
| 125 | + | // Steps are the steps reported so far, ordered by number, including the | |
| 126 | + | // implicit "Set up job" and "Complete job". Empty while queued. Always | |
| 127 | + | // set, including in JobUpdated events. | |
| 128 | + | repeated Step steps = 15; | |
| 129 | + | // CreatedAt is when the job was created (planned). | |
| 130 | + | google.protobuf.Timestamp created_at = 16; | |
| 131 | + | // StartedAt is when the job was given to a runner. Unset until then. | |
| 132 | + | google.protobuf.Timestamp started_at = 17; | |
| 133 | + | // CompletedAt is when the job completed. Unset until then. | |
| 134 | + | google.protobuf.Timestamp completed_at = 18; | |
| 135 | + | // Version counts the changes of this job on the server (status, conclusion, | |
| 136 | + | // runner, steps, with any attempt): it grows by at least one at every change | |
| 137 | + | // and never goes back. A client that holds two copies of a job keeps the | |
| 138 | + | // one with the higher version and drops the other, as for Run.version. | |
| 139 | + | int64 version = 19; | |
| 140 | + | } | |
| 141 | + | ||
| 142 | + | // Step is one step of a job, with where its lines are in the job log. | |
| 143 | + | message Step { | |
| 144 | + | // Number is the 1-based number of the step in the job, the one the runner | |
| 145 | + | // uses in UpdateJob and AppendLog. | |
| 146 | + | int32 number = 1; | |
| 147 | + | // Name is the display name of the step. | |
| 148 | + | string name = 2; | |
| 149 | + | // State is where the step is. | |
| 150 | + | StepState state = 3; | |
| 151 | + | // Conclusion is how the step ended. Unset until state is COMPLETED. | |
| 152 | + | CiConclusion conclusion = 4; | |
| 153 | + | // StartedAt is when the step started. Unset while PENDING. | |
| 154 | + | google.protobuf.Timestamp started_at = 5; | |
| 155 | + | // CompletedAt is when the step ended. Unset until COMPLETED. | |
| 156 | + | google.protobuf.Timestamp completed_at = 6; | |
| 157 | + | // LogStart is the number of the first line of the step in the job log (the | |
| 158 | + | // offset of GetJobLogRequest and AppendLogRequest), counted from 0. | |
| 159 | + | int64 log_start = 7; | |
| 160 | + | // LogEnd is the number of the line after the last one of the step. For an | |
| 161 | + | // IN_PROGRESS step it is the number of lines held at the time of the | |
| 162 | + | // call and grows; for a step without a line it equals log_start. | |
| 163 | + | int64 log_end = 8; | |
| 164 | + | } | |
| 165 | + | ||
| 166 | + | // Check is the result of one job on one commit, the unit shown next to a | |
| 167 | + | // commit or a merge request and counted by the merge rules. There is one per | |
| 168 | + | // job instance, named like GitHub's checks. | |
| 169 | + | message Check { | |
| 170 | + | // Id identifies the check. It is opaque and stable across attempts. | |
| 171 | + | string id = 1; | |
| 172 | + | // Repo is the name of the repository. | |
| 173 | + | string repo = 2; | |
| 174 | + | // Sha is the full id of the commit. | |
| 175 | + | string sha = 3; | |
| 176 | + | // Name is the name of the check: the RunJob.name of the job. | |
| 177 | + | string name = 4; | |
| 178 | + | // Status is where the check is. | |
| 179 | + | CiStatus status = 5; | |
| 180 | + | // Conclusion is how the check ended. Unset until status is COMPLETED. The | |
| 181 | + | // value "stale" of GitHub is never used. | |
| 182 | + | CiConclusion conclusion = 6; | |
| 183 | + | // RunId is the run of the job. | |
| 184 | + | int64 run_id = 7; | |
| 185 | + | // JobId is the RunJob.id of the job, to open its page and log. | |
| 186 | + | string job_id = 8; | |
| 187 | + | // Attempt is the attempt the check describes: the latest attempt of the run. | |
| 188 | + | int32 attempt = 9; | |
| 189 | + | // WorkflowName is the Run.workflow_name of the run. | |
| 190 | + | string workflow_name = 10; | |
| 191 | + | // StartedAt is when the job was given to a runner. Unset while queued. | |
| 192 | + | google.protobuf.Timestamp started_at = 11; | |
| 193 | + | // CompletedAt is when the job completed. Unset until then. | |
| 194 | + | google.protobuf.Timestamp completed_at = 12; | |
| 195 | + | } | |
| 196 | + | ||
| 197 | + | // Runner is a registered CI runner. It never contains the runner token nor its | |
| 198 | + | // hash. | |
| 199 | + | message Runner { | |
| 200 | + | // Id identifies the runner in RemoveRunner. It is not a secret. | |
| 201 | + | string id = 1; | |
| 202 | + | // Name is the unique name chosen at registration. | |
| 203 | + | string name = 2; | |
| 204 | + | // Labels are all the labels the runner can match: the ones chosen at | |
| 205 | + | // registration plus the implicit ones ("self-hosted", the os and the arch), | |
| 206 | + | // lowercase, sorted. | |
| 207 | + | repeated string labels = 3; | |
| 208 | + | // Isolation is how the runner isolates jobs. | |
| 209 | + | RunnerIsolation isolation = 4; | |
| 210 | + | // Version is the version of the runner software. | |
| 211 | + | string version = 5; | |
| 212 | + | // Arch is "x64" or "arm64". | |
| 213 | + | string arch = 6; | |
| 214 | + | // Os is "linux". | |
| 215 | + | string os = 7; | |
| 216 | + | // RegisteredAt is when the runner was registered. | |
| 217 | + | google.protobuf.Timestamp registered_at = 8; | |
| 218 | + | // LastSeen is when the server last heard from the runner: a FetchJob poll or | |
| 219 | + | // a heartbeat of one of its jobs. Unset if never. It may lag behind the real | |
| 220 | + | // time by a short delay. A runner not seen for more than about 2 minutes is | |
| 221 | + | // offline. | |
| 222 | + | google.protobuf.Timestamp last_seen = 9; | |
| 223 | + | // Busy is true while the runner has a job in progress. | |
| 224 | + | bool busy = 10; | |
| 225 | + | } | |
| 226 | + | ||
| 227 | + | // RunService reads and controls CI runs, like `gh run` does on GitHub. It is for | |
| 228 | + | // owners and their tools; runners use RunnerService. | |
| 229 | + | // | |
| 230 | + | // Runs, jobs, checks and logs belong to a repository, and reading them needs | |
| 231 | + | // the same access as reading it: nothing for a public repository, the | |
| 232 | + | // repo:read scope for a private one. A repository that does not exist or that | |
| 233 | + | // the caller cannot read gives not_found; so does a run or a job that belongs | |
| 234 | + | // to another repository than the one named (ids are global but are always | |
| 235 | + | // checked against the repository). Cancelling and re-running need the ci:write | |
| 236 | + | // scope on the repository (a token restricted to other repositories gets | |
| 237 | + | // permission_denied). The runner RPCs (ListRunners, RemoveRunner) are not about | |
| 238 | + | // a repository and need the runner:register scope on a token that is not | |
| 239 | + | // restricted to repositories, or the root token. A caller without the needed | |
| 240 | + | // scope gets permission_denied. | |
| 241 | + | // | |
| 242 | + | // Page sizes and page tokens work as in the other services: page_size 0 is the | |
| 243 | + | // server default, larger values are lowered to the server maximum, and a | |
| 244 | + | // page_token is the next_page_token of a previous response for the same | |
| 245 | + | // request (other fields must be unchanged). | |
| 246 | + | // | |
| 247 | + | // Servers that implement the runs side (every RPC but ListRunners and | |
| 248 | + | // RemoveRunner) list "ci.runs" in GetVersionResponse.features; those that | |
| 249 | + | // implement the runners side list "ci.runners", as RunnerService does. A server | |
| 250 | + | // that honours the filters of ListRunsRequest also lists "ci.runs.filters". | |
| 251 | + | service RunService { | |
| 252 | + | // ListRuns lists the runs of a repository, highest id (newest) first. Each | |
| 253 | + | // run is described by its latest attempt. The filters narrow the result; a | |
| 254 | + | // server without the feature "ci.runs.filters" ignores them and returns | |
| 255 | + | // every run, so a client that needs them checks the feature. Fails with | |
| 256 | + | // invalid_argument if a filter is malformed. | |
| 257 | + | rpc ListRuns(ListRunsRequest) returns (ListRunsResponse); | |
| 258 | + | // GetRun returns a run with its jobs and their steps, for the latest attempt | |
| 259 | + | // or for the one asked. Fails with not_found if the run or the attempt does | |
| 260 | + | // not exist. | |
| 261 | + | rpc GetRun(GetRunRequest) returns (GetRunResponse); | |
| 262 | + | // GetJob returns one job with its steps. Fails with not_found if the job | |
| 263 | + | // or the attempt does not exist. | |
| 264 | + | rpc GetJob(GetJobRequest) returns (GetJobResponse); | |
| 265 | + | // GetJobLog streams the lines of the log of a job, from a line number. The | |
| 266 | + | // server sends them in order in messages of at most 1,000 lines and 64 KiB of | |
| 267 | + | // text each. | |
| 268 | + | // | |
| 269 | + | // Without follow, the stream ends after the last line stored when the call | |
| 270 | + | // was made. With follow, it goes on as lines arrive, with at most 1 second of | |
| 271 | + | // delay after the runner's AppendLog, and ends without error once the job has | |
| 272 | + | // completed and all its lines were sent; on a completed job follow changes | |
| 273 | + | // nothing. A client that loses the stream calls again with the offset after | |
| 274 | + | // the last line it received. The client may cancel at any time. | |
| 275 | + | // | |
| 276 | + | // Fails with not_found if the job, the attempt or its log does not exist (the | |
| 277 | + | // log is removed by the retention sweep, and a queued job has none: with | |
| 278 | + | // follow, the call waits for the first line instead), with out_of_range if | |
| 279 | + | // offset is beyond the end of the log of a job without follow, and with | |
| 280 | + | // resource_exhausted when there are too many concurrent log streams, in | |
| 281 | + | // total or from one client. Like Watch, a stream ends with unauthenticated | |
| 282 | + | // when the token was revoked or expired. | |
| 283 | + | rpc GetJobLog(GetJobLogRequest) returns (stream GetJobLogResponse); | |
| 284 | + | // CancelRun asks to cancel the latest attempt of a run. Needs the ci:write | |
| 285 | + | // scope. Jobs that have not started are cancelled at once; jobs in progress | |
| 286 | + | // get a CANCEL_REASON_USER request through WatchJob, and the run completes | |
| 287 | + | // when they have ended, so the returned run may still be IN_PROGRESS. | |
| 288 | + | // Cancelling a run that already has a cancellation requested succeeds and | |
| 289 | + | // changes nothing. Fails with failed_precondition if the run has completed. | |
| 290 | + | rpc CancelRun(CancelRunRequest) returns (CancelRunResponse); | |
| 291 | + | // RerunRun starts a new attempt of a completed run: same run id and number, | |
| 292 | + | // attempt + 1, same commit and same workflow file as at the original run (the | |
| 293 | + | // file of the repository is not read again). Needs the ci:write scope. Fails | |
| 294 | + | // with failed_precondition if the latest attempt has not completed, or if | |
| 295 | + | // failed_only is set and no job failed. The new attempt is returned QUEUED. | |
| 296 | + | rpc RerunRun(RerunRunRequest) returns (RerunRunResponse); | |
| 297 | + | // ListChecks lists the checks of a commit: for each job of each run on that | |
| 298 | + | // sha, the one of the latest attempt, ordered by creation time then name. | |
| 299 | + | // A commit without a run has no check: the list is empty, which is not an | |
| 300 | + | // error, and the server does not verify that the commit exists. Returns at | |
| 301 | + | // most 1,000 checks (truncated tells). | |
| 302 | + | rpc ListChecks(ListChecksRequest) returns (ListChecksResponse); | |
| 303 | + | // ListRunners lists the registered runners, ordered by name. Needs the | |
| 304 | + | // runner:register scope. | |
| 305 | + | rpc ListRunners(ListRunnersRequest) returns (ListRunnersResponse); | |
| 306 | + | // RemoveRunner removes a runner: its runner token stops working at once (a | |
| 307 | + | // FetchJob in progress ends with unauthenticated) and it no longer gets | |
| 308 | + | // jobs. A job it is running is not affected: it ends normally, or fails as | |
| 309 | + | // a lost runner without heartbeats. Needs the runner:register scope. Fails | |
| 310 | + | // with not_found if the id is unknown. | |
| 311 | + | rpc RemoveRunner(RemoveRunnerRequest) returns (RemoveRunnerResponse); | |
| 312 | + | } | |
| 313 | + | ||
| 314 | + | // ListRunsRequest selects a page of runs. | |
| 315 | + | message ListRunsRequest { | |
| 316 | + | // Repo is the repository name. | |
| 317 | + | string repo = 1; | |
| 318 | + | // PageSize is the maximum number of runs to return. | |
| 319 | + | int32 page_size = 2; | |
| 320 | + | // PageToken is the next_page_token of a previous response. Empty for the | |
| 321 | + | // first page. | |
| 322 | + | string page_token = 3; | |
| 323 | + | // Workflow restricts the result to one workflow file: its path | |
| 324 | + | // (".github/workflows/ci.yml") or its file name ("ci.yml"). Empty means | |
| 325 | + | // every workflow. Ignored by servers without "ci.runs.filters". | |
| 326 | + | string workflow = 4; | |
| 327 | + | // Branch restricts the result to the runs whose ref is this branch, by | |
| 328 | + | // short name ("main"). Empty means every ref. Ignored by servers without | |
| 329 | + | // "ci.runs.filters". | |
| 330 | + | string branch = 5; | |
| 331 | + | // Status restricts the result to the runs whose latest attempt has this | |
| 332 | + | // status. CI_STATUS_UNSPECIFIED means every status. Ignored by servers | |
| 333 | + | // without "ci.runs.filters". | |
| 334 | + | CiStatus status = 6; | |
| 335 | + | } | |
| 336 | + | ||
| 337 | + | // ListRunsResponse is one page of runs. | |
| 338 | + | message ListRunsResponse { | |
| 339 | + | // Runs are the runs of this page, highest id first, without jobs. | |
| 340 | + | repeated Run runs = 1; | |
| 341 | + | // NextPageToken is passed as page_token to get the next page. Empty when | |
| 342 | + | // there is no next page. | |
| 343 | + | string next_page_token = 2; | |
| 344 | + | } | |
| 345 | + | ||
| 346 | + | // GetRunRequest selects a run. | |
| 347 | + | message GetRunRequest { | |
| 348 | + | // Repo is the repository name. | |
| 349 | + | string repo = 1; | |
| 350 | + | // RunId is the Run.id. | |
| 351 | + | int64 run_id = 2; | |
| 352 | + | // Attempt is the attempt to read. 0 means the latest. | |
| 353 | + | int32 attempt = 3; | |
| 354 | + | } | |
| 355 | + | ||
| 356 | + | // GetRunResponse holds a run with its jobs. | |
| 357 | + | message GetRunResponse { | |
| 358 | + | // Run is the run, as of the attempt asked. | |
| 359 | + | Run run = 1; | |
| 360 | + | // Jobs are the jobs of that attempt, with their steps, in the order of the | |
| 361 | + | // workflow file (matrix instances in the order of the matrix). Jobs kept from | |
| 362 | + | // an earlier attempt by a re-run of failed jobs are included, with their own | |
| 363 | + | // RunJob.attempt. Empty for a run that failed on an invalid workflow file. | |
| 364 | + | repeated RunJob jobs = 2; | |
| 365 | + | // LatestAttempt is the latest attempt of the run, to offer the other ones. | |
| 366 | + | int32 latest_attempt = 3; | |
| 367 | + | } | |
| 368 | + | ||
| 369 | + | // GetJobRequest selects a job. | |
| 370 | + | message GetJobRequest { | |
| 371 | + | // Repo is the repository name. | |
| 372 | + | string repo = 1; | |
| 373 | + | // JobId is the RunJob.id. | |
| 374 | + | string job_id = 2; | |
| 375 | + | // Attempt is the RunJob.attempt to read. 0 means the latest. | |
| 376 | + | int32 attempt = 3; | |
| 377 | + | } | |
| 378 | + | ||
| 379 | + | // GetJobResponse holds a job. | |
| 380 | + | message GetJobResponse { | |
| 381 | + | // Job is the job with its steps. | |
| 382 | + | RunJob job = 1; | |
| 383 | + | } | |
| 384 | + | ||
| 385 | + | // GetJobLogRequest selects the lines to stream. | |
| 386 | + | message GetJobLogRequest { | |
| 387 | + | // Repo is the repository name. | |
| 388 | + | string repo = 1; | |
| 389 | + | // JobId is the RunJob.id. | |
| 390 | + | string job_id = 2; | |
| 391 | + | // Attempt is the RunJob.attempt whose log to read. 0 means the latest. | |
| 392 | + | int32 attempt = 3; | |
| 393 | + | // Offset is the number of the first line to send, counted from 0 across all | |
| 394 | + | // steps (see Step.log_start). Negative is invalid_argument. | |
| 395 | + | int64 offset = 4; | |
| 396 | + | // Follow keeps the stream open while the job runs. See GetJobLog. | |
| 397 | + | bool follow = 5; | |
| 398 | + | } | |
| 399 | + | ||
| 400 | + | // GetJobLogResponse is one message of the log stream. | |
| 401 | + | message GetJobLogResponse { | |
| 402 | + | // Offset is the number of the first line of lines. | |
| 403 | + | int64 offset = 1; | |
| 404 | + | // Lines are consecutive lines of the log, at most 1,000, at most 64 KiB of | |
| 405 | + | // text in total. Never empty. | |
| 406 | + | repeated JobLogLine lines = 2; | |
| 407 | + | } | |
| 408 | + | ||
| 409 | + | // JobLogLine is one line of a job log, as the runner sent it. | |
| 410 | + | message JobLogLine { | |
| 411 | + | // Step is the number of the step the line belongs to. | |
| 412 | + | int32 step = 1; | |
| 413 | + | // Time is when the runner produced the line, with nanosecond precision. | |
| 414 | + | google.protobuf.Timestamp time = 2; | |
| 415 | + | // Text is the line without its terminator, as in LogLine.text, including the | |
| 416 | + | // "##[group]" and "##[endgroup]" markers. Clients show it escaped. | |
| 417 | + | string text = 3; | |
| 418 | + | // Continued is true when the line continues the line before it, which was | |
| 419 | + | // too long for the runner to send whole (see LogLine.continued). Pieces keep | |
| 420 | + | // their own line numbers, so offsets are the same as the runner's; a client | |
| 421 | + | // that shows lines joins a continued line to the previous one. The raw log | |
| 422 | + | // file already has them joined. | |
| 423 | + | bool continued = 4; | |
| 424 | + | } | |
| 425 | + | ||
| 426 | + | // CancelRunRequest names the run to cancel. | |
| 427 | + | message CancelRunRequest { | |
| 428 | + | // Repo is the repository name. | |
| 429 | + | string repo = 1; | |
| 430 | + | // RunId is the Run.id. | |
| 431 | + | int64 run_id = 2; | |
| 432 | + | } | |
| 433 | + | ||
| 434 | + | // CancelRunResponse holds the run after the request. | |
| 435 | + | message CancelRunResponse { | |
| 436 | + | // Run is the latest attempt of the run. | |
| 437 | + | Run run = 1; | |
| 438 | + | } | |
| 439 | + | ||
| 440 | + | // RerunRunRequest names the run to run again. | |
| 441 | + | message RerunRunRequest { | |
| 442 | + | // Repo is the repository name. | |
| 443 | + | string repo = 1; | |
| 444 | + | // RunId is the Run.id. | |
| 445 | + | int64 run_id = 2; | |
| 446 | + | // FailedOnly runs again only the jobs of the latest attempt that did not | |
| 447 | + | // succeed (conclusion FAILURE, CANCELLED, TIMED_OUT or ACTION_REQUIRED) and | |
| 448 | + | // the jobs that need them, directly or not, even if they were skipped. The | |
| 449 | + | // other jobs keep their result, steps and log from the earlier attempt. When | |
| 450 | + | // false, every job runs again. | |
| 451 | + | bool failed_only = 3; | |
| 452 | + | } | |
| 453 | + | ||
| 454 | + | // RerunRunResponse holds the new attempt. | |
| 455 | + | message RerunRunResponse { | |
| 456 | + | // Run is the run as of the new attempt, QUEUED. | |
| 457 | + | Run run = 1; | |
| 458 | + | } | |
| 459 | + | ||
| 460 | + | // ListChecksRequest names the commit. | |
| 461 | + | message ListChecksRequest { | |
| 462 | + | // Repo is the repository name. | |
| 463 | + | string repo = 1; | |
| 464 | + | // Sha is the full commit id (40 lowercase hexadecimal characters for SHA-1). | |
| 465 | + | // Abbreviations and names are invalid_argument. | |
| 466 | + | string sha = 2; | |
| 467 | + | } | |
| 468 | + | ||
| 469 | + | // ListChecksResponse holds the checks of a commit. | |
| 470 | + | message ListChecksResponse { | |
| 471 | + | // Checks are the checks of the commit, one per job of the latest attempt of | |
| 472 | + | // each run, ordered by creation time then name. | |
| 473 | + | repeated Check checks = 1; | |
| 474 | + | // Truncated is true when the commit has more checks than checks holds. | |
| 475 | + | bool truncated = 2; | |
| 476 | + | } | |
| 477 | + | ||
| 478 | + | // ListRunnersRequest selects a page of runners. | |
| 479 | + | message ListRunnersRequest { | |
| 480 | + | // PageSize is the maximum number of runners to return. | |
| 481 | + | int32 page_size = 1; | |
| 482 | + | // PageToken is the next_page_token of a previous response. Empty for the | |
| 483 | + | // first page. | |
| 484 | + | string page_token = 2; | |
| 485 | + | } | |
| 486 | + | ||
| 487 | + | // ListRunnersResponse is one page of runners. | |
| 488 | + | message ListRunnersResponse { | |
| 489 | + | // Runners are the runners of this page, ordered by name. | |
| 490 | + | repeated Runner runners = 1; | |
| 491 | + | // NextPageToken is passed as page_token to get the next page. Empty when | |
| 492 | + | // there is no next page. | |
| 493 | + | string next_page_token = 2; | |
| 494 | + | } | |
| 495 | + | ||
| 496 | + | // RemoveRunnerRequest names the runner to remove. | |
| 497 | + | message RemoveRunnerRequest { | |
| 498 | + | // RunnerId is the Runner.id. | |
| 499 | + | string runner_id = 1; | |
| 500 | + | } | |
| 501 | + | ||
| 502 | + | // RemoveRunnerResponse is empty. | |
| 503 | + | message RemoveRunnerResponse {} | |
A proto/ermite/runner.proto +622 -0
| @@ -0,0 +1,622 @@ | |||
| 1 | + | // SPDX-License-Identifier: MIT | |
| 2 | + | ||
| 3 | + | syntax = "proto3"; | |
| 4 | + | ||
| 5 | + | package ermite; | |
| 6 | + | ||
| 7 | + | import "google/protobuf/duration.proto"; | |
| 8 | + | import "google/protobuf/timestamp.proto"; | |
| 9 | + | ||
| 10 | + | // CiStatus is where a run, a job or a check is in its life. It is the same | |
| 11 | + | // as GitHub's status, without the rarely used values. | |
| 12 | + | enum CiStatus { | |
| 13 | + | // Not set. In a filter it means every status. Never returned by the server. | |
| 14 | + | CI_STATUS_UNSPECIFIED = 0; | |
| 15 | + | // Waiting: for a runner, for the jobs it needs, or for its turn | |
| 16 | + | // (max-parallel). | |
| 17 | + | CI_STATUS_QUEUED = 1; | |
| 18 | + | // At least one job has been given to a runner and has not ended. | |
| 19 | + | CI_STATUS_IN_PROGRESS = 2; | |
| 20 | + | // Over. The conclusion says how it ended. | |
| 21 | + | CI_STATUS_COMPLETED = 3; | |
| 22 | + | } | |
| 23 | + | ||
| 24 | + | // CiConclusion is how a run, a job, a step or a check ended, with GitHub's | |
| 25 | + | // values and meaning. It is unset (CI_CONCLUSION_UNSPECIFIED) until the status is | |
| 26 | + | // COMPLETED. | |
| 27 | + | enum CiConclusion { | |
| 28 | + | // Not completed yet. Never returned by the server for a completed item. | |
| 29 | + | CI_CONCLUSION_UNSPECIFIED = 0; | |
| 30 | + | // Everything it ran succeeded. | |
| 31 | + | CI_CONCLUSION_SUCCESS = 1; | |
| 32 | + | // A step failed, or the job failed for another reason described in | |
| 33 | + | // RunJob.error (runner lost, queue timeout, log limit, feature not | |
| 34 | + | // supported yet, invalid workflow file). | |
| 35 | + | CI_CONCLUSION_FAILURE = 2; | |
| 36 | + | // Cancelled by the owner, or by fail-fast, or because the runner shut down. | |
| 37 | + | CI_CONCLUSION_CANCELLED = 3; | |
| 38 | + | // Never ran: its "if" was false, or a job it needs did not succeed, or it was | |
| 39 | + | // not selected. Never reported by a runner. | |
| 40 | + | CI_CONCLUSION_SKIPPED = 4; | |
| 41 | + | // Exceeded its timeout. | |
| 42 | + | CI_CONCLUSION_TIMED_OUT = 5; | |
| 43 | + | // Neither a success nor a failure. Defined for parity with GitHub; no | |
| 44 | + | // workflow job ends this way yet. For merging it counts as a success. | |
| 45 | + | CI_CONCLUSION_NEUTRAL = 6; | |
| 46 | + | // Waits for a human action (for example the approval of an environment). | |
| 47 | + | // Defined for parity with GitHub; the server does not produce it before | |
| 48 | + | // environments exist. For merging it counts as a failure. | |
| 49 | + | CI_CONCLUSION_ACTION_REQUIRED = 7; | |
| 50 | + | } | |
| 51 | + | ||
| 52 | + | // StepState is where a step is in its life. | |
| 53 | + | enum StepState { | |
| 54 | + | // Not set. Rejected in requests, never returned by the server. | |
| 55 | + | STEP_STATE_UNSPECIFIED = 0; | |
| 56 | + | // Known but not started. | |
| 57 | + | STEP_STATE_PENDING = 1; | |
| 58 | + | // Running. | |
| 59 | + | STEP_STATE_IN_PROGRESS = 2; | |
| 60 | + | // Over. The conclusion says how it ended. A step that did not run because | |
| 61 | + | // of its "if" or an earlier failure is COMPLETED with CI_CONCLUSION_SKIPPED. | |
| 62 | + | STEP_STATE_COMPLETED = 3; | |
| 63 | + | } | |
| 64 | + | ||
| 65 | + | // RunnerIsolation is how a runner isolates each job from the host and from | |
| 66 | + | // other jobs. The runner chooses it (auto-detection included) and reports it | |
| 67 | + | // at registration; the job page shows it. | |
| 68 | + | enum RunnerIsolation { | |
| 69 | + | // Not set. Rejected at registration, never returned by the server. | |
| 70 | + | RUNNER_ISOLATION_UNSPECIFIED = 0; | |
| 71 | + | // One micro-VM per job, destroyed at the end. | |
| 72 | + | RUNNER_ISOLATION_VM = 1; | |
| 73 | + | // One container per job with its own Docker daemon, run by the sysbox | |
| 74 | + | // runtime. Shares the host kernel. | |
| 75 | + | RUNNER_ISOLATION_CONTAINER_SYSBOX = 2; | |
| 76 | + | // One privileged container per job with its own Docker daemon. Shares the | |
| 77 | + | // host kernel and is equivalent to root on the host: the weakest mode. | |
| 78 | + | RUNNER_ISOLATION_CONTAINER_PRIVILEGED = 3; | |
| 79 | + | } | |
| 80 | + | ||
| 81 | + | // CancelReason says why the server asks a runner to stop a job. | |
| 82 | + | enum CancelReason { | |
| 83 | + | // Not set. Never sent in a CancelRequest. | |
| 84 | + | CANCEL_REASON_UNSPECIFIED = 0; | |
| 85 | + | // The owner cancelled the run (RunService.CancelRun, web or CLI). The job | |
| 86 | + | // ends CI_CONCLUSION_CANCELLED. | |
| 87 | + | CANCEL_REASON_USER = 1; | |
| 88 | + | // Another job of the same matrix failed and the strategy has fail-fast. The | |
| 89 | + | // job ends CI_CONCLUSION_CANCELLED. | |
| 90 | + | CANCEL_REASON_FAIL_FAST = 2; | |
| 91 | + | // The job exceeded its time budget (see Job.timeout_minutes). The job ends | |
| 92 | + | // CI_CONCLUSION_TIMED_OUT. | |
| 93 | + | CANCEL_REASON_TIMEOUT = 3; | |
| 94 | + | } | |
| 95 | + | ||
| 96 | + | // RunnerService is what a CI runner (ermite-runner) calls to get jobs and | |
| 97 | + | // report on them. It is not for people: owners use RunService. | |
| 98 | + | // | |
| 99 | + | // Three credentials are used, each by different RPCs. All are sent as | |
| 100 | + | // "Authorization: Bearer <secret>": | |
| 101 | + | // | |
| 102 | + | // - RegisterRunner: a stored token with the runner:register scope, or the | |
| 103 | + | // root token. | |
| 104 | + | // - FetchJob: the runner token returned by RegisterRunner. It identifies the | |
| 105 | + | // runner and only works for FetchJob. It is "ermiterun_" followed by 43 | |
| 106 | + | // base64url characters (32 random bytes, no padding). | |
| 107 | + | // - UpdateJob, AppendLog, Heartbeat, WatchJob, CompleteJob: the job token of | |
| 108 | + | // the Job that FetchJob returned. It is valid for that one job and that | |
| 109 | + | // one assignment. It is "ermitejob_" followed by 43 base64url characters | |
| 110 | + | // (32 random bytes, no padding). The job_id of the request must be the | |
| 111 | + | // one of the token. | |
| 112 | + | // | |
| 113 | + | // Errors. unauthenticated means only that the credential is bad: missing, | |
| 114 | + | // unknown, expired, revoked, of the wrong kind for the RPC, or a job token | |
| 115 | + | // that was replaced (the job was given again, see FetchJob) or is older than | |
| 116 | + | // the 24 hours below. A runner that gets it for a job abandons the job at | |
| 117 | + | // once. A job token that is valid but belongs to another job than the job_id | |
| 118 | + | // of the request gets permission_denied. Repeated failed authentications are | |
| 119 | + | // rate limited per client address. | |
| 120 | + | // | |
| 121 | + | // The end of a job. A job ends when its conclusion is set, by CompleteJob or | |
| 122 | + | // by the server (cancellation not honoured, lost runner, log limit, queue | |
| 123 | + | // timeout). From then on UpdateJob, AppendLog, Heartbeat and WatchJob answer | |
| 124 | + | // failed_precondition with a JobEnded error detail (a JobEnded message in the | |
| 125 | + | // Connect error details) that gives the conclusion; the runner stops the job | |
| 126 | + | // and sends nothing more. The job token is still recognised for 24 hours after | |
| 127 | + | // the end, so that these calls can say so and so that CompleteJob, the only | |
| 128 | + | // call that still does something, returns the stored result to a runner that | |
| 129 | + | // lost the answer of its last call or that was cut off by the server. After | |
| 130 | + | // the 24 hours every call gets unauthenticated. | |
| 131 | + | // | |
| 132 | + | // Secrets and trust. Runner tokens and job tokens are secrets: the server | |
| 133 | + | // never logs them and clients must not log them. The job token stays in the | |
| 134 | + | // runner host process; it is never given to the sandbox that runs the job's | |
| 135 | + | // code. A runner receives the jobs of every repository, with their workflow | |
| 136 | + | // files, contexts and (from CI-2) their code, and from CI-3 their secrets: the | |
| 137 | + | // runner:register scope therefore effectively gives read access to the code | |
| 138 | + | // and the secrets of every repository, private ones included. Give it only to | |
| 139 | + | // runners you operate. | |
| 140 | + | // | |
| 141 | + | // Servers that implement this service list "ci.runners" in | |
| 142 | + | // GetVersionResponse.features. | |
| 143 | + | service RunnerService { | |
| 144 | + | // RegisterRunner registers a runner and returns its runner token, which is | |
| 145 | + | // shown only in this response; the runner keeps it. The caller needs the | |
| 146 | + | // runner:register scope on a token that is not restricted to repositories | |
| 147 | + | // (a runner serves every repository), or the root token. Fails with | |
| 148 | + | // unauthenticated without a valid token, permission_denied without the | |
| 149 | + | // scope or with a repository-restricted token, invalid_argument if a field | |
| 150 | + | // breaks a rule, and already_exists if name is taken by another runner and | |
| 151 | + | // replace is not set. | |
| 152 | + | rpc RegisterRunner(RegisterRunnerRequest) returns (RegisterRunnerResponse); | |
| 153 | + | // FetchJob asks for a job to run (long poll). The server holds the call | |
| 154 | + | // until a queued job matches the runner, or about 50 seconds (never more | |
| 155 | + | // than 50) pass, then answers; without a job the response has no job and the | |
| 156 | + | // runner calls again after retry_after. Clients set a call timeout above 50 | |
| 157 | + | // seconds (60 is suggested) and must not poll when they have no free | |
| 158 | + | // capacity. | |
| 159 | + | // | |
| 160 | + | // A job matches when every label of its runs-on is among the labels of the | |
| 161 | + | // runner (case-insensitive). A job is given to exactly one runner, even when | |
| 162 | + | // many runners and many polls compete; the assignment is recorded before | |
| 163 | + | // the response is sent. The job stays QUEUED for the owner until it is | |
| 164 | + | // acknowledged. | |
| 165 | + | // | |
| 166 | + | // Acknowledgement. The runner's first Heartbeat for the job is the | |
| 167 | + | // acknowledgement, and the runner sends it as soon as it has the job, before | |
| 168 | + | // anything else. If none arrives within 30 seconds of the assignment (the | |
| 169 | + | // response was lost, or the runner died), the server cancels the assignment: | |
| 170 | + | // the job token is revoked, the job goes back to QUEUED with a fresh token | |
| 171 | + | // and can be given to any runner, the same one included; nothing the old | |
| 172 | + | // assignment stored is kept. This is not a failure of the job. A job whose | |
| 173 | + | // assignment is cancelled 3 times in a row is failed with CI_CONCLUSION_FAILURE | |
| 174 | + | // and an error saying so. | |
| 175 | + | // | |
| 176 | + | // Retry after a lost response. poll_id lets a client retry a poll safely: | |
| 177 | + | // a call with the same poll_id as an earlier call of the same runner that | |
| 178 | + | // assigned a job returns that same assignment (same Job, same token) as long | |
| 179 | + | // as it has not been acknowledged or cancelled, instead of taking another. | |
| 180 | + | // | |
| 181 | + | // A runner that crashed or whose host restarted cannot resume a job: it does | |
| 182 | + | // not keep the job token, so the job fails with the lost-runner error after | |
| 183 | + | // the heartbeat timeout (see Heartbeat). | |
| 184 | + | // | |
| 185 | + | // Needs the runner token. Fails with unauthenticated when the runner was | |
| 186 | + | // removed (also ending a call in progress) and invalid_argument if labels | |
| 187 | + | // or poll_id break a rule. | |
| 188 | + | rpc FetchJob(FetchJobRequest) returns (FetchJobResponse); | |
| 189 | + | // UpdateJob reports the state of the steps of a job while it runs. Needs the | |
| 190 | + | // job token. Each call is applied whole or not at all, and repeating an | |
| 191 | + | // identical call changes nothing, so a runner may retry after a network | |
| 192 | + | // error. To end the job use CompleteJob. | |
| 193 | + | // | |
| 194 | + | // Fails with invalid_argument if a rule is broken, with failed_precondition | |
| 195 | + | // if a step goes back (a COMPLETED step cannot change, a step cannot go from | |
| 196 | + | // IN_PROGRESS to PENDING) and with failed_precondition and a JobEnded detail | |
| 197 | + | // if the job has ended. | |
| 198 | + | rpc UpdateJob(UpdateJobRequest) returns (UpdateJobResponse); | |
| 199 | + | // AppendLog appends lines to the log of a job. Needs the job token. | |
| 200 | + | // | |
| 201 | + | // The log of a job is one sequence of lines, numbered from 0 across all | |
| 202 | + | // steps; offset is the number of lines the server holds when the request is | |
| 203 | + | // applied, that is the number of the first line of the request. Calls must | |
| 204 | + | // go in order, one at a time, and are idempotent: | |
| 205 | + | // | |
| 206 | + | // - offset equal to the server's line count: the lines are appended; | |
| 207 | + | // - offset below it: the first (count - offset) lines were already stored | |
| 208 | + | // (a retry after a lost response) and are skipped, and the rest is | |
| 209 | + | // appended; a request entirely stored changes nothing. The skipped lines | |
| 210 | + | // are not compared with the stored ones: a retry whose lines differ from | |
| 211 | + | // the first attempt is silently dropped, so a client must resend the | |
| 212 | + | // same lines at the same offset; | |
| 213 | + | // - offset above it: out_of_range (a gap is a bug of the client; the | |
| 214 | + | // message gives the line count the server holds). | |
| 215 | + | // | |
| 216 | + | // The response gives the line count after the call, so a client can check | |
| 217 | + | // itself. Offsets resume only after a network error within the same runner | |
| 218 | + | // process; they are not a way to resume a job after a crash. | |
| 219 | + | // | |
| 220 | + | // A request has at most 1,000 lines whose text adds up to at most 64 KiB | |
| 221 | + | // (65,536 bytes), all in the same step; more is invalid_argument. A line | |
| 222 | + | // longer than that is cut by the client into pieces, see LogLine.continued. | |
| 223 | + | // | |
| 224 | + | // Steps. The step of a request must be at least the step of the last line | |
| 225 | + | // the server holds, because the log is ordered by step (applied lines only: | |
| 226 | + | // lines skipped as already stored are not checked); a lower step is | |
| 227 | + | // failed_precondition. Lines for a step that UpdateJob has not announced | |
| 228 | + | // create it: it starts IN_PROGRESS at the time of its first line, with an | |
| 229 | + | // empty name until an UpdateJob gives one. | |
| 230 | + | // | |
| 231 | + | // The log of a job is limited to 512 MiB (536,870,912 bytes) as stored by | |
| 232 | + | // the server (text, timestamps and separators). The call that would exceed | |
| 233 | + | // it appends nothing; the server adds a last line saying that the limit was | |
| 234 | + | // reached, ends the job with CI_CONCLUSION_FAILURE and RunJob.error set, and | |
| 235 | + | // answers failed_precondition with a JobEnded detail like any call after the | |
| 236 | + | // end of a job. The runner then stops the job. | |
| 237 | + | // | |
| 238 | + | // Lines sent after the end of the job are rejected, so a runner flushes all | |
| 239 | + | // its AppendLog lines before it calls CompleteJob. | |
| 240 | + | // | |
| 241 | + | // Fails with invalid_argument if a rule is broken (step number, text with a | |
| 242 | + | // line feed or invalid UTF-8, missing time, a continued first line). | |
| 243 | + | rpc AppendLog(AppendLogRequest) returns (AppendLogResponse); | |
| 244 | + | // Heartbeat tells the server that the runner is alive and still working on | |
| 245 | + | // the job. Needs the job token. The first one acknowledges the assignment | |
| 246 | + | // (see FetchJob). The runner then calls it every 30 seconds for as long as | |
| 247 | + | // the job runs. The deadline is 2 minutes after the later of the last | |
| 248 | + | // heartbeat and the start of the server (so a server restart does not fail | |
| 249 | + | // the jobs of runners that could not reach it): past it the server ends the | |
| 250 | + | // job with CI_CONCLUSION_FAILURE and the message "The self-hosted runner: | |
| 251 | + | // <name> lost communication with the server...". Only Heartbeat counts: | |
| 252 | + | // other calls do not keep a job alive. | |
| 253 | + | // | |
| 254 | + | // A runner that gets unavailable (or any network error) retries Heartbeat | |
| 255 | + | // every 5 seconds until it succeeds, instead of waiting for its next 30 | |
| 256 | + | // second tick, and keeps the job running meanwhile. | |
| 257 | + | rpc Heartbeat(HeartbeatRequest) returns (HeartbeatResponse); | |
| 258 | + | // WatchJob streams what the runner must react to. Needs the job token. The | |
| 259 | + | // runner opens it when it starts the job and keeps it open; it reopens it | |
| 260 | + | // after any error other than unauthenticated and the failed_precondition | |
| 261 | + | // that says the job ended, and after a clean close of | |
| 262 | + | // the stream that did not end with a JobEnded message. | |
| 263 | + | // | |
| 264 | + | // When the stream opens and a cancellation has already been requested, the | |
| 265 | + | // first message is that request, so a reconnect never misses one. Only the | |
| 266 | + | // first reason is sent: a job already cancelled by the owner does not get a | |
| 267 | + | // second message when its time budget expires. The server also sends a | |
| 268 | + | // Keepalive at least every 30 seconds, which the client ignores. When the | |
| 269 | + | // job ends the server sends JobEnded, then closes the stream without error. | |
| 270 | + | // On a job that has already ended the call fails like the other RPCs | |
| 271 | + | // (failed_precondition with a JobEnded detail). | |
| 272 | + | // | |
| 273 | + | // On a CancelRequest the runner stops the job as the official runner does | |
| 274 | + | // (interrupt, then terminate, then kill) and reports the conclusion given | |
| 275 | + | // for the reason with CompleteJob. | |
| 276 | + | // | |
| 277 | + | // The server does not trust the runner to obey. If no conclusion arrives | |
| 278 | + | // within 60 seconds after a cancellation request, whatever the reason (user, | |
| 279 | + | // fail-fast, timeout), the server ends the job itself: CI_CONCLUSION_CANCELLED | |
| 280 | + | // for user and fail-fast, CI_CONCLUSION_TIMED_OUT for timeout, with an error | |
| 281 | + | // saying that the runner did not answer, and the steps not completed are | |
| 282 | + | // completed as cancelled. The runner's later CompleteJob returns that result. | |
| 283 | + | rpc WatchJob(WatchJobRequest) returns (stream WatchJobResponse); | |
| 284 | + | // CompleteJob ends a job: it reports the final steps, the outputs and the | |
| 285 | + | // conclusion. Needs the job token, which stays valid for this RPC for 24 | |
| 286 | + | // hours after the end of the job, however it ended. The call is applied whole | |
| 287 | + | // or not at all. Once the job has ended, the token works for no other RPC | |
| 288 | + | // (they answer failed_precondition with a JobEnded detail). | |
| 289 | + | // | |
| 290 | + | // It is idempotent. The first call that finds the job running ends it and | |
| 291 | + | // answers applied = true. Any later call, a retry after a lost response or a | |
| 292 | + | // call after the server ended the job itself, is not validated and changes | |
| 293 | + | // nothing: it answers OK with the stored conclusion and error and | |
| 294 | + | // applied = false (a runner whose conclusion differs from the stored one | |
| 295 | + | // simply logs it; the outputs it sent are dropped). | |
| 296 | + | // | |
| 297 | + | // Lines sent with AppendLog after this call are rejected: a runner flushes | |
| 298 | + | // all its log lines first. Steps that were not reported COMPLETED when the job | |
| 299 | + | // ends are completed by the server as CI_CONCLUSION_CANCELLED (or SKIPPED when | |
| 300 | + | // they never started and the job did not end by cancellation). | |
| 301 | + | // | |
| 302 | + | // Fails with invalid_argument if a rule is broken (including the output | |
| 303 | + | // limits) and failed_precondition if a step goes back, as in UpdateJob. | |
| 304 | + | rpc CompleteJob(CompleteJobRequest) returns (CompleteJobResponse); | |
| 305 | + | } | |
| 306 | + | ||
| 307 | + | // RegisterRunnerRequest describes the runner to register. | |
| 308 | + | message RegisterRunnerRequest { | |
| 309 | + | // Name identifies the runner for people (job page, logs, ListRunners) and is | |
| 310 | + | // unique: 1 to 64 characters among letters, digits, ".", "_" and "-". It is | |
| 311 | + | // not a label and never matches runs-on. | |
| 312 | + | string name = 1; | |
| 313 | + | // Labels are the labels the runner adds to its implicit ones: at most 64, | |
| 314 | + | // each 1 to 64 characters among letters, digits, ".", "_" and "-", for | |
| 315 | + | // example "ubuntu-latest". Comparison is case-insensitive and duplicates | |
| 316 | + | // are removed. The server adds the implicit labels "self-hosted", the os | |
| 317 | + | // and the arch ("linux", "x64" or "arm64"); the runner name is not a label. | |
| 318 | + | repeated string labels = 2; | |
| 319 | + | // Version is the release of the runner, for example "v0.1.0", or "devel". | |
| 320 | + | // Informational, at most 64 characters. | |
| 321 | + | string version = 3; | |
| 322 | + | // Isolation is how the runner isolates jobs. Required. | |
| 323 | + | RunnerIsolation isolation = 4; | |
| 324 | + | // Arch is the CPU architecture, in GitHub's names: "x64" or "arm64". Other | |
| 325 | + | // values are invalid_argument (the set may grow with compatible additions). | |
| 326 | + | string arch = 5; | |
| 327 | + | // Os is the operating system: "linux". Other values are invalid_argument | |
| 328 | + | // (the set may grow with compatible additions). | |
| 329 | + | string os = 6; | |
| 330 | + | // Replace removes the runner that already has this name, if any, before | |
| 331 | + | // registering this one: its runner token is revoked at once, as in | |
| 332 | + | // RunService.RemoveRunner, and a job it is running is not affected. The new | |
| 333 | + | // runner gets a new runner_id. Needs the same scope as registering. Without | |
| 334 | + | // replace, a name in use is already_exists. It is how a runner re-registers | |
| 335 | + | // after losing its state. | |
| 336 | + | bool replace = 7; | |
| 337 | + | } | |
| 338 | + | ||
| 339 | + | // RegisterRunnerResponse holds the new runner and its secret. | |
| 340 | + | message RegisterRunnerResponse { | |
| 341 | + | // RunnerId identifies the runner in ListRunners and RemoveRunner. It is not | |
| 342 | + | // a secret. | |
| 343 | + | string runner_id = 1; | |
| 344 | + | // RunnerToken is the secret of the runner, to present as "Authorization: | |
| 345 | + | // Bearer <runner_token>" to FetchJob: "ermiterun_" and 43 base64url | |
| 346 | + | // characters (32 random bytes, no padding). It is returned once: the server | |
| 347 | + | // keeps only its SHA-256, the runner must store it (mode 0600). It stops | |
| 348 | + | // working when the runner is removed or replaced. | |
| 349 | + | string runner_token = 2; | |
| 350 | + | } | |
| 351 | + | ||
| 352 | + | // FetchJobRequest asks for a job. | |
| 353 | + | message FetchJobRequest { | |
| 354 | + | // Labels narrows the labels offered for this call. Empty means all the | |
| 355 | + | // labels of the runner, which is the normal case. Otherwise each one must be | |
| 356 | + | // a label of the runner (invalid_argument if not) and only jobs whose runs-on | |
| 357 | + | // labels are all among them are offered. | |
| 358 | + | repeated string labels = 1; | |
| 359 | + | // PollId identifies this poll, chosen by the client (for example 16 random | |
| 360 | + | // bytes in base64url), 1 to 64 characters among letters, digits, "_" and | |
| 361 | + | // "-". A client that retries a call whose response it did not get sends the | |
| 362 | + | // same poll_id, and gets the assignment the first call made, if it made one | |
| 363 | + | // (see FetchJob). A new poll uses a new id. Empty means no retry protection: | |
| 364 | + | // a lost assignment is then recovered by the acknowledgement timeout alone. | |
| 365 | + | string poll_id = 2; | |
| 366 | + | } | |
| 367 | + | ||
| 368 | + | // FetchJobResponse holds the job given to the runner, if any. | |
| 369 | + | message FetchJobResponse { | |
| 370 | + | // Job is the job to run. Unset when no job was available before the end of | |
| 371 | + | // the poll. | |
| 372 | + | Job job = 1; | |
| 373 | + | // RetryAfter is how long the client waits before its next FetchJob. Unset or | |
| 374 | + | // zero means call again at once. The server sets it when it has no job for | |
| 375 | + | // the runner and wants to slow polling down (load, shutdown in progress); | |
| 376 | + | // clients obey it and may wait longer, never less. Unset when job is set. | |
| 377 | + | google.protobuf.Duration retry_after = 2; | |
| 378 | + | } | |
| 379 | + | ||
| 380 | + | // Job is a job given to a runner: everything needed to run it, nothing more. | |
| 381 | + | // The runner parses workflow_yaml itself; the protocol does not carry the | |
| 382 | + | // workflow model, so it does not change when the model grows. | |
| 383 | + | message Job { | |
| 384 | + | // JobId identifies the job on the server. It is opaque, unique across | |
| 385 | + | // repositories and runs, and the same for every attempt of the job. With | |
| 386 | + | // attempt it names one execution. | |
| 387 | + | string job_id = 1; | |
| 388 | + | // RunId is the run the job belongs to, the "github.run_id". It is global to | |
| 389 | + | // the server. | |
| 390 | + | int64 run_id = 2; | |
| 391 | + | // Attempt is the attempt of the run this job executes: 1 for the first, and | |
| 392 | + | // one more after each RunService.RerunRun. It is the "github.run_attempt". | |
| 393 | + | int32 attempt = 3; | |
| 394 | + | // JobToken is the secret that authenticates this job's UpdateJob, | |
| 395 | + | // AppendLog, Heartbeat, WatchJob and CompleteJob calls ("Authorization: | |
| 396 | + | // Bearer <job_token>"): "ermitejob_" and 43 base64url characters (32 random | |
| 397 | + | // bytes, no padding). It is random, valid from the assignment until the job | |
| 398 | + | // ends (and for CompleteJob 24 hours more), survives a server restart and | |
| 399 | + | // is shown only in this response, or in a repeat of the same poll_id. It | |
| 400 | + | // must stay in the runner host process and never reach the job's code. A new | |
| 401 | + | // assignment of the same job has a new token. | |
| 402 | + | string job_token = 4; | |
| 403 | + | // WorkflowPath is the path of the workflow file in the repository, for | |
| 404 | + | // example ".github/workflows/ci.yml". | |
| 405 | + | string workflow_path = 5; | |
| 406 | + | // WorkflowYaml is the content of that file at sha, as is, at most 1 MiB | |
| 407 | + | // (larger files fail at planning). | |
| 408 | + | string workflow_yaml = 6; | |
| 409 | + | // JobKey is the key of the job under "jobs:" in the workflow, the | |
| 410 | + | // "github.job". | |
| 411 | + | string job_key = 7; | |
| 412 | + | // Matrix is the JSON object of the matrix values of this instance of the | |
| 413 | + | // job, for example {"os":"linux","go":"1.27"}. "{}" when the job has no | |
| 414 | + | // matrix. It is the "matrix" context. | |
| 415 | + | string matrix = 8; | |
| 416 | + | // Contexts is a JSON object with the contexts that the server computed for | |
| 417 | + | // this job: "github", "needs", "strategy", "matrix", "inputs" and "vars", in | |
| 418 | + | // the shape GitHub gives them. The contexts "job", "runner", "steps" and | |
| 419 | + | // "env" belong to the runner and are not in it. Other keys may be added | |
| 420 | + | // later; clients ignore those they do not know. | |
| 421 | + | string contexts = 9; | |
| 422 | + | // Labels are the runs-on labels of the job, evaluated. | |
| 423 | + | repeated string labels = 10; | |
| 424 | + | // TimeoutMinutes is the timeout of the job in minutes: the value of the | |
| 425 | + | // workflow's timeout-minutes, or 360 when it has none. At least 1. The | |
| 426 | + | // runner enforces it from the moment it receives the job. The server counts | |
| 427 | + | // from the moment of the assignment and adds 60 seconds of slack, so the | |
| 428 | + | // runner's own timeout always comes first: when the server's deadline | |
| 429 | + | // passes it announces CANCEL_REASON_TIMEOUT, and ends the job itself after | |
| 430 | + | // 60 more seconds without a conclusion (see WatchJob). | |
| 431 | + | int32 timeout_minutes = 11; | |
| 432 | + | // Repo is the name of the repository. | |
| 433 | + | string repo = 12; | |
| 434 | + | // Sha is the full id of the commit the run is for, 40 lowercase | |
| 435 | + | // hexadecimal characters for SHA-1. The runner reads the code at it. | |
| 436 | + | string sha = 13; | |
| 437 | + | // Ref is the full ref name that triggered the run, for example | |
| 438 | + | // "refs/heads/main" or "refs/tags/v1.0.0". | |
| 439 | + | string ref = 14; | |
| 440 | + | } | |
| 441 | + | ||
| 442 | + | // UpdateJobRequest reports the steps of a running job. | |
| 443 | + | message UpdateJobRequest { | |
| 444 | + | // JobId is the Job.job_id. It must be the job of the token. | |
| 445 | + | string job_id = 1; | |
| 446 | + | // Steps are the steps whose state changed or that are new. Each one is a | |
| 447 | + | // full snapshot of its step, applied by number. At most 1,000 steps per job | |
| 448 | + | // (invalid_argument beyond). Steps are numbered like GitHub's log: the | |
| 449 | + | // implicit "Set up job" is 1, the steps of the workflow follow in order, and | |
| 450 | + | // the implicit "Complete job" is last. | |
| 451 | + | repeated StepUpdate steps = 2; | |
| 452 | + | } | |
| 453 | + | ||
| 454 | + | // StepUpdate is the state of one step as the runner knows it. | |
| 455 | + | message StepUpdate { | |
| 456 | + | // Number is the 1-based number of the step in the job. It is the number | |
| 457 | + | // used by AppendLog. | |
| 458 | + | int32 number = 1; | |
| 459 | + | // Name is the display name of the step, evaluated: the "name" of the | |
| 460 | + | // workflow step, or "Run <first line of the script>", as GitHub shows it. | |
| 461 | + | // At most 1,024 characters; the server cuts longer names. | |
| 462 | + | string name = 2; | |
| 463 | + | // State is where the step is. | |
| 464 | + | StepState state = 3; | |
| 465 | + | // Conclusion is how the step ended. Required (not UNSPECIFIED) when state is | |
| 466 | + | // COMPLETED, must be UNSPECIFIED otherwise. Allowed values: success, | |
| 467 | + | // failure, cancelled, skipped. | |
| 468 | + | CiConclusion conclusion = 4; | |
| 469 | + | // StartedAt is when the step started, by the clock of the runner. Required | |
| 470 | + | // from IN_PROGRESS on. | |
| 471 | + | google.protobuf.Timestamp started_at = 5; | |
| 472 | + | // CompletedAt is when the step ended, by the clock of the runner. Required | |
| 473 | + | // when state is COMPLETED. | |
| 474 | + | google.protobuf.Timestamp completed_at = 6; | |
| 475 | + | } | |
| 476 | + | ||
| 477 | + | // UpdateJobResponse is empty. | |
| 478 | + | message UpdateJobResponse {} | |
| 479 | + | ||
| 480 | + | // CompleteJobRequest ends a job. | |
| 481 | + | message CompleteJobRequest { | |
| 482 | + | // JobId is the Job.job_id. It must be the job of the token. | |
| 483 | + | string job_id = 1; | |
| 484 | + | // Conclusion is how the job ended. Required: a runner reports | |
| 485 | + | // CI_CONCLUSION_SUCCESS, CI_CONCLUSION_FAILURE, CI_CONCLUSION_CANCELLED or | |
| 486 | + | // CI_CONCLUSION_TIMED_OUT; any other value is invalid_argument. Skipped is | |
| 487 | + | // decided by the server and never reported by a runner. | |
| 488 | + | CiConclusion conclusion = 2; | |
| 489 | + | // Outputs are the outputs of the job, evaluated by the runner. Names are 1 | |
| 490 | + | // to 255 characters among letters, digits, "_" and "-" and begin with a | |
| 491 | + | // letter or "_" and are case-insensitive: two names that differ only by case | |
| 492 | + | // are invalid_argument. Each value is at most 1 MiB, and all names and | |
| 493 | + | // values together at most 1 MiB (1,048,576 bytes); beyond that the whole call | |
| 494 | + | // is rejected with invalid_argument and the runner reports the failure of | |
| 495 | + | // the job without outputs, with a line in the log. | |
| 496 | + | map<string, string> outputs = 3; | |
| 497 | + | // RunnerShutdown is true when the runner ends the job because it was told to | |
| 498 | + | // stop (service stopped, signal). Only allowed with CI_CONCLUSION_CANCELLED. | |
| 499 | + | // The server then annotates the job with GitHub's message "The runner has | |
| 500 | + | // received a shutdown signal. This can happen when the runner service is | |
| 501 | + | // stopped, or a manually started runner is canceled." The conclusion | |
| 502 | + | // CANCELLED for this case is to be verified against a recording of GitHub. | |
| 503 | + | bool runner_shutdown = 4; | |
| 504 | + | // Steps are the final steps, with the same meaning as UpdateJobRequest.steps, | |
| 505 | + | // applied in the same atomic step as the conclusion. | |
| 506 | + | repeated StepUpdate steps = 5; | |
| 507 | + | } | |
| 508 | + | ||
| 509 | + | // CompleteJobResponse is the stored result of a job. | |
| 510 | + | message CompleteJobResponse { | |
| 511 | + | // Conclusion is the conclusion of the job as the server stored it. It is the | |
| 512 | + | // one of the request when applied is true. | |
| 513 | + | CiConclusion conclusion = 1; | |
| 514 | + | // Error is the error text stored with the job, as RunJob.error. Empty when | |
| 515 | + | // there is none. | |
| 516 | + | string error = 2; | |
| 517 | + | // Applied is true when this call ended the job, false when the job had | |
| 518 | + | // already ended (a retry, or the server ended it first) and nothing changed. | |
| 519 | + | bool applied = 3; | |
| 520 | + | } | |
| 521 | + | ||
| 522 | + | // JobEnded says that a job has ended. It is sent in WatchJob and attached, as | |
| 523 | + | // an error detail, to the failed_precondition errors that RunnerService returns | |
| 524 | + | // for a job that has ended. | |
| 525 | + | message JobEnded { | |
| 526 | + | // Conclusion is how the job ended. | |
| 527 | + | CiConclusion conclusion = 1; | |
| 528 | + | // Error is the error text stored with the job, as RunJob.error. Empty when | |
| 529 | + | // there is none. | |
| 530 | + | string error = 2; | |
| 531 | + | } | |
| 532 | + | ||
| 533 | + | // AppendLogRequest carries log lines of one step. | |
| 534 | + | message AppendLogRequest { | |
| 535 | + | // JobId is the Job.job_id. It must be the job of the token. | |
| 536 | + | string job_id = 1; | |
| 537 | + | // Step is the number of the step the lines belong to (see | |
| 538 | + | // UpdateJobRequest.steps), at least 1, and at least the step of the last | |
| 539 | + | // stored line. A step that UpdateJob has not announced yet is created by the | |
| 540 | + | // first lines. See the rules on AppendLog. | |
| 541 | + | int32 step = 2; | |
| 542 | + | // Offset is the number of the first line of the request in the log of the | |
| 543 | + | // job, counted from 0 across all steps. See the rules on AppendLog. | |
| 544 | + | int64 offset = 3; | |
| 545 | + | // Lines are the lines to append, in order: at most 1,000, at most 64 KiB of | |
| 546 | + | // text in total. | |
| 547 | + | repeated LogLine lines = 4; | |
| 548 | + | } | |
| 549 | + | ||
| 550 | + | // LogLine is one line of a job log. | |
| 551 | + | message LogLine { | |
| 552 | + | // Time is when the line was produced, by the clock of the runner. The server | |
| 553 | + | // keeps it with nanosecond precision (RFC 3339) and does not reorder lines. | |
| 554 | + | google.protobuf.Timestamp time = 1; | |
| 555 | + | // Text is the line without its line terminator, valid UTF-8 (the client | |
| 556 | + | // replaces invalid bytes with U+FFFD). It must not contain a line feed; a | |
| 557 | + | // carriage return is kept. It is the line as GitHub's raw log has it, | |
| 558 | + | // including "##[group]" and "##[endgroup]" markers and "##[error]" lines. | |
| 559 | + | string text = 2; | |
| 560 | + | // Continued is true when this line is the continuation of the line before | |
| 561 | + | // it, which was too long to send whole. A runner cuts a line of more than | |
| 562 | + | // 64 KiB into pieces at UTF-8 character boundaries, each piece of at most | |
| 563 | + | // 64 KiB, and sets continued on every piece but the first. Each piece is one | |
| 564 | + | // line for numbering and offsets; the server and the raw log join the | |
| 565 | + | // pieces back, so the original line is rebuilt exactly. The first line of a | |
| 566 | + | // job cannot be continued (invalid_argument) and a continued line is in | |
| 567 | + | // the same step as the line before it (failed_precondition otherwise). | |
| 568 | + | bool continued = 3; | |
| 569 | + | } | |
| 570 | + | ||
| 571 | + | // AppendLogResponse tells how much of the log the server holds. | |
| 572 | + | message AppendLogResponse { | |
| 573 | + | // NextOffset is the number of lines of the job log after the call, which is | |
| 574 | + | // the offset of the next request. | |
| 575 | + | int64 next_offset = 1; | |
| 576 | + | } | |
| 577 | + | ||
| 578 | + | // HeartbeatRequest names the job that is alive. | |
| 579 | + | message HeartbeatRequest { | |
| 580 | + | // JobId is the Job.job_id. It must be the job of the token. | |
| 581 | + | string job_id = 1; | |
| 582 | + | } | |
| 583 | + | ||
| 584 | + | // HeartbeatResponse is empty. | |
| 585 | + | message HeartbeatResponse {} | |
| 586 | + | ||
| 587 | + | // WatchJobRequest names the job to watch. | |
| 588 | + | message WatchJobRequest { | |
| 589 | + | // JobId is the Job.job_id. It must be the job of the token. | |
| 590 | + | string job_id = 1; | |
| 591 | + | } | |
| 592 | + | ||
| 593 | + | // WatchJobResponse is one message of the stream. | |
| 594 | + | message WatchJobResponse { | |
| 595 | + | // Msg is what the message carries. New kinds may be added: a client ignores | |
| 596 | + | // the ones it does not know. | |
| 597 | + | oneof msg { | |
| 598 | + | // Keepalive: nothing to do, the stream is alive. | |
| 599 | + | Keepalive keepalive = 1; | |
| 600 | + | // Cancel: the job must stop. | |
| 601 | + | CancelRequest cancel = 2; | |
| 602 | + | // Ended: the job has ended. The last message of a stream: a close without | |
| 603 | + | // it means the client reconnects. | |
| 604 | + | JobEnded ended = 3; | |
| 605 | + | } | |
| 606 | + | } | |
| 607 | + | ||
| 608 | + | // Keepalive has no fields. | |
| 609 | + | message Keepalive {} | |
| 610 | + | ||
| 611 | + | // CancelRequest asks the runner to stop a job. | |
| 612 | + | message CancelRequest { | |
| 613 | + | // Reason is why the job must stop. New reasons may be added; a runner that | |
| 614 | + | // does not know one cancels the job and reports CI_CONCLUSION_CANCELLED. | |
| 615 | + | CancelReason reason = 1; | |
| 616 | + | // Message is a short human-readable explanation, for the job log, for | |
| 617 | + | // example "Canceled by the owner". At most 1,024 characters. | |
| 618 | + | string message = 2; | |
| 619 | + | // RequestedAt is when the cancellation was requested, by the clock of the | |
| 620 | + | // server. | |
| 621 | + | google.protobuf.Timestamp requested_at = 3; | |
| 622 | + | } | |
M proto/ermite/server.proto +5 -1
| @@ -31,7 +31,11 @@ message GetVersionResponse { | |||
| 31 | 31 | // that this server implements, for example "repo.update" or | |
| 32 | 32 | // "events.resume". A client that needs a capability missing from this list | |
| 33 | 33 | // should warn instead of failing on an unimplemented RPC or ignored field. | |
| 34 | - | // Identifiers are lowercase, dot-separated and never reused. | |
| 34 | + | // Identifiers are lowercase, dot-separated and never reused. The CI | |
| 35 | + | // identifiers are "ci.runs" (RunService runs, jobs, logs, checks, and the | |
| 36 | + | // run_updated and job_updated events), "ci.runs.filters" (ListRuns honours | |
| 37 | + | // its filters) and "ci.runners" (RunnerService, and RunService.ListRunners | |
| 38 | + | // and RemoveRunner). | |
| 35 | 39 | repeated string features = 2; | |
| 36 | 40 | } | |
| 37 | 41 | ||