Skip to content

Commit a290b8b

Browse files
authored
[public-api] define PrebuildService (#19082)
1 parent 453392b commit a290b8b

File tree

10 files changed

+2899
-0
lines changed

10 files changed

+2899
-0
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
syntax = "proto3";
2+
3+
package gitpod.v1;
4+
5+
import "google/protobuf/timestamp.proto";
6+
import "gitpod/v1/pagination.proto";
7+
import "gitpod/v1/scm.proto";
8+
9+
option go_package = "github.com/gitpod-io/gitpod/components/public-api/go/v1";
10+
11+
service PrebuildService {
12+
rpc StartPrebuild(StartPrebuildRequest) returns (StartPrebuildResponse) {}
13+
rpc CancelPrebuild(CancelPrebuildRequest) returns (CancelPrebuildResponse) {}
14+
15+
rpc GetPrebuild(GetPrebuildRequest) returns (GetPrebuildResponse) {}
16+
rpc ListPrebuilds(ListPrebuildsRequest) returns (ListPrebuildsResponse) {}
17+
rpc WatchPrebuild(WatchPrebuildRequest) returns (stream WatchPrebuildResponse) {}
18+
}
19+
20+
message GetPrebuildRequest {
21+
string prebuild_id = 1;
22+
}
23+
message GetPrebuildResponse {
24+
Prebuild prebuild = 1;
25+
}
26+
27+
message ListPrebuildsRequest {
28+
PaginationRequest pagination = 1;
29+
// it is for backward compatiblity with the current dashboard, use prebuild_id instead
30+
string build_workspace_id = 2 [deprecated = true];
31+
string configuration_id = 3;
32+
string git_ref = 4;
33+
}
34+
35+
message ListPrebuildsResponse {
36+
PaginationResponse pagination = 1;
37+
repeated Prebuild prebuilds = 2;
38+
}
39+
40+
message StartPrebuildRequest {
41+
string configuration_id = 1;
42+
string git_ref = 2;
43+
}
44+
message StartPrebuildResponse {
45+
string prebuild_id = 1;
46+
}
47+
48+
message CancelPrebuildRequest {
49+
string prebuild_id = 1;
50+
}
51+
message CancelPrebuildResponse {
52+
}
53+
54+
message WatchPrebuildRequest {
55+
repeated string prebuild_ids = 1;
56+
}
57+
message WatchPrebuildResponse {
58+
Prebuild prebuild = 1;
59+
}
60+
61+
message Prebuild {
62+
string id = 1;
63+
// it is for backward compatiblity with the current dashboard, use prebuild_id instead
64+
string build_workspace_id = 2 [deprecated = true];
65+
66+
string based_on_prebuild_id = 3;
67+
68+
string configuration_id = 4;
69+
string ref = 5;
70+
71+
Commit commit = 6;
72+
string context_url = 7;
73+
74+
PrebuildStatus status = 8;
75+
}
76+
77+
message PrebuildStatus {
78+
PrebuildPhase phase = 1;
79+
google.protobuf.Timestamp start_time = 2;
80+
// message is an optional human-readable message detailing the current phase
81+
string message = 3;
82+
}
83+
84+
message PrebuildPhase {
85+
enum Phase {
86+
PHASE_UNSPECIFIED = 0;
87+
PHASE_QUEUED = 1;
88+
PHASE_BUILDING = 2;
89+
PHASE_ABORTED = 3;
90+
PHASE_TIMEOUT = 4;
91+
PHASE_AVAILABLE = 5;
92+
PHASE_FAILED = 6;
93+
}
94+
Phase name = 1;
95+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
syntax = "proto3";
2+
3+
package gitpod.v1;
4+
5+
import "google/protobuf/timestamp.proto";
6+
7+
option go_package = "github.com/gitpod-io/gitpod/components/public-api/go/v1";
8+
9+
message Author {
10+
string name = 1;
11+
string avatar_url = 2;
12+
}
13+
14+
message Commit {
15+
string message = 1;
16+
Author author = 2;
17+
google.protobuf.Timestamp author_date = 3;
18+
string sha = 4;
19+
}

0 commit comments

Comments
 (0)