Skip to content

#505 docs: contract has no CHANGELOG.md for tracking version history FIXED - #549

Merged
Naomi-Gift merged 4 commits into
HubDApp:mainfrom
felladaniel36-hash:#505--docs--contract-has-no-CHANGELOG.md-for-tracking-version-history-FIX
Aug 20, 2026
Merged

#505 docs: contract has no CHANGELOG.md for tracking version history FIXED#549
Naomi-Gift merged 4 commits into
HubDApp:mainfrom
felladaniel36-hash:#505--docs--contract-has-no-CHANGELOG.md-for-tracking-version-history-FIX

Conversation

@felladaniel36-hash

Copy link
Copy Markdown
Contributor

Summary

The repository had no structured version history. A CHANGELOG.md did exist at the
root, but it was a by-product of the docs-consolidation work (#504) and did not
follow the Keep a Changelog format the issue
asks for: releases were identified by bare dates instead of Semantic Versions, there
were no link-reference definitions, breaking changes were never flagged, the file was
disconnected from the crate version, and nothing told contributors to update it — so
recently merged work (#503, #508, #514, proposal payload-hash verification) had
already drifted out of it.

This PR rewrites CHANGELOG.md to strict Keep a Changelog 1.1.0 + SemVer, backfills
the full project history into six versioned releases (0.1.00.6.0), flags every
on-chain breaking change with operator guidance, and — most importantly — makes the
format machine-enforced with a new dependency-free validator wired into CI, plus a
written contributor policy so the file cannot rot again.

No Rust source file is touched by this PR.

Type of Change

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Refactoring / Documentation update

Changes Made

Documentation

  • CHANGELOG.md (rewritten, +191/-56)
  • docs/CONTRIBUTING.md (+73) — new ## 6. Changelog Entries: the
    "every user-visible change needs an Unreleased entry" policy, a worked example,
    the BREAKING convention, local validation commands, the list of enforced rules, and
    a 4-step release-cutting runbook. Also adds a PR-checklist item and a ## Changelog
    block to the PR description template.
  • README.md (+2/-2) — changelog links now state the format and that it is
    CI-validated.

Tooling

  • scripts/validate_changelog.py (new) — standard-library-only validator. Fails
    the build when the changelog:
    1. is missing/empty or lacks the # Changelog title and format references;
    2. has no ## [Unreleased], or places it below a release;
    3. uses a heading that is not ## [X.Y.Z] - YYYY-MM-DD (invalid SemVer or
      non-ISO-8601 date);
    4. repeats a version, or lists versions/dates out of newest-first order;
    5. uses a non-Keep-a-Changelog category, or leaves a category empty;
    6. omits a link-reference definition for any version, or leaves an orphan one;
    7. disagrees with the dongle-contract version in
      dongle-smartcontract/Cargo.toml.
  • scripts/test_validate_changelog.py (new) — 15 self-tests (14 positive/negative
    fixtures plus the live repository file). No pytest or third-party dependency needed.
  • .github/workflows/ci.yml (+10) — new validate-changelog job running both
    scripts on every push and PR. Placed alongside validate-manifest so it fails fast
    before any Rust toolchain is provisioned; it does not gate build, so a docs-format
    failure never blocks artifact production. Adds ~10s to CI wall time.

Version alignment

  • dongle-smartcontract/Cargo.toml: version = "0.1.0""0.6.0", matching the
    newest changelog release (the validator now keeps these two in lockstep).
  • Cargo.lock and dongle-smartcontract/Cargo.lock: dongle-contract version synced.
    Verified with cargo metadata --locked — no lock drift, CI will not report
    "lock file needs to be updated".
  • .gitignore (+4): ignore __pycache__/, *.py[cod], .pytest_cache/ generated by
    the new Python scripts, consistent with the artifact hygiene established in refactor: remove test output text files committed to dongle-smartcontract directory #503.

Acceptance Criteria

  • A CHANGELOG.md exists at the repository root and follows Keep a Changelog 1.1.0.
  • The project adheres to Semantic Versioning, with one section per release.
  • Version history is complete — every prior release is represented.
  • Breaking changes are explicitly identified with the action integrators must take.
  • Feature additions are categorised under Added with issue/PR references.
  • Contributors have documented guidance for adding entries and cutting releases.
  • The format is enforced automatically rather than by review discipline alone.
  • The crate version and the changelog cannot silently diverge.
  • No Rust source, contract interface, storage key, event or error code is changed.

Test Coverage

All checks run locally on Rust 1.85.0 (the version pinned in CI):

Command Result
python3 scripts/validate_changelog.py pass — valid (Keep a Changelog 1.1.0 + SemVer)
python3 scripts/test_validate_changelog.py pass — 15/15
python3 scripts/validate_deployments.py (pre-existing gate) pass
cargo metadata --locked pass — workspace resolves, no lock drift
cargo test -p dongle-contract pass — 522 passed, 0 failed, 0 ignored
cargo build -p dongle-contract --target wasm32-unknown-unknown --release pass — dongle-contract v0.6.0, 432,543-byte wasm

Total: 538 checks, 0 failures.

Negative-path evidence — the new validator run against the pre-fix CHANGELOG.md
from main reports 8 violations (six date-as-version headings, "no released
versions found", missing [Unreleased] link definition); against the file in this PR
it reports 0.

Known pre-existing failure (not introduced here)

cargo fmt --all -- --check fails on changelog_registry.rs, lib.rs, utils.rs,
types.rs, events.rs, fee_manager.rs and verification_registry/storage.rs.
This is an existing condition on main: this PR modifies zero .rs files
(git diff --name-only | grep '\.rs$' returns nothing). Happy to fix it in a separate
formatting-only PR if maintainers prefer.

Files Changed

Created (2)

  • scripts/validate_changelog.py
  • scripts/test_validate_changelog.py

Modified (8)

  • CHANGELOG.md
  • docs/CONTRIBUTING.md
  • README.md
  • .github/workflows/ci.yml
  • dongle-smartcontract/Cargo.toml
  • Cargo.lock
  • dongle-smartcontract/Cargo.lock
  • .gitignore

Diffstat: 8 files changed, 229 insertions(+), 56 deletions(-) plus the two new scripts.

Reviewer Notes

  • The version-to-date mapping (0.6.0 ↔ 2026-08-01, etc.) preserves the previous
    date-based sections one-for-one; only the labels became SemVer. Please confirm the
    0.6.0 starting point is the intended current version — if maintainers prefer
    1.0.0 or a 0.x pre-release scheme, only the headings, the link block and
    Cargo.toml need updating, and the validator will confirm the result.
  • No git tags exist yet, so the compare links point at vX.Y.Z tags that should be
    created at release time (git tag v0.6.0). The links resolve as soon as the tags
    exist and do not affect validation.
  • To relax the crate-version check, delete the final block in
    validate_changelog.py::validate; every other rule is independent.

Changelog

  • Entry added to CHANGELOG.md under ## [Unreleased] (category: Added / Changed)

Related Issues

Closes #505

@Naomi-Gift
Naomi-Gift merged commit 9352803 into HubDApp:main Aug 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: contract has no CHANGELOG.md for tracking version history

2 participants