Skip to content

merge removedmembers into the migrationguide kind (I19.4) - #213

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

1 commit merged into
mainfrom
pl2-migrationguide

Conversation

@adssib

@adssib adssib commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Closes #175

What this changes

One kind for "a guide that lists what a release removed" (I19.4). plugins/migrationguide has one Plugin and one Extract; a source's Guide is its reader: sdkguide.Guide (an SDK's removed request parameters) or the new members.Guide (a package's removed members, RST or Markdown tables; the old removedmembers code, moved to plugins/migrationguide/members). NumPy, PostHog and New Relic register on migrationguide now; their kind in the list is migrationguide.

  • plugins/removedmembers stays as a deprecated forwarder (types, values, Parse, Plugin = migrationguide.Plugin), so removedmembers.Plugin{Guide: removedmembers.NumPy2} still compiles; it registers nothing.
  • plugin.CanonicalKind("removedmembers") is migrationguide (a source registered with the old kind name still passes).
  • new-plugin --format removedmembers scaffolds a members.Guide on migrationguide.

Acceptance criteria

  • The moved goldens are byte-identical (git diff --stat -M100%: three pure renames, below)
  • One package, one Extract
  • Subtask "each source lists every major's guide through ListVersions, not one pinned tag": the SDK guide does; the removed-members guides list every PyPI release but still read the one release their Release names (left for I19.8)

Calls I made (please check)

  • The removed-members tests moved to an external test package (members_test) with a dot import of the reader, plus an export_test.go for three unexported helpers: the tests need the kind's Plugin, which imports the reader.
  • migrationguide.Plugin.Guide is now an interface: Plugin{Guide: …} literals compile, but code reading p.Guide.Package through the old type would not (nothing does).

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: three pure renames (plugins/{removedmembers => migrationguide}/testdata/golden/{numpy-2.0.0,posthog-8.0.0,newrelic-11.0.0}.json, 0 lines changed); every golden test passes on the moved code

Related PRs

🤖 Generated with Claude Code

One kind for a guide that lists what a release removed: the SDK guide and
the removed-members readers implement migrationguide.Guide, and one
Plugin lists, reads and extracts for both. plugins/removedmembers only
forwards now; old kind names resolve through plugin.CanonicalKind.

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 31s —— View job


✅ Ready to merge: a clean refactor. The three sources' metadata moved unchanged, the goldens are exact renames, and every check passes locally.

Rules

Rule Status Evidence
Metadata in the registration (Rule 1) ✅ The numpy, posthog/python-sdk and newrelic/python-agent RegisterProvider blocks moved word for word from removedmembers.go to plugins/migrationguide/migrationguide.go:36-62 (id, name, category, homepage, layer, watches, URLs, page). RegisterProvider sets Kind from KindOf (core/plugin/provider.go:139), so the list now shows migrationguide. No hand-kept list was added. plugins.schema.json dropped removedmembers from the enum, and the schema test skips merged kinds. I read the metadata and it is still accurate.
Provider pages ✅ providers/{numpy,posthog,newrelic}.md now name the kind and the reader. "Why this source" is untouched, which is right because no source changed.
Golden test + dated quote ✅ The three goldens are 100%-similarity renames to plugins/migrationguide/testdata/golden/. The saved sources and the testdata/README.md rows moved with them to members/testdata/, and the relative paths are correct (../../testdata/golden/…, plus the fixed ../sdkguide/testdata/README.md link).
Drop test ✅ The existing drop and decision tests moved along (posthog_test.go, newrelic_test.go, versions_test.go "only the guide's release has events").
Fetch only via env ✅ Fetching goes only through env.Get in migrationguide.Plugin.ReadAt and versions.PyPIReleases(ctx, env.Get, …). No net/http or filesystem access.
Precision ✅ members.Guide.GuideURL returns a URL only when v.ID == g.Release, so other releases still read as empty with no events, exactly as before. sdkguide.GuideURL keeps the FirstOfMajor gate. Fingerprints and the rename/removal logic are byte-for-byte the old code.
Nothing private (Rule 2) ✅ Nothing private in the code, docs, commit message or PR body. The commit is signed off.
Contract fixtures ✅ Not touched.

Bugs

None found. I checked behaviour against the old code path by path:

  • Run: the pinned and unpinned SDK paths are now sdkguide.Guide.Current. The removed-members baseline uses p.Name(), v.ID, v.Ref and to.SourceURL, which equal the old g.Package, g.Release, g.tag() and g.URL().
  • Extract: Label and the error now use to.SourceURL, which is the same URL ReadAt fetched. SDK v1 events still go through migrate.Fresh, and v2 events pass straight through.
  • Old import path: removedmembers.Plugin{Guide: removedmembers.NumPy2} still compiles, and because Plugin is an alias, KindOf gives migrationguide.

Verified

  • go build ./...: passes.
  • go vet ./...: no output.
  • gofmt -l .: no output.
  • go test -race ./...: all packages pass, including plugins/migrationguide, plugins/migrationguide/members, plugins/removedmembers, core/plugin, internal/pluginlist and cmd/new-plugin. The cmd/new-plugin test scaffolds and builds every format, removedmembers included.
  • python3 scripts/leak_guard.py --all: "no banned terms (8 hashed terms checked)".
  • I didn't run make contract, because there is no patch-it checkout here.

Non-blocking (optional)

  • Scaffolder layout: new-plugin --format removedmembers writes its test (package migrationguide) and its saved sources to plugins/migrationguide/testdata/. The three existing members sources keep theirs in plugins/migrationguide/members/testdata/, with tests in members_test. Both work, but a contributor will see two layouts. It could be worth either aligning them or saying in writing-a-plugin.md which one new sources should use.
  • Forwarder variables are copies: removedmembers.NumPy2 and its siblings are var copies, not the same value as members.NumPy2. That's fine for a forwarder, since nothing mutates them. You could add a one-line comment saying so.
  • Unreachable branch: the CanonicalKind branch in check() only runs if a caller sets Source.Kind explicitly, and none do today. The new test covers CanonicalKind itself, but nothing covers that branch.
  • Unchecked acceptance criterion: the open one ("every major's guide through ListVersions" for the members guides) is clearly deferred to I19.8 in the PR body, so it doesn't block this PR.

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.4 · One migration-guide kind

1 participant