1// SPDX-License-Identifier: MIT
2
3syntax = "proto3";
4
5package ermite;
6
7import "ermite/runner.proto";
8import "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.
12message 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). It is the "github.workflow" of the run and the
31 // workflow name of its checks. See name for the name of the run itself.
32 string workflow_name = 6;
33 // Title is GitHub's display title, at most 256 characters: the evaluated
34 // "run-name" of the workflow when it has one, else for a push to a branch
35 // the first line of the message of the commit sha, and for a push of a tag
36 // the name of the workflow registered for workflow_path (the "name" of that
37 // file on the default branch, else workflow_name).
38 string title = 7;
39 // Event is the event that triggered the run, in GitHub's name: "push" (push
40 // to a branch or a tag, and merge of a merge request), and from servers with
41 // the matching trigger "pull_request", "workflow_dispatch", "schedule" and
42 // "workflow_run". New values may be added; clients show the ones they do not
43 // know as they are.
44 string event = 8;
45 // Ref is the full ref name that was pushed, for example "refs/heads/main"
46 // or "refs/tags/v1.0.0".
47 string ref = 9;
48 // Sha is the full id of the commit the run is for.
49 string sha = 10;
50 // Actor names who triggered the run: the label of the token that pushed, or
51 // "root", or "owner" (a web session, a merge of the web UI), as
52 // MergeRequest.author. It is informational.
53 string actor = 11;
54 // Status is where this attempt is: QUEUED until a job starts, IN_PROGRESS
55 // while jobs run or wait, COMPLETED when every job is over.
56 CiStatus status = 12;
57 // Conclusion is how this attempt ended, from its jobs' conclusions like
58 // GitHub: CANCELLED if it was cancelled, else FAILURE if a job failed or
59 // timed out, else SUCCESS (also when jobs were skipped). Unset until
60 // status is COMPLETED.
61 CiConclusion conclusion = 13;
62 // Error is set when the run failed without running a job because the
63 // workflow could not be used: an invalid workflow file (the run then has
64 // no jobs and conclusion FAILURE), as GitHub's "Invalid workflow file".
65 // It holds the errors with their positions, one per line, at most 8 KiB.
66 // Empty otherwise.
67 string error = 14;
68 // CreatedAt is when this attempt was created: for attempt 1 when the
69 // trigger was planned, for later ones when RerunRun was called.
70 google.protobuf.Timestamp created_at = 15;
71 // StartedAt is when the first job of this attempt was given to a runner.
72 // Unset until then.
73 google.protobuf.Timestamp started_at = 16;
74 // CompletedAt is when this attempt completed. Unset until then.
75 google.protobuf.Timestamp completed_at = 17;
76 // Version counts the changes of this run on the server: it grows by at least
77 // one at every change and never goes back, also across attempts. Events are
78 // not delivered in order, and a client that holds two copies of a run keeps
79 // the one with the higher version and drops the other.
80 int64 version = 18;
81 // Name is the name of the run, GitHub's "name" of a workflow run: the
82 // evaluated "run-name" of the workflow when it has one, else the same value
83 // as workflow_name. It is what GitHub lists as the run's name, whereas
84 // workflow_name stays the name of the workflow ("github.workflow") even when
85 // the workflow has a "run-name". A run stored before this field existed
86 // reads as workflow_name.
87 string name = 19;
88 // Trusted is true when the run may use secrets and a job token with write
89 // permissions: its actor is the owner, a "workflow_run" inherits it from the
90 // run that triggered it, and a re-run keeps it only if the original run had
91 // it and the caller of the re-run is the owner. It is false when the actor
92 // is a token limited to branches (see Job.trusted). It never goes from false
93 // to true. False for a run stored before this field existed and from servers
94 // without the feature "ci.secrets".
95 bool trusted = 20;
96}
97
98// RunJob is a job of a run as people see it: the state of one job instance
99// (one matrix combination is one job) in one attempt. It is not Job, which is
100// what a runner receives.
101message RunJob {
102 // Id is the Job.job_id. It is the same in every attempt.
103 string id = 1;
104 // RunId is the run the job belongs to.
105 int64 run_id = 2;
106 // Attempt is the attempt of the run in which this job executed. It is lower
107 // than the attempt of the run when the job was kept from an earlier attempt
108 // by a re-run of the failed jobs only; the log and steps are then those of
109 // that earlier attempt. Pass it to GetJob and GetJobLog.
110 int32 attempt = 3;
111 // Repo is the name of the repository.
112 string repo = 4;
113 // Key is the key of the job under "jobs:" in the workflow (the
114 // "github.job"). Matrix instances of one job share it.
115 string key = 5;
116 // Name is the display name of the job, evaluated, with the matrix suffix as
117 // GitHub names them, for example "build (linux, 1.27)". It is also the
118 // name of the job's check.
119 string name = 6;
120 // Status is where the job is. A job waits QUEUED for a runner and for the
121 // jobs it needs, and PENDING for its concurrency group.
122 CiStatus status = 7;
123 // Conclusion is how the job ended. Unset until status is COMPLETED.
124 CiConclusion conclusion = 8;
125 // Error explains a FAILURE, CANCELLED or TIMED_OUT that no step explains, in
126 // GitHub's words where it has them: the runner was lost ("The self-hosted
127 // runner: <name> lost communication with the server..."), it received a
128 // shutdown signal, no runner took the job within 24 hours, the log limit
129 // was reached, the workflow uses a feature that is not supported yet
130 // ("not supported yet: <feature>"). At most 4 KiB. Empty otherwise.
131 string error = 9;
132 // Labels are the runs-on labels of the job, evaluated. Empty while the job
133 // is not planned yet.
134 repeated string labels = 10;
135 // Needs are the keys of the jobs this job needs, for drawing the graph.
136 repeated string needs = 11;
137 // RunnerId is the id of the runner that executed or is executing the job.
138 // Empty while queued, and when the runner has since been removed (runner_name
139 // and isolation are kept).
140 string runner_id = 12;
141 // RunnerName is the name of that runner. Empty while queued.
142 string runner_name = 13;
143 // Isolation is how that runner isolated the job. UNSPECIFIED while queued.
144 RunnerIsolation isolation = 14;
145 // Steps are the steps reported so far, ordered by number, including the
146 // implicit "Set up job" and "Complete job". Empty while queued. Always
147 // set, including in JobUpdated events.
148 repeated Step steps = 15;
149 // CreatedAt is when the job was created (planned).
150 google.protobuf.Timestamp created_at = 16;
151 // StartedAt is when the job was given to a runner. Unset until then.
152 google.protobuf.Timestamp started_at = 17;
153 // CompletedAt is when the job completed. Unset until then.
154 google.protobuf.Timestamp completed_at = 18;
155 // Version counts the changes of this job on the server (status, conclusion,
156 // runner, steps, with any attempt): it grows by at least one at every change
157 // and never goes back. A client that holds two copies of a job keeps the
158 // one with the higher version and drops the other, as for Run.version.
159 int64 version = 19;
160 // ConcurrencyGroup is the evaluated concurrency group of the job (its
161 // "concurrency:", or the one of its workflow), compared without regard to
162 // case within the repository. Empty when the job has none and from servers
163 // without the feature "ci.concurrency". The job is PENDING while another job
164 // of the group runs or a newer one is waiting.
165 string concurrency_group = 20;
166}
167
168// Step is one step of a job, with where its lines are in the job log.
169message Step {
170 // Number is the 1-based number of the step in the job, the one the runner
171 // uses in UpdateJob and AppendLog.
172 int32 number = 1;
173 // Name is the display name of the step.
174 string name = 2;
175 // State is where the step is.
176 StepState state = 3;
177 // Conclusion is how the step ended. Unset until state is COMPLETED.
178 CiConclusion conclusion = 4;
179 // StartedAt is when the step started. Unset while PENDING.
180 google.protobuf.Timestamp started_at = 5;
181 // CompletedAt is when the step ended. Unset until COMPLETED.
182 google.protobuf.Timestamp completed_at = 6;
183 // LogStart is the number of the first line of the step in the job log (the
184 // offset of GetJobLogRequest and AppendLogRequest), counted from 0.
185 int64 log_start = 7;
186 // LogEnd is the number of the line after the last one of the step. For an
187 // IN_PROGRESS step it is the number of lines held at the time of the
188 // call and grows; for a step without a line it equals log_start.
189 int64 log_end = 8;
190 // Outcome is how the step ended before continue-on-error was applied, as
191 // StepUpdate.outcome: it differs from conclusion only for a failed step with
192 // continue-on-error. Unset until state is COMPLETED, and for a step stored
193 // by a server or runner before this field existed (read it as conclusion).
194 CiConclusion outcome = 9;
195}
196
197// Check is the result of one job on one commit, the unit shown next to a
198// commit or a merge request and counted by the merge rules. There is one per
199// job instance, named like GitHub's checks.
200message Check {
201 // Id identifies the check. It is opaque and stable across attempts.
202 string id = 1;
203 // Repo is the name of the repository.
204 string repo = 2;
205 // Sha is the full id of the commit.
206 string sha = 3;
207 // Name is the name of the check: the RunJob.name of the job.
208 string name = 4;
209 // Status is where the check is.
210 CiStatus status = 5;
211 // Conclusion is how the check ended. Unset until status is COMPLETED. The
212 // value "stale" of GitHub is never used.
213 CiConclusion conclusion = 6;
214 // RunId is the run of the job.
215 int64 run_id = 7;
216 // JobId is the RunJob.id of the job, to open its page and log.
217 string job_id = 8;
218 // Attempt is the attempt the check describes: the latest attempt of the run.
219 int32 attempt = 9;
220 // WorkflowName is the Run.workflow_name of the run.
221 string workflow_name = 10;
222 // StartedAt is when the job was given to a runner. Unset while queued.
223 google.protobuf.Timestamp started_at = 11;
224 // CompletedAt is when the job completed. Unset until then.
225 google.protobuf.Timestamp completed_at = 12;
226}
227
228// Runner is a registered CI runner. It never contains the runner token nor its
229// hash.
230message Runner {
231 // Id identifies the runner in RemoveRunner. It is not a secret.
232 string id = 1;
233 // Name is the unique name chosen at registration.
234 string name = 2;
235 // Labels are all the labels the runner can match: the ones chosen at
236 // registration plus the implicit ones ("self-hosted", the os and the arch),
237 // lowercase, sorted.
238 repeated string labels = 3;
239 // Isolation is how the runner isolates jobs.
240 RunnerIsolation isolation = 4;
241 // Version is the version of the runner software.
242 string version = 5;
243 // Arch is "x64" or "arm64".
244 string arch = 6;
245 // Os is "linux".
246 string os = 7;
247 // RegisteredAt is when the runner was registered.
248 google.protobuf.Timestamp registered_at = 8;
249 // LastSeen is when the server last heard from the runner: a FetchJob poll or
250 // a heartbeat of one of its jobs. Unset if never. It may lag behind the real
251 // time by a short delay. A runner not seen for more than about 2 minutes is
252 // offline.
253 google.protobuf.Timestamp last_seen = 9;
254 // Busy is true while the runner has a job in progress.
255 bool busy = 10;
256 // Online is true when the server heard from the runner (see last_seen) less
257 // than 2 minutes ago, by the server's own clock at the time of the answer.
258 // Clients show this instead of comparing last_seen with their clock, which
259 // may be minutes off. A server that predates the field leaves it false:
260 // clients that need to tell can fall back to last_seen.
261 bool online = 11;
262}
263
264// RunService reads and controls CI runs, like `gh run` does on GitHub. It is for
265// owners and their tools; runners use RunnerService.
266//
267// Runs, jobs, checks, logs, annotations and summaries belong to a repository,
268// and reading them needs the same access as reading it: nothing for a public
269// repository, the repo:read scope for a private one. A repository that does not exist or that
270// the caller cannot read gives not_found; so does a run or a job that belongs
271// to another repository than the one named (ids are global but are always
272// checked against the repository). Cancelling and re-running need the ci:write
273// scope on the repository (a token restricted to other repositories gets
274// permission_denied). The runner RPCs (ListRunners, RemoveRunner) are not about
275// a repository and need the runner:register scope on a token that is not
276// restricted to repositories, or the root token. A caller without the needed
277// scope gets permission_denied.
278//
279// Page sizes and page tokens work as in the other services: page_size 0 is the
280// server default, larger values are lowered to the server maximum, and a
281// page_token is the next_page_token of a previous response for the same
282// request (other fields must be unchanged).
283//
284// Servers that implement the runs side (every RPC but ListRunners,
285// RemoveRunner, ListAnnotations, GetStepSummaries and DispatchWorkflow) list
286// "ci.runs" in
287// GetVersionResponse.features; those that
288// implement the runners side list "ci.runners", as RunnerService does. A server
289// that honours the filters of ListRunsRequest also lists "ci.runs.filters".
290// ListAnnotations needs "ci.annotations" and GetStepSummaries "ci.summaries",
291// which are also the features of the runner side of each. DispatchWorkflow
292// needs "ci.dispatch". RunJob.concurrency_group and CI_STATUS_PENDING belong
293// to "ci.concurrency", Run.trusted to "ci.secrets".
294service RunService {
295 // ListRuns lists the runs of a repository, highest id (newest) first. Each
296 // run is described by its latest attempt. The filters narrow the result; a
297 // server without the feature "ci.runs.filters" ignores them and returns
298 // every run, so a client that needs them checks the feature. Fails with
299 // invalid_argument if a filter is malformed.
300 rpc ListRuns(ListRunsRequest) returns (ListRunsResponse);
301 // GetRun returns a run with its jobs and their steps, for the latest attempt
302 // or for the one asked. Fails with not_found if the run or the attempt does
303 // not exist.
304 rpc GetRun(GetRunRequest) returns (GetRunResponse);
305 // GetJob returns one job with its steps. Fails with not_found if the job
306 // or the attempt does not exist.
307 rpc GetJob(GetJobRequest) returns (GetJobResponse);
308 // ListAnnotations lists the annotations of a run attempt, optionally of one
309 // job, ordered by job (as in GetRun), step number, then the order in which
310 // the step produced them. For each job it gives the annotations of the
311 // attempt in which that job executed (RunJob.attempt), which is lower than
312 // the attempt of the run for a job kept by a re-run of failed jobs only. Needs the same access as GetRun. Returns at most
313 // 1,000 annotations (truncated tells). A run without annotations gives an
314 // empty list. Only servers with the feature "ci.annotations" implement it
315 // (unimplemented otherwise). Fails with not_found if the run, the attempt or
316 // the job does not exist, or if the job is not a job of the run.
317 rpc ListAnnotations(ListAnnotationsRequest) returns (ListAnnotationsResponse);
318 // GetStepSummaries returns the job summaries (the Markdown written to
319 // GITHUB_STEP_SUMMARY) of the steps of a job that have one, ordered by step
320 // number. Like GitHub, it returns at most 20 summaries per job: the first 20
321 // steps that have one, in step order; truncated says there are more. Needs
322 // the same access as GetJob. Only servers with the feature
323 // "ci.summaries" implement it (unimplemented otherwise). A job without
324 // summaries gives an empty list. Fails with not_found if the job or the
325 // attempt does not exist.
326 rpc GetStepSummaries(GetStepSummariesRequest) returns (GetStepSummariesResponse);
327 // GetJobLog streams the lines of the log of a job, from a line number. The
328 // server sends them in order in messages of at most 1,000 lines and 64 KiB of
329 // text each.
330 //
331 // Without follow, the stream ends after the last line stored when the call
332 // was made. With follow, it goes on as lines arrive, with at most 1 second of
333 // delay after the runner's AppendLog, and ends without error once the job has
334 // completed and all its lines were sent; on a completed job follow changes
335 // nothing. A client that loses the stream calls again with the offset after
336 // the last line it received. The client may cancel at any time.
337 //
338 // Fails with not_found if the job, the attempt or its log does not exist (the
339 // log is removed by the retention sweep, and a queued job has none: with
340 // follow, the call waits for the first line instead), with out_of_range if
341 // offset is beyond the end of the log of a job without follow, and with
342 // resource_exhausted when there are too many concurrent log streams, in
343 // total or from one client. Like Watch, a stream ends with unauthenticated
344 // when the token was revoked or expired.
345 rpc GetJobLog(GetJobLogRequest) returns (stream GetJobLogResponse);
346 // CancelRun asks to cancel the latest attempt of a run. Needs the ci:write
347 // scope. Jobs that have not started are cancelled at once; jobs in progress
348 // get a CANCEL_REASON_USER request through WatchJob, and the run completes
349 // when they have ended, so the returned run may still be IN_PROGRESS.
350 // Cancelling a run that already has a cancellation requested succeeds and
351 // changes nothing. Fails with failed_precondition if the run has completed.
352 rpc CancelRun(CancelRunRequest) returns (CancelRunResponse);
353 // RerunRun starts a new attempt of a completed run: same run id and number,
354 // attempt + 1, same commit and same workflow file as at the original run (the
355 // file of the repository is not read again). Needs the ci:write scope. Fails
356 // with failed_precondition if the latest attempt has not completed, or if
357 // failed_only is set and no job failed. The new attempt is returned QUEUED.
358 rpc RerunRun(RerunRunRequest) returns (RerunRunResponse);
359 // DispatchWorkflow starts a run of a workflow file by hand, like `gh
360 // workflow run` and GitHub's "workflow_dispatch" event. Needs the ci:write
361 // scope on the repository. The workflow is read at ref and must have
362 // "workflow_dispatch" among its events. The run has event
363 // "workflow_dispatch", ref and the commit ref points to, and the caller as
364 // actor; it is trusted when the caller is the owner and not trusted when the
365 // caller is a token limited to branches. The run is returned QUEUED, before
366 // any job has been given to a runner. Only servers with the feature
367 // "ci.dispatch" implement it (unimplemented otherwise). Fails with
368 // not_found if the repository, the workflow file or ref does not exist,
369 // with failed_precondition if the workflow does not declare
370 // "workflow_dispatch", and with invalid_argument if an input is unknown, is
371 // missing while required without default, or has a value of the wrong type
372 // or outside its choices, or if the workflow file is not valid.
373 rpc DispatchWorkflow(DispatchWorkflowRequest) returns (DispatchWorkflowResponse);
374 // ListChecks lists the checks of a commit: for each job of each run on that
375 // sha, the one of the latest attempt, ordered by creation time then name.
376 // A commit without a run has no check: the list is empty, which is not an
377 // error, and the server does not verify that the commit exists. Returns at
378 // most 1,000 checks (truncated tells).
379 rpc ListChecks(ListChecksRequest) returns (ListChecksResponse);
380 // ListRunners lists the registered runners, ordered by name. Needs the
381 // runner:register scope.
382 rpc ListRunners(ListRunnersRequest) returns (ListRunnersResponse);
383 // RemoveRunner removes a runner: its runner token stops working at once (a
384 // FetchJob in progress ends with unauthenticated) and it no longer gets
385 // jobs. A job it is running is not affected: it ends normally, or fails as
386 // a lost runner without heartbeats. Needs the runner:register scope. Fails
387 // with not_found if the id is unknown.
388 rpc RemoveRunner(RemoveRunnerRequest) returns (RemoveRunnerResponse);
389}
390
391// ListRunsRequest selects a page of runs.
392message ListRunsRequest {
393 // Repo is the repository name.
394 string repo = 1;
395 // PageSize is the maximum number of runs to return.
396 int32 page_size = 2;
397 // PageToken is the next_page_token of a previous response. Empty for the
398 // first page.
399 string page_token = 3;
400 // Workflow restricts the result to one workflow file: its path
401 // (".github/workflows/ci.yml") or its file name ("ci.yml"). Empty means
402 // every workflow. Ignored by servers without "ci.runs.filters".
403 string workflow = 4;
404 // Branch restricts the result to the runs whose ref is this branch, by
405 // short name ("main"). Empty means every ref. Ignored by servers without
406 // "ci.runs.filters".
407 string branch = 5;
408 // Status restricts the result to the runs whose latest attempt has this
409 // status. CI_STATUS_UNSPECIFIED means every status. Ignored by servers
410 // without "ci.runs.filters".
411 CiStatus status = 6;
412}
413
414// ListRunsResponse is one page of runs.
415message ListRunsResponse {
416 // Runs are the runs of this page, highest id first, without jobs.
417 repeated Run runs = 1;
418 // NextPageToken is passed as page_token to get the next page. Empty when
419 // there is no next page.
420 string next_page_token = 2;
421}
422
423// GetRunRequest selects a run.
424message GetRunRequest {
425 // Repo is the repository name.
426 string repo = 1;
427 // RunId is the Run.id.
428 int64 run_id = 2;
429 // Attempt is the attempt to read. 0 means the latest.
430 int32 attempt = 3;
431}
432
433// GetRunResponse holds a run with its jobs.
434message GetRunResponse {
435 // Run is the run, as of the attempt asked.
436 Run run = 1;
437 // Jobs are the jobs of that attempt, with their steps, in the order of the
438 // workflow file (matrix instances in the order of the matrix). Jobs kept from
439 // an earlier attempt by a re-run of failed jobs are included, with their own
440 // RunJob.attempt. Empty for a run that failed on an invalid workflow file.
441 repeated RunJob jobs = 2;
442 // LatestAttempt is the latest attempt of the run, to offer the other ones.
443 int32 latest_attempt = 3;
444}
445
446// GetJobRequest selects a job.
447message GetJobRequest {
448 // Repo is the repository name.
449 string repo = 1;
450 // JobId is the RunJob.id.
451 string job_id = 2;
452 // Attempt is the RunJob.attempt to read. 0 means the latest.
453 int32 attempt = 3;
454}
455
456// GetJobResponse holds a job.
457message GetJobResponse {
458 // Job is the job with its steps.
459 RunJob job = 1;
460}
461
462// ListAnnotationsRequest selects the annotations of a run.
463message ListAnnotationsRequest {
464 // Repo is the repository name.
465 string repo = 1;
466 // RunId is the Run.id.
467 int64 run_id = 2;
468 // Attempt is the attempt to read. 0 means the latest, and then each job
469 // contributes the annotations of its own RunJob.attempt (not necessarily the
470 // latest attempt of the run, see ListAnnotations).
471 int32 attempt = 3;
472 // JobId restricts the result to one job (RunJob.id). Empty means every job
473 // of the run.
474 string job_id = 4;
475}
476
477// ListAnnotationsResponse holds the annotations of a run.
478message ListAnnotationsResponse {
479 // Annotations are the annotations, at most 1,000.
480 repeated JobAnnotation annotations = 1;
481 // Truncated is true when there are more annotations than annotations holds.
482 bool truncated = 2;
483}
484
485// JobAnnotation is an annotation with the job it belongs to.
486message JobAnnotation {
487 // JobId is the RunJob.id of the job.
488 string job_id = 1;
489 // Annotation is the annotation as the runner sent it, after the server
490 // checked it. Its step_number is the step of the job.
491 Annotation annotation = 2;
492}
493
494// GetStepSummariesRequest selects a job.
495message GetStepSummariesRequest {
496 // Repo is the repository name.
497 string repo = 1;
498 // JobId is the RunJob.id.
499 string job_id = 2;
500 // Attempt is the RunJob.attempt to read. 0 means the latest.
501 int32 attempt = 3;
502}
503
504// GetStepSummariesResponse holds the summaries of a job.
505message GetStepSummariesResponse {
506 // Summaries are the summaries of the steps that have one, ordered by step
507 // number: at most 20, the first 20 steps having one.
508 repeated StepSummary summaries = 1;
509 // Truncated is true when the job has more than 20 steps with a summary and
510 // summaries holds only the first 20.
511 bool truncated = 2;
512}
513
514// StepSummary is the job summary of one step.
515message StepSummary {
516 // StepNumber is the number of the step (see Step.number).
517 int32 step_number = 1;
518 // Markdown is the summary as uploaded, at most 1 MiB. Clients render it
519 // safely: it is untrusted content (raw HTML and script URLs must not run).
520 string markdown = 2;
521}
522
523// GetJobLogRequest selects the lines to stream.
524message GetJobLogRequest {
525 // Repo is the repository name.
526 string repo = 1;
527 // JobId is the RunJob.id.
528 string job_id = 2;
529 // Attempt is the RunJob.attempt whose log to read. 0 means the latest.
530 int32 attempt = 3;
531 // Offset is the number of the first line to send, counted from 0 across all
532 // steps (see Step.log_start). Negative is invalid_argument.
533 int64 offset = 4;
534 // Follow keeps the stream open while the job runs. See GetJobLog.
535 bool follow = 5;
536}
537
538// GetJobLogResponse is one message of the log stream.
539message GetJobLogResponse {
540 // Offset is the number of the first line of lines.
541 int64 offset = 1;
542 // Lines are consecutive lines of the log, at most 1,000, at most 64 KiB of
543 // text in total. Never empty.
544 repeated JobLogLine lines = 2;
545}
546
547// JobLogLine is one line of a job log, as the runner sent it.
548message JobLogLine {
549 // Step is the number of the step the line belongs to.
550 int32 step = 1;
551 // Time is when the runner produced the line, with nanosecond precision.
552 google.protobuf.Timestamp time = 2;
553 // Text is the line without its terminator, as in LogLine.text, including the
554 // "##[group]" and "##[endgroup]" markers. Clients show it escaped.
555 string text = 3;
556 // Continued is true when the line continues the line before it, which was
557 // too long for the runner to send whole (see LogLine.continued). Pieces keep
558 // their own line numbers, so offsets are the same as the runner's; a client
559 // that shows lines joins a continued line to the previous one. The raw log
560 // file already has them joined.
561 bool continued = 4;
562}
563
564// CancelRunRequest names the run to cancel.
565message CancelRunRequest {
566 // Repo is the repository name.
567 string repo = 1;
568 // RunId is the Run.id.
569 int64 run_id = 2;
570}
571
572// CancelRunResponse holds the run after the request.
573message CancelRunResponse {
574 // Run is the latest attempt of the run.
575 Run run = 1;
576}
577
578// RerunRunRequest names the run to run again.
579message RerunRunRequest {
580 // Repo is the repository name.
581 string repo = 1;
582 // RunId is the Run.id.
583 int64 run_id = 2;
584 // FailedOnly runs again only the jobs of the latest attempt that did not
585 // succeed (conclusion FAILURE, CANCELLED, TIMED_OUT or ACTION_REQUIRED) and
586 // the jobs that need them, directly or not, even if they were skipped. The
587 // other jobs keep their result, steps and log from the earlier attempt. When
588 // false, every job runs again.
589 bool failed_only = 3;
590}
591
592// RerunRunResponse holds the new attempt.
593message RerunRunResponse {
594 // Run is the run as of the new attempt, QUEUED.
595 Run run = 1;
596}
597
598// DispatchWorkflowRequest names the workflow to run and its inputs.
599message DispatchWorkflowRequest {
600 // Repo is the repository name.
601 string repo = 1;
602 // WorkflowPath is the path of the workflow file at ref, for example
603 // ".github/workflows/ci.yml", or its file name ("ci.yml").
604 string workflow_path = 2;
605 // Ref is the branch or tag to run on, by short name ("main") or full name
606 // ("refs/heads/main"). Empty means the default branch of the repository.
607 string ref = 3;
608 // Inputs are the values of the "inputs" of the workflow's
609 // "workflow_dispatch" by name, as strings: a boolean is "true" or "false", a
610 // number its decimal text. An input left out takes its default.
611 map<string, string> inputs = 4;
612}
613
614// DispatchWorkflowResponse holds the new run.
615message DispatchWorkflowResponse {
616 // Run is the new run, QUEUED, attempt 1.
617 Run run = 1;
618}
619
620// ListChecksRequest names the commit.
621message ListChecksRequest {
622 // Repo is the repository name.
623 string repo = 1;
624 // Sha is the full commit id (40 lowercase hexadecimal characters for SHA-1).
625 // Abbreviations and names are invalid_argument.
626 string sha = 2;
627}
628
629// ListChecksResponse holds the checks of a commit.
630message ListChecksResponse {
631 // Checks are the checks of the commit, one per job of the latest attempt of
632 // each run, ordered by creation time then name.
633 repeated Check checks = 1;
634 // Truncated is true when the commit has more checks than checks holds.
635 bool truncated = 2;
636}
637
638// ListRunnersRequest selects a page of runners.
639message ListRunnersRequest {
640 // PageSize is the maximum number of runners to return.
641 int32 page_size = 1;
642 // PageToken is the next_page_token of a previous response. Empty for the
643 // first page.
644 string page_token = 2;
645}
646
647// ListRunnersResponse is one page of runners.
648message ListRunnersResponse {
649 // Runners are the runners of this page, ordered by name.
650 repeated Runner runners = 1;
651 // NextPageToken is passed as page_token to get the next page. Empty when
652 // there is no next page.
653 string next_page_token = 2;
654}
655
656// RemoveRunnerRequest names the runner to remove.
657message RemoveRunnerRequest {
658 // RunnerId is the Runner.id.
659 string runner_id = 1;
660}
661
662// RemoveRunnerResponse is empty.
663message RemoveRunnerResponse {}