Runner.online and FetchJobRequest.version (#13)
- commit
- faa62b9acaf01e19839922c08ccbd49f0fec2b63
- author
- brice · · 2026-10-16 07:37 UTC
- committer
- bnema · · 2026-10-16 07:37 UTC
- parent
- 9d26b26
- signature
- SSH Unverified
SHA256:VOCA5lYARHcbKDZ7GhTV45VmcjWnJ6ZQIBazj17LivAThe key is unknown
4 files · +46 -6
M gen/ermite/run.pb.go +17 -3
| @@ -829,7 +829,13 @@ type Runner struct { | |||
| 829 | 829 | // offline. | |
| 830 | 830 | LastSeen *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"` | |
| 831 | 831 | // Busy is true while the runner has a job in progress. | |
| 832 | - | Busy bool `protobuf:"varint,10,opt,name=busy,proto3" json:"busy,omitempty"` | |
| 832 | + | Busy bool `protobuf:"varint,10,opt,name=busy,proto3" json:"busy,omitempty"` | |
| 833 | + | // Online is true when the server heard from the runner (see last_seen) less | |
| 834 | + | // than 2 minutes ago, by the server's own clock at the time of the answer. | |
| 835 | + | // Clients show this instead of comparing last_seen with their clock, which | |
| 836 | + | // may be minutes off. A server that predates the field leaves it false: | |
| 837 | + | // clients that need to tell can fall back to last_seen. | |
| 838 | + | Online bool `protobuf:"varint,11,opt,name=online,proto3" json:"online,omitempty"` | |
| 833 | 839 | unknownFields protoimpl.UnknownFields | |
| 834 | 840 | sizeCache protoimpl.SizeCache | |
| 835 | 841 | } | |
| @@ -934,6 +940,13 @@ func (x *Runner) GetBusy() bool { | |||
| 934 | 940 | return false | |
| 935 | 941 | } | |
| 936 | 942 | ||
| 943 | + | func (x *Runner) GetOnline() bool { | |
| 944 | + | if x != nil { | |
| 945 | + | return x.Online | |
| 946 | + | } | |
| 947 | + | return false | |
| 948 | + | } | |
| 949 | + | ||
| 937 | 950 | // ListRunsRequest selects a page of runs. | |
| 938 | 951 | type ListRunsRequest struct { | |
| 939 | 952 | state protoimpl.MessageState `protogen:"open.v1"` | |
| @@ -2642,7 +2655,7 @@ const file_ermite_run_proto_rawDesc = "" + | |||
| 2642 | 2655 | " \x01(\tR\fworkflowName\x129\n" + | |
| 2643 | 2656 | "\n" + | |
| 2644 | 2657 | "started_at\x18\v \x01(\v2\x1a.google.protobuf.TimestampR\tstartedAt\x12=\n" + | |
| 2645 | - | "\fcompleted_at\x18\f \x01(\v2\x1a.google.protobuf.TimestampR\vcompletedAt\"\xc7\x02\n" + | |
| 2658 | + | "\fcompleted_at\x18\f \x01(\v2\x1a.google.protobuf.TimestampR\vcompletedAt\"\xdf\x02\n" + | |
| 2646 | 2659 | "\x06Runner\x12\x0e\n" + | |
| 2647 | 2660 | "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + | |
| 2648 | 2661 | "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + | |
| @@ -2654,7 +2667,8 @@ const file_ermite_run_proto_rawDesc = "" + | |||
| 2654 | 2667 | "\rregistered_at\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\fregisteredAt\x127\n" + | |
| 2655 | 2668 | "\tlast_seen\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\blastSeen\x12\x12\n" + | |
| 2656 | 2669 | "\x04busy\x18\n" + | |
| 2657 | - | " \x01(\bR\x04busy\"\xbf\x01\n" + | |
| 2670 | + | " \x01(\bR\x04busy\x12\x16\n" + | |
| 2671 | + | "\x06online\x18\v \x01(\bR\x06online\"\xbf\x01\n" + | |
| 2658 | 2672 | "\x0fListRunsRequest\x12\x12\n" + | |
| 2659 | 2673 | "\x04repo\x18\x01 \x01(\tR\x04repo\x12\x1b\n" + | |
| 2660 | 2674 | "\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" + | |
| @@ -829,7 +829,13 @@ type Runner struct { | |||||
| 829 | // offline. | 829 | // offline. | ||
| 830 | LastSeen *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"` | 830 | LastSeen *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"` | ||
| 831 | // Busy is true while the runner has a job in progress. | 831 | // Busy is true while the runner has a job in progress. | ||
| 832 | - | Busy bool `protobuf:"varint,10,opt,name=busy,proto3" json:"busy,omitempty"` | 832 | + | Busy bool `protobuf:"varint,10,opt,name=busy,proto3" json:"busy,omitempty"` |
| 833 | + | // Online is true when the server heard from the runner (see last_seen) less | |||
| 834 | + | // than 2 minutes ago, by the server's own clock at the time of the answer. | |||
| 835 | + | // Clients show this instead of comparing last_seen with their clock, which | |||
| 836 | + | // may be minutes off. A server that predates the field leaves it false: | |||
| 837 | + | // clients that need to tell can fall back to last_seen. | |||
| 838 | + | Online bool `protobuf:"varint,11,opt,name=online,proto3" json:"online,omitempty"` | |||
| 833 | unknownFields protoimpl.UnknownFields | 839 | unknownFields protoimpl.UnknownFields | ||
| 834 | sizeCache protoimpl.SizeCache | 840 | sizeCache protoimpl.SizeCache | ||
| 835 | } | 841 | } | ||
| @@ -934,6 +940,13 @@ func (x *Runner) GetBusy() bool { | |||||
| 934 | return false | 940 | return false | ||
| 935 | } | 941 | } | ||
| 936 | 942 | ||||
| 943 | + | func (x *Runner) GetOnline() bool { | |||
| 944 | + | if x != nil { | |||
| 945 | + | return x.Online | |||
| 946 | + | } | |||
| 947 | + | return false | |||
| 948 | + | } | |||
| 949 | + | ||||
| 937 | // ListRunsRequest selects a page of runs. | 950 | // ListRunsRequest selects a page of runs. | ||
| 938 | type ListRunsRequest struct { | 951 | type ListRunsRequest struct { | ||
| 939 | state protoimpl.MessageState `protogen:"open.v1"` | 952 | state protoimpl.MessageState `protogen:"open.v1"` | ||
| @@ -2642,7 +2655,7 @@ const file_ermite_run_proto_rawDesc = "" + | |||||
| 2642 | " \x01(\tR\fworkflowName\x129\n" + | 2655 | " \x01(\tR\fworkflowName\x129\n" + | ||
| 2643 | "\n" + | 2656 | "\n" + | ||
| 2644 | "started_at\x18\v \x01(\v2\x1a.google.protobuf.TimestampR\tstartedAt\x12=\n" + | 2657 | "started_at\x18\v \x01(\v2\x1a.google.protobuf.TimestampR\tstartedAt\x12=\n" + | ||
| 2645 | - | "\fcompleted_at\x18\f \x01(\v2\x1a.google.protobuf.TimestampR\vcompletedAt\"\xc7\x02\n" + | 2658 | + | "\fcompleted_at\x18\f \x01(\v2\x1a.google.protobuf.TimestampR\vcompletedAt\"\xdf\x02\n" + |
| 2646 | "\x06Runner\x12\x0e\n" + | 2659 | "\x06Runner\x12\x0e\n" + | ||
| 2647 | "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + | 2660 | "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + | ||
| 2648 | "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + | 2661 | "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + | ||
| @@ -2654,7 +2667,8 @@ const file_ermite_run_proto_rawDesc = "" + | |||||
| 2654 | "\rregistered_at\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\fregisteredAt\x127\n" + | 2667 | "\rregistered_at\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\fregisteredAt\x127\n" + | ||
| 2655 | "\tlast_seen\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\blastSeen\x12\x12\n" + | 2668 | "\tlast_seen\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\blastSeen\x12\x12\n" + | ||
| 2656 | "\x04busy\x18\n" + | 2669 | "\x04busy\x18\n" + | ||
| 2657 | - | " \x01(\bR\x04busy\"\xbf\x01\n" + | 2670 | + | " \x01(\bR\x04busy\x12\x16\n" + |
| 2671 | + | "\x06online\x18\v \x01(\bR\x06online\"\xbf\x01\n" + | |||
| 2658 | "\x0fListRunsRequest\x12\x12\n" + | 2672 | "\x0fListRunsRequest\x12\x12\n" + | ||
| 2659 | "\x04repo\x18\x01 \x01(\tR\x04repo\x12\x1b\n" + | 2673 | "\x04repo\x18\x01 \x01(\tR\x04repo\x12\x1b\n" + | ||
| 2660 | "\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" + | 2674 | "\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" + | ||
M gen/ermite/runner.pb.go +17 -3 generated file: collapsed
M proto/ermite/run.proto +6 -0
| @@ -253,6 +253,12 @@ message Runner { | |||
| 253 | 253 | google.protobuf.Timestamp last_seen = 9; | |
| 254 | 254 | // Busy is true while the runner has a job in progress. | |
| 255 | 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; | |
| 256 | 262 | } | |
| 257 | 263 | ||
| 258 | 264 | // RunService reads and controls CI runs, like `gh run` does on GitHub. It is for | |
| @@ -253,6 +253,12 @@ message Runner { | |||||
| 253 | google.protobuf.Timestamp last_seen = 9; | 253 | google.protobuf.Timestamp last_seen = 9; | ||
| 254 | // Busy is true while the runner has a job in progress. | 254 | // Busy is true while the runner has a job in progress. | ||
| 255 | bool busy = 10; | 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; | |||
| 256 | } | 262 | } | ||
| 257 | 263 | ||||
| 258 | // RunService reads and controls CI runs, like `gh run` does on GitHub. It is for | 264 | // RunService reads and controls CI runs, like `gh run` does on GitHub. It is for | ||
M proto/ermite/runner.proto +6 -0
| @@ -463,6 +463,12 @@ message FetchJobRequest { | |||
| 463 | 463 | // (see FetchJob). A new poll uses a new id. Empty means no retry protection: | |
| 464 | 464 | // a lost assignment is then recovered by the acknowledgement timeout alone. | |
| 465 | 465 | string poll_id = 2; | |
| 466 | + | // Version is the release of the running runner software, for example | |
| 467 | + | // "v0.1.0", or "devel", at most 64 characters. Optional: the server stores it | |
| 468 | + | // as the runner's version (Runner.version in ListRunners), replacing the one | |
| 469 | + | // given at registration, so that the list shows what runs now. Empty, from | |
| 470 | + | // an older runner, leaves the stored version unchanged. | |
| 471 | + | string version = 3; | |
| 466 | 472 | } | |
| 467 | 473 | ||
| 468 | 474 | // FetchJobResponse holds the job given to the runner, if any. | |
| @@ -463,6 +463,12 @@ message FetchJobRequest { | |||||
| 463 | // (see FetchJob). A new poll uses a new id. Empty means no retry protection: | 463 | // (see FetchJob). A new poll uses a new id. Empty means no retry protection: | ||
| 464 | // a lost assignment is then recovered by the acknowledgement timeout alone. | 464 | // a lost assignment is then recovered by the acknowledgement timeout alone. | ||
| 465 | string poll_id = 2; | 465 | string poll_id = 2; | ||
| 466 | + | // Version is the release of the running runner software, for example | |||
| 467 | + | // "v0.1.0", or "devel", at most 64 characters. Optional: the server stores it | |||
| 468 | + | // as the runner's version (Runner.version in ListRunners), replacing the one | |||
| 469 | + | // given at registration, so that the list shows what runs now. Empty, from | |||
| 470 | + | // an older runner, leaves the stored version unchanged. | |||
| 471 | + | string version = 3; | |||
| 466 | } | 472 | } | ||
| 467 | 473 | ||||
| 468 | // FetchJobResponse holds the job given to the runner, if any. | 474 | // FetchJobResponse holds the job given to the runner, if any. | ||