Skip to content

Commit

Permalink
fix: update discourse forum posts contents for subnet proposals
Browse files Browse the repository at this point in the history
  • Loading branch information
sasa-tomic committed Dec 13, 2024
1 parent 9cdd83c commit 9c513fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions rs/cli/src/discourse_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,20 +257,21 @@ impl DiscourseClient for DiscourseClientImp {
return Ok(());
}

let new_content = format!("Proposal id [{0}](https://dashboard.internetcomputer.org/proposal/{0})", proposal_id);
if post_id.is_none() {
warn!("Update the forum post with the following text");
warn!("{}", new_content);
warn!("Failed to find post id to update the proposal id");
return Ok(());
}
let post_id = post_id.unwrap();

let content = self.get_post_content(post_id).await?;
let orig_content = self.get_post_content(post_id).await?;
let new_content = format!(
r#"{0}
r#"A new proposal with id [{0}](https://dashboard.internetcomputer.org/proposal/{0}) has been submitted for this subnet.
{1}"#,
content, new_content
[details="Click here to open proposal details"]
{1}
[/details]
"#,
proposal_id, orig_content
);
self.update_post_content(post_id, new_content).await
})
Expand Down
2 changes: 1 addition & 1 deletion rs/cli/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ impl Runner {
&change,
&health_of_nodes,
Some(format!(
"The following nodes in subnet `{}` have been cordoned and will be removed:\n{}",
"The following nodes in subnet `{}` have been cordoned and need to be removed from the subnet:\n{}",
subnet_id_short,
nodes_to_remove_with_explanations
.iter()
Expand Down

0 comments on commit 9c513fc

Please sign in to comment.