Add new change-id option in bootstrap.example.toml and update the change-id description references

This commit is contained in:
bit-aloo 2025-03-27 23:10:30 +05:30
parent 02444322c0
commit b24083bccc
No known key found for this signature in database
GPG Key ID: 02911B24FDAE81DA
4 changed files with 11 additions and 6 deletions

View File

@ -28,8 +28,9 @@
# - A new option
# - A change in the default values
#
# If `change-id` does not match the version that is currently running,
# `x.py` will inform you about the changes made on bootstrap.
# If the change-id does not match the version currently in use, x.py will
# display the changes made to the bootstrap.
# To suppress these warnings, you can set change-id = "ignore".
#change-id = <latest change id in src/bootstrap/src/utils/change_tracker.rs>
# =============================================================================

View File

@ -163,7 +163,7 @@ fn check_version(config: &Config) -> Option<String> {
msg.push_str("WARNING: The `change-id` is missing in the `bootstrap.toml`. This means that you will not be able to track the major changes made to the bootstrap configurations.\n");
msg.push_str("NOTE: to silence this warning, ");
msg.push_str(&format!(
"add `change-id = {latest_change_id}` at the top of `bootstrap.toml`"
"add `change-id = {latest_change_id}` or change-id = \"ignore\" at the top of `bootstrap.toml`"
));
return Some(msg);
}
@ -195,7 +195,7 @@ fn check_version(config: &Config) -> Option<String> {
msg.push_str("NOTE: to silence this warning, ");
msg.push_str(&format!(
"update `bootstrap.toml` to use `change-id = {latest_change_id}` instead"
"update `bootstrap.toml` to use `change-id = {latest_change_id}` or change-id = \"ignore\" instead"
));
if io::stdout().is_terminal() {

View File

@ -724,7 +724,11 @@ fn deserialize_change_id<'de, D: Deserializer<'de>>(
Ok(match value {
toml::Value::String(s) if s == "ignore" => Some(ChangeId::Ignore),
toml::Value::Integer(i) => Some(ChangeId::Id(i as usize)),
_ => return Err(serde::de::Error::custom("expected \"ignore\" or an integer")),
_ => {
return Err(serde::de::Error::custom(
"expected \"ignore\" or an integer for change-id",
));
}
})
}

View File

@ -393,6 +393,6 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
ChangeInfo {
change_id: 138986,
severity: ChangeSeverity::Info,
summary: "You can now use `change_id = \"ignore\"` to suppress `change_id` warnings in the console.",
summary: "You can now use `change-id = \"ignore\"` to suppress `change-id ` warnings in the console.",
},
];