Skip to content

v0.4.0 — ditto runs as a command, and knows what a staged change justifies

Choose a tag to compare

@Disble Disble released this 27 Aug 18:08

Ditto took a *testing.T, so anything that wanted to drive a release had to build a test to get in. That is where the wrappers came from. This is the command they were standing in for.

Breaking

  • The Go floor is 1.27, up from 1.25. Nothing in the code needs it; the toolchain does.

Added

  • ditto staged — mutates exactly what a staged change justifies: which files the index touches, which of their bytes, and it runs the suite against a checkout of the index, not of the working tree.

    Measured: with the release pointed at the worktree instead, and one tracked file left dirty and unstaged, 7 of 8 verdicts moved — 0.13 against 1.00 for the identical mutants of an identical file. Checking that the staged files are clean does not cover it, because the file that moved them was never staged.

    Held against the wrapper it replaces, on two staged changes in a real repository: 4 / 1 / 3 on one file and 9 / 5 / 4 on two, identical on both paths. The second case is the control — the numbers had to move, and both moved together.

  • cmd/ditto, with run and staged: go install github.com/Disble/ditto/cmd/ditto@v0.4.0. Policy stays with the caller — --threshold, --test-command, --exclude-prefix, --dry.

  • ditto.Run, a release with no test binary around it, plus ditto.RunStaged, ditto.PlanStaged and ditto.Verbose().

Fixed

  • A red baseline reaches a command as an error, not a panic. A gate must never make its own refusal indistinguishable from being broken.

Unchanged, and measured to be

The eight exact counters in perf/baseline.json did not move — including sandboxesBuiltPerRelease, whose own note records that it is registered through t.Cleanup in Release, which is precisely what this release restructured. The golden release output is byte-identical, and a new golden holds the command to the same bytes as the library.

What ran

Tagged on 33b5b5e, the exact merged head, after a green run on it: CI (1.27) and CI (latest) both pass, along with CodeQL, Analyze (go) and OSV-Scanner. SonarCloud reports neutral — it is inherited from upstream and applies its own gate, which is not this project's bar.