Repository navigation
add the stripe sdk changelog sources #228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
adssib
wants to merge
3
commits into
pl4-changelog-reader
Choose a base branch
from
pl4-changelog-stripe
base: pl4-changelog-reader
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,614
−0
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| package changelog | ||
|
|
||
| import "github.com/patch-it-dev/patch-it-plugins/core/plugin" | ||
|
|
||
| // The providers' official SDKs (stripe.go, sentry.go, cloudflare.go, ...), | ||
| // each read from its own changelog at every release (or, with Notes, from its | ||
| // release notes on GitHub). Every one was checked by hand: the file's path, | ||
| // the tag each release is cut at, and a release whose section this reader | ||
| // turns into events (each provider's test pins it). | ||
|
|
||
| // sdk is the source an SDK's changelog is, its metadata read off f. | ||
| func sdk(page, id string, f File, packages ...string) plugin.Source { | ||
| watches := "Names removed, renamed or deprecated in each release of " + f.Package + ", from the release's section of " + f.Path + " at its tag" | ||
| first := "https://github.com/" + f.Repo + "/blob/HEAD/" + f.Path | ||
| if f.Notes { | ||
| watches = "Names removed, renamed or deprecated in each release of " + f.Package + ", from the release's notes on GitHub" | ||
| first = "https://github.com/" + f.Repo + "/releases" | ||
| } | ||
| return plugin.Source{ | ||
| ID: id, Layer: layerOf(f), Page: page, Watches: watches, | ||
| URLs: []string{first}, Packages: packages, Plugin: Plugin{File: f}, | ||
| } | ||
| } | ||
|
|
||
| func layerOf(f File) plugin.Layer { | ||
| if f.Ecosystem == "terraform" { | ||
| return plugin.LayerInfra | ||
| } | ||
| return plugin.LayerSDK | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| package changelog | ||
|
|
||
| import ( | ||
| "strings" | ||
| "testing" | ||
|
|
||
| "github.com/patch-it-dev/patch-it-plugins/core/kit/kittest" | ||
| ) | ||
|
|
||
| // sdkCase is one SDK's changelog, saved at a release's tag | ||
| // (testdata/README.md), and the release its golden pins: the pair from the | ||
| // release before (on the registry, or among the repo's tags) to it. drop is | ||
| // another release in the same saved file (for Notes, in dropped, its own | ||
| // saved release) whose notes name nothing removed: it must read as no event. | ||
| type sdkCase struct { | ||
| file File | ||
| release, prev string | ||
| saved, dropped string | ||
| drop string | ||
| } | ||
|
|
||
| // checkSDKs runs each case's golden, its drop test and its registration. | ||
| func checkSDKs(t *testing.T, cases []sdkCase) { | ||
| t.Helper() | ||
| for _, c := range cases { | ||
| t.Run(c.file.API, func(t *testing.T) { | ||
| kittest.Registered(t, Plugin{File: c.file}) | ||
| got := release(t, c.file.At(c.release), "testdata/"+c.saved, c.prev) | ||
| if len(got) == 0 { | ||
| t.Fatal("no events: the golden must pin a release with some") | ||
| } | ||
| kittest.Golden(t, "testdata/golden/"+strings.ReplaceAll(c.file.API, "/", "-")+".json", got) | ||
|
|
||
| saved := c.saved | ||
| if c.dropped != "" { | ||
| saved = c.dropped | ||
| } | ||
| _, fs, err := c.file.At(c.drop).Read(kittest.Read(t, "testdata/"+saved)) | ||
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| for _, f := range fs { | ||
| if f.Dropped == "" { | ||
| t.Errorf("drop test %s: an event from %q", c.drop, f.Bullet.Text) | ||
| } | ||
| } | ||
| }) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| package changelog | ||
|
|
||
| import "github.com/patch-it-dev/patch-it-plugins/core/plugin" | ||
|
|
||
| func init() { | ||
| const page = "providers/stripe-sdks.md" | ||
| plugin.RegisterProvider(plugin.Provider{ | ||
| ID: "stripe", Name: "Stripe", Category: plugin.CategoryPayments, Homepage: "https://stripe.com", | ||
| Sources: []plugin.Source{ | ||
| sdk(page, "python", StripePython, "pypi:stripe"), | ||
| sdk(page, "node", StripeNode, "npm:stripe"), | ||
| sdk(page, "go", StripeGo, "go:github.com/stripe/stripe-go/v87"), | ||
| sdk(page, "java", StripeJava, "maven:com.stripe:stripe-java"), | ||
| sdk(page, "ruby", StripeRuby, "rubygems:stripe"), | ||
| sdk(page, "dotnet", StripeDotnet, "nuget:Stripe.net"), | ||
| sdk(page, "php", StripePHP, "packagist:stripe/stripe-php"), | ||
| }, | ||
| }) | ||
| } | ||
|
|
||
| // Stripe's SDKs: one CHANGELOG.md each, "## <a id="X-Y-Z"></a>X.Y.Z - date" | ||
| // (older ones "## X.Y.Z - date"), every breaking bullet marked "⚠️"; each | ||
| // release tagged vX.Y.Z. | ||
| var ( | ||
| StripePython = File{API: "stripe/python", Package: "stripe", Ecosystem: "pypi", Module: "stripe", | ||
| Repo: "stripe/stripe-python", TagPrefix: "v", Path: "CHANGELOG.md"} | ||
| StripeNode = File{API: "stripe/node", Package: "stripe", Ecosystem: "npm", | ||
| Repo: "stripe/stripe-node", TagPrefix: "v", Path: "CHANGELOG.md"} | ||
| StripeGo = File{API: "stripe/go", Package: "github.com/stripe/stripe-go", Ecosystem: "go", | ||
| Repo: "stripe/stripe-go", TagPrefix: "v", Path: "CHANGELOG.md"} | ||
| StripeJava = File{API: "stripe/java", Package: "com.stripe:stripe-java", Ecosystem: "maven", | ||
| Repo: "stripe/stripe-java", TagPrefix: "v", Path: "CHANGELOG.md"} | ||
| StripeRuby = File{API: "stripe/ruby", Package: "stripe", Ecosystem: "rubygems", | ||
| Repo: "stripe/stripe-ruby", TagPrefix: "v", Path: "CHANGELOG.md"} | ||
| StripeDotnet = File{API: "stripe/dotnet", Package: "Stripe.net", Ecosystem: "nuget", | ||
| Repo: "stripe/stripe-dotnet", TagPrefix: "v", Path: "CHANGELOG.md"} | ||
| StripePHP = File{API: "stripe/php", Package: "stripe/stripe-php", Ecosystem: "packagist", | ||
| Repo: "stripe/stripe-php", TagPrefix: "v", Path: "CHANGELOG.md"} | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package changelog | ||
|
|
||
| import "testing" | ||
|
|
||
| func TestStripeSDKs(t *testing.T) { | ||
| checkSDKs(t, []sdkCase{ | ||
| {StripePython, "4.0.0", "3.5.0", "stripe-python-4.0.0-CHANGELOG.md", "", "3.5.0"}, | ||
| {StripeNode, "10.0.0", "9.16.0", "stripe-node-10.0.0-CHANGELOG.md", "", "9.16.0"}, | ||
| {StripeGo, "73.0.0", "72.122.0", "stripe-go-73.0.0-CHANGELOG.md", "", "72.122.0"}, | ||
| {StripeJava, "21.0.0", "20.136.0", "stripe-java-21.0.0-CHANGELOG.md", "", "20.136.0"}, | ||
| {StripeRuby, "7.0.0", "6.5.0", "stripe-ruby-7.0.0-CHANGELOG.md", "", "6.5.0"}, | ||
| {StripeDotnet, "40.0.0", "39.126.0", "stripe-dotnet-40.0.0-CHANGELOG.md", "", "39.126.0"}, | ||
| {StripePHP, "9.0.0", "8.12.1", "stripe-php-9.0.0-CHANGELOG.md", "", "8.12.0"}, | ||
| }) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| [ | ||
| { | ||
| "id": 1, | ||
| "fingerprint": "sha256:eebe0e0b38610cb9a0567dd0faa50aaef5b3ad8adb64e47c4ec2b8b775a0d28c", | ||
| "api": "stripe/dotnet", | ||
| "version": "40.0.0", | ||
| "previous_version": "39.126.0", | ||
| "change_type": "breaking", | ||
| "breaking": true, | ||
| "subject": { | ||
| "type": "package_release", | ||
| "ecosystem": "nuget", | ||
| "package": "Stripe.net", | ||
| "change": "removed_symbol", | ||
| "symbols": [ | ||
| "CustomerPaymentSettingsOptions", | ||
| "CustomerPaymentSettingsPaymentMethodOptionsBancontactOptions", | ||
| "CustomerPaymentSettingsPaymentMethodOptionsCardOptions", | ||
| "CustomerPaymentSettingsPaymentMethodOptionsOptions" | ||
| ] | ||
| }, | ||
| "description": "`CustomerPaymentSettingsOptions`, `CustomerPaymentSettingsPaymentMethodOptionsBancontactOptions`, `CustomerPaymentSettingsPaymentMethodOptionsCardOptions`, `CustomerPaymentSettingsPaymentMethodOptionsOptions` were removed in Stripe.net 40.0.0: code using it fails.", | ||
| "migration_hint": "Remove `CustomerPaymentSettingsOptions`, `CustomerPaymentSettingsPaymentMethodOptionsBancontactOptions`, `CustomerPaymentSettingsPaymentMethodOptionsCardOptions`, and `CustomerPaymentSettingsPaymentMethodOptionsOptions`. (Stripe.net's changelog for 40.0.0)", | ||
| "source_url": "https://raw.githubusercontent.com/stripe/stripe-dotnet/v40.0.0/CHANGELOG.md", | ||
| "source_excerpt": "## 40.0.0 - 2022-08-02\n⚠️ Removed\n* Remove `CustomerPaymentSettingsOptions`, `CustomerPaymentSettingsPaymentMethodOptionsBancontactOptions`, `CustomerPaymentSettingsPaymentMethodOptionsCardOptions`, and `CustomerPaymentSettingsPaymentMethodOptionsOptions`.", | ||
| "confidence": 1, | ||
| "detected_at": "2026-11-14T12:00:00Z" | ||
| }, | ||
| { | ||
| "id": 2, | ||
| "fingerprint": "sha256:da684da773ddf61efd72704ca30144801a397b1f97d9ebe8b38747a7c5895aa3", | ||
| "api": "stripe/dotnet", | ||
| "version": "40.0.0", | ||
| "previous_version": "39.126.0", | ||
| "change_type": "breaking", | ||
| "breaking": true, | ||
| "subject": { | ||
| "type": "package_release", | ||
| "ecosystem": "nuget", | ||
| "package": "Stripe.net", | ||
| "change": "removed_symbol", | ||
| "symbols": [ | ||
| "FilePurpose.IncorporationArticle", | ||
| "FilePurpose.IncorporationDocument", | ||
| "FilePurpose.PaymentProviderTransfer", | ||
| "FilePurpose.ProductFeed" | ||
| ] | ||
| }, | ||
| "description": "`FilePurpose.IncorporationArticle`, `FilePurpose.IncorporationDocument`, `FilePurpose.PaymentProviderTransfer`, `FilePurpose.ProductFeed` were removed in Stripe.net 40.0.0: code using it fails.", | ||
| "migration_hint": "Remove `IncorporationArticle`, `IncorporationDocument`, `PaymentProviderTransfer`, and `ProductFeed` from `FilePurpose` constants. The values are no longer in use. (Stripe.net's changelog for 40.0.0)", | ||
| "source_url": "https://raw.githubusercontent.com/stripe/stripe-dotnet/v40.0.0/CHANGELOG.md", | ||
| "source_excerpt": "## 40.0.0 - 2022-08-02\n⚠️ Removed\n* Remove `IncorporationArticle`, `IncorporationDocument`, `PaymentProviderTransfer`, and `ProductFeed` from `FilePurpose` constants. The values are no longer in use.", | ||
| "confidence": 1, | ||
| "detected_at": "2026-11-14T12:00:00Z" | ||
| }, | ||
| { | ||
| "id": 3, | ||
| "fingerprint": "sha256:8e8af5e5a10f757b9a821b6933a11b5eed7e272b7c5f7c06ce366fe85ac1a13c", | ||
| "api": "stripe/dotnet", | ||
| "version": "40.0.0", | ||
| "previous_version": "39.126.0", | ||
| "change_type": "breaking", | ||
| "breaking": true, | ||
| "subject": { | ||
| "type": "package_release", | ||
| "ecosystem": "nuget", | ||
| "package": "Stripe.net", | ||
| "change": "removed_symbol", | ||
| "symbols": [ | ||
| "CustomerUpdateOptions.TrialEnd" | ||
| ] | ||
| }, | ||
| "description": "`CustomerUpdateOptions.TrialEnd` was removed in Stripe.net 40.0.0: code using it fails.", | ||
| "migration_hint": "Remove `TrialEnd` property in `CustomerUpdateOptions`. The property was not supported in the operation. (Stripe.net's changelog for 40.0.0)", | ||
| "source_url": "https://raw.githubusercontent.com/stripe/stripe-dotnet/v40.0.0/CHANGELOG.md", | ||
| "source_excerpt": "## 40.0.0 - 2022-08-02\n⚠️ Removed\n* Remove `TrialEnd` property in `CustomerUpdateOptions`. The property was not supported in the operation.", | ||
| "confidence": 1, | ||
| "detected_at": "2026-11-14T12:00:00Z" | ||
| }, | ||
| { | ||
| "id": 4, | ||
| "fingerprint": "sha256:f19f602855f3af0487e459aefecbf349d33357be48e1090eec34ba49d50152fb", | ||
| "api": "stripe/dotnet", | ||
| "version": "40.0.0", | ||
| "previous_version": "39.126.0", | ||
| "change_type": "breaking", | ||
| "breaking": true, | ||
| "subject": { | ||
| "type": "package_release", | ||
| "ecosystem": "nuget", | ||
| "package": "Stripe.net", | ||
| "change": "removed_symbol", | ||
| "symbols": [ | ||
| "QuoteFinalizeQuoteOptions" | ||
| ] | ||
| }, | ||
| "description": "`QuoteFinalizeQuoteOptions` was removed in Stripe.net 40.0.0: code using it fails.", | ||
| "migration_hint": "Remove `QuoteFinalizeQuoteOptions`. The options weren't used anymore. (Stripe.net's changelog for 40.0.0)", | ||
| "source_url": "https://raw.githubusercontent.com/stripe/stripe-dotnet/v40.0.0/CHANGELOG.md", | ||
| "source_excerpt": "## 40.0.0 - 2022-08-02\n⚠️ Removed\n* Remove `QuoteFinalizeQuoteOptions`. The options weren't used anymore.", | ||
| "confidence": 1, | ||
| "detected_at": "2026-11-14T12:00:00Z" | ||
| }, | ||
| { | ||
| "id": 5, | ||
| "fingerprint": "sha256:6318782d02a60ee53ce339826d81530094a32aa04dd81945452d24a7dfdd13de", | ||
| "api": "stripe/dotnet", | ||
| "version": "40.0.0", | ||
| "previous_version": "39.126.0", | ||
| "change_type": "breaking", | ||
| "breaking": true, | ||
| "subject": { | ||
| "type": "package_release", | ||
| "ecosystem": "nuget", | ||
| "package": "Stripe.net", | ||
| "change": "removed_symbol", | ||
| "symbols": [ | ||
| "LoginLinkCreateOptions.RedirectUrl" | ||
| ] | ||
| }, | ||
| "description": "`LoginLinkCreateOptions.RedirectUrl` was removed in Stripe.net 40.0.0: code using it fails.", | ||
| "migration_hint": "Remove `RedirectUrl` from `LoginLinkCreateOptions`. The property was deprecated. (Stripe.net's changelog for 40.0.0)", | ||
| "source_url": "https://raw.githubusercontent.com/stripe/stripe-dotnet/v40.0.0/CHANGELOG.md", | ||
| "source_excerpt": "## 40.0.0 - 2022-08-02\n⚠️ Removed\n* Remove `RedirectUrl` from `LoginLinkCreateOptions`. The property was deprecated.", | ||
| "confidence": 1, | ||
| "detected_at": "2026-11-14T12:00:00Z" | ||
| } | ||
| ] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only case where
prev(8.12.1) anddrop(8.12.0) differ. The saved file's two sections are 9.0.0 and 8.12.0,testdata/README.mddescribes the trim as "9.0.0 (the golden) and 8.12.0", and all 13 events ingolden/stripe-php.jsoncarry"previous_version": "8.12.1".Can you confirm that a
v8.12.1tag exists in stripe/stripe-php and comes right beforev9.0.0? I couldn't check that from CI. If it doesn't exist, the golden records the wrong previous version:(then regenerate
golden/stripe-php.json). If it does exist, please say so in the PR and note in the README row that 8.12.1's section was trimmed out.