ui: trim community streaming surface
This commit is contained in:
@@ -1065,6 +1065,13 @@ mod tests {
|
||||
.collect::<Vec<_>>(),
|
||||
vec!["rest", "graphql", "grpc"]
|
||||
);
|
||||
for item in response["items"].as_array().unwrap() {
|
||||
assert_eq!(item["supports_execution_modes"], json!(["unary"]));
|
||||
assert_eq!(
|
||||
item["supports_transport_behaviors"],
|
||||
json!(["request_response"])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
|
||||
@@ -1562,11 +1562,11 @@ impl AdminService {
|
||||
}
|
||||
|
||||
pub async fn list_protocol_capabilities(&self) -> Vec<ProtocolCapabilityView> {
|
||||
self.get_capabilities()
|
||||
.await
|
||||
let capabilities = self.get_capabilities().await;
|
||||
capabilities
|
||||
.supported_protocols
|
||||
.into_iter()
|
||||
.map(protocol_capability_view)
|
||||
.map(|protocol| protocol_capability_view(protocol, capabilities.edition))
|
||||
.collect()
|
||||
}
|
||||
|
||||
@@ -5124,25 +5124,34 @@ fn runtime_error_code(error: &RuntimeError) -> &'static str {
|
||||
}
|
||||
}
|
||||
|
||||
fn protocol_capability_view(protocol: Protocol) -> ProtocolCapabilityView {
|
||||
let supports_execution_modes = [
|
||||
ExecutionMode::Unary,
|
||||
ExecutionMode::Window,
|
||||
ExecutionMode::Session,
|
||||
ExecutionMode::AsyncJob,
|
||||
]
|
||||
.into_iter()
|
||||
.filter(|mode| protocol.supports_execution_mode(*mode))
|
||||
.collect();
|
||||
let supports_transport_behaviors = [
|
||||
TransportBehavior::RequestResponse,
|
||||
TransportBehavior::ServerStream,
|
||||
TransportBehavior::StatefulSession,
|
||||
TransportBehavior::DeferredResult,
|
||||
]
|
||||
.into_iter()
|
||||
.filter(|behavior| protocol.supports_transport_behavior(*behavior))
|
||||
.collect();
|
||||
fn protocol_capability_view(protocol: Protocol, edition: ProductEdition) -> ProtocolCapabilityView {
|
||||
let community_build = matches!(edition, ProductEdition::Community);
|
||||
let supports_execution_modes = if community_build {
|
||||
vec![ExecutionMode::Unary]
|
||||
} else {
|
||||
[
|
||||
ExecutionMode::Unary,
|
||||
ExecutionMode::Window,
|
||||
ExecutionMode::Session,
|
||||
ExecutionMode::AsyncJob,
|
||||
]
|
||||
.into_iter()
|
||||
.filter(|mode| protocol.supports_execution_mode(*mode))
|
||||
.collect()
|
||||
};
|
||||
let supports_transport_behaviors = if community_build {
|
||||
vec![TransportBehavior::RequestResponse]
|
||||
} else {
|
||||
[
|
||||
TransportBehavior::RequestResponse,
|
||||
TransportBehavior::ServerStream,
|
||||
TransportBehavior::StatefulSession,
|
||||
TransportBehavior::DeferredResult,
|
||||
]
|
||||
.into_iter()
|
||||
.filter(|behavior| protocol.supports_transport_behavior(*behavior))
|
||||
.collect()
|
||||
};
|
||||
let supports_upload_artifacts = match protocol {
|
||||
Protocol::Rest | Protocol::Graphql | Protocol::Websocket => Vec::new(),
|
||||
Protocol::Grpc => vec!["proto".to_owned(), "descriptor_set".to_owned()],
|
||||
|
||||
Reference in New Issue
Block a user