github.com/tilt-dev/tilt@v0.33.15-0.20240515162809-0a22ed45d8a0/pkg/webview/view.proto (about) 1 syntax = "proto3"; 2 3 package webview; 4 5 import "google/api/annotations.proto"; 6 import "google/protobuf/timestamp.proto"; 7 import "pkg/webview/log.proto"; 8 import "pkg/apis/core/v1alpha1/generated.proto"; 9 10 option go_package = "github.com/tilt-dev/tilt/pkg/webview"; 11 12 13 // Correspond to implementations of the TargetSpec interface 14 enum TargetType { 15 TARGET_TYPE_UNSPECIFIED = 0; 16 TARGET_TYPE_IMAGE = 1; 17 TARGET_TYPE_K8S = 2; 18 TARGET_TYPE_DOCKER_COMPOSE = 3; 19 TARGET_TYPE_LOCAL = 4; 20 } 21 22 message TargetSpec { 23 string id = 1; 24 TargetType type = 2; 25 bool has_live_update = 3; 26 } 27 28 message BuildRecord { 29 reserved "edits"; 30 reserved 1; 31 32 string error = 2; 33 repeated string warnings = 3; 34 google.protobuf.Timestamp start_time = 4; 35 google.protobuf.Timestamp finish_time = 5; 36 37 reserved "update_types"; 38 reserved 9; 39 40 reserved "log"; 41 reserved 6; 42 43 bool is_crash_rebuild = 7; 44 45 // The span id for this build record's logs in the main logstore. 46 string span_id = 8; 47 } 48 49 message K8sResourceInfo { 50 string pod_name = 1; 51 string pod_creation_time = 2; 52 string pod_update_start_time = 3; 53 string pod_status = 4; 54 string pod_status_message = 5; 55 bool all_containers_ready = 6; 56 int32 pod_restarts = 7; 57 58 // pod logs are now in the log store 59 reserved "pod_log"; 60 reserved 8; 61 62 // The span id for this pod's logs in the main logstore 63 string span_id = 9; 64 65 repeated string display_names = 10; 66 } 67 68 message LocalResourceInfo { 69 int64 pid = 1; 70 bool is_test = 2; 71 } 72 73 message Link { 74 string url = 1; 75 string name = 2; 76 } 77 78 message Resource { 79 string name = 1; 80 81 reserved "directories_watched"; 82 reserved 2; 83 84 reserved "paths_watched"; 85 reserved 3; 86 87 google.protobuf.Timestamp last_deploy_time = 4; 88 int32 trigger_mode = 5; 89 repeated BuildRecord build_history = 6; 90 BuildRecord current_build = 7; 91 92 reserved "pending_build_reason"; 93 reserved 8; 94 95 reserved "pending_build_edits"; 96 reserved 9; 97 98 google.protobuf.Timestamp pending_build_since = 10; 99 bool has_pending_changes = 11; 100 101 // Endpoints used to be sent as strings, but now contain extra info 102 reserved "endpoints"; 103 reserved 12; 104 105 repeated Link endpoint_links = 28; 106 string podID = 13; 107 K8sResourceInfo k8s_resource_info = 14; 108 109 reserved "dc_resource_info"; 110 reserved 15; 111 112 reserved "yaml_resource_info"; 113 reserved 16; 114 115 LocalResourceInfo local_resource_info = 17; 116 string runtime_status = 18; 117 string update_status = 29; 118 bool is_tiltfile = 19; 119 repeated TargetSpec specs = 27; 120 121 reserved "show_build_status"; 122 reserved 20; 123 124 // Resource logs are now stored in the log store. 125 reserved "combined_log"; 126 reserved 21; 127 128 // Obsoleted by crash_log_span_id. 129 reserved "crash_log"; 130 reserved 22; 131 132 // A span id for the log that crashed. 133 reserved "crash_log_span_id"; 134 reserved 26; 135 136 // Alerts are currently client-side only, and not 137 // sent in the payload. 138 reserved "alerts"; 139 reserved 23; 140 141 // Facets have been removed from the UI. They may come back in a future protocol. See: 142 // https://github.com/tilt-dev/tilt/issues/4148 143 // https://github.com/tilt-dev/tilt/issues/4219 144 reserved "facets"; 145 reserved 24; 146 147 bool queued = 25; 148 149 // NEXT ID: 30 150 } 151 152 message TiltBuild { 153 string version = 1; 154 string commitSHA = 2; 155 string date = 3; 156 bool dev = 4; 157 } 158 159 message VersionSettings { 160 bool check_updates = 1; 161 } 162 163 // Our websocket service has two kinds of View messages: 164 // 165 // 1) On initialization, we send down the complete view state 166 // (TiltStartTime, UISession, UIResources, and LogList) 167 // 168 // 2) On every change, we send down the resources that have 169 // changed since the last send(). 170 // (new logs and any updated UISession/UIResource objects). 171 // 172 // All other fields are obsolete, but are needed for deserializing 173 // old snapshots. 174 message View { 175 string log = 1; 176 repeated Resource resources = 2; 177 178 // We used to have a setting that allowed users to dynamically 179 // prepend timestamps in logs. 180 bool DEPRECATED_log_timestamps = 3; 181 182 map<string, bool> feature_flags = 4; 183 184 bool needs_analytics_nudge = 5; 185 186 TiltBuild running_tilt_build = 6; 187 TiltBuild DEPRECATED_latest_tilt_build = 7; 188 string suggested_tilt_version = 16; 189 VersionSettings version_settings = 12; 190 191 string tilt_cloud_username = 8; 192 string tilt_cloud_team_name = 15; 193 string tilt_cloud_schemeHost = 9; 194 string tilt_cloud_teamID = 10; 195 196 string fatal_error = 11; 197 198 LogList log_list = 13; 199 200 // Allows us to synchronize on a running Tilt instance, 201 // so we can tell when Tilt restarted. 202 google.protobuf.Timestamp tilt_start_time = 14; 203 204 // an identifier for the tiltfile that is running, so that the web ui can store data per tiltfile 205 string tiltfile_key = 17; 206 207 reserved "metrics_serving"; 208 reserved 18; 209 210 // New API-server based data models. 211 github.com.tilt_dev.tilt.pkg.apis.core.v1alpha1.UISession ui_session = 19; 212 repeated github.com.tilt_dev.tilt.pkg.apis.core.v1alpha1.UIResource ui_resources = 20; 213 repeated github.com.tilt_dev.tilt.pkg.apis.core.v1alpha1.UIButton ui_buttons = 22; 214 repeated github.com.tilt_dev.tilt.pkg.apis.core.v1alpha1.Cluster clusters = 23; 215 216 // indicates that this view is a complete representation of the app 217 // if false, this view just contains deltas from a previous view. 218 bool is_complete = 21; 219 } 220 221 message MetricsServing { 222 // Whether we're using the local or remote metrics stack. 223 string mode = 1; 224 225 // e.g., "localhost:10352" 226 string grafana_host = 2; 227 } 228 229 message GetViewRequest {} 230 231 message SnapshotHighlight { 232 string beginning_logID = 1; 233 string ending_logID = 2; 234 string text = 3; 235 } 236 237 message Snapshot { 238 View view = 1; 239 bool is_sidebar_closed = 2; 240 string path = 3; 241 SnapshotHighlight snapshot_highlight = 4; 242 string snapshot_link = 5; 243 google.protobuf.Timestamp created_at = 6; 244 } 245 246 message UploadSnapshotResponse { 247 string url = 1; 248 } 249 250 // NOTE(nick): This is obsolete. 251 // 252 // Our websocket service has two kinds of messages: 253 // 1) On initialization, we send down the complete view state 254 // 2) On every change, we send down the resources that have 255 // changed since the last send(). 256 message AckWebsocketRequest { 257 // The to_checkpoint on the received LogList 258 int32 to_checkpoint = 1; 259 260 // Allows us to synchronize on a running Tilt instance, 261 // so we can tell when we're talking to the same Tilt. 262 google.protobuf.Timestamp tilt_start_time = 2; 263 } 264 265 message AckWebsocketResponse {} 266 267 // These services need to be here for the generated TS to be generated 268 service ViewService { 269 rpc GetView(GetViewRequest) returns (View) { 270 option (google.api.http) = { 271 get: "/api/view" 272 }; 273 } 274 275 rpc UploadSnapshot(Snapshot) returns (UploadSnapshotResponse) { 276 option (google.api.http) = { 277 post: "/api/snapshot/new" 278 body: "*" 279 }; 280 } 281 } 282 283 // This is a fake service, so that we do codegen for the websocket protocol messages. 284 service WebsocketService { 285 rpc AckWebsocket(AckWebsocketRequest) returns (AckWebsocketResponse) { 286 option (google.api.http) = { 287 post: "/websocket/ack" 288 body: "*" 289 }; 290 } 291 }