Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update discourse forum posts contents for subnet proposals #1151

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading