Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions crates/admin-rest-model/src/deployments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use restate_serde_util::SerdeableHeaderHashMap;
use restate_types::identifiers::ServiceRevision;
use restate_types::identifiers::{DeploymentId, LambdaARN};
use restate_types::schema::deployment::{EndpointLambdaCompression, ProtocolType};
use restate_types::schema::info::Info;
use restate_types::schema::service::ServiceMetadata;
use serde::{Deserialize, Serialize};
use serde_with::serde_as;
Expand Down Expand Up @@ -186,6 +187,12 @@ pub struct RegisterDeploymentResponse {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default)]
pub sdk_version: Option<String>,

/// # Info
///
/// List of configuration/deprecation information related to this deployment.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub info: Vec<Info>,
}

#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
Expand Down Expand Up @@ -266,6 +273,12 @@ pub enum DeploymentResponse {
///
/// List of services exposed by this deployment.
services: Vec<ServiceNameRevPair>,

/// # Info
///
/// List of configuration/deprecation information related to this deployment.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
info: Vec<Info>,
},
#[cfg_attr(
feature = "schema",
Expand Down Expand Up @@ -331,6 +344,12 @@ pub enum DeploymentResponse {
///
/// List of services exposed by this deployment.
services: Vec<ServiceNameRevPair>,

/// # Info
///
/// List of configuration/deprecation information related to this deployment.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
info: Vec<Info>,
},
}

Expand Down Expand Up @@ -413,6 +432,12 @@ pub enum DetailedDeploymentResponse {
///
/// List of services exposed by this deployment.
services: Vec<ServiceMetadata>,

/// # Info
///
/// List of configuration/deprecation information related to this deployment.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
info: Vec<Info>,
},
#[cfg_attr(
feature = "schema",
Expand Down Expand Up @@ -479,6 +504,12 @@ pub enum DetailedDeploymentResponse {
///
/// List of services exposed by this deployment.
services: Vec<ServiceMetadata>,

/// # Info
///
/// List of configuration/deprecation information related to this deployment.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
info: Vec<Info>,
},
}

Expand Down
8 changes: 8 additions & 0 deletions crates/admin/src/rest_api/deployments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ fn to_register_response(
id,
supported_protocol_versions,
sdk_version,
info,
..
}: Deployment,
services: Vec<ServiceMetadata>,
Expand All @@ -436,6 +437,7 @@ fn to_register_response(
min_protocol_version: *supported_protocol_versions.start(),
max_protocol_version: *supported_protocol_versions.end(),
sdk_version,
info,
}
}

Expand All @@ -448,6 +450,7 @@ fn to_deployment_response(
sdk_version,
created_at,
metadata,
info,
..
}: Deployment,
services: Vec<(String, ServiceRevision)>,
Expand All @@ -472,6 +475,7 @@ fn to_deployment_response(
.into_iter()
.map(|(name, revision)| ServiceNameRevPair { name, revision })
.collect(),
info,
},
DeploymentType::Lambda {
arn,
Expand All @@ -492,6 +496,7 @@ fn to_deployment_response(
.into_iter()
.map(|(name, revision)| ServiceNameRevPair { name, revision })
.collect(),
info,
},
}
}
Expand All @@ -505,6 +510,7 @@ fn to_detailed_deployment_response(
sdk_version,
created_at,
metadata,
info,
..
}: Deployment,
services: Vec<ServiceMetadata>,
Expand All @@ -526,6 +532,7 @@ fn to_detailed_deployment_response(
max_protocol_version: *supported_protocol_versions.end(),
sdk_version,
services,
info,
},
DeploymentType::Lambda {
arn,
Expand All @@ -543,6 +550,7 @@ fn to_detailed_deployment_response(
max_protocol_version: *supported_protocol_versions.end(),
sdk_version,
services,
info,
},
}
}
Expand Down
3 changes: 3 additions & 0 deletions crates/errors/src/error_codes/RT0021.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## RT0021

The `inactivity_timeout` option is ignored when the deployment serving the services/handlers is using Request/Response mode, such as when deploying on Lambda or using HTTP/1.1
3 changes: 3 additions & 0 deletions crates/errors/src/error_codes/RT0022.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## RT0022

The configured `journal_retention` valued was clamped, because it's higher than the maximum value configured for the server.
5 changes: 3 additions & 2 deletions crates/errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ mod helper;

declare_restate_error_codes!(
RT0001, RT0002, RT0003, RT0004, RT0005, RT0006, RT0007, RT0009, RT0010, RT0011, RT0012, RT0013,
RT0014, RT0015, RT0016, RT0017, RT0018, RT0019, RT0020, META0003, META0004, META0005, META0006,
META0009, META0010, META0011, META0012, META0013, META0014, META0015, META0016, META0017
RT0014, RT0015, RT0016, RT0017, RT0018, RT0019, RT0020, RT0021, RT0022, META0003, META0004,
META0005, META0006, META0009, META0010, META0011, META0012, META0013, META0014, META0015,
META0016, META0017
);

// -- Some commonly used errors
Expand Down
2 changes: 2 additions & 0 deletions crates/ingress-http/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ mod mocks {
input_json_schema: None,
output_json_schema: None,
retry_policy: Default::default(),
info: vec![],
},
)]),
ty: invocation_target_metadata.target_ty.into(),
Expand All @@ -189,6 +190,7 @@ mod mocks {
abort_timeout: DEFAULT_ABORT_TIMEOUT,
enable_lazy_state: false,
retry_policy: Default::default(),
info: vec![],
});
self.1.add(
service_name,
Expand Down
7 changes: 7 additions & 0 deletions crates/types/src/schema/deployment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use crate::deployment::{
DeploymentAddress, Headers, HttpDeploymentAddress, LambdaDeploymentAddress,
};
use crate::identifiers::{DeploymentId, LambdaARN, ServiceRevision};
use crate::schema::info::Info;
use crate::schema::service::ServiceMetadata;
use crate::time::MillisSinceEpoch;
use bytestring::ByteString;
Expand Down Expand Up @@ -47,6 +48,10 @@ pub struct Deployment {
pub created_at: MillisSinceEpoch,
/// User provided metadata during registration
pub metadata: HashMap<String, String>,
/// # Info
///
/// List of configuration/deprecation information related to this deployment.
pub info: Vec<Info>,
}

impl Deployment {
Expand Down Expand Up @@ -358,6 +363,7 @@ pub mod test_util {
created_at: MillisSinceEpoch::now(),
metadata: Default::default(),
additional_headers: Default::default(),
info: vec![],
}
}

Expand All @@ -377,6 +383,7 @@ pub mod test_util {
created_at: MillisSinceEpoch::now(),
metadata: Default::default(),
additional_headers: Default::default(),
info: vec![],
}
}
}
Expand Down
40 changes: 40 additions & 0 deletions crates/types/src/schema/info.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright (c) 2023 - 2025 Restate Software, Inc., Restate GmbH.
// All rights reserved.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0.

use codederror::Code;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
pub struct Info {
#[serde(default, skip_serializing_if = "Option::is_none")]
code: Option<String>,
message: String,
}

impl Info {
pub fn new(message: impl ToString) -> Self {
Self {
code: None,
message: message.to_string(),
}
}

pub fn new_with_code(code: &'static Code, message: impl ToString) -> Self {
Self {
code: Some(code.code().to_string()),
message: message.to_string(),
}
}

pub fn message(&self) -> &str {
&self.message
}
}
Loading
Loading