Skip to content

Commit 32f07cf

Browse files
MattJacksonMatthew Jackson
andauthored
ci: make public-hygiene-lint green (#5)
The public-hygiene gate flags text in customer-readable files that describes how the software was BUILT rather than what it DOES. Every hit in this repo is rewritten to state the behaviour or the invariant; no allow markers are added, so the gate keeps its teeth. Co-authored-by: Matthew Jackson <dev@getbusbar.com>
1 parent 25318c4 commit 32f07cf

4 files changed

Lines changed: 20 additions & 22 deletions

File tree

.github/scripts/next-version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# next-version.sh — compute THIS repo's next release tag for release-on-upstream.yml.
33
#
44
# Single source of truth for the version math, exercised in CI by release-selftest.yml so the
5-
# release automation can't silently rot (guard #135.8). Prints "v<MAJOR>.<MINOR>.<PATCH>" to stdout.
5+
# release automation can't silently rot. Prints "v<MAJOR>.<MINOR>.<PATCH>" to stdout.
66
#
77
# Inputs (env, all optional):
88
# INPUT_VERSION explicit version to cut (leading "v" tolerated) -> used verbatim.

.github/workflows/release-selftest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# CI self-test for the release-on-upstream version-compute logic (guard #135.8).
1+
# CI self-test for the release-on-upstream version-compute logic.
22
# Runs the REAL .github/scripts/next-version.sh against synthetic repos and asserts it produces a
33
# valid next version for BOTH the has-prior-tag and no-prior-tag cases — WITHOUT publishing anything.
44
# This is what keeps the release automation from silently rotting before the fleet fan-out is armed.

store-valkey/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ fn url_password(url: &str) -> Option<String> {
228228

229229
/// Percent-DECODE a URL component (`%40` -> `@`, `%25` -> `%`). A malformed escape is left verbatim.
230230
/// Used so the scrub redacts BOTH the raw (as-written-in-URL) and decoded forms of the password -
231-
/// the valkey driver may surface either in an error string (L1).
231+
/// the valkey driver may surface either in an error string.
232232
fn percent_decode(s: &str) -> String {
233233
let bytes = s.as_bytes();
234234
let mut out = Vec::with_capacity(bytes.len());

store-valkey/src/tests.rs

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -896,20 +896,18 @@ fn connect_refuses_to_start_under_an_eviction_policy() {
896896
);
897897
}
898898

899-
// ── migrate() / with_conn retry — mutation-testing coverage gaps (round: cargo-mutants) ───────
899+
// ── migrate() / with_conn retry: guards on two predicates in `store-valkey/src/lib.rs` ─────────
900900
//
901-
// `cargo-mutants` against `store-valkey/src/lib.rs` found four real coverage gaps (no production
902-
// bug — the existing logic is correct, but nothing in the suite would have caught it breaking):
903-
// - `migrate()`'s `version >= SCHEMA_VERSION` early-return guard (mutating `>=` to `<` survived
904-
// every existing test) — nothing exercised a SECOND `connect()` against an
905-
// already-migrated namespace, which is exactly the case that guard exists to protect: without
906-
// it, every reconnect would wipe the entire shared `busbar:*` keyspace.
907-
// - `run()`'s `retry && is_connection_error(&e)` match guard (mutating it to `true`, `false`, or
908-
// `retry || is_connection_error(&e)` all survived) — nothing exercised either half of the
909-
// condition independently: a non-connection error under `retry: true` (must NOT retry) or a
910-
// genuine connection-level error (must retry and transparently recover).
911-
912-
/// Kills the `version >= SCHEMA_VERSION` -> `version < SCHEMA_VERSION` mutant: a second
901+
// The logic these pin is correct; what was missing was anything that would fail if it broke. Both
902+
// predicates are silent in normal operation and catastrophic when wrong:
903+
// - `migrate()`'s `version >= SCHEMA_VERSION` early return. If that comparison were inverted, a
904+
// SECOND `connect()` against an already-migrated namespace would wipe the entire shared
905+
// `busbar:*` keyspace on every reconnect.
906+
// - `run()`'s `retry && is_connection_error(&e)` match guard. Each half must hold on its own: a
907+
// non-connection error under `retry: true` must NOT be retried, and a genuine connection-level
908+
// error must be retried and transparently recovered.
909+
910+
/// Pins the `version >= SCHEMA_VERSION` early return against inversion: a second
913911
/// `connect()` (fresh `ValkeyStore`, fresh internal `migrate()` call) against a namespace already
914912
/// at the current schema version must be a pure no-op, not a full `busbar:*` wipe.
915913
#[test]
@@ -932,9 +930,9 @@ fn reconnecting_to_an_already_migrated_namespace_does_not_wipe_existing_data() {
932930
);
933931
}
934932

935-
/// Kills the `true` and `retry || is_connection_error(&e)` mutants: a deterministic
936-
/// NON-connection error (`WRONGTYPE`, from issuing `LPUSH` against a string-valued key) under
937-
/// `with_conn` (`retry: true`) must surface directly via the `"command"` error context, never
933+
/// Pins the `retry && is_connection_error(&e)` guard against a constant-true or `||` form. A
934+
/// deterministic NON-connection error (`WRONGTYPE`, from issuing `LPUSH` against a string-valued
935+
/// key) under `with_conn` (`retry: true`) must surface directly via the `"command"` error context, never
938936
/// silently retry — a retry would issue the exact same doomed command again and report it via the
939937
/// `"retry after reconnect"` context instead, which is what this test would see if the guard ever
940938
/// stopped checking `is_connection_error` at all.
@@ -960,9 +958,9 @@ fn with_conn_does_not_retry_a_non_connection_error() {
960958
store.with_conn(|c| c.del::<_, ()>(&k)).unwrap();
961959
}
962960

963-
/// Kills the `false` mutant: a genuine connection-level error (the server killing our connection
964-
/// out from under usthe real-world case `with_conn`'s reconnect-and-retry exists for) must be
965-
/// transparently recovered, not surfaced to the caller.
961+
/// Pins the retry half of the guard: a genuine connection-level error (the server killing our
962+
/// connection out from under us, the real-world case `with_conn`'s reconnect-and-retry exists for)
963+
/// must be transparently recovered, not surfaced to the caller.
966964
#[test]
967965
fn with_conn_transparently_reconnects_after_the_connection_is_dropped() {
968966
let Some(store) = live_store() else { return };

0 commit comments

Comments
 (0)