Skip to content

CodeWitness 1.0.22

Choose a tag to compare

@github-actions github-actions released this 08 Nov 09:17
· 5 commits to main since this release

CodeWitness 1.0.22 brings the CI workflow's action pins to the releases their own comments name, and stops the
repository from being able to acquire a mutable tag pin — or two versions of one action — without the fast suite
failing.

What changed

  • Four pins were behind the release recorded beside them, and one of them was behind in three files at once.
    Sixteen uses: lines across three workflow files pin twelve distinct actions to a commit SHA; a SHA never moves
    on its own, which is the point of it, so each was resolved deliberately from upstream's tag to its commit:

    Action Was Now
    actions/setup-java v6.1.0 v6.2.0
    actions/setup-python v7.0.0 v7.1.0
    actions/setup-dotnet v6.0.0 v6.1.0
    ruby/setup-ruby v1.329.0 v1.338.0

    setup-java is pinned in ci.yml, codeql.yml and release.yml. All three moved together, because a pipeline
    that builds on v6.1.0 in its CodeQL job and v6.2.0 in its test job is running two versions of one action, and the
    one nobody looked at is the one that did not get reviewed.

    Each tag was resolved to a commit with the GitHub API rather than copied from a report — the same API that a
    dependency scanner read when it offered shivammathur/setup-php an "update" to verbose, which is a tag on that
    repository and not a version of anything.

  • CiActionPinsTest now holds the invariant ci.yml stated only in prose. The workflow's comment block claims
    every action is pinned to a full-length commit SHA rather than a movable tag; that claim had no test behind it,
    and uses: actions/checkout@v4 is exactly the line a hurried "fix the CI" commit writes. The test checks three
    things across every workflow file:

    • every uses: names a 40-character commit SHA — no tag, no branch, no short SHA;
    • every SHA carries a # <release> comment, because .github/dependabot.yml reads that comment to know which
      release a SHA is, and a pin without one quietly stops being tracked;
    • the same action is pinned to one SHA across the whole pipeline.
  • The reactor-root walk-up was extracted rather than copied. PackagingNativeAccessTest already walked up from
    the working directory to find the aggregator POM, because Surefire's working directory is the module directory
    and differs between a full reactor build and ./mvnw -pl codewitness-cli test. The new test needs the same
    walk-up and the same subtle rule that distinguishes the reactor root from a module POM that merely names
    codewitness-parent, so it moved into ReactorRoot and both tests call it.

  • Left alone on purpose. dtolnay/rust-toolchain is a commit at the tip of a moving stable branch with no
    release tag; dependabot.yml says it must be refreshed deliberately, and refreshing it here would move the Rust
    fixture's compiler as a side effect of a housekeeping release. The two github/codeql-action pins were also
    left untouched — see the correction at the end of these notes for why that was wrong.

What this does not fix

  • It does not keep the pins current; it keeps them well-formed. The test asserts the form of a pin, not its
    currency. A pin can be a valid full-length SHA with a correct version comment and still be a year old, and
    noticing that needs the network — which is why it stays Dependabot's job. The mechanism is imperfect in a way
    worth recording: the one open Dependabot pull request covers two of these four actions, and by the time it was
    read its ruby/setup-ruby pin proposed v1.336.0 when v1.338.0 was current. A grouped PR is only as fresh as the
    day it opened.

  • It cannot tell whether a SHA belongs to the repository named beside it, or whether the comment is the release
    that SHA came from.
    Both need upstream, and both are what a bad manual edit gets wrong. The test catches a
    missing comment and a disagreeing pair of pins; it would not have caught a comment reading v6.2.0 beside
    v6.1.0's commit, which is why the four bumps here were resolved from the API rather than hand-typed.

  • A dependency scanner cannot track the two github/codeql-action pins, though Dependabot can. A scanner that
    splits an action reference on its final / reads github/codeql-action/init as a repository named
    codeql-action/init, gets a 404, and drops both init and analyze from its results entirely. That is the
    scanner's defect and not a gap in this repository's coverage: .github/dependabot.yml covers every workflow file
    in / with pattern *, and Dependabot resolves a subpath reference to its repository, so these pins are tracked
    like the rest. The test added here covers their form — well-formed, and one version across the pipeline — but
    it cannot tell whether either pin is current, which is why the pins then went two releases stale. See the
    correction at the end.

  • No behaviour changes. No adapter, phase, verdict rule, report field, budget or exit code is touched. The one
    user-visible difference is the version string in reports.

Verified for this release

  • Full reactor suite: 1,763 tests, 0 failures, 0 errors, 0 skipped across the 22 test modules (up from 1,762;
    CiActionPinsTest is the only addition). PackagingNativeAccessTest still passes after its helper was
    extracted, which is what makes the extraction safe rather than a rewrite.
  • All three assertions were proved to fire, each against a backup of the file and each restored afterwards:
    • Pinning actions/setup-go@v7 in place of its SHA fails with setup-go@v7 is not pinned to a 40-character commit SHA. A tag or branch can be re-pointed at different code after review….
    • Stripping the comment from ruby/setup-ruby@b3aacea… fails with …carries no # <release> comment. Dependabot reads that comment to know which release the SHA is….
    • Leaving codeql.yml at v6.1.0 while ci.yml and release.yml moved to v6.2.0 fails with codeql.yml:51: actions/setup-java is pinned to b843ebf9… here but to 77dd5b2c… elsewhere in .github/workflows. One pipeline, two versions of one action….
  • All sixteen pins in the three workflow files now resolve to a 40-character SHA with a version comment, and
    actions/setup-java resolves to a single SHA across all three.
  • ./codewitness version and java -jar codewitness-cli/target/codewitness.jar version both print
    codewitness 1.0.22.
  • Self-check against the built jar (./codewitness verify . --requirements selfcheck/requirements.yaml --config selfcheck/codewitness.yaml --no-mutation --max-duration 30m): all seven ground rules VERIFIED,
    1,763 tests executed and passed, 0 findings — five suppressed with their reasons — coverage 71.2% line
    (25563/35919) and 59.4% branch, 30 resolved dependencies with 0 advisories from OSV, and exit 0 in
    1 m 45 s. Run CW-2026-11-08-EHFGG. selfcheck/README.md quotes this run.

Process note

This release was found by pointing a dependency-scanner MCP server (depmcp 0.11.0) at the repository rather than
by a human noticing, and the way it went wrong is the useful part. The scanner has no Maven support, so of the
project's 23 POMs it read none: its 21 "dependencies" were the workflow pins, one setuptools constraint, and four
entries that are not dependencies at all — requires-python looked up on PyPI as a package, and the fixtures'
own version = "0.1.0" field matched against a 2014 PyPI package literally named version, which it then
proposed bumping to 0.1.1. That is why the pins here were resolved from the GitHub API by hand and no update plan
was applied: the plan contained two entries that would have broken the repository, and applying it applies every
group at once.

The near-miss is worth recording because the new test caught it: the first pass at this change bumped
actions/setup-java in ci.yml only. The version-comment and SHA assertions both passed, and the pipeline would
have run v6.2.0 for tests and v6.1.0 for CodeQL — a difference invisible in review, in a green build, and in the
report. The third assertion exists because of that mistake.

Compatibility

  • No CLI command, flag, exit code, report key, SARIF profile, configuration key or adapter-SPI change. A project
    verified by 1.0.21 is verified identically by 1.0.22; only version in the report differs.
  • The two new test-visible files are ReactorRoot and CiActionPinsTest, both in codewitness-cli's test tree;
    neither is part of any published artifact.

Correction (added in 1.0.23)

Two statements in this note about github/codeql-action were false, and the pins they excused were two patch
releases out of date at the time of writing. Both are corrected above; the original wording is recorded here so
the record cannot quietly improve.

  • Claimed: "their tags are codeql-bundle-v* rather than semver." Wrong. The action's own tags are
    ordinary semver — v4.39.0, v4.39.1, v4.39.2, v4.39.3. Only the bundle releases use codeql-bundle-v*,
    which is why releases/latest answers codeql-bundle-v2.27.4; that is a reason for a naive resolver to
    stumble, not a reason to stop tracking the pins.
  • Claimed: "github/codeql-action still gets no update proposal from anything." Wrong. Dependabot covers
    every action in every workflow under /, and resolves github/codeql-action/init to its repository. It had
    simply not proposed either release yet.
  • And the pins were stale. Both sat at v4.39.1 (2026-10-21) while v4.39.2 (2026-11-03) and v4.39.3
    (2026-11-04) had shipped. v4.39.3 fixes diff-informed alert filtering incorrectly removing alerts in
    changed files whose paths contain spaces, special characters or non-ASCII characters — for a scanning workflow
    that is not housekeeping.

The mechanism behind the mistake is worth keeping: the dependency scanner returned both pins with an "error"
and no candidate, and the reasoning that filled the gap was written from assumption rather than from
/tags. 1.0.23 moves the pins and re-keys the consistency assertion on the repository, so that a half-applied
CodeQL bump — init moved and analyze not — now fails the fast suite instead of passing it.