3 Commits
Author SHA1 Message Date
slop-cannon Botandjackos1998 50b3103b9f 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>
2026-11-26 22:51:19 +00:00
jackos1998 e59d5d377e release: Derive the Nix version from Cargo
CI / Check (pull_request) Successful in 4m43s
CI / Check (push) Successful in 5m43s
2026-11-26 21:48:34 +00:00
jackos1998 5123ba7643 ci: Check branch changes once per pull request 2026-11-26 21:47:57 +00:00
7 changed files with 42 additions and 12 deletions

No files matched your search

+3 -2
View File
@@ -2,6 +2,7 @@ name: CI
on:
push:
branches: [main]
pull_request:
jobs:
@@ -18,7 +19,7 @@ jobs:
extra-conf: |
sandbox-fallback = false
# Builds the package with its tests, clippy, rustfmt and the VM test (which needs KVM), and
# evaluates the other outputs
# Builds the package with its tests, runs clippy, rustfmt, shellcheck and the VM test
# (which needs KVM), and evaluates the other outputs
- name: Check the flake
run: nix flake check -L
+2 -1
View File
@@ -39,7 +39,8 @@ of devenv's scripts, `devenv test` or the demo's host side.
errors) and the tests.
- `cargo fmt` — the crate is formatted with `rustfmt` (`rustfmt.toml`); run it on code you change.
- `nix build` — the package, which also runs the tests.
- CI ([`.gitea/workflows/ci.yaml`](.gitea/workflows/ci.yaml)) runs `nix flake check` on every push:
- CI ([`.gitea/workflows/ci.yaml`](.gitea/workflows/ci.yaml)) runs `nix flake check` for pull
requests and pushes to `main`:
the package with its tests, `clippy` (warnings as errors), `fmt` (`cargo fmt --check`),
`shellcheck` on `src/**/*.sh` and the VM test. Keep them passing. `nix flake check --no-build`
fails where the VM test's keys haven't been built, because the test reads them at evaluation.
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"
+14
View File
@@ -45,6 +45,20 @@ The development environment is [devenv](https://devenv.sh): direnv with `.envrc`
and `cargo clippy --all-targets` work there, `devenv test` runs both, and `vm-test` runs the NixOS
VM test (needs KVM). See [`AGENTS.md`](AGENTS.md) for conventions.
## Releasing
Use SemVer for the CLI, request protocol and Nix module options. Bump the patch for
compatible fixes and the minor for compatible features. While the major is zero,
use a minor bump for breaking changes and document how to upgrade. After `1.0.0`,
bump the major for breaking changes.
1. Set `package.version` in `Cargo.toml` and run `cargo check` to refresh
`Cargo.lock`. The Nix package reads the version from `Cargo.toml`.
2. After the release commit lands on `main` and passes CI, tag it `v<version>` and
push the tag. Keep published tags fixed.
3. Update the `slop-broker` input in nixfiles to `ref=refs/tags/v<version>` and run
`nix flake update slop-broker` there to refresh its lock entry.
## License
MIT; see [`LICENSE`](LICENSE).
+1 -1
View File
@@ -4,7 +4,7 @@ let
in
rustPlatform.buildRustPackage {
pname = "slop-broker";
version = "0.1.0";
inherit ((builtins.fromTOML (builtins.readFile ../Cargo.toml)).package) version;
src = toSource {
root = ../.;
+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", "", ""]);
}