Skip to content

Commit

Permalink
require motivation for add/update proposals
Browse files Browse the repository at this point in the history
  • Loading branch information
r-birkner committed Jun 5, 2024
1 parent 37f387a commit 7255142
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
11 changes: 10 additions & 1 deletion rs/cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ pub mod subnet {
#[clap(long, num_args(1..))]
include: Vec<PrincipalId>,

/// Motivation for resing the subnet
/// Motivation for resizing the subnet
#[clap(short, long, aliases = ["summary"])]
motivation: Option<String>,
},
Expand Down Expand Up @@ -476,8 +476,13 @@ pub mod api_boundary_nodes {
/// Node IDs where to rollout the version
#[clap(long, num_args(1..), required = true)]
nodes: Vec<PrincipalId>,

#[clap(long, required = true)]
version: String,

/// Motivation for creating the subnet
#[clap(short, long, aliases = ["summary"], required = true)]
motivation: Option<String>,
},

/// Turn a set of unassigned nodes into API BNs
Expand All @@ -489,6 +494,10 @@ pub mod api_boundary_nodes {
/// guestOS version
#[clap(long, required = true)]
version: String,

/// Motivation for creating the subnet
#[clap(short, long, aliases = ["summary"], required = true)]
motivation: Option<String>,
},

/// Decommission a set of API BNs and turn them again in unassigned nodes
Expand Down
8 changes: 4 additions & 4 deletions rs/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ async fn async_main() -> Result<(), anyhow::Error> {
},

cli::Commands::ApiBoundaryNodes(api_boundary_nodes) => match &api_boundary_nodes.subcommand {
cli::api_boundary_nodes::Commands::Update { nodes, version } => {
cli::api_boundary_nodes::Commands::Update { nodes, version, motivation } => {
runner_instance
.ic_admin
.propose_run(
Expand All @@ -367,14 +367,14 @@ async fn async_main() -> Result<(), anyhow::Error> {
ic_admin::ProposeOptions {
title: Some(format!("Update {} API boundary node(s) to {version}", nodes.clone().len())),
summary: Some(format!("Update {} API boundary node(s) to {version}", nodes.clone().len())),
motivation: None,
motivation: motivation.clone(),
},
simulate,
)
.await?;
Ok(())
}
cli::api_boundary_nodes::Commands::Add { nodes, version } => {
cli::api_boundary_nodes::Commands::Add { nodes, version, motivation } => {
runner_instance
.ic_admin
.propose_run(
Expand All @@ -385,7 +385,7 @@ async fn async_main() -> Result<(), anyhow::Error> {
ic_admin::ProposeOptions {
title: Some(format!("Add {} API boundary node(s)", nodes.clone().len())),
summary: Some(format!("Add {} API boundary node(s)", nodes.clone().len())),
motivation: None,
motivation: motivation.clone(),
},
simulate,
)
Expand Down

0 comments on commit 7255142

Please sign in to comment.