Skip to content

Commit

Permalink
fix(deployments): make tier field optional in update (#133)
Browse files Browse the repository at this point in the history
Made the `tier` field optional in both GraphQL mutation
and CLI command. This ensures more flexible deployment updates.
  • Loading branch information
steebchen authored Nov 18, 2024
1 parent f5b6c07 commit ab0d160
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions cli/src/command/deployments/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ use torii_cli::args::ToriiArgsConfig;
pub struct UpdateArgs {
#[arg(help = "The name of the project.")]
pub project: String,
#[arg(short, long, default_value = "basic")]

#[arg(short, long)]
#[arg(value_name = "tier")]
#[arg(help = "Deployment tier.")]
pub tier: Tier,
pub tier: Option<Tier>,

#[command(subcommand)]
update_commands: UpdateServiceCommands,
Expand Down Expand Up @@ -79,10 +80,11 @@ impl UpdateArgs {
};

let tier = match &self.tier {
Tier::Basic => DeploymentTier::basic,
Tier::Common => DeploymentTier::common,
Tier::Rare => DeploymentTier::rare,
Tier::Epic => DeploymentTier::epic,
None => None,
Some(Tier::Basic) => Some(DeploymentTier::basic),
Some(Tier::Common) => Some(DeploymentTier::common),
Some(Tier::Rare) => Some(DeploymentTier::rare),
Some(Tier::Epic) => Some(DeploymentTier::epic),
};

let request_body = UpdateDeployment::build_query(Variables {
Expand Down
2 changes: 1 addition & 1 deletion slot/src/graphql/deployments/update.graphql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mutation UpdateDeployment(
$project: String!
$service: UpdateServiceInput!
$tier: DeploymentTier!
$tier: DeploymentTier
$wait: Boolean
) {
updateDeployment(
Expand Down

0 comments on commit ab0d160

Please sign in to comment.