Skip to content

Commit

Permalink
feat(sns): Add UpgradeStepsReset type to the upgrade journal (#2602)
Browse files Browse the repository at this point in the history
This will be useful in the contingency that we need to reset them for
some reason
  • Loading branch information
anchpop authored Nov 13, 2024
1 parent cf7bf50 commit 13c0601
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 1 deletion.
6 changes: 6 additions & 0 deletions rs/sns/governance/canister/governance.did
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,7 @@ type WaitForQuietState = record {
type UpgradeJournalEntry = record {
event : opt variant {
UpgradeStepsRefreshed : UpgradeStepsRefreshed;
UpgradeStepsReset : UpgradeStepsReset;
TargetVersionSet : TargetVersionSet;
TargetVersionReset : TargetVersionReset;
UpgradeStarted : UpgradeStarted;
Expand All @@ -742,6 +743,11 @@ type UpgradeStepsRefreshed = record {
upgrade_steps : opt Versions;
};

type UpgradeStepsReset = record {
human_readable : opt text;
upgrade_steps : opt Versions;
};

type TargetVersionSet = record {
new_target_version : opt Version;
old_target_version : opt Version;
Expand Down
6 changes: 6 additions & 0 deletions rs/sns/governance/canister/governance_test.did
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,7 @@ type WaitForQuietState = record {
type UpgradeJournalEntry = record {
event : opt variant {
UpgradeStepsRefreshed : UpgradeStepsRefreshed;
UpgradeStepsReset : UpgradeStepsReset;
TargetVersionSet : TargetVersionSet;
TargetVersionReset : TargetVersionReset;
UpgradeStarted : UpgradeStarted;
Expand All @@ -756,6 +757,11 @@ type UpgradeStepsRefreshed = record {
upgrade_steps : opt Versions;
};

type UpgradeStepsReset = record {
human_readable : opt text;
upgrade_steps : opt Versions;
};

type TargetVersionSet = record {
new_target_version : opt Version;
old_target_version : opt Version;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2160,6 +2160,7 @@ message AdvanceTargetVersionResponse {}
message UpgradeJournalEntry {
oneof event {
UpgradeStepsRefreshed upgrade_steps_refreshed = 1;
UpgradeStepsReset upgrade_steps_reset = 7;
TargetVersionSet target_version_set = 2;
TargetVersionReset target_version_reset = 3;
UpgradeStarted upgrade_started = 4;
Expand All @@ -2171,6 +2172,11 @@ message UpgradeJournalEntry {
optional Governance.Versions upgrade_steps = 2;
}

message UpgradeStepsReset {
optional string human_readable = 1;
optional Governance.Versions upgrade_steps = 2;
}

message TargetVersionSet {
optional Governance.Version old_target_version = 1;
optional Governance.Version new_target_version = 2;
Expand Down
1 change: 1 addition & 0 deletions rs/sns/governance/protobuf_generator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ pub fn generate_prost_files(proto: ProtoPaths<'_>, out: &Path) {
"UpgradeJournalEntry",
"UpgradeJournalEntry.event",
"UpgradeJournalEntry.UpgradeStepsRefreshed",
"UpgradeJournalEntry.UpgradeStepsReset",
"UpgradeJournalEntry.TargetVersionSet",
"UpgradeJournalEntry.TargetVersionReset",
"UpgradeJournalEntry.UpgradeStarted",
Expand Down
19 changes: 18 additions & 1 deletion rs/sns/governance/src/gen/ic_sns_governance.pb.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3381,7 +3381,7 @@ pub struct AdvanceTargetVersionResponse {}
pub struct UpgradeJournalEntry {
#[prost(uint64, optional, tag = "6")]
pub timestamp_seconds: ::core::option::Option<u64>,
#[prost(oneof = "upgrade_journal_entry::Event", tags = "1, 2, 3, 4, 5")]
#[prost(oneof = "upgrade_journal_entry::Event", tags = "1, 7, 2, 3, 4, 5")]
pub event: ::core::option::Option<upgrade_journal_entry::Event>,
}
/// Nested message and enum types in `UpgradeJournalEntry`.
Expand All @@ -3408,6 +3408,21 @@ pub mod upgrade_journal_entry {
PartialEq,
::prost::Message,
)]
pub struct UpgradeStepsReset {
#[prost(string, optional, tag = "1")]
pub human_readable: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub upgrade_steps: ::core::option::Option<super::governance::Versions>,
}
#[derive(
candid::CandidType,
candid::Deserialize,
comparable::Comparable,
serde::Serialize,
Clone,
PartialEq,
::prost::Message,
)]
pub struct TargetVersionSet {
#[prost(message, optional, tag = "1")]
pub old_target_version: ::core::option::Option<super::governance::Version>,
Expand Down Expand Up @@ -3528,6 +3543,8 @@ pub mod upgrade_journal_entry {
pub enum Event {
#[prost(message, tag = "1")]
UpgradeStepsRefreshed(UpgradeStepsRefreshed),
#[prost(message, tag = "7")]
UpgradeStepsReset(UpgradeStepsReset),
#[prost(message, tag = "2")]
TargetVersionSet(TargetVersionSet),
#[prost(message, tag = "3")]
Expand Down

0 comments on commit 13c0601

Please sign in to comment.