Skip to content

Commit

Permalink
feat(nns-tools): Release runscript asks you which canisters to release (
Browse files Browse the repository at this point in the history
#3714)

Later, this will enable it to perform some of the steps of the release
for you.

[← Previous PR](#3713) | [Next PR
→](#3715)
  • Loading branch information
anchpop authored Feb 3, 2025
1 parent f53fd04 commit bc69386
Showing 1 changed file with 61 additions and 14 deletions.
75 changes: 61 additions & 14 deletions rs/nervous_system/tools/release-runscript/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,24 +131,50 @@ fn run_pick_commit() {
}

fn run_determine_targets(_: DetermineTargets) {
println!("Now choose which canisters to upgrade. You can run ./testnet/tools/nns-tools/list-new-commits.sh to see the changes for each canister.");

// Define the candidate canisters.
let nns_candidates = [
"Governance",
"Root",
"SNS-Wasm",
"Lifeline",
"Registry",
"Cycles-Minting",
"Genesis-Token",
];
let sns_candidates = ["Root", "Governance", "Swap", "Ledger", "Archive", "Index"];

// Prepare vectors for selected releases.
let mut nns_canisters: Vec<String> = Vec::new();
let mut sns_canisters: Vec<String> = Vec::new();

// Ask about NNS canisters.
println!("NNS canisters:");
for &canister in nns_candidates.iter() {
if input_yes_or_no(&format!(" Release {}?", canister), false) {
nns_canisters.push(canister.to_string().to_lowercase());
}
}

// Ask about SNS canisters.
println!("SNS canisters:");
for &canister in sns_candidates.iter() {
if input_yes_or_no(&format!(" Release {}?", canister), false) {
sns_canisters.push(canister.to_string().to_lowercase());
}
}

print_step(
2,
"Determine Upgrade Targets",
"Determine which NNS canisters and/or SNS WASMs need to be upgraded/published.
Only those with 'interesting' changes need to be released.
Required checks:
1. Run: ./testnet/tools/nns-tools/list-new-commits.sh
2. Check Monday team sync meeting minutes at:
https://docs.google.com/document/d/1CPM1RlMz6UMSUQzqvdP7EDiLMomK4YeuEV7UnxQ9DAE/edit
For SNS ledger suite (ledger, archive, and index canisters):
- Consult Financial Integrations team
- FI team should contact NNS team Friday morning about significant changes
- FI team should provide the 'Features' section of proposals
- This agreement is new - you may need to remind them
- This applies to ledger, archive, and index canisters",
&format!(
"NNS canisters selected for release: {}\nSNS canisters selected for release: {}",
nns_canisters.join(", "),
sns_canisters.join(", ")
),
);

run_run_tests(RunTests);
}

Expand Down Expand Up @@ -366,3 +392,24 @@ fn input_with_default(text: &str, default: &str) -> String {
input
}
}

fn input_yes_or_no(text: &str, default: bool) -> bool {
loop {
let input = input(&format!(
"{} {}",
text,
if default {
"Y/n (default: yes)"
} else {
"y/N (default: no)"
}
));
if input.is_empty() {
return default;
} else if input.to_lowercase() == "y" {
return true;
} else if input.to_lowercase() == "n" {
return false;
}
}
}

0 comments on commit bc69386

Please sign in to comment.