Skip to content

merge apichangelog into the changelog kind (I19.5) - #214

Merged
adssib merged 1 commit into
mainfrom
pl2-changelog
Nov 21, 2026
Merged

adssib merged 1 commit into
mainfrom
pl2-changelog

Conversation

@adssib

@adssib adssib commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #213

Closes #176

What this changes

One changelog kind, Markdown/RST or JSON (I19.5). apichangelog moves into plugins/changelog as its JSON parser: changelog.Plugin{Log: changelog.MongoDBAtlas} next to Plugin{File: …}. The JSON changelog now has versions: ListVersions is the commits that changed the file (versions.GitHubCommits), ReadAt the file at a commit, Extract the life-cycle findings the newer commit has that the older didn't. Run reads the newest commit, as before.

  • plugins/apichangelog stays as a deprecated forwarder (Plugin = changelog.Plugin, Log, Finding, MongoDBAtlas); CanonicalKind("apichangelog") is changelog.

Acceptance criteria

  • Today's changelog goldens byte-identical (and MongoDB Atlas's, moved: a pure rename)
  • A saved changelog with three releases: TestJSONChangelogPairByPair lists three commits oldest first and extracts the two consecutive pairs (plus the first from nothing, which Run covers), each giving only what that commit added. The Markdown side's pair test (TestReleasesAreListedAndExtractedPairByPair) was already there.
  • Terraform providers' changelogs use this kind: no Terraform source registered in this stack (I18)

Calls I made (please check)

  • The JSON changelog's events keep the endpoint's API version in version and leave previous_version empty: a pair of commits is two days of the file, not two releases of the API.
  • "No pinned tag" for the Markdown changelog was already done in part 1 (File.At pins only the goldens' cases).

Checks

  • make check passes (tidy, build, gofmt, vet, import allowlist, net/http guard, go test -race, no TODO(new-plugin), leak guard); make contract against patch-it's main fixtures passes (11 files).
  • Goldens: one pure rename (plugins/{apichangelog => changelog}/testdata/golden/mongodb-atlas.json, 0 lines changed)

Related PRs

🤖 Generated with Claude Code

changelog.Plugin reads a Markdown/RST changelog (File) or a JSON one (Log).
The JSON one now lists its versions (the commits that changed the file),
reads each, and extracts what a commit added. plugins/apichangelog only
forwards.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: adssib <[email protected]>
@claude

claude Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Claude finished @adssib's task in 1m 8s —— View job


✅ Ready to merge. The move is clean: MongoDB Atlas's registration and golden output are unchanged, the new commit-by-commit path follows the same rules for which changes count as events, and every check passes locally.

Rules

Rule Status Evidence
Metadata in the registration (Rule 1) ✅ The mongodb / atlas-admin-api RegisterProvider block moved word for word from apichangelog.go to plugins/changelog/changelog.go:51-59. It has the id, name, category, homepage, layer, watches, URL and page. The forwarder registers nothing, and plugins/all drops its import, so the source isn't registered twice. No hand-kept list appears anywhere. I read the metadata and it is still accurate.
Provider page ✅ providers/mongodb-atlas.md now names the changelog kind and json.go. Its Why this source section is unchanged, which is right because the source is unchanged.
Golden test and quote ✅ testdata/golden/mongodb-atlas.json is a pure rename (git diff -M shows 0 lines changed). The saved files moved with it, and their rows (URL, date, license, quote) now live in plugins/changelog/testdata/README.md. The synthetic log-history/* fixtures have their own row, marked "written for the test", and no golden reads them.
Drop test ✅ TestPropertyChangesMakeNoEvent still runs over the real 2026-11-18 day file.
Source URL and quote on every event ✅ extractLog sets SourceURL to the to commit's raw URL, with a pointer and excerpt into that same file (json.go:283-285).
Fetch only through env ✅ env.Get, github.LatestCommit and versions.GitHubCommits are the only fetches. No net/http and no filesystem access.
Nothing private (Rule 2) ✅ Nothing found in the code, docs, test data, commit message or PR body. The leak guard is clean.
Contract ✅ contract/fixtures/ is untouched.

Bugs

None found. Things I checked in the new pair logic (extractLog):

  • The finding key is the change type, operation and API version (json.go:301). It doesn't include the date or pointer, so a day re-indexed or re-dated between commits makes no event. That is precision over recall, as intended.
  • Deprecated, then reactivated, then deprecated again across commits: the third commit makes an event again, with the same fingerprint as the first, so patch-it's dedupe absorbs it. That's fine.
  • Run still gates on kit.Unchanged and sets the baseline as before. Its events are the same as the old apichangelog.Plugin.Run, which the unchanged golden confirms.
  • CanonicalKind("apichangelog") maps to changelog. apichangelog.Plugin is a type alias, so the kind is reported the same through either import path.

Verified

  • go build ./...: OK
  • go vet ./...: OK
  • gofmt -l .: printed nothing
  • go test -race ./...: all packages pass, including plugins/changelog (golden, drop test and TestJSONChangelogPairByPair), the plugins/apichangelog forwarder test and cmd/new-plugin (which still uses the apichangelog format)
  • python3 scripts/leak_guard.py --all: "no banned terms (8 hashed terms checked)"
  • I did not run make contract, because there's no patch-it checkout here.

Non-blocking (optional)

  • Two commits on the same day get the same version ID. versions.GitHubCommits sets ID to the commit's date (core/versions/versions.go:136). If MongoDB's CI releases the changelog twice in one day, two versions share an ID. The Ref (SHA) is still distinct, so extraction is correct, but anything that keys on Version.ID would see a collision. This is in existing code, not this PR, so a follow-up would do.
  • Backfill cost. Each ReadAt fetches the full file, about 10 MB according to the testdata notes. A full history backfill over every commit since 2023 is therefore a lot of data. It's worth keeping in mind if the hosted ingestion service runs ListVersions → ReadAt over the whole history.
  • I agree with the call to leave previous_version empty and keep the endpoint's API version in version. Two commits are two days of the file, not two API releases.

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.

I19.5 · One changelog kind

1 participant