Skip to content

Commit

Permalink
Remove UpsertVersion, as it does not make sense anymore (#2084)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse-Bakker authored Sep 25, 2023
1 parent 79b58b3 commit c2f278b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 34 deletions.
5 changes: 0 additions & 5 deletions dozer-cli/src/cli/cloud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,6 @@ pub enum VersionCommand {
/// The version to inspect
version: u32,
},
/// Creates a new version of the application with the given deployment
Create {
/// The deployment of the application to create a new version from
deployment: u32,
},
/// Sets a version as the "current" version of the application
///
/// Current version of an application can be visited without the "/v<version>" prefix.
Expand Down
21 changes: 1 addition & 20 deletions dozer-cli/src/simple/cloud_orchestrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use dozer_types::grpc_types::cloud::{
};
use dozer_types::grpc_types::cloud::{
CreateAppRequest, DeploymentInfo, DeploymentStatusWithHealth, File, ListDeploymentRequest,
SetCurrentVersionRequest, UpsertVersionRequest,
SetCurrentVersionRequest,
};
use dozer_types::log::info;
use dozer_types::prettytable::{row, table};
Expand Down Expand Up @@ -524,25 +524,6 @@ impl SimpleOrchestrator {
let mut client = get_cloud_client(&cloud, cloud_config).await?;

match version {
VersionCommand::Create { deployment } => {
let status = client
.get_status(GetStatusRequest {
app_id: app_id.clone(),
})
.await
.map_err(map_tonic_error)?
.into_inner();
let latest_version = status.versions.into_values().max().unwrap_or(0);

client
.upsert_version(UpsertVersionRequest {
app_id,
version: latest_version + 1,
deployment,
})
.await
.map_err(map_tonic_error)?;
}
VersionCommand::SetCurrent { version } => {
client
.set_current_version(SetCurrentVersionRequest { app_id, version })
Expand Down
9 changes: 0 additions & 9 deletions dozer-types/protos/cloud.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ service DozerCloud {
rpc get_status(GetStatusRequest) returns (GetStatusResponse);
rpc list_deployments(ListDeploymentRequest) returns (ListDeploymentResponse);
rpc list_versions(ListVersionsRequest) returns (ListVersionsResponse);
rpc upsert_version(UpsertVersionRequest) returns (UpsertVersionResponse);
rpc set_current_version(SetCurrentVersionRequest) returns (SetCurrentVersionResponse);
rpc list_files(ListFilesRequest) returns (ListFilesResponse);
rpc get_configuration(GetConfigurationRequest) returns (GetConfigurationResponse);
Expand Down Expand Up @@ -218,14 +217,6 @@ message ListDeploymentResponse {
repeated DeploymentInfo deployments = 2;
}

message UpsertVersionRequest {
string app_id = 1;
uint32 version = 2;
uint32 deployment = 3;
}

message UpsertVersionResponse {}

message SetCurrentVersionRequest {
string app_id = 1;
uint32 version = 2;
Expand Down

0 comments on commit c2f278b

Please sign in to comment.