deploy: Label unchanged versions and bump to 0.1.1
CI / Check (push) Successful in 4m45s

Show `unchanged` in the deployment approval's Version column when Nix
reports a size change for the same version. Keep colour-formatted sizes
in the Size column and render them as plain text.

Bump Cargo and its lock entry to `0.1.1`. The first release tag used
the package version already shipped by nixfiles, so that update
produced no package version delta. After this lands and passes CI,
tag `v0.1.1` and update the nixfiles pin.

---------

Co-authored-by: Jack O'Sullivan <jackos1998@gmail.com>
Reviewed-on: #6
Co-authored-by: slop-cannon <slop-cannon@nul.ie>
This commit was merged in pull request #6.
This commit is contained in:
slop-cannon Botandjackos1998 authored and Jack O'Sullivan committed 2026-11-26 22:51:19 +00:00
1 parent e59d5d377e
commit 50b3103b9f
3 files changed
+22 -8

No files matched your search

Generated
+1 -1
View File
@@ -3859,7 +3859,7 @@ checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
[[package]]
name = "slop-broker"
version = "0.1.0"
version = "0.1.1"
dependencies = [
"age",
"anyhow",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "slop-broker"
version = "0.1.0"
version = "0.1.1"
edition = "2024"
description = "Approval broker that runs privileged operations for coding agents"
license = "MIT"
+20 -6
View File
@@ -417,12 +417,24 @@ impl Changes {
/// and size change.
fn package_cells(line: &str) -> [&str; 3] {
let Some((name, rest)) = line.split_once(": ") else { return [line, "", ""] };
let is_size = |s: &str| s.starts_with(['+', '-']);
match rest.rsplit_once(", ") {
Some((version, size)) if is_size(size) => [name, version, size],
_ if is_size(rest) => [name, "", rest],
_ => [name, rest, ""],
if let Some((version, size)) = rest.rsplit_once(", ")
&& let Some(size) = package_size(size)
{
return [name, version, size];
}
if let Some(size) = package_size(rest) {
return [name, "unchanged", size];
}
[name, rest, ""]
}
fn package_size(value: &str) -> Option<&str> {
// Some Nix versions indicate the direction with colour even on piped output.
value
.strip_prefix("\x1b[31;1m")
.or_else(|| value.strip_prefix("\x1b[32;1m"))
.and_then(|size| size.strip_suffix("\x1b[0m"))
.or_else(|| value.starts_with(['+', '-']).then_some(value))
}
#[cfg(test)]
@@ -432,7 +444,9 @@ mod tests {
#[test]
fn splits_package_lines() {
assert_eq!(package_cells("a: 1.0 → 1.1, +3.4 KiB"), ["a", "1.0 → 1.1", "+3.4 KiB"]);
assert_eq!(package_cells("b: -12.0 KiB"), ["b", "", "-12.0 KiB"]);
assert_eq!(package_cells("b: -12.0 KiB"), ["b", "unchanged", "-12.0 KiB"]);
assert_eq!(package_cells("b: \x1b[31;1m12.0 KiB\x1b[0m"), ["b", "unchanged", "12.0 KiB"]);
assert_eq!(package_cells("b: 1.0 → 1.1, \x1b[32;1m-12.0 KiB\x1b[0m"), ["b", "1.0 → 1.1", "-12.0 KiB"]);
assert_eq!(package_cells("c: ∅ → 2.0"), ["c", "∅ → 2.0", ""]);
assert_eq!(package_cells("odd"), ["odd", "", ""]);
}