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 generated file: collapsed
M gen/ermite/runner.pb.go +17 -3
| @@ -653,7 +653,13 @@ type FetchJobRequest struct { | |||
| 653 | 653 | // same poll_id, and gets the assignment the first call made, if it made one | |
| 654 | 654 | // (see FetchJob). A new poll uses a new id. Empty means no retry protection: | |
| 655 | 655 | // a lost assignment is then recovered by the acknowledgement timeout alone. | |
| 656 | - | PollId string `protobuf:"bytes,2,opt,name=poll_id,json=pollId,proto3" json:"poll_id,omitempty"` | |
| 656 | + | PollId string `protobuf:"bytes,2,opt,name=poll_id,json=pollId,proto3" json:"poll_id,omitempty"` | |
| 657 | + | // Version is the release of the running runner software, for example | |
| 658 | + | // "v0.1.0", or "devel", at most 64 characters. Optional: the server stores it | |
| 659 | + | // as the runner's version (Runner.version in ListRunners), replacing the one | |
| 660 | + | // given at registration, so that the list shows what runs now. Empty, from | |
| 661 | + | // an older runner, leaves the stored version unchanged. | |
| 662 | + | Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` | |
| 657 | 663 | unknownFields protoimpl.UnknownFields | |
| 658 | 664 | sizeCache protoimpl.SizeCache | |
| 659 | 665 | } | |
| @@ -702,6 +708,13 @@ func (x *FetchJobRequest) GetPollId() string { | |||
| 702 | 708 | return "" | |
| 703 | 709 | } | |
| 704 | 710 | ||
| 711 | + | func (x *FetchJobRequest) GetVersion() string { | |
| 712 | + | if x != nil { | |
| 713 | + | return x.Version | |
| 714 | + | } | |
| 715 | + | return "" | |
| 716 | + | } | |
| 717 | + | ||
| 705 | 718 | // FetchJobResponse holds the job given to the runner, if any. | |
| 706 | 719 | type FetchJobResponse struct { | |
| 707 | 720 | state protoimpl.MessageState `protogen:"open.v1"` | |
| @@ -2708,10 +2721,11 @@ const file_ermite_runner_proto_rawDesc = "" + | |||
| 2708 | 2721 | "\areplace\x18\a \x01(\bR\areplace\"X\n" + | |
| 2709 | 2722 | "\x16RegisterRunnerResponse\x12\x1b\n" + | |
| 2710 | 2723 | "\trunner_id\x18\x01 \x01(\tR\brunnerId\x12!\n" + | |
| 2711 | - | "\frunner_token\x18\x02 \x01(\tR\vrunnerToken\"B\n" + | |
| 2724 | + | "\frunner_token\x18\x02 \x01(\tR\vrunnerToken\"\\\n" + | |
| 2712 | 2725 | "\x0fFetchJobRequest\x12\x16\n" + | |
| 2713 | 2726 | "\x06labels\x18\x01 \x03(\tR\x06labels\x12\x17\n" + | |
| 2714 | - | "\apoll_id\x18\x02 \x01(\tR\x06pollId\"m\n" + | |
| 2727 | + | "\apoll_id\x18\x02 \x01(\tR\x06pollId\x12\x18\n" + | |
| 2728 | + | "\aversion\x18\x03 \x01(\tR\aversion\"m\n" + | |
| 2715 | 2729 | "\x10FetchJobResponse\x12\x1d\n" + | |
| 2716 | 2730 | "\x03job\x18\x01 \x01(\v2\v.ermite.JobR\x03job\x12:\n" + | |
| 2717 | 2731 | "\vretry_after\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\n" + | |
| @@ -653,7 +653,13 @@ type FetchJobRequest struct { | |||||
| 653 | // same poll_id, and gets the assignment the first call made, if it made one | 653 | // same poll_id, and gets the assignment the first call made, if it made one | ||
| 654 | // (see FetchJob). A new poll uses a new id. Empty means no retry protection: | 654 | // (see FetchJob). A new poll uses a new id. Empty means no retry protection: | ||
| 655 | // a lost assignment is then recovered by the acknowledgement timeout alone. | 655 | // a lost assignment is then recovered by the acknowledgement timeout alone. | ||
| 656 | - | PollId string `protobuf:"bytes,2,opt,name=poll_id,json=pollId,proto3" json:"poll_id,omitempty"` | 656 | + | PollId string `protobuf:"bytes,2,opt,name=poll_id,json=pollId,proto3" json:"poll_id,omitempty"` |
| 657 | + | // Version is the release of the running runner software, for example | |||
| 658 | + | // "v0.1.0", or "devel", at most 64 characters. Optional: the server stores it | |||
| 659 | + | // as the runner's version (Runner.version in ListRunners), replacing the one | |||
| 660 | + | // given at registration, so that the list shows what runs now. Empty, from | |||
| 661 | + | // an older runner, leaves the stored version unchanged. | |||
| 662 | + | Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` | |||
| 657 | unknownFields protoimpl.UnknownFields | 663 | unknownFields protoimpl.UnknownFields | ||
| 658 | sizeCache protoimpl.SizeCache | 664 | sizeCache protoimpl.SizeCache | ||
| 659 | } | 665 | } | ||
| @@ -702,6 +708,13 @@ func (x *FetchJobRequest) GetPollId() string { | |||||
| 702 | return "" | 708 | return "" | ||
| 703 | } | 709 | } | ||
| 704 | 710 | ||||
| 711 | + | func (x *FetchJobRequest) GetVersion() string { | |||
| 712 | + | if x != nil { | |||
| 713 | + | return x.Version | |||
| 714 | + | } | |||
| 715 | + | return "" | |||
| 716 | + | } | |||
| 717 | + | ||||
| 705 | // FetchJobResponse holds the job given to the runner, if any. | 718 | // FetchJobResponse holds the job given to the runner, if any. | ||
| 706 | type FetchJobResponse struct { | 719 | type FetchJobResponse struct { | ||
| 707 | state protoimpl.MessageState `protogen:"open.v1"` | 720 | state protoimpl.MessageState `protogen:"open.v1"` | ||
| @@ -2708,10 +2721,11 @@ const file_ermite_runner_proto_rawDesc = "" + | |||||
| 2708 | "\areplace\x18\a \x01(\bR\areplace\"X\n" + | 2721 | "\areplace\x18\a \x01(\bR\areplace\"X\n" + | ||
| 2709 | "\x16RegisterRunnerResponse\x12\x1b\n" + | 2722 | "\x16RegisterRunnerResponse\x12\x1b\n" + | ||
| 2710 | "\trunner_id\x18\x01 \x01(\tR\brunnerId\x12!\n" + | 2723 | "\trunner_id\x18\x01 \x01(\tR\brunnerId\x12!\n" + | ||
| 2711 | - | "\frunner_token\x18\x02 \x01(\tR\vrunnerToken\"B\n" + | 2724 | + | "\frunner_token\x18\x02 \x01(\tR\vrunnerToken\"\\\n" + |
| 2712 | "\x0fFetchJobRequest\x12\x16\n" + | 2725 | "\x0fFetchJobRequest\x12\x16\n" + | ||
| 2713 | "\x06labels\x18\x01 \x03(\tR\x06labels\x12\x17\n" + | 2726 | "\x06labels\x18\x01 \x03(\tR\x06labels\x12\x17\n" + | ||
| 2714 | - | "\apoll_id\x18\x02 \x01(\tR\x06pollId\"m\n" + | 2727 | + | "\apoll_id\x18\x02 \x01(\tR\x06pollId\x12\x18\n" + |
| 2728 | + | "\aversion\x18\x03 \x01(\tR\aversion\"m\n" + | |||
| 2715 | "\x10FetchJobResponse\x12\x1d\n" + | 2729 | "\x10FetchJobResponse\x12\x1d\n" + | ||
| 2716 | "\x03job\x18\x01 \x01(\v2\v.ermite.JobR\x03job\x12:\n" + | 2730 | "\x03job\x18\x01 \x01(\v2\v.ermite.JobR\x03job\x12:\n" + | ||
| 2717 | "\vretry_after\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\n" + | 2731 | "\vretry_after\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\n" + | ||
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. | ||