Repository navigation
stripe: sdk changelogs read the api version they pin; stripe/api lists api versions - #246
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: adssib <75389300+adssib@users.noreply.github.com>
|
Claude finished @adssib's task in 1m 44s —— View job ✅ Ready to merge. The pins are read only from plainly worded sentences in each release's own section, every check passes, and no event output changes. One design question below needs a maintainer to decide before release. Rules
BugsNone found that block the merge. Design question for a maintainer (not a code bug): the comment on Verified
Non-blocking (optional, comments left on the lines)
Thanks for the careful testdata and for writing up the gaps so clearly. |
| out, conflict := map[string]string{}, map[string]bool{} | ||
| release, fenced := "", false | ||
| for _, l := range strings.Split(strings.ReplaceAll(string(file), "\r\n", "\n"), "\n") { | ||
| if strings.HasPrefix(l, "## ") || strings.HasPrefix(l, "# ") { |
There was a problem hiding this comment.
Non-blocking: the heading check runs before the fence check, so a # comment line inside a fenced Ruby/Python/shell example (common in migration notes) ends the current release: any pin sentence after that code block in the same section is lost. That loses a pin rather than inventing one, so precision is fine. Moving the fence toggle above the heading check fixes it:
if strings.HasPrefix(strings.TrimSpace(l), "```") {
fenced = !fenced
continue
}
if fenced {
continue
}
if strings.HasPrefix(l, "## ") || strings.HasPrefix(l, "# ") { ... }(A changelog that never closes a fence would then hide every heading after it. If you care about that, also reset fenced on a ## heading.)
| if f.Pins == "" || f.Notes || len(vs) == 0 { | ||
| return vs | ||
| } | ||
| newest := f.At(vs[len(vs)-1].ID) |
There was a problem hiding this comment.
Non-blocking: for the registry-listed SDKs (PyPI, npm), the newest version comes from the registry, but the changelog is fetched at its git tag. If a release reaches the registry before its tag exists, or never gets a v-prefixed tag, this fetch 404s and every release loses its MapsTo until the next release. One fallback would be to try the next-newest version when the newest fails. Not a correctness bug as it stands, because nothing wrong is emitted. Worth checking that the hosted service doesn't overwrite a previously stored MapsTo with zero on such a listing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: adssib <75389300+adssib@users.noreply.github.com>
|
@claude review |
|
Claude finished @adssib's task in 33s —— View job ✅ Ready to merge. The new commit ( What changed since the last review
Rules
I can't run the tests here; Blocking bugsNone. Non-blocking suggestions
Thanks for picking up both suggestions so quickly, with tests for each. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: adssib <75389300+adssib@users.noreply.github.com>
…them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: adssib <75389300+adssib@users.noreply.github.com>
|
@claude review |
|
Claude finished @adssib's task in 1m 8s —— View job ✅ Ready to merge. The two new commits ( Rules
I can't run the tests here; Blocking bugsNone. Things I checked
Non-blocking suggestions
Thanks for closing the id mismatch at the source instead of documenting around it, and for the cross-check test that keeps the two sides in step. |
…sion Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: adssib <75389300+adssib@users.noreply.github.com>
What this changes
Two parts: the SDK changelogs read the API version each release pins, and
stripe/apilists its versions by that same API version, so the two ids match.1. The SDK changelogs fill
MapsToThe seven Stripe SDK changelog sources (
stripe/python,stripe/node,stripe/go,stripe/java,stripe/ruby,stripe/dotnet,stripe/php) now fillplugin.Version.MapsTowhile listing their releases:stripe/apiat the API version the release's own changelog section states it pins.Every SDK states it the same way when a release changes the pin (checked 2026-11-20 in all seven
CHANGELOG.mds):and a few releases say they keep it ("This release doesn't change the pinned API version; it still uses
2026-05-27.dahlia." in Go, Java and .NET; "…does not change the pinned API version. It's still2026-06-24.dahlia." in PHP; "This release uses the same pinned API version to2026-03-25.dahliaas the last major release." in Node). Those four sentences are read; nothing else is.Example pair:
stripe/python16.1.0 →stripe/api2026-10-28.endive, 17.1.0 →stripe/api2026-11-18.endive(17.0.0 says nothing: zero).plugins/changelog/pins.go:pins(file), the stated pin per release (one pass over the Markdown changelog, code blocks skipped, two different versions in one section are none);File.pinnedreads the changelog once per listing, at the newest release's tag (which has every earlier section), and setsMapsTo. A changelog that can't be fetched leaves the listing as it is (logged; the next listing fills it).File.Pins(new field): the source a release's section pins a version of. Set tostripe/apion the seven Stripe files; empty everywhere else, which fetches nothing extra.providers/stripe-sdks.md: what's read, quotes, and the gaps below.2.
stripe/apilists API versions, not release tagsBefore,
stripe/apilisted everystripe/openapirelease tag (v2191…v2602, ~2,600 tags, several a day), while its events carried the spec'sinfo.version. Now its versions are Stripe's API versions, as the releases' notes name them. Since v2191 (2026-03-11) every release's notes have a table:Ref,URL) and dated by the first (Released). Today that gives2026-02-25.clover@v2203,2026-03-25.dahlia@v2248, …2026-10-28.endive@v2600,2026-11-18.endive@v2602. Pairs are API version → next API version, and events'version/previous_versionare these ids (the spec'sinfo.version).latest/openapi.spec3.json. If the spec at that release declares another version,ReadAtreturns an error (new optionaladapter.SpecVersionedinterface); it is never read as the listed version. This happens today: at v2602 the notes say2026-11-18.endivebut the GA file still says2026-10-28.endive. When a later release's file catches up, its notes name the same version,Refmoves to it, and the next run reads it.2026-02-25.cloveris listed. Naming those would mean reading thousands of old specs or guessing.openapi/spec3.jsonfallback for tags older thanlatest/(v207-era) and its test. No listed release needs it any more.stripe/apigolden; the OpenAPI goldens are other providers' and are untouched.TestStripeListsAPIVersionsruns over a saved listing (adapter/testdata/versions/stripe-openapi-releases.json, 21 real releases: the first and last of each of the 10 named versions, plus v2190 with no table).TestASpecVersionedReadMustDeclareItsVersioncovers the read check.TestStripePinsAreVersionsStripeAPILists: every pin the seven SDK sources read from their saved changelogs is an idstripe/apilists from that saved listing (via the registeredstripe/apiplugin).Checklist
Pins. I readproviders/stripe-sdks.md's words.git commit -s, DCO)testdata/README.mdlists each file: the seven saved changelogs undertestdata/pins/(each SDK'sCHANGELOG.mdat its newest release tag, trimmed to 2–3 whole sections: one that changes the pin, one that says nothing, and the "keeps it" wording where the SDK has one) and one tag list written for the testTestAnUnsurePinIsNone)providers/stripe-sdks.mdupdatedenv.Getmake checkpasses locallyTests:
TestStripeReleasesStateWhatTheyPin(each saved file, every stated pin exactly),TestListedVersionsCarryWhatTheyPin(stripe-go listed from its tags,MapsToset from the changelog at the newest tag),TestPinsAreReadOnlyWhenTheyCanBe(fetch failure → no pins, no error; noPins→ no extra fetch),TestAnUnsurePinIsNone. Ran the reader over all seven full changelogs: 33–60 pins each, every one a real "pinned API version" sentence (back to stripe-go's2014-11-20), e.g. stripe-dotnet 24.0.1's "Fix pinned API version to2019-02-19".Notes for the reviewer
stripe/api's ids are the same strings (part 2). The cross-check test pins that down.MapsTo.v0.6.0) after merge.File.Pinsandadapter.SpecVersionedare new exported API, andstripe/api's version ids change. The ingest bump then re-listsstripe/apiwith new ids; ingest has no production data to keep, and the old tag-id rows can be dropped (DB reset). patch-it's hosted ingestion service picks it up on that bump.Part of #186.
🤖 Generated with Claude Code