Skip to content

CHANGELOG: nothing couples the top release heading to the version constant, or rejects a future date #494

Closed

Description

@scttfrdmn

internal/config/changelog_test.go has three gates and they are all about link references:
TestChangelogSectionsAllHaveLinkReferences, TestChangelogUnreleasedComparesFromTheNewestRelease,
TestChangelogLinkReferencesCompareConsecutiveReleases. Two properties of the heading itself are
unchecked, and one of them was violated in the 0.14.0 cut.

1. A future release date

The 0.14.0 heading was written as ## [0.14.0] - 2026-09-15 on 2026-09-14 — a release dated one day
after the tag that describes it. Caught by reading it, which is not a mechanism. Keep a Changelog's
date field is the release date, so a date after today is unambiguously wrong at the moment it is
committed; there is no development state in which it is correct.

Cheap and total: parse the date out of every ## [x.y.z] - <date> heading, assert it parses as
2006-01-02, and assert the newest is not after today. Asserting the whole list is also monotonically
non-increasing costs nothing extra and catches a section inserted in the wrong place — which is a
mistake made once already in this same cut, where the ## [0.14.0] heading first landed below
Unreleased's content and left everything under Unreleased.

2. The top heading versus the version constant

cmd/objectfs/main.go's version is the only authority for the current version — CLAUDE.md says so
and TestNoDocumentRestatesTheCurrentVersion enforces that no document restates it. But a changelog
heading
is not a restatement of the current version, it is a record of a release, so it is correctly
outside that test's scope, and the result is that nothing checks the two agree.

They should, and the invariant holds today. Verified against history rather than assumed — at each of
v0.10.0, v0.10.3, v0.11.0, v0.12.0, v0.13.0 and bbc94ec the newest ## [x.y.z] heading equals the
constant at that ref, because this project bumps the constant in the same PR that promotes Unreleased.

The failure it guards is the one CLAUDE.md records as having already happened in a different form:
five files claiming five different versions. A release that promotes the CHANGELOG and forgets the
constant ships a binary that reports the previous version, and install.sh ends by running
objectfs --version and printing it — so the user is told they installed the version before the one
they asked for, by the installer, as a success message.

Not a blocker for anything

Both are static assertions over one file in a package that already reads it, so this is a small,
self-contained gate rather than new machinery. Filed rather than folded into the 0.14.0 PR so the
release was not delayed another CI cycle for it.

Activity

  1. added this to the Future Work milestone on Sep 15, 2026
  2. added
    type: ci-cd
    priority: low
    effort: small
    area: ci-cd
    on Sep 15, 2026
  3. scttfrdmn commented on Sep 15, 2026

    @scttfrdmn
    OwnerAuthor

    Correcting part 1 of this issue, because cutting 0.14.0 showed the framing was wrong.

    I described ## [0.14.0] - 2026-09-15 written on 2026-09-14 as "unambiguously wrong at the moment it
    is committed." It was not. The tag went up at 2026-09-14 23:09 -0700, which is 2026-09-15 06:09
    UTC
    , and the release published at 2026-09-15T06:23:16Z. So 2026-09-15 was the UTC release date
    and the heading was defensible; the question was never future-versus-past, it was which timezone the
    date field means.

    Which makes "reject a future date" the wrong gate. Implemented naively it compares against
    whichever clock the runner has, and GitHub Actions runners are UTC while this project is cut from
    Pacific. Any release tagged after 5pm Pacific would be flagged by CI and pass locally, or the reverse —
    a check that disagrees with itself depending on where it runs, for eight hours out of every day.

    The project already has a convention, and it is local time. Three of the four previous releases had
    the same UTC and local date, so they cannot distinguish. v0.10.3 can: UTC 2026-08-03, local
    2026-08-02, and CHANGELOG.md says 2026-08-02. One data point, but it is the only one that
    resolves the question, and 0.14.0 now matches it at 2026-09-14.

    So the gate to build is not "not in the future" but "equal to the tag's own authored date" —
    git log -1 --format=%ai <tag>, which carries the committer's offset, so it is the local date by
    construction and needs no timezone assumption at all. That is checkable after the fact for every
    released version and is a stronger property than a bound against today: it catches a date typed
    wrong in either direction, not just forward.

    Two consequences for the implementation:

    • It cannot run on the newest section before that section is tagged, so the gate has to skip the
      top entry when no matching tag exists yet, and check every entry that has one. A test that skipped
      everything because no tags were fetched would pass vacuously — CI checkouts are shallow and carry no
      tags by default, so it needs fetch-depth: 0 plus a floor on how many sections it actually compared.
    • Part 2 of this issue (top heading versus the version constant) is unaffected and remains the
      straightforwardly correct half.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ci-cdeffort: smallpriority: lowtype: ci-cd

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions