Skip to content
Open
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
1 change: 1 addition & 0 deletions esp-rom-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ license = "MIT OR Apache-2.0"
links = "esp_rom_sys"

[package.metadata.espressif]
semver-checked = true
forever-unstable = true
check-configs = [{ features = [] }]
clippy-configs = [{ features = [] }]
Expand Down
24 changes: 23 additions & 1 deletion xtask/src/semver_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::{
use anyhow::{Context, Error};
use cargo_semver_checks::{Check, GlobalConfig, ReleaseType, Rustdoc};
use esp_metadata::{Chip, Config};
use toml_edit::{Item, Value};

use crate::{Package, cargo::CargoArgsBuilder, commands::checker::download_baselines};

Expand Down Expand Up @@ -46,7 +47,6 @@ pub fn minimum_update(
let mut cfg = GlobalConfig::new();
cfg.set_log_level(Some(log::Level::Info));
let result = semver_check.check_release(&mut cfg)?;
log::info!("Result {:?}", result);

let mut min_required_update = ReleaseType::Patch;
for (_, report) in result.crate_reports() {
Expand All @@ -59,6 +59,28 @@ pub fn minimum_update(
}
}

let forever_unstable = package
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not necessarily something which needs to be done in this PR but we could have a forever_unstable() method on Package - we now have this piece of code duplicated

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo this should be done here, as its the first copy of the original. Let's refactor this now.

.toml()
.espressif_metadata()
.and_then(|metadata| metadata.get("forever-unstable"))
.map(|item| match item {
Item::Value(Value::Boolean(b)) => *b.value(),
Item::Value(_) => {
log::warn!("Invalid value for 'forever-unstable' in metadata - must be a boolean");
true
}
_ => false,
})
.unwrap_or(false);

if forever_unstable && min_required_update == ReleaseType::Major {
log::warn!(
"Downgrading required bump from Minor to Patch for unstable package: {}",
package
);
min_required_update = ReleaseType::Minor;
}

Ok(min_required_update)
}

Expand Down
Loading