From 99a99ac1c6681656c1c221978fa6db34797a4055 Mon Sep 17 00:00:00 2001 From: adssib <75389300+adssib@users.noreply.github.com> Date: Fri, 20 Nov 2026 18:13:25 -0500 Subject: [PATCH 1/7] remove the top-level forwarding packages plugin/, event/, fetch/, migrate/, kit/ (and kit/kittest/), retire/ and sdkguide/ only forwarded to core/ and plugins/. Code importing them moves to core/plugin, core/event, core/fetch, core/migrate, core/kit, plugins/notices/retire and plugins/migrationguide/sdkguide. Co-Authored-By: Claude Opus 5.5 Signed-off-by: adssib <75389300+adssib@users.noreply.github.com> --- .github/pull_request_template.md | 2 +- AGENTS.md | 2 -- docs/how-it-works.md | 2 +- event/event.go | 50 -------------------------------- fetch/fetch.go | 19 ------------ kit/kit.go | 30 ------------------- kit/kittest/kittest.go | 33 --------------------- migrate/migrate.go | 14 --------- plugin/plugin.go | 27 ----------------- retire/retire.go | 23 --------------- sdkguide/sdkguide.go | 21 -------------- 11 files changed, 2 insertions(+), 221 deletions(-) delete mode 100644 event/event.go delete mode 100644 fetch/fetch.go delete mode 100644 kit/kit.go delete mode 100644 kit/kittest/kittest.go delete mode 100644 migrate/migrate.go delete mode 100644 plugin/plugin.go delete mode 100644 retire/retire.go delete mode 100644 sdkguide/sdkguide.go diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 5e14f73..2517da6 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -4,7 +4,7 @@ ## Checklist -- [ ] **Metadata complete in the registration** (`plugin.RegisterProvider`: provider id, name, category, homepage; each source's id, layer, what it watches, URLs, page), and I read the words. There is no list to update. Not applicable: +- [ ] **Metadata complete in the registration** (`plugin.RegisterProvider`: provider id, name, category, homepage; each source's id, kind, layer, what it watches, URLs, packages, page), and I read the words. There is no list to update. Not applicable: - [ ] Every commit is signed off (`git commit -s`, DCO) - [ ] Golden test over a real saved copy of the source (`testdata/golden/.json`) - [ ] `testdata/README.md` lists each file: URL, date fetched, license, quote of the part the plugin reads diff --git a/AGENTS.md b/AGENTS.md index 249fac1..03d508d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -64,8 +64,6 @@ plugins// one package per kind, with its providers: openapi (+ adap plugins/all imports every one plugins/removedmembers/ apichangelog/ retirements/ feed/ eol/ deprecated: merged into migrationguide, changelog and notices, they only forward there -plugin/ event/ fetch/ migrate/ kit/ retire/ sdkguide/ deprecated old import paths: they only - forward to the packages above; don't add to them cmd/list-plugins/ prints the list from the registry (make plugins); internal/pluginlist/ is its logic cmd/new-plugin/ scaffolds a provider's source on a kind (make new-plugin ARGS=...; go run ./cmd/new-plugin --help) contract/fixtures/ a copy of patch-it's change-event fixtures (CI_contract checks it) diff --git a/docs/how-it-works.md b/docs/how-it-works.md index 642e17b..9e3150a 100644 --- a/docs/how-it-works.md +++ b/docs/how-it-works.md @@ -28,7 +28,7 @@ There's no list in this repo: `make plugins` prints every provider and source fr | [`core/diff/`](../core/diff/), [`core/normalize/`](../core/normalize/), [`core/hint/`](../core/hint/), [`plugins/openapi/adapter/`](../plugins/openapi/adapter/) | The OpenAPI diff engine: compare two specs, turn the changes into events, attach changelog hints; one adapter per spec provider | | [`plugins/notices/retire/`](../plugins/notices/retire/), [`plugins/notices/feed/`](../plugins/notices/feed/), [`plugins/notices/eol/`](../plugins/notices/eol/), [`plugins/migrationguide/sdkguide/`](../plugins/migrationguide/sdkguide/), [`plugins/migrationguide/members/`](../plugins/migrationguide/members/), [`core/fetch/`](../core/fetch/) | The notices readers (deprecations pages, feeds, end-of-life tables) and the migration-guide readers (removed parameters, removed members); the HTTP fetch and cache | | [`contract/fixtures/`](../contract/) | A copy of patch-it's change-event fixtures | -| `plugin/`, `event/`, `fetch/`, `migrate/`, `kit/`, `kit/kittest/`, `retire/`, `sdkguide/`, `plugins/removedmembers/`, `plugins/apichangelog/`, `plugins/retirements/`, `plugins/feed/`, `plugins/eol/` | Deprecated: the old import paths, forwarding to the packages above until code that imports them moves | +| `plugins/removedmembers/`, `plugins/apichangelog/`, `plugins/retirements/`, `plugins/feed/`, `plugins/eol/` | Deprecated: the old import paths, forwarding to the packages above until code that imports them moves | | [`providers/`](../providers/) | One page per provider: why that source, what the plugin reads | | [`docs/`](./) | [How to write a plugin](writing-a-plugin.md), the [README template](README-template.md) patch-it's public repos share | diff --git a/event/event.go b/event/event.go deleted file mode 100644 index 02bec52..0000000 --- a/event/event.go +++ /dev/null @@ -1,50 +0,0 @@ -// Package event is the old import path of github.com/patch-it-dev/patch-it-plugins/core/event. -// -// Deprecated: import github.com/patch-it-dev/patch-it-plugins/core/event -// instead. This package only forwards to it, so code written against the old -// path keeps building; it will be removed in a later release. -package event - -import moved "github.com/patch-it-dev/patch-it-plugins/core/event" - -// Deprecated: the types live in github.com/patch-it-dev/patch-it-plugins/core/event. -type ( - Affected = moved.Affected - AffectedKind = moved.AffectedKind - ChangeEvent = moved.ChangeEvent - ChangeType = moved.ChangeType - EventV2 = moved.EventV2 - PackageChange = moved.PackageChange - Side = moved.Side - Subject = moved.Subject - SubjectType = moved.SubjectType -) - -// Deprecated: the constants live in github.com/patch-it-dev/patch-it-plugins/core/event. -const ( - AffectedKindOperation = moved.AffectedKindOperation - AffectedKindRequestParameter = moved.AffectedKindRequestParameter - AffectedKindSchema = moved.AffectedKindSchema - AffectedKindSchemaProperty = moved.AffectedKindSchemaProperty - ChangeTypeBreaking = moved.ChangeTypeBreaking - ChangeTypeDeprecation = moved.ChangeTypeDeprecation - ChangeTypeFix = moved.ChangeTypeFix - ChangeTypeNewFeature = moved.ChangeTypeNewFeature - PackageChangedDefault = moved.PackageChangedDefault - PackageRemovedParameter = moved.PackageRemovedParameter - PackageRemovedSymbol = moved.PackageRemovedSymbol - PackageRenamedSymbol = moved.PackageRenamedSymbol - SideRequest = moved.SideRequest - SideResponse = moved.SideResponse - SubjectAPIOperation = moved.SubjectAPIOperation - SubjectCIRuntime = moved.SubjectCIRuntime - SubjectModel = moved.SubjectModel - SubjectPackageRelease = moved.SubjectPackageRelease -) - -// Deprecated: the functions and values live in github.com/patch-it-dev/patch-it-plugins/core/event. -var ( - DecodeV2 = moved.DecodeV2 - Fingerprint = moved.Fingerprint - FingerprintV2 = moved.FingerprintV2 -) diff --git a/fetch/fetch.go b/fetch/fetch.go deleted file mode 100644 index 8d79a32..0000000 --- a/fetch/fetch.go +++ /dev/null @@ -1,19 +0,0 @@ -// Package fetch is the old import path of github.com/patch-it-dev/patch-it-plugins/core/fetch. -// -// Deprecated: import github.com/patch-it-dev/patch-it-plugins/core/fetch -// instead. This package only forwards to it, so code written against the old -// path keeps building; it will be removed in a later release. -package fetch - -import moved "github.com/patch-it-dev/patch-it-plugins/core/fetch" - -// Deprecated: the types live in github.com/patch-it-dev/patch-it-plugins/core/fetch. -type ( - Cache = moved.Cache - StatusError = moved.StatusError -) - -// Deprecated: the functions and values live in github.com/patch-it-dev/patch-it-plugins/core/fetch. -var ( - Get = moved.Get -) diff --git a/kit/kit.go b/kit/kit.go deleted file mode 100644 index 5575062..0000000 --- a/kit/kit.go +++ /dev/null @@ -1,30 +0,0 @@ -// Package kit is the old import path of github.com/patch-it-dev/patch-it-plugins/core/kit. -// -// Deprecated: import github.com/patch-it-dev/patch-it-plugins/core/kit -// instead. This package only forwards to it, so code written against the old -// path keeps building; it will be removed in a later release. -package kit - -import ( - "context" - - moved "github.com/patch-it-dev/patch-it-plugins/core/kit" -) - -// Deprecated: the types live in github.com/patch-it-dev/patch-it-plugins/core/kit. -type ( - Archiver = moved.Archiver - Wayback = moved.Wayback -) - -// Deprecated: the functions and values live in github.com/patch-it-dev/patch-it-plugins/core/kit. -var ( - Unchanged = moved.Unchanged -) - -// Cite forwards to core/kit.Cite. -// -// Deprecated: use github.com/patch-it-dev/patch-it-plugins/core/kit.Cite. -func Cite[T any](ctx context.Context, a Archiver, pageURL string, read func([]byte) (T, error), want T) (snapURL string, snap []byte, got T, err error) { - return moved.Cite(ctx, a, pageURL, read, want) -} diff --git a/kit/kittest/kittest.go b/kit/kittest/kittest.go deleted file mode 100644 index 39f0e4e..0000000 --- a/kit/kittest/kittest.go +++ /dev/null @@ -1,33 +0,0 @@ -// Package kittest is the old import path of github.com/patch-it-dev/patch-it-plugins/core/kit/kittest. -// -// Deprecated: import github.com/patch-it-dev/patch-it-plugins/core/kit/kittest -// instead. This package only forwards to it, so code written against the old -// path keeps building; it will be removed in a later release. -package kittest - -import moved "github.com/patch-it-dev/patch-it-plugins/core/kit/kittest" - -// Deprecated: the types live in github.com/patch-it-dev/patch-it-plugins/core/kit/kittest. -type ( - Archive = moved.Archive - Mem = moved.Mem - Pages = moved.Pages - Sink = moved.Sink -) - -// Deprecated: the functions and values live in github.com/patch-it-dev/patch-it-plugins/core/kit/kittest. -var ( - CheckSink = moved.CheckSink - CompareGolden = moved.CompareGolden - Env = moved.Env - Golden = moved.Golden - Ingest = moved.Ingest - IngestWith = moved.IngestWith - NewMem = moved.NewMem - Read = moved.Read - Registered = moved.Registered - Replay = moved.Replay - Run = moved.Run - Stored = moved.Stored - Clock = moved.Clock -) diff --git a/migrate/migrate.go b/migrate/migrate.go deleted file mode 100644 index cf6865d..0000000 --- a/migrate/migrate.go +++ /dev/null @@ -1,14 +0,0 @@ -// Package migrate is the old import path of github.com/patch-it-dev/patch-it-plugins/core/migrate. -// -// Deprecated: import github.com/patch-it-dev/patch-it-plugins/core/migrate -// instead. This package only forwards to it, so code written against the old -// path keeps building; it will be removed in a later release. -package migrate - -import moved "github.com/patch-it-dev/patch-it-plugins/core/migrate" - -// Deprecated: the functions and values live in github.com/patch-it-dev/patch-it-plugins/core/migrate. -var ( - Fresh = moved.Fresh - ToV2 = moved.ToV2 -) diff --git a/plugin/plugin.go b/plugin/plugin.go deleted file mode 100644 index 4b0fb6e..0000000 --- a/plugin/plugin.go +++ /dev/null @@ -1,27 +0,0 @@ -// Package plugin is the old import path of github.com/patch-it-dev/patch-it-plugins/core/plugin. -// -// Deprecated: import github.com/patch-it-dev/patch-it-plugins/core/plugin -// instead. This package only forwards to it, so code written against the old -// path keeps building; it will be removed in a later release. -package plugin - -import moved "github.com/patch-it-dev/patch-it-plugins/core/plugin" - -// Deprecated: the types live in github.com/patch-it-dev/patch-it-plugins/core/plugin. -type ( - BaselineReader = moved.BaselineReader - Env = moved.Env - Plugin = moved.Plugin - Replayer = moved.Replayer - Result = moved.Result - Spec = moved.Spec -) - -// Deprecated: the functions and values live in github.com/patch-it-dev/patch-it-plugins/core/plugin. -var ( - Baseline = moved.Baseline - Lookup = moved.Lookup - Names = moved.Names - Register = moved.Register - SHA256 = moved.SHA256 -) diff --git a/retire/retire.go b/retire/retire.go deleted file mode 100644 index ff9477b..0000000 --- a/retire/retire.go +++ /dev/null @@ -1,23 +0,0 @@ -// Package retire is the old import path of github.com/patch-it-dev/patch-it-plugins/plugins/notices/retire. -// -// Deprecated: import github.com/patch-it-dev/patch-it-plugins/plugins/notices/retire -// instead. This package only forwards to it, so code written against the old -// path keeps building; it will be removed in a later release. -package retire - -import moved "github.com/patch-it-dev/patch-it-plugins/plugins/notices/retire" - -// Deprecated: the types live in github.com/patch-it-dev/patch-it-plugins/plugins/notices/retire. -type ( - Page = moved.Page - Retirement = moved.Retirement -) - -// Deprecated: the functions and values live in github.com/patch-it-dev/patch-it-plugins/plugins/notices/retire. -var ( - Events = moved.Events - First = moved.First - Parse = moved.Parse - Anthropic = moved.Anthropic - OpenAI = moved.OpenAI -) diff --git a/sdkguide/sdkguide.go b/sdkguide/sdkguide.go deleted file mode 100644 index 7b1a75f..0000000 --- a/sdkguide/sdkguide.go +++ /dev/null @@ -1,21 +0,0 @@ -// Package sdkguide is the old import path of github.com/patch-it-dev/patch-it-plugins/plugins/migrationguide/sdkguide. -// -// Deprecated: import github.com/patch-it-dev/patch-it-plugins/plugins/migrationguide/sdkguide -// instead. This package only forwards to it, so code written against the old -// path keeps building; it will be removed in a later release. -package sdkguide - -import moved "github.com/patch-it-dev/patch-it-plugins/plugins/migrationguide/sdkguide" - -// Deprecated: the types live in github.com/patch-it-dev/patch-it-plugins/plugins/migrationguide/sdkguide. -type ( - Guide = moved.Guide - Removal = moved.Removal -) - -// Deprecated: the functions and values live in github.com/patch-it-dev/patch-it-plugins/plugins/migrationguide/sdkguide. -var ( - Events = moved.Events - Parse = moved.Parse - AnthropicV1 = moved.AnthropicV1 -) From 999aceddb746bd1e939882fdf4e9d6e5e6861c19 Mon Sep 17 00:00:00 2001 From: adssib <75389300+adssib@users.noreply.github.com> Date: Fri, 20 Nov 2026 18:29:25 -0500 Subject: [PATCH 2/7] delete the merged kinds' forwarding packages and CanonicalKind Co-Authored-By: Claude Opus 5.5 Signed-off-by: adssib <75389300+adssib@users.noreply.github.com> --- AGENTS.md | 2 - core/plugin/provider.go | 22 +----- core/plugin/provider_test.go | 13 ---- docs/how-it-works.md | 1 - internal/pluginlist/schema_test.go | 3 +- plugins/all/all_test.go | 77 +++++++++++++++++++ plugins/apichangelog/apichangelog.go | 18 ----- plugins/apichangelog/apichangelog_test.go | 16 ---- plugins/eol/eol.go | 26 ------- plugins/eol/eol_test.go | 16 ---- plugins/feed/feed.go | 51 ------------ plugins/feed/feed_test.go | 16 ---- plugins/openapi/openapi.go | 2 +- plugins/removedmembers/removedmembers.go | 36 --------- plugins/removedmembers/removedmembers_test.go | 16 ---- plugins/retirements/retire/retire.go | 24 ------ plugins/retirements/retirements.go | 13 ---- plugins/retirements/retirements_test.go | 17 ---- 18 files changed, 80 insertions(+), 289 deletions(-) delete mode 100644 plugins/apichangelog/apichangelog.go delete mode 100644 plugins/apichangelog/apichangelog_test.go delete mode 100644 plugins/eol/eol.go delete mode 100644 plugins/eol/eol_test.go delete mode 100644 plugins/feed/feed.go delete mode 100644 plugins/feed/feed_test.go delete mode 100644 plugins/removedmembers/removedmembers.go delete mode 100644 plugins/removedmembers/removedmembers_test.go delete mode 100644 plugins/retirements/retire/retire.go delete mode 100644 plugins/retirements/retirements.go delete mode 100644 plugins/retirements/retirements_test.go diff --git a/AGENTS.md b/AGENTS.md index 03d508d..74fbfbf 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -62,8 +62,6 @@ plugins// one package per kind, with its providers: openapi (+ adap per provider), notices (+ retire/, feed/, eol/), migrationguide (+ sdkguide/, members/), changelog (Markdown, RST or JSON), catalog, apisurface (+ pysurface/); plugins/all imports every one -plugins/removedmembers/ apichangelog/ retirements/ feed/ eol/ deprecated: merged into - migrationguide, changelog and notices, they only forward there cmd/list-plugins/ prints the list from the registry (make plugins); internal/pluginlist/ is its logic cmd/new-plugin/ scaffolds a provider's source on a kind (make new-plugin ARGS=...; go run ./cmd/new-plugin --help) contract/fixtures/ a copy of patch-it's change-event fixtures (CI_contract checks it) diff --git a/core/plugin/provider.go b/core/plugin/provider.go index 9d6cd7d..085b8f7 100644 --- a/core/plugin/provider.go +++ b/core/plugin/provider.go @@ -216,7 +216,7 @@ func (p Provider) check() error { return fmt.Errorf("source %q has no URLs", id) case !strings.HasPrefix(s.Page, "providers/") || !strings.HasSuffix(s.Page, ".md"): return fmt.Errorf("source %q: Page %q isn't providers/.md", id, s.Page) - case s.Kind != "" && CanonicalKind(s.Kind) != KindOf(s.Plugin): + case s.Kind != "" && s.Kind != KindOf(s.Plugin): return fmt.Errorf("source %q: Kind %q, but its plugin is in plugins/%s", id, s.Kind, KindOf(s.Plugin)) } for _, u := range s.URLs { @@ -250,26 +250,6 @@ func KindOf(p Plugin) string { return path.Base(t.PkgPath()) } -// mergedKinds are the kinds merged into another, by their old name: what -// they read is read by the new kind, with the same events. -var mergedKinds = map[string]string{ - "removedmembers": "migrationguide", - "apichangelog": "changelog", - "retirements": "notices", - "feed": "notices", - "eol": "notices", -} - -// CanonicalKind is the kind name means now: name itself, or, for a kind -// merged into another ("removedmembers"), the kind that reads its sources -// now ("migrationguide"). Code that still says an old kind keeps working. -func CanonicalKind(name string) string { - if k, ok := mergedKinds[name]; ok { - return k - } - return name -} - // Providers are the registered providers with their sources, sorted by id // (sources by id within each). func Providers() []Provider { diff --git a/core/plugin/provider_test.go b/core/plugin/provider_test.go index 6d42186..6311bf4 100644 --- a/core/plugin/provider_test.go +++ b/core/plugin/provider_test.go @@ -88,19 +88,6 @@ func TestRegisterProviderRefusesConflictingProvider(t *testing.T) { RegisterProvider(p) } -// A kind merged into another still names it: a source registered with the -// old name passes the check, and the old name reads as the new one. -func TestMergedKindsKeepWorking(t *testing.T) { - for old, now := range mergedKinds { - if got := CanonicalKind(old); got != now { - t.Errorf("CanonicalKind(%q) = %q, want %q", old, got, now) - } - } - if got := CanonicalKind("openapi"); got != "openapi" { - t.Errorf("CanonicalKind(openapi) = %q", got) - } -} - // A package names its sources, and a source answers to its first name. func TestForPackage(t *testing.T) { s := src("pkg", "acme-test-pkg") diff --git a/docs/how-it-works.md b/docs/how-it-works.md index 9e3150a..ba0a6f3 100644 --- a/docs/how-it-works.md +++ b/docs/how-it-works.md @@ -28,7 +28,6 @@ There's no list in this repo: `make plugins` prints every provider and source fr | [`core/diff/`](../core/diff/), [`core/normalize/`](../core/normalize/), [`core/hint/`](../core/hint/), [`plugins/openapi/adapter/`](../plugins/openapi/adapter/) | The OpenAPI diff engine: compare two specs, turn the changes into events, attach changelog hints; one adapter per spec provider | | [`plugins/notices/retire/`](../plugins/notices/retire/), [`plugins/notices/feed/`](../plugins/notices/feed/), [`plugins/notices/eol/`](../plugins/notices/eol/), [`plugins/migrationguide/sdkguide/`](../plugins/migrationguide/sdkguide/), [`plugins/migrationguide/members/`](../plugins/migrationguide/members/), [`core/fetch/`](../core/fetch/) | The notices readers (deprecations pages, feeds, end-of-life tables) and the migration-guide readers (removed parameters, removed members); the HTTP fetch and cache | | [`contract/fixtures/`](../contract/) | A copy of patch-it's change-event fixtures | -| `plugins/removedmembers/`, `plugins/apichangelog/`, `plugins/retirements/`, `plugins/feed/`, `plugins/eol/` | Deprecated: the old import paths, forwarding to the packages above until code that imports them moves | | [`providers/`](../providers/) | One page per provider: why that source, what the plugin reads | | [`docs/`](./) | [How to write a plugin](writing-a-plugin.md), the [README template](README-template.md) patch-it's public repos share | diff --git a/internal/pluginlist/schema_test.go b/internal/pluginlist/schema_test.go index 65cb7ea..4b7df50 100644 --- a/internal/pluginlist/schema_test.go +++ b/internal/pluginlist/schema_test.go @@ -95,8 +95,7 @@ func TestSchemaEnumsMatchTheRegistry(t *testing.T) { t.Fatal(err) } for _, k := range kinds { - // A merged kind's old package only forwards: no source has its name. - if name := filepath.Base(k); name != "all" && plugin.CanonicalKind(name) == name && !slices.Contains(src["kind"].Enum, name) { + if name := filepath.Base(k); name != "all" && !slices.Contains(src["kind"].Enum, name) { t.Errorf("kind %s is missing from the schema's kind enum", name) } } diff --git a/plugins/all/all_test.go b/plugins/all/all_test.go index dc94d93..998da1c 100644 --- a/plugins/all/all_test.go +++ b/plugins/all/all_test.go @@ -1,8 +1,10 @@ package all import ( + "go/ast" "go/parser" "go/token" + "io/fs" "os" "path/filepath" "slices" @@ -118,3 +120,78 @@ func TestWhichKindNamesEveryKind(t *testing.T) { } } } + +// Every package under plugins/ is a kind that registers its sources, or a +// reader package inside one (plugins///); and none only +// forwards to another package (type aliases and re-exported values, no code +// of its own). +func TestEveryPackageIsAKindOrPartOfOne(t *testing.T) { + dirs, err := os.ReadDir("..") + if err != nil { + t.Fatal(err) + } + for _, d := range dirs { + if d.IsDir() && d.Name() != "all" && !registers(t, filepath.Join("..", d.Name())) { + t.Errorf("plugins/%s registers no source: a kind registers its sources, a reader lives inside its kind", d.Name()) + } + } + err = filepath.WalkDir("..", func(p string, d fs.DirEntry, err error) error { + if err != nil || !d.IsDir() || d.Name() == "testdata" { + if d != nil && d.IsDir() && d.Name() == "testdata" { + return filepath.SkipDir + } + return err + } + if forwardsOnly(t, p) { + t.Errorf("%s only forwards to another package: import that package instead", p) + } + return nil + }) + if err != nil { + t.Fatal(err) + } +} + +// forwardsOnly reports whether a package's non-test code is nothing but type +// aliases and values copied from other packages. +func forwardsOnly(t *testing.T, dir string) bool { + t.Helper() + files, err := filepath.Glob(filepath.Join(dir, "*.go")) + if err != nil { + t.Fatal(err) + } + decls := 0 + for _, f := range files { + if strings.HasSuffix(f, "_test.go") { + continue + } + file, err := parser.ParseFile(token.NewFileSet(), f, nil, 0) + if err != nil { + t.Fatal(err) + } + for _, decl := range file.Decls { + g, ok := decl.(*ast.GenDecl) + if !ok { + return false // a func: code of its own + } + for _, spec := range g.Specs { + switch s := spec.(type) { + case *ast.ImportSpec: + continue + case *ast.TypeSpec: + if !s.Assign.IsValid() { + return false + } + case *ast.ValueSpec: + for _, v := range s.Values { + if _, sel := v.(*ast.SelectorExpr); !sel { + return false + } + } + } + decls++ + } + } + } + return decls > 0 +} diff --git a/plugins/apichangelog/apichangelog.go b/plugins/apichangelog/apichangelog.go deleted file mode 100644 index 1013b47..0000000 --- a/plugins/apichangelog/apichangelog.go +++ /dev/null @@ -1,18 +0,0 @@ -// Package apichangelog is the old import path of the changelog kind's JSON -// parser, kept so code that imports it still builds. -// -// Deprecated: use plugins/changelog: Plugin{Log: changelog.MongoDBAtlas}. -// This package only forwards there and registers nothing; it goes once -// nothing imports it. -package apichangelog - -import "github.com/patch-it-dev/patch-it-plugins/plugins/changelog" - -type ( - // Plugin is changelog.Plugin: set Log, as before. - Plugin = changelog.Plugin - Log = changelog.Log - Finding = changelog.LogFinding -) - -var MongoDBAtlas = changelog.MongoDBAtlas diff --git a/plugins/apichangelog/apichangelog_test.go b/plugins/apichangelog/apichangelog_test.go deleted file mode 100644 index ed0bdad..0000000 --- a/plugins/apichangelog/apichangelog_test.go +++ /dev/null @@ -1,16 +0,0 @@ -package apichangelog - -import ( - "testing" - - "github.com/patch-it-dev/patch-it-plugins/core/kit/kittest" -) - -// Code written against the old path still builds and runs the same source. -func TestTheOldPathStillWorks(t *testing.T) { - p := Plugin{Log: MongoDBAtlas} - kittest.Registered(t, p) - if p.Name() != "mongodb-atlas" { - t.Errorf("Plugin{Log: MongoDBAtlas} is %q", p.Name()) - } -} diff --git a/plugins/eol/eol.go b/plugins/eol/eol.go deleted file mode 100644 index 906b2ab..0000000 --- a/plugins/eol/eol.go +++ /dev/null @@ -1,26 +0,0 @@ -// Package eol is the old import path of the notices kind's end-of-life -// page reader, kept so code that imports it still builds. -// -// Deprecated: use plugins/notices (Plugin) and plugins/notices/eol (the -// reader: Page, Salesforce, Findings). This package only forwards to them -// and registers nothing; it goes once nothing imports it. -package eol - -import ( - "github.com/patch-it-dev/patch-it-plugins/plugins/notices" - moved "github.com/patch-it-dev/patch-it-plugins/plugins/notices/eol" -) - -type ( - // Plugin is notices.Plugin: set Page and Archiver, as before. - Plugin = notices.Plugin - Page = moved.Page - Row = moved.Row - Finding = moved.Finding -) - -var ( - Salesforce = moved.Salesforce - Parse = moved.Parse - Findings = moved.Findings -) diff --git a/plugins/eol/eol_test.go b/plugins/eol/eol_test.go deleted file mode 100644 index 27019ea..0000000 --- a/plugins/eol/eol_test.go +++ /dev/null @@ -1,16 +0,0 @@ -package eol - -import ( - "testing" - - "github.com/patch-it-dev/patch-it-plugins/core/kit/kittest" -) - -// Code written against the old path still builds and runs the same source. -func TestTheOldPathStillWorks(t *testing.T) { - p := Plugin{Page: Salesforce} - kittest.Registered(t, p) - if p.Name() != "salesforce" { - t.Errorf("Plugin{Page: Salesforce} is %q", p.Name()) - } -} diff --git a/plugins/feed/feed.go b/plugins/feed/feed.go deleted file mode 100644 index 7690531..0000000 --- a/plugins/feed/feed.go +++ /dev/null @@ -1,51 +0,0 @@ -// Package feed is the old import path of the notices kind's RSS and Atom -// feed reader, kept so code that imports it still builds. -// -// Deprecated: use plugins/notices (notices.Plugin{Page: feed.GitHubActions}) -// and plugins/notices/feed (the reader). This package only forwards to them -// and registers nothing; it goes once nothing imports it. -package feed - -import ( - "context" - - "github.com/patch-it-dev/patch-it-plugins/core/kit" - "github.com/patch-it-dev/patch-it-plugins/core/plugin" - "github.com/patch-it-dev/patch-it-plugins/plugins/notices" - moved "github.com/patch-it-dev/patch-it-plugins/plugins/notices/feed" -) - -type ( - Feed = moved.Feed - Reader = moved.Reader - Finding = moved.Finding - Entry = moved.Entry - Section = moved.Section -) - -var ( - GitHubActions = moved.GitHubActions - VertexAIModels = moved.VertexAIModels - CloudflareAPI = moved.CloudflareAPI - Parse = moved.Parse - Text = moved.Text - Lines = moved.Lines - SplitBy = moved.SplitBy - Date = moved.Date - Codes = moved.Codes -) - -// Plugin reads one feed: notices.Plugin{Page: Feed, Archiver: Archiver}. -type Plugin struct { - Feed Feed - Archiver kit.Archiver -} - -func (p Plugin) notices() notices.Plugin { return notices.Plugin{Page: p.Feed, Archiver: p.Archiver} } - -func (p Plugin) Name() string { return p.notices().Name() } - -// Run is notices.Plugin's Run. -func (p Plugin) Run(ctx context.Context, env plugin.Env) (plugin.Result, error) { - return p.notices().Run(ctx, env) -} diff --git a/plugins/feed/feed_test.go b/plugins/feed/feed_test.go deleted file mode 100644 index 610dd33..0000000 --- a/plugins/feed/feed_test.go +++ /dev/null @@ -1,16 +0,0 @@ -package feed - -import ( - "testing" - - "github.com/patch-it-dev/patch-it-plugins/core/kit/kittest" -) - -// Code written against the old path still builds and runs the same feed -// with the same events. -func TestTheOldPathStillWorks(t *testing.T) { - saved := kittest.Pages{GitHubActions.URL: "../notices/feed/testdata/github-changelog-actions.rss.xml"} - archive := &kittest.Archive{T: t, Pages: saved} - got := kittest.IngestWith(t, kittest.Env(t, saved), Plugin{Feed: GitHubActions, Archiver: archive}) - kittest.CompareGolden(t, "../notices/testdata/golden/github-actions.json", got) -} diff --git a/plugins/openapi/openapi.go b/plugins/openapi/openapi.go index 65d686f..ef0cceb 100644 --- a/plugins/openapi/openapi.go +++ b/plugins/openapi/openapi.go @@ -56,7 +56,7 @@ func init() { }) // No Hints yet: GitHub's per-version CHANGELOG.md is prose with no table // at all, so there's nothing for hint.Source to key on. (GitHub's Actions - // source is registered by plugins/feed.) + // source is registered by plugins/notices.) plugin.RegisterProvider(plugin.Provider{ ID: "github", Name: "GitHub", Category: plugin.CategoryDevTools, Homepage: "https://github.com", Sources: []plugin.Source{{ diff --git a/plugins/removedmembers/removedmembers.go b/plugins/removedmembers/removedmembers.go deleted file mode 100644 index d012195..0000000 --- a/plugins/removedmembers/removedmembers.go +++ /dev/null @@ -1,36 +0,0 @@ -// Package removedmembers is the old import path of the migration-guide -// kind's removed-members reader, kept so code that imports it still builds. -// -// Deprecated: use plugins/migrationguide (the kind: Plugin) and -// plugins/migrationguide/members (the reader: Guide, NumPy2, Parse). This -// package only forwards to them and registers nothing; it goes once nothing -// imports it. -package removedmembers - -import ( - "github.com/patch-it-dev/patch-it-plugins/plugins/migrationguide" - "github.com/patch-it-dev/patch-it-plugins/plugins/migrationguide/members" -) - -type ( - // Plugin is migrationguide.Plugin: its Guide is now any reader, a - // members.Guide among them. - Plugin = migrationguide.Plugin - Guide = members.Guide - Format = members.Format - Removal = members.Removal -) - -const ( - FormatRST = members.FormatRST - FormatMarkdown = members.FormatMarkdown -) - -var ( - NumPy2 = members.NumPy2 - PostHog8 = members.PostHog8 - NewRelic11 = members.NewRelic11 -) - -// Parse is members.Parse. -func Parse(page []byte, g Guide) ([]Removal, error) { return members.Parse(page, g) } diff --git a/plugins/removedmembers/removedmembers_test.go b/plugins/removedmembers/removedmembers_test.go deleted file mode 100644 index 480bbdb..0000000 --- a/plugins/removedmembers/removedmembers_test.go +++ /dev/null @@ -1,16 +0,0 @@ -package removedmembers - -import ( - "testing" - - "github.com/patch-it-dev/patch-it-plugins/core/kit/kittest" -) - -// Code written against the old path still builds and runs the same source. -func TestTheOldPathStillWorks(t *testing.T) { - p := Plugin{Guide: NumPy2} - kittest.Registered(t, p) - if p.Name() != "numpy" || NumPy2.URL() == "" { - t.Errorf("Plugin{Guide: NumPy2} is %q at %q", p.Name(), NumPy2.URL()) - } -} diff --git a/plugins/retirements/retire/retire.go b/plugins/retirements/retire/retire.go deleted file mode 100644 index 200af4c..0000000 --- a/plugins/retirements/retire/retire.go +++ /dev/null @@ -1,24 +0,0 @@ -// Package retire is the old import path of github.com/patch-it-dev/patch-it-plugins/plugins/notices/retire, -// the notices kind's deprecations-page reader. -// -// Deprecated: import github.com/patch-it-dev/patch-it-plugins/plugins/notices/retire -// instead. This package only forwards to it, so code written against the old -// path keeps building; it goes once nothing imports it. -package retire - -import moved "github.com/patch-it-dev/patch-it-plugins/plugins/notices/retire" - -// Deprecated: the types live in github.com/patch-it-dev/patch-it-plugins/plugins/notices/retire. -type ( - Page = moved.Page - Retirement = moved.Retirement -) - -// Deprecated: the functions and values live in github.com/patch-it-dev/patch-it-plugins/plugins/notices/retire. -var ( - Events = moved.Events - First = moved.First - Parse = moved.Parse - Anthropic = moved.Anthropic - OpenAI = moved.OpenAI -) diff --git a/plugins/retirements/retirements.go b/plugins/retirements/retirements.go deleted file mode 100644 index 6e4ff50..0000000 --- a/plugins/retirements/retirements.go +++ /dev/null @@ -1,13 +0,0 @@ -// Package retirements is the old import path of the notices kind for a -// model provider's deprecations page, kept so code that imports it still -// builds. -// -// Deprecated: use plugins/notices: notices.Plugin{Page: retire.OpenAI}. This -// package only forwards there and registers nothing; it goes once nothing -// imports it. -package retirements - -import "github.com/patch-it-dev/patch-it-plugins/plugins/notices" - -// Plugin is notices.Plugin: set Page and Archiver, as before. -type Plugin = notices.Plugin diff --git a/plugins/retirements/retirements_test.go b/plugins/retirements/retirements_test.go deleted file mode 100644 index 80e9b99..0000000 --- a/plugins/retirements/retirements_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package retirements - -import ( - "testing" - - "github.com/patch-it-dev/patch-it-plugins/core/kit/kittest" - "github.com/patch-it-dev/patch-it-plugins/plugins/retirements/retire" -) - -// Code written against the old paths still builds and runs the same source. -func TestTheOldPathStillWorks(t *testing.T) { - p := Plugin{Page: retire.OpenAI} - kittest.Registered(t, p) - if p.Name() != "openai-models" { - t.Errorf("Plugin{Page: retire.OpenAI} is %q", p.Name()) - } -} From a36eb227e6863ab32077db856be43fe59079b9ae Mon Sep 17 00:00:00 2001 From: adssib <75389300+adssib@users.noreply.github.com> Date: Fri, 20 Nov 2026 18:40:31 -0500 Subject: [PATCH 3/7] one event type, sources named by their id, no replay, no legacy flags - core/event: the v1 ChangeEvent, its fingerprint and core/migrate are gone; every reader builds event.Event (was EventV2) directly. api_operation's kind type is event.Kind. - A source's plugin is named by its id, provider/source, and its events carry that id in api. The old slugs, Alias/Aliases/first_name, Register by slug and Lookup by slug are gone; RegisterProvider refuses a plugin whose Name isn't its source's id. plugins.json drops alias, first_name and aliases. - Replay, Replayer and Spec.Replay are gone: a version pair is ReadAt twice and Extract (kittest.Pair in tests). catalog gains ListVersions, ReadAt and Extract, so every kind is read version by version. - new-plugin: --format, --api and the old meanings of --provider and --source are gone; files are named -. Goldens regenerated on purpose: api is now the source id, and since the fingerprint hashes api, every fingerprint changed with it. Checked with a script: old and new goldens are identical once api and fingerprint are set aside (three normalize goldens also move from v1's affected to subject). Two notices goldens are renamed to their id (cloudflare-api.json, google-vertex-ai-models.json). Co-Authored-By: Claude Opus 5.5 Signed-off-by: adssib <75389300+adssib@users.noreply.github.com> --- .github/workflows/CI_contract.yml | 2 +- Makefile | 2 +- cmd/list-plugins/main.go | 2 +- cmd/new-plugin/formats.go | 100 ++-- cmd/new-plugin/main.go | 166 ++----- cmd/new-plugin/main_test.go | 22 +- cmd/new-plugin/resolve.go | 23 +- core/event/event.go | 331 ++++++++++--- core/event/event_test.go | 320 +++++------- core/event/v2.go | 262 ---------- core/event/v2_test.go | 147 ------ core/hint/hint.go | 6 +- core/hint/hint_test.go | 16 +- core/kit/kit_test.go | 2 +- core/kit/kittest/checksink.go | 42 +- core/kit/kittest/kittest.go | 14 +- core/kit/kittest/mem.go | 59 +-- core/kit/kittest/mem_test.go | 6 +- core/migrate/migrate.go | 120 ----- core/migrate/migrate_test.go | 137 ------ core/normalize/golden_test.go | 2 +- core/normalize/normalize.go | 29 +- core/normalize/normalize_test.go | 12 +- .../breaking-property-removed/events.json | 7 +- .../testdata/golden/deprecation/events.json | 7 +- .../testdata/golden/new-endpoint/events.json | 7 +- core/plugin/plugin.go | 58 +-- core/plugin/plugin_test.go | 50 +- core/plugin/provider.go | 45 +- core/plugin/provider_test.go | 43 +- core/plugin/versions.go | 9 +- docs/plugins.schema.json | 7 +- internal/pluginlist/pluginlist.go | 19 +- internal/pluginlist/pluginlist_test.go | 8 +- plugins/all/all_test.go | 25 +- plugins/apisurface/apisurface.go | 21 +- plugins/apisurface/apisurface_test.go | 2 +- .../testdata/golden/openai-1.1.2.json | 8 +- plugins/catalog/catalog.go | 61 +-- plugins/catalog/catalog_test.go | 8 +- plugins/changelog/changelog.go | 19 +- plugins/changelog/json.go | 14 +- .../testdata/golden/mongodb-atlas.json | 324 ++++++------- .../testdata/golden/textual-0.86.0.json | 8 +- .../testdata/golden/urllib3-2.0.0.json | 48 +- plugins/migrationguide/members/members.go | 20 +- .../migrationguide/members/members_test.go | 4 +- plugins/migrationguide/members/newrelic.go | 1 + .../migrationguide/members/newrelic_test.go | 6 +- plugins/migrationguide/members/posthog.go | 1 + .../migrationguide/members/posthog_test.go | 4 +- plugins/migrationguide/migrationguide.go | 16 +- plugins/migrationguide/sdkguide/sdkguide.go | 45 +- .../migrationguide/sdkguide/sdkguide_test.go | 5 +- plugins/migrationguide/sdkguide/versions.go | 16 +- .../testdata/golden/anthropic-1.0.0.json | 12 +- .../testdata/golden/newrelic-11.0.0.json | 28 +- .../testdata/golden/numpy-2.0.0.json | 224 ++++----- .../testdata/golden/posthog-8.0.0.json | 28 +- plugins/notices/eol/eol.go | 18 +- plugins/notices/feed/cloudflare_test.go | 2 +- plugins/notices/feed/feed.go | 14 +- plugins/notices/feed/readers.go | 8 +- plugins/notices/feed_golden_test.go | 3 +- plugins/notices/notices.go | 26 +- plugins/notices/retire/notices.go | 11 +- plugins/notices/retire/providers.go | 20 +- plugins/notices/retire/retire.go | 55 ++- plugins/notices/retire/retire_test.go | 18 +- plugins/notices/retirements_golden_test.go | 3 +- .../testdata/golden/anthropic-models.json | 80 +-- .../{cloudflare.json => cloudflare-api.json} | 456 +++++++++--------- .../testdata/golden/github-actions.json | 12 +- ...dels.json => google-vertex-ai-models.json} | 140 +++--- .../testdata/golden/openai-models.json | 240 ++++----- .../notices/testdata/golden/salesforce.json | 136 +++--- plugins/openapi/adapter/adapter.go | 2 +- plugins/openapi/adapter/algolia.go | 2 +- plugins/openapi/adapter/algolia_test.go | 2 +- plugins/openapi/adapter/appwrite.go | 4 +- plugins/openapi/adapter/convex.go | 2 +- plugins/openapi/adapter/datadog.go | 2 +- plugins/openapi/adapter/elasticsearch.go | 2 +- plugins/openapi/adapter/flagsmith.go | 2 +- plugins/openapi/adapter/github.go | 2 +- plugins/openapi/adapter/gitlab.go | 2 +- plugins/openapi/adapter/neon.go | 2 +- plugins/openapi/adapter/planetscale.go | 2 +- plugins/openapi/adapter/sentry.go | 2 +- plugins/openapi/adapter/stripe.go | 2 +- plugins/openapi/adapter/supabase.go | 2 +- plugins/openapi/adapter/vercel.go | 2 +- plugins/openapi/algolia_test.go | 12 +- plugins/openapi/appwrite_test.go | 6 +- plugins/openapi/convex_test.go | 8 +- plugins/openapi/datadog_test.go | 6 +- plugins/openapi/elasticsearch_test.go | 10 +- plugins/openapi/flagsmith_test.go | 6 +- plugins/openapi/github_test.go | 6 +- plugins/openapi/gitlab_test.go | 2 +- plugins/openapi/neon_test.go | 12 +- plugins/openapi/openapi.go | 35 +- plugins/openapi/openapi_test.go | 10 +- plugins/openapi/planetscale_test.go | 6 +- plugins/openapi/sentry_test.go | 10 +- plugins/openapi/supabase_test.go | 12 +- .../testdata/golden/algolia-ingestion.json | 32 +- .../testdata/golden/algolia-search.json | 36 +- plugins/openapi/testdata/golden/appwrite.json | 56 +-- plugins/openapi/testdata/golden/convex.json | 24 +- .../testdata/golden/elasticsearch.json | 32 +- .../openapi/testdata/golden/flagsmith.json | 12 +- plugins/openapi/testdata/golden/neon.json | 4 +- .../openapi/testdata/golden/planetscale.json | 20 +- plugins/openapi/testdata/golden/sentry.json | 48 +- plugins/openapi/testdata/golden/supabase.json | 8 +- plugins/openapi/testdata/golden/vercel.json | 24 +- plugins/openapi/vercel_test.go | 16 +- scripts/check_contract.py | 4 +- 119 files changed, 1996 insertions(+), 2767 deletions(-) delete mode 100644 core/event/v2.go delete mode 100644 core/event/v2_test.go delete mode 100644 core/migrate/migrate.go delete mode 100644 core/migrate/migrate_test.go rename plugins/notices/testdata/golden/{cloudflare.json => cloudflare-api.json} (89%) rename plugins/notices/testdata/golden/{vertex-ai-models.json => google-vertex-ai-models.json} (89%) diff --git a/.github/workflows/CI_contract.yml b/.github/workflows/CI_contract.yml index 0ddd5cb..515d953 100644 --- a/.github/workflows/CI_contract.yml +++ b/.github/workflows/CI_contract.yml @@ -1,5 +1,5 @@ # contract/fixtures/ is a copy of patch-it's fixtures/ (the change-event contract -# patch-it owns). This fails when the two drift apart, so core/event/ and core/migrate/ test +# patch-it owns). This fails when the two drift apart, so core/event/ tests # the same events the patch-it client does. Only top-level "_comment" fields may # differ (scripts/check_contract.py). # diff --git a/Makefile b/Makefile index 3cd0e17..b95da4f 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,7 @@ test: # A provider started with new-plugin is done when nothing it wrote still says # TODO(new-plugin). -TODO_DIRS := plugins core/migrate providers +TODO_DIRS := plugins providers todos: @left=$$(grep -rl 'TODO(new-plugin)' $(TODO_DIRS) || true); \ if [ -n "$$left" ]; then \ diff --git a/cmd/list-plugins/main.go b/cmd/list-plugins/main.go index 0718165..1f9c2b9 100644 --- a/cmd/list-plugins/main.go +++ b/cmd/list-plugins/main.go @@ -1,5 +1,5 @@ // Command list-plugins prints what patch-it watches, as JSON: every registered -// provider with its sources (id, old slug, kind, layer, what it watches, the +// provider with its sources (id, kind, layer, what it watches, the // URLs it reads, its page), built from the plugin registry at run time. The // Release workflow attaches its output to each release as plugins.json; it is // never committed. diff --git a/cmd/new-plugin/formats.go b/cmd/new-plugin/formats.go index 69e29c6..9e3bd44 100644 --- a/cmd/new-plugin/formats.go +++ b/cmd/new-plugin/formats.go @@ -18,29 +18,10 @@ type formatSpec struct { next string // a format-specific line for the next steps drop string // the drop test, when "no event at all" can't be it (template) dropFile string // the drop test's placeholder, when not a copy of the source's - mapEntry *mapEntry // an entry the format needs in a map elsewhere -} - -// mapEntry is a line added to a map literal in another package: the v1 -> v2 -// conversion in migrate/ knows each model retirement page and SDK guide. -type mapEntry struct { - file, varName, entry string // entry is a template } const todo = "TODO(new-plugin)" -// legacyFormats are the old --format names, each the template it is now. -var legacyFormats = map[string]string{ - "feed": "notices/feed", - "retirements": "notices/deprecations", - "migrationguide": "migrationguide/sdk", - "removedmembers": "migrationguide/members", - "changelog": "changelog/markdown", - "apichangelog": "changelog/json", - "catalog": "catalog", - "openapi": "openapi", -} - // defaultReaders are the reader --kind picks when --reader is left out. var defaultReaders = map[string]string{ "notices": "deprecations", @@ -90,7 +71,7 @@ func read{{.Ident}}(e Entry) []Finding { source: "{{.File}}.rss.xml", ingest: `// {{.Lower}}Ingest runs the plugin over a saved copy of the feed, cited // through a test archive that serves the same copy. -func {{.Lower}}Ingest(t *testing.T, file string) []event.EventV2 { +func {{.Lower}}Ingest(t *testing.T, file string) []event.Event { t.Helper() saved := kittest.Pages{feed.{{.Ident}}.URL: file} archive := &kittest.Archive{T: t, Pages: saved} @@ -115,18 +96,16 @@ import "strings" // date" or "Retirement date" column first, then the model and its // replacement), how far back it goes. var {{.Ident}} = Page{ - API: "{{.ID}}", - Vendor: "{{.Provider}}", - URL: "{{.Source}}", - // ` + todo + `: the provider's main call that takes a model name. - Operation: "POST /v1/TODO", - // ` + todo + `: keep the model names the operation above takes (text - // models, not image or embedding ones), as openAIText in providers.go does. + API: "{{.ID}}", + Provider: "{{.ProviderID}}", + Vendor: "{{.Provider}}", + URL: "{{.Source}}", + // ` + todo + `: keep the model names the provider's calls take as text + // models (not image or embedding ones), as openAIText in providers.go does. Keep: func(name string) bool { return strings.HasPrefix(name, "placeholder-text-") }, } `, register: `plugin.Register(Plugin{Page: retire.{{.Ident}}, Archiver: kit.Wayback{}})`, - mapEntry: &mapEntry{"core/migrate/migrate.go", "providers", `retire.{{.Ident}}.API: "{{.Slug}}"`}, pluginOf: `Plugin{Page: retire.{{.Ident}}}`, fixtures: map[string]string{"{{.File}}-deprecations.md": `# Placeholder deprecations page @@ -164,7 +143,7 @@ func Test{{.Ident}}DropsANonChange(t *testing.T) { source: "{{.File}}-deprecations.md", ingest: `// {{.Lower}}Ingest runs the plugin over a saved copy of the page, cited // through a test archive that serves the same copy. -func {{.Lower}}Ingest(t *testing.T, file string) []event.EventV2 { +func {{.Lower}}Ingest(t *testing.T, file string) []event.Event { t.Helper() saved := kittest.Pages{retire.{{.Ident}}.URL: file} archive := &kittest.Archive{T: t, Pages: saved} @@ -183,20 +162,18 @@ func {{.Lower}}Ingest(t *testing.T, file string) []event.EventV2 { // {{.Ident}} is {{.Provider}}'s SDK guide to a major release (MIGRATION.md at // the release tag). // -// ` + todo + `: the repo, the major release, the API operation the removed -// parameters were sent to, and the calls the guide's table names. Say what -// you checked, with the date. +// ` + todo + `: the PyPI name, the repo, the major release and the calls the +// guide's table names. Say what you checked, with the date. var {{.Ident}} = Guide{ - API: "{{.ID}}", - Repo: "TODO-owner/TODO-repo", - Major: 1, - Operation: "POST /v1/TODO", - Methods: "` + "`TODO.create()`" + `", - Symbols: []string{"TODO.create"}, + API: "{{.ID}}", + Package: "{{.PyPI}}", + Repo: "TODO-owner/TODO-repo", + Major: 1, + Methods: "` + "`TODO.create()`" + `", + Symbols: []string{"TODO.create"}, } `, register: `plugin.Register(Plugin{Guide: sdkguide.{{.Ident}}})`, - mapEntry: &mapEntry{"core/migrate/migrate.go", "guides", `sdkguide.{{.Ident}}.API: sdkguide.{{.Ident}}`}, pluginOf: `Plugin{Guide: sdkguide.{{.Ident}}}`, fixtures: map[string]string{"{{.File}}-MIGRATION.md": `# Migrating to v1 @@ -233,7 +210,7 @@ func Test{{.Ident}}DropsANonChange(t *testing.T) { `, source: "{{.File}}-MIGRATION.md", ingest: `// {{.Lower}}Ingest runs the plugin over a saved copy of the guide. -func {{.Lower}}Ingest(t *testing.T, file string) []event.EventV2 { +func {{.Lower}}Ingest(t *testing.T, file string) []event.Event { t.Helper() return kittest.Ingest(t, Plugin{Guide: sdkguide.{{.Ident}}}, kittest.Pages{sdkguide.{{.Ident}}.URL(): file}) } @@ -254,8 +231,9 @@ func {{.Lower}}Ingest(t *testing.T, file string) []event.EventV2 { // the repo, the guide's path at the release tag and the heading the table is // under. Say what you checked, with the date. var {{.Ident}} = Guide{ - Package: "{{.ID}}", - Module: "{{.ID}}", + API: "{{.ID}}", + Package: "{{.PyPI}}", + Module: "{{.Module}}", Release: "1.0.0", Repo: "TODO-owner/TODO-repo", Path: "TODO/migration_guide.rst", @@ -272,7 +250,7 @@ Removed members ====================== ========================== Removed member Migration guideline ====================== ========================== -placeholder_member Use ` + "``{{.ID}}.placeholder_new``" + ` instead. +placeholder_member Use ` + "``{{.Module}}.placeholder_new``" + ` instead. ====================== ========================== `}, dropFile: `.. ` + todo + `: a placeholder. Replace it with a real copy of the guide and say in the test why its other table is no removal. @@ -283,7 +261,7 @@ Removed members ====================== ========================== Removed member Migration guideline ====================== ========================== -placeholder_member Use ` + "``{{.ID}}.placeholder_new``" + ` instead. +placeholder_member Use ` + "``{{.Module}}.placeholder_new``" + ` instead. ====================== ========================== Other members @@ -309,7 +287,7 @@ func Test{{.Ident}}DropsANonChange(t *testing.T) { `, source: "{{.File}}-migration-guide.rst", ingest: `// {{.Lower}}Ingest runs the plugin over a saved copy of the guide. -func {{.Lower}}Ingest(t *testing.T, file string) []event.EventV2 { +func {{.Lower}}Ingest(t *testing.T, file string) []event.Event { t.Helper() return kittest.Ingest(t, Plugin{Guide: members.{{.Ident}}}, kittest.Pages{members.{{.Ident}}.URL(): file}) } @@ -330,7 +308,7 @@ func {{.Lower}}Ingest(t *testing.T, file string) []event.EventV2 { // the changelog's path. Say what you checked, with the date, as changelog.go // does for Textual and urllib3. var {{.Ident}} = File{ - Package: "{{.ID}}", Ecosystem: "pypi", Module: "{{.ID}}", + API: "{{.ID}}", Package: "{{.PyPI}}", Ecosystem: "pypi", Module: "{{.Module}}", Repo: "TODO-owner/TODO-repo", TagPrefix: "v", Path: "CHANGELOG.md", } @@ -351,7 +329,7 @@ var {{.Ident}}Golden = {{.Ident}}.At("1.0.0") `}, source: "{{.File}}-CHANGELOG.md", ingest: `// {{.Lower}}Ingest runs the plugin over a saved copy of the changelog. -func {{.Lower}}Ingest(t *testing.T, file string) []event.EventV2 { +func {{.Lower}}Ingest(t *testing.T, file string) []event.Event { t.Helper() return kittest.Ingest(t, Plugin{File: {{.Ident}}Golden}, kittest.Pages{ {{.Ident}}Golden.URL(): file}) } @@ -386,7 +364,7 @@ var {{.Ident}} = Log{ const {{.Lower}}Commit = "0000000000000000000000000000000000000000" // {{.Lower}}Ingest runs the plugin over a saved copy of the changelog. -func {{.Lower}}Ingest(t *testing.T, file string) []event.EventV2 { +func {{.Lower}}Ingest(t *testing.T, file string) []event.Event { t.Helper() return kittest.Ingest(t, Plugin{Log: {{.Ident}}}, kittest.Pages{ {{.Ident}}.CommitsURL(): "testdata/{{.File}}-commits.json", @@ -410,7 +388,7 @@ func {{.Lower}}Ingest(t *testing.T, file string) []event.EventV2 { // the catalog's path and the commits API URL for the newest ref. Say what you // checked, with the date, as catalog.go does for Redis. var {{.Ident}} = Catalog{ - API: "{{.ID}}", Ecosystem: "{{.ID}}", Package: "{{.ID}}", + API: "{{.ID}}", Ecosystem: "{{.ProviderID}}", Package: "{{.ProviderID}}", Repo: "TODO-owner/TODO-repo", Path: "TODO/commands.json", RefsURL: "https://api.github.com/repos/TODO-owner/TODO-repo/commits/main", } @@ -429,8 +407,8 @@ const ( {{.Lower}}NewRef = "1111111111111111111111111111111111111111" ) -// {{.Lower}}Ingest replays the saved old snapshot against file. -func {{.Lower}}Ingest(t *testing.T, file string) []event.EventV2 { +// {{.Lower}}Ingest extracts the change from the saved old snapshot to file. +func {{.Lower}}Ingest(t *testing.T, file string) []event.Event { t.Helper() env := kittest.Env(t, kittest.Pages{ {{.Ident}}.URL({{.Lower}}OldRef): "testdata/{{.File}}-old.json", @@ -438,8 +416,8 @@ func {{.Lower}}Ingest(t *testing.T, file string) []event.EventV2 { }) sink := env.Baselines.(kittest.Sink) p := Plugin{Catalog: {{.Ident}}} - if rejected, err := kittest.Replay(context.Background(), env, sink, p, {{.Lower}}OldRef, {{.Lower}}NewRef); err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + if rejected, err := kittest.Pair(context.Background(), env, sink, p, {{.Lower}}OldRef, {{.Lower}}NewRef); err != nil || rejected { + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } return kittest.Stored(t, sink) } @@ -517,14 +495,14 @@ func (a {{.Lower}}Adapter) Fetch(_ context.Context, tag string) (adapter.Spec, e return adapter.Spec{Content: body, Version: tag, SourceURL: "{{.Source}}"}, nil } -// {{.Lower}}Ingest replays the saved old spec against file. -func {{.Lower}}Ingest(t *testing.T, file string) []event.EventV2 { +// {{.Lower}}Ingest extracts the change from the saved old spec to file. +func {{.Lower}}Ingest(t *testing.T, file string) []event.Event { t.Helper() env := kittest.Env(t, nil) sink := env.Baselines.(kittest.Sink) p := Plugin{Adapter: {{.Lower}}Adapter{"old": "testdata/{{.File}}-old.json", "new": file}} - if rejected, err := kittest.Replay(context.Background(), env, sink, p, "old", "new"); err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + if rejected, err := kittest.Pair(context.Background(), env, sink, p, "old", "new"); err != nil || rejected { + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } return kittest.Stored(t, sink) } @@ -545,7 +523,7 @@ func {{.Lower}}Ingest(t *testing.T, file string) []event.EventV2 { // imports (from --package, or guessed). Say // what you checked, with the date: that the wheel holds the package's .py // (or .pyi) files. -var {{.Ident}} = Package{Name: "{{.PyPI}}", Ecosystem: "pypi", Module: "{{.Module}}"} +var {{.Ident}} = Package{ID: "{{.ID}}", Name: "{{.PyPI}}", Ecosystem: "pypi", Module: "{{.Module}}"} `, register: `plugin.Register(Plugin{Package: {{.Ident}}})`, pluginOf: `Plugin{Package: {{.Ident}}}`, @@ -561,7 +539,7 @@ var {{.Ident}} = Package{Name: "{{.PyPI}}", Ecosystem: "pypi", Module: "{{.Modul // holding file. The wheels are built here so the placeholders are text. // ` + todo + `: save the two real wheels (trimmed if they're large, as // apisurface_test.go's are) and serve them instead. -func {{.Lower}}Ingest(t *testing.T, file string) []event.EventV2 { +func {{.Lower}}Ingest(t *testing.T, file string) []event.Event { t.Helper() wheel := func(src string) []byte { var buf bytes.Buffer @@ -640,10 +618,10 @@ func Test{{.Ident}}RegistersItself(t *testing.T) { // // go test ./plugins/{{.Kind}} -run Test{{.Ident}}Golden -update // -// and read testdata/golden/{{.ID}}.json like code: every event in it is a +// and read testdata/golden/{{.Name}}.json like code: every event in it is a // pull request someone may get. func Test{{.Ident}}Golden(t *testing.T) { - kittest.Golden(t, "testdata/golden/{{.ID}}.json", {{.Lower}}Ingest(t, {{.Lower}}Source)) + kittest.Golden(t, "testdata/golden/{{.Name}}.json", {{.Lower}}Ingest(t, {{.Lower}}Source)) } {{if .Drop}}{{.Drop}}{{else}}// The pinned drop test: a realistic input that must not become an event. diff --git a/cmd/new-plugin/main.go b/cmd/new-plugin/main.go index bc2b712..f508721 100644 --- a/cmd/new-plugin/main.go +++ b/cmd/new-plugin/main.go @@ -24,9 +24,8 @@ // there. `go test ./...` passes right after; every place to fill in says // TODO(new-plugin). // -// It changes nothing when the provider/source id or the first name is -// taken, or a file it would write exists. The old flags (--api, --provider -// as the name, --format, --source as the URL) still work for one release. +// It changes nothing when the provider/source id is taken, or a file it +// would write exists. package main import ( @@ -71,19 +70,16 @@ type Options struct { URLs []string // the provider's pages or files it reads; none is a placeholder Packages []string // the packages it covers, "pypi:acme" Watches string // what the source watches, in a few words - Page string // the provider page, providers/.md; "" is the first name. An existing page is shared, not rewritten - API string // its first name, the old slug events carry in api; "" is - (or the provider's id when they're the same) - - // Deprecated: Format is a template ("openapi", "notices/feed") or an old - // format name ("feed"); Kind and Reader replace it. Source is the first - // URL (URLs replaces it). - Format string - Source string + Page string // the provider page, providers/.md; "" is -. An existing page is shared, not rewritten Today time.Time // Go runs the go command afterwards: the golden file from the placeholders // (go test -update). Go bool + + tmpl string // the template: a kind, or kind/reader + name string // the files' base name: -, or the provider's id when they're the same + url string // the first URL } // list is a repeatable flag. @@ -95,33 +91,25 @@ func (l *list) Set(v string) error { *l = append(*l, v); return nil } func main() { var o Options var urls, packages list - var provider, source string flag.StringVar(&o.Root, "root", ".", "the repo root") - flag.StringVar(&provider, "provider", "", "the provider's id, e.g. acme (with --format: its name, the old meaning)") + flag.StringVar(&o.ProviderID, "provider", "", "the provider's id, e.g. acme") flag.StringVar(&o.Provider, "name", "", "the provider's name as it writes it, e.g. Acme (a registered provider's is kept)") flag.StringVar(&o.Category, "category", "", "the provider's category: "+strings.Join(categories(), ", ")) flag.StringVar(&o.Homepage, "homepage", "", "the provider's own site, https://...") - flag.StringVar(&source, "source", "", "the source's id within the provider, e.g. api or python-sdk (with --format: its URL, the old meaning)") + flag.StringVar(&o.SourceID, "source", "", "the source's id within the provider, e.g. api or python-sdk") flag.StringVar(&o.Kind, "kind", "", "the kind that reads it: "+strings.Join(kindNames(), ", ")) flag.StringVar(&o.Reader, "reader", "", "the kind's reader, for a kind with several: "+readerHelp()) flag.StringVar(&o.Layer, "layer", "", "the source's layer: api, sdk, package, runtime, ci, ai-models or infra (default: the kind's)") flag.Var(&urls, "url", "a page or file the source reads, https://... (repeatable; default: a placeholder to fill in)") flag.Var(&packages, "package", "a package the source covers, ecosystem:name, e.g. pypi:acme or npm:@acme/sdk (repeatable)") flag.StringVar(&o.Watches, "watches", "", "what it watches, in a few words (default: a placeholder)") - flag.StringVar(&o.Page, "page", "", "the provider page, providers/.md (default: the first name); a second source of a provider may share the existing page") - flag.StringVar(&o.API, "api", "", "the source's first name, the slug events carry in api (default: -)") - flag.StringVar(&o.Format, "format", "", "deprecated, for one release: the old format names ("+strings.Join(legacyNames(), ", ")+"), with --api, --provider and --source ") + flag.StringVar(&o.Page, "page", "", "the provider page, providers/.md (default: -); a second source of a provider may share the existing page") flag.Parse() o.URLs, o.Packages = urls, packages - if o.Format != "" { - o.Provider, o.Source = provider, source - } else { - o.ProviderID, o.SourceID = provider, source - if term() { - if err := ask(&o, bufio.NewReader(os.Stdin), os.Stdout); err != nil { - fmt.Fprintln(os.Stderr, "new-plugin:", err) - os.Exit(1) - } + if term() { + if err := ask(&o, bufio.NewReader(os.Stdin), os.Stdout); err != nil { + fmt.Fprintln(os.Stderr, "new-plugin:", err) + os.Exit(1) } } o.Today = time.Now().UTC() @@ -171,15 +159,6 @@ func readerHelp() string { return strings.Join(parts, "; ") } -func legacyNames() []string { - var names []string - for n := range legacyFormats { - names = append(names, n) - } - slices.Sort(names) - return names -} - func categories() []string { var out []string for _, c := range plugin.Categories() { @@ -188,18 +167,8 @@ func categories() []string { return out } -// template is the template o asks for: from --kind and --reader, or the -// deprecated --format. +// template is the template o asks for: from --kind and --reader. func (o Options) template() (string, error) { - if o.Format != "" { - if t, ok := legacyFormats[o.Format]; ok { - return t, nil - } - if _, ok := formats[o.Format]; ok { - return o.Format, nil - } - return "", fmt.Errorf("--format %q: want one of %s", o.Format, strings.Join(legacyNames(), ", ")) - } if !slices.Contains(kindNames(), o.Kind) { return "", fmt.Errorf("--kind %q: want one of %s", o.Kind, strings.Join(kindNames(), ", ")) } @@ -223,10 +192,10 @@ var ( // data is what the templates fill in. type data struct { - ID, Ident, Lower, Provider, Source, File, Format, Kind, Module, PyPI string - Slug string // the provider, lowercase: a model subject's provider - SourceFile, DropFile, PluginOf, Ingest, Drop string - Imports []string + ID, Name, Ident, Lower, ProviderID, Provider, Source, File, Format, Kind, Module, PyPI string + Slug string // the provider, lowercase: a model subject's provider + SourceFile, DropFile, PluginOf, Ingest, Drop string + Imports []string } // Run scaffolds the source, or changes nothing and says why. @@ -235,13 +204,15 @@ func Run(o Options, out io.Writer) error { if err != nil { return err } - o.Format = tmpl + o.tmpl = tmpl f := formats[tmpl] if err := o.resolve(); err != nil { return err } - if !validID.MatchString(o.API) || o.API == "all" { - return fmt.Errorf("--api %q: want lowercase letters, digits and single hyphens, starting with a letter (acme, acme-models), and not \"all\"", o.API) + id := o.ProviderID + "/" + o.SourceID + o.name = o.ProviderID + "-" + o.SourceID + if o.SourceID == o.ProviderID { + o.name = o.ProviderID } if o.Provider == "" || !cellSafe.MatchString(o.Provider) { return fmt.Errorf("--provider %q: want the provider's name, without |, quotes, backslashes or backticks", o.Provider) @@ -252,15 +223,10 @@ func Run(o Options, out io.Writer) error { if !slices.Contains(plugin.Layers(), plugin.Layer(o.Layer)) { return fmt.Errorf("--layer %q: want one of %v", o.Layer, plugin.Layers()) } - if o.Source == "" && len(o.URLs) > 0 { - o.Source = o.URLs[0] - } - if o.Source == "" { - o.Source = "https://example.com/TODO-" + o.API + "-source" - } if len(o.URLs) == 0 { - o.URLs = []string{o.Source} + o.URLs = []string{"https://example.com/TODO-" + o.name + "-source"} } + o.url = o.URLs[0] for _, u := range o.URLs { if !validURL.MatchString(u) { return fmt.Errorf("--url %q: want an https URL", u) @@ -283,7 +249,7 @@ func Run(o Options, out io.Writer) error { sharedPage := false if o.Page == "" { - o.Page = o.API + o.Page = o.name } else if !validID.MatchString(o.Page) { return fmt.Errorf("--page %q: want the name of a page in providers/, without .md", o.Page) } else if _, err := os.Stat(filepath.Join(o.Root, "providers", o.Page+".md")); err == nil { @@ -291,14 +257,11 @@ func Run(o Options, out io.Writer) error { } // Taken? Check everything before writing anything. - if _, ok := plugin.Lookup(o.API); ok { - return fmt.Errorf("a source named %q is already registered: pick another --api (the first name)", o.API) - } - if _, ok := plugin.LookupSource(o.ProviderID + "/" + o.SourceID); ok { - return fmt.Errorf("source %s/%s is already registered: pick another --source", o.ProviderID, o.SourceID) + if _, ok := plugin.LookupSource(id); ok { + return fmt.Errorf("source %s is already registered: pick another --source", id) } - d := data{ID: o.API, Provider: o.Provider, Source: o.Source, Format: o.Format, Kind: f.kind, PyPI: o.API} + d := data{ID: id, Name: o.name, ProviderID: o.ProviderID, Provider: o.Provider, Source: o.url, Format: o.tmpl, Kind: f.kind, PyPI: o.ProviderID} for _, p := range o.Packages { if name, ok := strings.CutPrefix(p, "pypi:"); ok { d.PyPI = name @@ -306,9 +269,9 @@ func Run(o Options, out io.Writer) error { } } d.Module = strings.ReplaceAll(strings.ToLower(d.PyPI), "-", "_") - d.Ident = ident(o.API) + d.Ident = ident(o.name) d.Lower = string(unicode.ToLower(rune(d.Ident[0]))) + d.Ident[1:] - d.File = fileBase(o.API) + d.File = fileBase(o.name) d.Slug = strings.Trim(regexp.MustCompile(`[^a-z0-9]+`).ReplaceAllString(strings.ToLower(o.Provider), "-"), "-") d.SourceFile = fill(f.source, d) d.DropFile = dropName(d.SourceFile) @@ -324,7 +287,7 @@ func Run(o Options, out io.Writer) error { def, err := gofmt(fill(f.def, d)) if err != nil { - return fmt.Errorf("the %s template: %w", o.Format, err) + return fmt.Errorf("the %s template: %w", o.tmpl, err) } add(filepath.Join(f.defDir, d.File+".go"), def) test, err := gofmt(fill(testFile, d)) @@ -342,7 +305,7 @@ func Run(o Options, out io.Writer) error { add(filepath.Join(pkgDir, "testdata", d.DropFile), []byte(fill(drop, d))) // What the placeholders give; rewritten with -update below, and again // once the source is real. - add(filepath.Join(pkgDir, "testdata", "golden", o.API+".json"), []byte("[]\n")) + add(filepath.Join(pkgDir, "testdata", "golden", o.name+".json"), []byte("[]\n")) if !sharedPage { page, err := providerPage(o) @@ -354,7 +317,7 @@ func Run(o Options, out io.Writer) error { for path := range writes { if _, err := os.Stat(filepath.Join(o.Root, path)); err == nil { - return fmt.Errorf("%s already exists: pick another --api, or remove what's left of an earlier run", path) + return fmt.Errorf("%s already exists: pick another --source, or remove what's left of an earlier run", path) } } for _, dir := range []string{f.defDir, pkgDir} { @@ -374,17 +337,12 @@ func Run(o Options, out io.Writer) error { } else if ok { edits[filepath.Join("plugins", "all", "all.go")] = all } - if m := f.mapEntry; m != nil { - if edits[m.file], err = addMapEntry(filepath.Join(o.Root, m.file), m.varName, fill(m.entry, d)); err != nil { - return err - } - } readmePath := filepath.Join(pkgDir, "testdata", "README.md") readme, err := os.ReadFile(filepath.Join(o.Root, readmePath)) if err != nil { return err } - if edits[readmePath], err = readmeRows(readme, []string{d.SourceFile, d.DropFile}, o.Source); err != nil { + if edits[readmePath], err = readmeRows(readme, []string{d.SourceFile, d.DropFile}, o.url); err != nil { return fmt.Errorf("%s: %w", readmePath, err) } @@ -407,7 +365,7 @@ func Run(o Options, out io.Writer) error { paths = append(paths, path) } slices.Sort(paths) - fmt.Fprintf(out, "Scaffolded %s/%s (%s, first name %s, kind %s):\n", o.ProviderID, o.SourceID, o.Provider, o.API, o.Format) + fmt.Fprintf(out, "Scaffolded %s (%s, kind %s):\n", id, o.Provider, o.tmpl) for _, p := range paths { fmt.Fprintln(out, " "+p) } @@ -421,7 +379,7 @@ func Run(o Options, out io.Writer) error { return fmt.Errorf("the files are written, but `go %s` failed: %w\n%s", strings.Join(args, " "), err, b) } } - fmt.Fprintf(out, " %s (from the placeholders)\n", filepath.Join(pkgDir, "testdata", "golden", o.API+".json")) + fmt.Fprintf(out, " %s (from the placeholders)\n", filepath.Join(pkgDir, "testdata", "golden", o.name+".json")) } fmt.Fprint(out, fill(nextSteps, struct { data @@ -495,7 +453,7 @@ func identsFree(dir string, names ...string) error { for _, decl := range file.Decls { for _, n := range declNames(decl) { if slices.Contains(names, n) { - return fmt.Errorf("%s already declares %s: pick another --api", path, n) + return fmt.Errorf("%s already declares %s: pick another --source", path, n) } } } @@ -606,39 +564,6 @@ func register(root, pkgDir, line string) (string, []byte, error) { return "", nil, fmt.Errorf("found no init in %s that calls plugin.RegisterProvider", pkgDir) } -// addMapEntry adds entry to the map literal varName is set to in path. -func addMapEntry(path, varName, entry string) ([]byte, error) { - src, err := os.ReadFile(path) - if err != nil { - return nil, err - } - fset := token.NewFileSet() - file, err := parser.ParseFile(fset, path, src, parser.SkipObjectResolution) - if err != nil { - return nil, err - } - var lit *ast.CompositeLit - ast.Inspect(file, func(n ast.Node) bool { - if v, ok := n.(*ast.ValueSpec); ok && len(v.Names) == 1 && v.Names[0].Name == varName && len(v.Values) == 1 { - lit, _ = v.Values[0].(*ast.CompositeLit) - } - return lit == nil - }) - if lit == nil { - return nil, fmt.Errorf("%s: no map literal %s to add %s to", path, varName, entry) - } - at := fset.Position(lit.Rbrace).Offset - var b bytes.Buffer - b.Write(src[:at]) - if len(lit.Elts) > 0 && fset.Position(lit.Elts[len(lit.Elts)-1].End()).Line == fset.Position(lit.Rbrace).Line { - b.WriteString(", " + entry) - } else { - b.WriteString("\t" + entry + ",\n") - } - b.Write(src[at:]) - return format.Source(b.Bytes()) -} - // readmeRows adds a row per saved file to the first table of a testdata // README whose first column is the file, with a TODO in every other column. func readmeRows(readme []byte, files []string, source string) ([]byte, error) { @@ -690,13 +615,6 @@ func readmeRows(readme []byte, files []string, source string) ([]byte, error) { return []byte(strings.Join(lines, "\n")), nil } -func linkText(url string) string { - if strings.Contains(url, "example.com/TODO") { - return "TODO: the source" - } - return strings.TrimPrefix(url, "https://") -} - // providerPage is providers/_template.md for this provider. func providerPage(o Options) ([]byte, error) { tmpl, err := os.ReadFile(filepath.Join(o.Root, "providers", "_template.md")) @@ -705,10 +623,10 @@ func providerPage(o Options) ([]byte, error) { } s := string(tmpl) s = strings.ReplaceAll(s, "", o.Provider) - s = strings.ReplaceAll(s, "", o.API) - s = strings.ReplaceAll(s, "``", "<"+o.Source+">") + s = strings.ReplaceAll(s, "`/`", "`"+o.ProviderID+"/"+o.SourceID+"`") + s = strings.ReplaceAll(s, "``", "<"+o.url+">") s = strings.ReplaceAll(s, "``", o.Today.Format("2006-01-02")+" (TODO(new-plugin): the date you checked it)") - s = strings.Replace(s, "Copy this file to `providers/"+o.API+".md` and fill every section. Delete these instructions.", + s = strings.Replace(s, "Copy this file to `providers/-.md` and fill every section. Delete these instructions.", "TODO(new-plugin): fill every section, then delete this line. Scaffolded by `go run ./cmd/new-plugin`.", 1) return []byte(s), nil } diff --git a/cmd/new-plugin/main_test.go b/cmd/new-plugin/main_test.go index 087e8f6..1ee9952 100644 --- a/cmd/new-plugin/main_test.go +++ b/cmd/new-plugin/main_test.go @@ -47,7 +47,7 @@ func TestScaffoldEveryKind(t *testing.T) { t.Errorf("%s: no next steps in\n%s", f, out.String()) } } - for _, args := range [][]string{{"build", "./..."}, {"vet", "./..."}, {"test", "-count=1", "./plugins/...", "./internal/...", "./core/migrate/..."}} { + for _, args := range [][]string{{"build", "./..."}, {"vet", "./..."}, {"test", "-count=1", "./plugins/...", "./internal/..."}} { cmd := exec.Command(goCmd, args...) cmd.Dir = root if b, err := cmd.CombinedOutput(); err != nil { @@ -81,7 +81,7 @@ func TestScaffoldEveryKind(t *testing.T) { // page, and the registration names the existing ones. func TestScaffoldSharesTheProviderPage(t *testing.T) { root := copyRepo(t) - o := Options{Root: root, API: "algolia-analytics", Provider: "Algolia", Format: "openapi", Page: "algolia", Today: today} + o := Options{Root: root, ProviderID: "algolia", SourceID: "analytics", Kind: "openapi", Page: "algolia", Today: today} if err := Run(o, io.Discard); err != nil { t.Fatal(err) } @@ -107,17 +107,13 @@ func TestRefusesBadInput(t *testing.T) { "other name": {ProviderID: "stripe", Provider: "Stripe Inc", SourceID: "sdk", Kind: "apisurface"}, "bad category": {ProviderID: "acme", Provider: "Acme", SourceID: "api", Kind: "openapi", Category: "toys"}, "bad package": {ProviderID: "acme", Provider: "Acme", SourceID: "api", Kind: "openapi", Packages: []string{"pip:acme"}}, - "first name taken": {ProviderID: "acme", Provider: "Acme", SourceID: "api", Kind: "openapi", API: "stripe"}, - "unknown format": {API: "acme", Provider: "Acme", Format: "graphql"}, - "uppercase id": {API: "Acme", Provider: "Acme", Format: "feed"}, - "double hyphen": {API: "acme--x", Provider: "Acme", Format: "feed"}, - "id all": {API: "all", Provider: "Acme", Format: "feed"}, - "registered id": {API: "stripe", Provider: "Stripe", Format: "openapi"}, - "no provider": {API: "acme", Format: "feed"}, - "pipe in name": {API: "acme", Provider: "Ac|me", Format: "feed"}, - "unknown layer": {API: "acme", Provider: "Acme", Format: "feed", Layer: "database"}, - "http source": {API: "acme", Provider: "Acme", Format: "feed", Source: "http://acme.example/feed"}, - "provider exists": {API: "numpy", Provider: "NumPy", Format: "changelog"}, + "uppercase id": {ProviderID: "Acme", Provider: "Acme", SourceID: "api", Kind: "notices"}, + "double hyphen": {ProviderID: "acme", Provider: "Acme", SourceID: "a--x", Kind: "notices"}, + "no provider name": {ProviderID: "acme", SourceID: "api", Kind: "notices"}, + "pipe in name": {ProviderID: "acme", Provider: "Ac|me", SourceID: "api", Kind: "notices"}, + "unknown layer": {ProviderID: "acme", Provider: "Acme", SourceID: "api", Kind: "notices", Layer: "database"}, + "http source": {ProviderID: "acme", Provider: "Acme", SourceID: "api", Kind: "notices", URLs: []string{"http://acme.example/feed"}}, + "provider exists": {ProviderID: "numpy", Provider: "NumPy Inc", SourceID: "changes", Kind: "changelog"}, } { o.Root, o.Today = root, today if err := Run(o, io.Discard); err == nil { diff --git a/cmd/new-plugin/resolve.go b/cmd/new-plugin/resolve.go index 7b3ab38..99612db 100644 --- a/cmd/new-plugin/resolve.go +++ b/cmd/new-plugin/resolve.go @@ -8,28 +8,15 @@ import ( "io" "os" "path/filepath" - "regexp" "slices" "strings" "github.com/patch-it-dev/patch-it-plugins/core/plugin" ) -// resolve fills in the provider and source from the registry and the -// flags: a registered provider's name, category and homepage, the first -// name, and, for the deprecated flags, the ids from the name and --api. +// resolve fills in the provider from the registry: a registered provider's +// name, category and homepage. func (o *Options) resolve() error { - if o.ProviderID == "" && o.Provider != "" { // the old flags: --provider is the name - o.ProviderID = strings.Trim(regexp.MustCompile(`[^a-z0-9]+`).ReplaceAllString(strings.ToLower(o.Provider), "-"), "-") - for _, p := range plugin.Providers() { - if strings.EqualFold(p.Name, o.Provider) { - o.ProviderID = p.ID - } - } - if o.SourceID == "" { - o.SourceID = strings.TrimPrefix(o.API, o.ProviderID+"-") - } - } if !validID.MatchString(o.ProviderID) { return fmt.Errorf("--provider %q: want the provider's id, lowercase letters, digits and single hyphens (acme)", o.ProviderID) } @@ -55,12 +42,6 @@ func (o *Options) resolve() error { return fmt.Errorf("--homepage %q: want an https URL", o.Homepage) } } - if o.API == "" { - o.API = o.ProviderID + "-" + o.SourceID - if o.SourceID == o.ProviderID { - o.API = o.ProviderID - } - } return nil } diff --git a/core/event/event.go b/core/event/event.go index d17f1c9..be8b0b9 100644 --- a/core/event/event.go +++ b/core/event/event.go @@ -1,20 +1,23 @@ +// Package event is the change event of patch-it's contract +// (docs/contract/change-event.md in patch-it): what changed, at which +// version, with the source that says so. A typed subject says what changed. package event import ( + "bytes" "crypto/sha256" "encoding/hex" + "encoding/json" "fmt" "regexp" + "slices" "strings" "time" "unicode/utf8" ) -type ( - ChangeType string - AffectedKind string - Side string -) +// ChangeType is what kind of change it is to the code that calls the source. +type ChangeType string const ( ChangeTypeBreaking ChangeType = "breaking" @@ -23,30 +26,77 @@ const ( ChangeTypeFix ChangeType = "fix" ) +// Kind is what an api_operation subject is about. +type Kind string + const ( - AffectedKindOperation AffectedKind = "operation" - AffectedKindRequestParameter AffectedKind = "request_parameter" - AffectedKindSchema AffectedKind = "schema" - AffectedKindSchemaProperty AffectedKind = "schema_property" + KindOperation Kind = "operation" + KindRequestParameter Kind = "request_parameter" + KindSchema Kind = "schema" + KindSchemaProperty Kind = "schema_property" ) +// Side is which side of a call an api_operation change breaks. +type Side string + const ( SideRequest Side = "request" SideResponse Side = "response" ) -type Affected struct { - Kind AffectedKind `json:"kind"` // kind of change - Side Side `json:"side"` // which side is breaking - Operation string `json:"operation,omitempty"` // if operation change, what changed - Schema string `json:"schema,omitempty"` // if schema change, what changed - Property string `json:"property,omitempty"` // if poperty change, what changed - // Value is the one value of Property the change is about, when it's about one: - // the retired model name for a model retirement ("gpt-4"). Optional. - Value string `json:"value,omitempty"` +// SubjectType is what kind of thing changed. +type SubjectType string + +const ( + SubjectAPIOperation SubjectType = "api_operation" + SubjectModel SubjectType = "model" + SubjectPackageRelease SubjectType = "package_release" + SubjectCIRuntime SubjectType = "ci_runtime" +) + +// PackageChange is what a package release did to the code that calls it. +type PackageChange string + +const ( + PackageRemovedParameter PackageChange = "removed_parameter" + PackageRemovedSymbol PackageChange = "removed_symbol" + PackageRenamedSymbol PackageChange = "renamed_symbol" + PackageChangedDefault PackageChange = "changed_default" +) + +// Subject is what changed. Type picks which fields it may have; every other +// field must be empty (the contract's "a field its type doesn't define"). +type Subject struct { + Type SubjectType `json:"type"` + + // api_operation + Kind Kind `json:"kind,omitempty"` + Side Side `json:"side,omitempty"` + Operation string `json:"operation,omitempty"` + Schema string `json:"schema,omitempty"` + Property string `json:"property,omitempty"` + + // model + Provider string `json:"provider,omitempty"` + Name string `json:"name,omitempty"` + + // package_release + Ecosystem string `json:"ecosystem,omitempty"` + Package string `json:"package,omitempty"` + Change PackageChange `json:"change,omitempty"` + Symbols []string `json:"symbols,omitempty"` + Parameter string `json:"parameter,omitempty"` + + // ci_runtime + Platform string `json:"platform,omitempty"` + Runtime string `json:"runtime,omitempty"` + + // model, package_release (renamed_symbol), ci_runtime + Replacement string `json:"replacement,omitempty"` } -type ChangeEvent struct { +// Event is one change event. +type Event struct { ID int64 `json:"id"` Fingerprint string `json:"fingerprint"` API string `json:"api"` @@ -54,7 +104,8 @@ type ChangeEvent struct { PreviousVersion string `json:"previous_version,omitempty"` ChangeType ChangeType `json:"change_type"` Breaking bool `json:"breaking"` - Affected Affected `json:"affected"` + Subject Subject `json:"subject"` + Supersedes string `json:"supersedes,omitempty"` Description string `json:"description"` MigrationHint string `json:"migration_hint,omitempty"` SourceURL string `json:"source_url"` @@ -64,50 +115,186 @@ type ChangeEvent struct { DetectedAt time.Time `json:"detected_at"` } -// Fingerprint identifies one change at one location, so re-running ingest over -// the same specs updates nothing instead of duplicating events. detail is what -// separates two changes at the same place: the enum value added, the old and -// new type, "added as required". Absent fields are empty strings, and the parts -// are joined with a separator that cannot appear in a path or a schema name. -func Fingerprint(api, version string, changeType ChangeType, affected Affected, detail string) string { - sum := sha256.Sum256([]byte(strings.Join([]string{ - api, - version, - string(changeType), - string(affected.Kind), - string(affected.Side), - affected.Operation, - affected.Schema, - affected.Property, - detail, - }, "|"))) - return "sha256:" + hex.EncodeToString(sum[:]) +// Decode reads one event and refuses a field the contract doesn't define, +// at the top level or in subject: the patch-it client's model forbids extra +// fields too, so the hosted service and the client reject the same events. Keys are +// matched exactly ("TYPE" isn't "type", though encoding/json would take it), +// and a subject key belongs to its type even when its value is empty: pydantic +// sees the key, not the value. +func Decode(raw []byte) (Event, error) { + var e Event + dec := json.NewDecoder(bytes.NewReader(raw)) + dec.DisallowUnknownFields() + if err := dec.Decode(&e); err != nil { + return Event{}, err + } + var keys struct { + Top map[string]json.RawMessage + Subject map[string]json.RawMessage `json:"subject"` + } + if err := json.Unmarshal(raw, &keys.Top); err != nil { + return Event{}, err + } + for k := range keys.Top { + if !slices.Contains(eventKeys, k) { + return Event{}, fmt.Errorf("%q isn't a field of a change event", k) + } + } + if sub, ok := keys.Top["subject"]; ok { + if err := json.Unmarshal(sub, &keys.Subject); err != nil { + return Event{}, err + } + } + allowed := slices.Concat(subjectKeys[e.Subject.Type], []string{"type"}) + for k := range keys.Subject { + if !slices.Contains(allowed, k) { + return Event{}, fmt.Errorf("subject.%s isn't a field of type %s", k, e.Subject.Type) + } + } + return e, nil } -// fingerprintPattern is the contract's shape for a fingerprint (the schema's -// pattern in the change event contract). patch-it checks the same pattern. -var fingerprintPattern = regexp.MustCompile(`^sha256:[0-9a-f]{64}$`) +// eventKeys are the JSON names of Event's fields. +var eventKeys = []string{"id", "fingerprint", "api", "version", "previous_version", "change_type", + "breaking", "subject", "supersedes", "description", "migration_hint", "source_url", + "source_pointer", "source_excerpt", "confidence", "detected_at"} -func (e ChangeEvent) Validate() error { +// subjectKeys are the fields each type may have, besides `type`. +var subjectKeys = map[SubjectType][]string{ + SubjectAPIOperation: {"kind", "side", "operation", "schema", "property"}, + SubjectModel: {"provider", "name", "replacement"}, + SubjectPackageRelease: {"ecosystem", "package", "change", "symbols", "parameter", "replacement"}, + SubjectCIRuntime: {"platform", "runtime", "replacement"}, +} + +// Fingerprint identifies one change, so re-reading the same source stores +// nothing twice. The parts are joined with a separator that can't appear in +// them. For api_operation, the location and detail (what separates two +// changes at one place: the enum value added, "added as required"); for the +// other types, the type and its key fields, detail empty: the key already +// says what changed. Symbols are sorted first, so the same release always +// gets the same fingerprint. +func Fingerprint(api, version string, changeType ChangeType, s Subject, detail string) string { + if s.Type == SubjectAPIOperation { + return hash(api, version, string(changeType), string(s.Kind), string(s.Side), s.Operation, s.Schema, s.Property, detail) + } + parts := []string{api, version, string(changeType), string(s.Type)} + switch s.Type { + case SubjectModel: + parts = append(parts, s.Provider, s.Name) + case SubjectPackageRelease: + symbols := slices.Clone(s.Symbols) + slices.Sort(symbols) + parts = append(parts, s.Ecosystem, s.Package, string(s.Change), strings.Join(symbols, ","), s.Parameter) + case SubjectCIRuntime: + parts = append(parts, s.Platform, s.Runtime) + } + return hash(append(parts, "")...) +} + +func hash(parts ...string) string { + sum := sha256.Sum256([]byte(strings.Join(parts, "|"))) + return "sha256:" + hex.EncodeToString(sum[:]) +} + +// Validate applies the contract: the rules for every field, then subject's own. +func (e Event) Validate() error { if err := checkCommon(e.SourceURL, e.SourceExcerpt, e.Fingerprint, e.API, e.Version, e.Description, e.DetectedAt, e.ChangeType, e.Breaking, e.Confidence); err != nil { return err } + if e.Supersedes != "" && !fingerprintPattern.MatchString(e.Supersedes) { + return fmt.Errorf("supersedes must look like sha256:<64 lowercase hex>, got %q", e.Supersedes) + } + return e.Subject.validate() +} - if err := e.Affected.validate(); err != nil { +func (s Subject) validate() error { + allowed, err := s.required() + if err != nil { return err } + for name, set := range s.present() { + if set && !slices.Contains(allowed, name) { + return fmt.Errorf("subject.%s isn't a field of type %s", name, s.Type) + } + } + return nil +} - // Rule 5 (continued): a value is a value of a property. - if e.Affected.Value != "" && e.Affected.Property == "" { - return fmt.Errorf("affected.value needs affected.property: it is a value of that property") +// required checks the fields the type must have and returns every field it may. +func (s Subject) required() ([]string, error) { + need := func(name, v string) error { + if v == "" { + return fmt.Errorf("subject.%s is required for type %s", name, s.Type) + } + return nil } + switch s.Type { + case SubjectAPIOperation: + if err := s.validateOperation(); err != nil { + return nil, fmt.Errorf("subject: %w", err) + } + return subjectKeys[SubjectAPIOperation], nil + case SubjectModel: + for _, f := range [][2]string{{"provider", s.Provider}, {"name", s.Name}} { + if err := need(f[0], f[1]); err != nil { + return nil, err + } + } + return subjectKeys[SubjectModel], nil + case SubjectPackageRelease: + for _, f := range [][2]string{{"ecosystem", s.Ecosystem}, {"package", s.Package}} { + if err := need(f[0], f[1]); err != nil { + return nil, err + } + } + switch s.Change { + case PackageRemovedParameter, PackageChangedDefault: + if err := need("parameter", s.Parameter); err != nil { + return nil, err + } + case PackageRenamedSymbol: + if err := need("replacement", s.Replacement); err != nil { + return nil, err + } + case PackageRemovedSymbol: + default: + return nil, fmt.Errorf("subject.change must be a valid enum value, got %q", s.Change) + } + if len(s.Symbols) == 0 || slices.Contains(s.Symbols, "") { + return nil, fmt.Errorf("subject.symbols must name at least one symbol, none empty") + } + return subjectKeys[SubjectPackageRelease], nil + case SubjectCIRuntime: + for _, f := range [][2]string{{"platform", s.Platform}, {"runtime", s.Runtime}} { + if err := need(f[0], f[1]); err != nil { + return nil, err + } + } + return subjectKeys[SubjectCIRuntime], nil + } + return nil, fmt.Errorf("subject.type must be a valid enum value, got %q", s.Type) +} - return nil +// present is which subject fields are set, by their JSON names. +func (s Subject) present() map[string]bool { + return map[string]bool{ + "kind": s.Kind != "", "side": s.Side != "", "operation": s.Operation != "", + "schema": s.Schema != "", "property": s.Property != "", + "provider": s.Provider != "", "name": s.Name != "", + "ecosystem": s.Ecosystem != "", "package": s.Package != "", "change": s.Change != "", + "symbols": len(s.Symbols) > 0, "parameter": s.Parameter != "", + "platform": s.Platform != "", "runtime": s.Runtime != "", + "replacement": s.Replacement != "", + } } -// checkCommon is the contract's rules for every field outside affected (v1) or -// subject (v2): the two versions differ only in what changed, not in the rest. +// fingerprintPattern is the contract's shape for a fingerprint (the schema's +// pattern in the change event contract). patch-it checks the same pattern. +var fingerprintPattern = regexp.MustCompile(`^sha256:[0-9a-f]{64}$`) + +// checkCommon is the contract's rules for every field outside subject. func checkCommon(sourceURL, excerpt, fingerprint, api, version, description string, detectedAt time.Time, changeType ChangeType, breaking bool, confidence float64) error { // Rule 1: provenance is mandatory — the anti-hallucination mechanism. @@ -165,50 +352,50 @@ func checkCommon(sourceURL, excerpt, fingerprint, api, version, description stri return nil } -// validate is the contract's rules for an API location: v1's affected, and v2's -// api_operation subject. Kind decides the side and the required fields. -func (a Affected) validate() error { - // Rule 3 (continued): affected.kind and affected.side must be valid too. - if a.Kind != AffectedKindOperation && - a.Kind != AffectedKindRequestParameter && - a.Kind != AffectedKindSchema && - a.Kind != AffectedKindSchemaProperty { - return fmt.Errorf("affected.kind must be a valid enum value, got %q", a.Kind) +// validateOperation is the contract's rules for an api_operation subject: +// kind decides the side and the required fields. +func (a Subject) validateOperation() error { + // Rule 3 (continued): subject.kind and subject.side must be valid too. + if a.Kind != KindOperation && + a.Kind != KindRequestParameter && + a.Kind != KindSchema && + a.Kind != KindSchemaProperty { + return fmt.Errorf("subject.kind must be a valid enum value, got %q", a.Kind) } if a.Side != SideRequest && a.Side != SideResponse { - return fmt.Errorf("affected.side must be a valid enum value, got %q", a.Side) + return fmt.Errorf("subject.side must be a valid enum value, got %q", a.Side) } - // Rule 5: affected's required sub-fields, and its side, depend on its kind. + // Rule 5: subject's required fields, and its side, depend on its kind. // Kind decides side: requests live under paths, responses under schemas. switch a.Kind { - case AffectedKindOperation: + case KindOperation: if a.Operation == "" { - return fmt.Errorf("affected.operation is required when kind is operation") + return fmt.Errorf("subject.operation is required when kind is operation") } if a.Side != SideRequest { - return fmt.Errorf("affected.side must be %q when kind is operation, got %q", SideRequest, a.Side) + return fmt.Errorf("subject.side must be %q when kind is operation, got %q", SideRequest, a.Side) } - case AffectedKindRequestParameter: + case KindRequestParameter: if a.Operation == "" || a.Property == "" { - return fmt.Errorf("affected.operation and affected.property are required when kind is request_parameter") + return fmt.Errorf("subject.operation and subject.property are required when kind is request_parameter") } if a.Side != SideRequest { - return fmt.Errorf("affected.side must be %q when kind is request_parameter, got %q", SideRequest, a.Side) + return fmt.Errorf("subject.side must be %q when kind is request_parameter, got %q", SideRequest, a.Side) } - case AffectedKindSchema: + case KindSchema: if a.Schema == "" { - return fmt.Errorf("affected.schema is required when kind is schema") + return fmt.Errorf("subject.schema is required when kind is schema") } if a.Side != SideResponse { - return fmt.Errorf("affected.side must be %q when kind is schema, got %q", SideResponse, a.Side) + return fmt.Errorf("subject.side must be %q when kind is schema, got %q", SideResponse, a.Side) } - case AffectedKindSchemaProperty: + case KindSchemaProperty: if a.Schema == "" || a.Property == "" { - return fmt.Errorf("affected.schema and affected.property are required when kind is schema_property") + return fmt.Errorf("subject.schema and subject.property are required when kind is schema_property") } if a.Side != SideResponse { - return fmt.Errorf("affected.side must be %q when kind is schema_property, got %q", SideResponse, a.Side) + return fmt.Errorf("subject.side must be %q when kind is schema_property, got %q", SideResponse, a.Side) } } return nil diff --git a/core/event/event_test.go b/core/event/event_test.go index 6f0b3f6..a513875 100644 --- a/core/event/event_test.go +++ b/core/event/event_test.go @@ -8,223 +8,77 @@ import ( "time" ) -var fixtureOperationAdded = ChangeEvent{ - ID: 1, - Fingerprint: "sha256:3b1f000000000000000000000000000000000000000000000000000000000000", - API: "stripe", - Version: "2026-08-26.dahlia", - PreviousVersion: "2026-07-29.dahlia", - ChangeType: ChangeTypeNewFeature, - Breaking: false, - Affected: Affected{ - Kind: AffectedKindOperation, - Side: SideRequest, - Operation: "POST /v1/billing/feedback_options", - }, - Description: "New operation POST /v1/billing/feedback_options (PostBillingFeedbackOptions).", - SourceURL: "https://raw.githubusercontent.com/stripe/openapi/v2468/latest/openapi.spec3.json", - SourcePointer: "/paths/~1v1~1billing~1feedback_options/post", - SourceExcerpt: `{"operationId":"PostBillingFeedbackOptions","summary":"Create a feedback option"}`, - Confidence: 1.0, - DetectedAt: time.Date(2026, 9, 13, 15, 0, 0, 0, time.UTC), -} +// fixtures is the copy of patch-it's contract fixtures (CI_contract keeps it +// in sync). +const fixtures = "../../contract/fixtures/" -var fixtureEnumValueAdded = ChangeEvent{ - ID: 2, - Fingerprint: "sha256:9f2c000000000000000000000000000000000000000000000000000000000000", - API: "stripe", +var operationAdded = Event{ + ID: 1, + API: "stripe/api", Version: "2026-08-26.dahlia", PreviousVersion: "2026-07-29.dahlia", ChangeType: ChangeTypeNewFeature, - Breaking: false, - Affected: Affected{ - Kind: AffectedKindSchemaProperty, - Side: SideResponse, - Schema: "invoices_payment_settings", - Property: "payment_method_types[]", - }, - Description: "Enum value 'billie' added to invoices_payment_settings.payment_method_types[].", - SourceURL: "https://raw.githubusercontent.com/stripe/openapi/v2468/latest/openapi.spec3.json", - SourcePointer: "/components/schemas/invoices_payment_settings/properties/payment_method_types/items/enum", - SourceExcerpt: `["ach_credit_transfer","ach_debit","billie"]`, - Confidence: 1.0, - DetectedAt: time.Date(2026, 9, 13, 15, 0, 0, 0, time.UTC), -} - -var fixturePropertyRemoved = ChangeEvent{ - ID: 3, - Fingerprint: "sha256:c07a000000000000000000000000000000000000000000000000000000000000", - API: "stripe", - Version: "2026-08-26.dahlia", - PreviousVersion: "2026-07-29.dahlia", - ChangeType: ChangeTypeBreaking, - Breaking: true, - Affected: Affected{ - Kind: AffectedKindSchemaProperty, - Side: SideResponse, - Schema: "payments_primitives_payment_records_resource_payment_method_card_details_resource_three_d_secure", - Property: "cryptogram", - }, - Description: "Property cryptogram removed from payments_primitives_payment_records_resource_payment_method_card_details_resource_three_d_secure.", - SourceURL: "https://raw.githubusercontent.com/stripe/openapi/v2460/latest/openapi.spec3.json", - SourcePointer: "/components/schemas/payments_primitives_payment_records_resource_payment_method_card_details_resource_three_d_secure/properties/cryptogram", - SourceExcerpt: `{"description":"The 3D Secure cryptogram.","maxLength":5000,"nullable":true,"type":"string"}`, - Confidence: 1.0, - DetectedAt: time.Date(2026, 9, 13, 15, 0, 0, 0, time.UTC), -} - -var fixtureDeprecation = ChangeEvent{ - ID: 4, - Fingerprint: "sha256:a1e5000000000000000000000000000000000000000000000000000000000000", - API: "stripe", - Version: "2026-08-26.dahlia", - PreviousVersion: "2026-07-29.dahlia", - ChangeType: ChangeTypeDeprecation, - Breaking: false, - Affected: Affected{ - Kind: AffectedKindOperation, - Side: SideRequest, - Operation: "POST /v1/charges", - }, - Description: "Operation POST /v1/charges marked deprecated in favor of POST /v1/payment_intents.", - MigrationHint: "Use POST /v1/payment_intents instead.", - SourceURL: "https://raw.githubusercontent.com/stripe/openapi/v2468/latest/openapi.spec3.json", - SourcePointer: "/paths/~1v1~1charges/post/deprecated", - SourceExcerpt: `{"deprecated":true}`, - Confidence: 1.0, - DetectedAt: time.Date(2026, 9, 13, 15, 0, 0, 0, time.UTC), -} - -func TestFixturesAreValid(t *testing.T) { - fixtures := []ChangeEvent{ - fixtureOperationAdded, - fixtureEnumValueAdded, - fixturePropertyRemoved, - fixtureDeprecation, - } - for i, e := range fixtures { - if err := e.Validate(); err != nil { - t.Errorf("fixture %d failed validation: %v", i, err) - } - } -} - -func TestValidateRejectsMissingProvenance(t *testing.T) { - bad := fixtureOperationAdded - bad.SourceURL = "" - if err := bad.Validate(); err == nil { - t.Error("expected validation error for missing source_url, got nil") - } -} - -// Regression: the excerpt cap is 2,000 characters, not bytes. Spec text is full of -// non-ASCII, and a byte count rejected valid events. -func TestExcerptLimitCountsCharacters(t *testing.T) { - ok := fixtureOperationAdded - ok.SourceExcerpt = strings.Repeat("é", 2000) // 2,000 characters, 4,000 bytes - if err := ok.Validate(); err != nil { - t.Errorf("2000-character excerpt rejected: %v", err) - } - tooLong := fixtureOperationAdded - tooLong.SourceExcerpt = strings.Repeat("é", 2001) - if err := tooLong.Validate(); err == nil { - t.Error("2001-character excerpt accepted") - } -} - -func TestValidateRejectsContractViolations(t *testing.T) { - cases := map[string]func(e *ChangeEvent){ - "missing source_excerpt": func(e *ChangeEvent) { e.SourceExcerpt = "" }, - "missing detected_at": func(e *ChangeEvent) { e.DetectedAt = time.Time{} }, - "breaking disagrees with change_type": func(e *ChangeEvent) { e.Breaking = true }, - "unknown change_type": func(e *ChangeEvent) { e.ChangeType = "maybe" }, - "confidence above 1": func(e *ChangeEvent) { e.Confidence = 1.5 }, - "operation kind on the response side": func(e *ChangeEvent) { e.Affected.Side = SideResponse }, - "operation kind without an operation": func(e *ChangeEvent) { e.Affected.Operation = "" }, - } - for name, breakIt := range cases { - e := fixtureOperationAdded - breakIt(&e) - if err := e.Validate(); err == nil { - t.Errorf("%s: accepted", name) - } - } - - schemaOnRequest := fixtureEnumValueAdded - schemaOnRequest.Affected.Side = SideRequest - if err := schemaOnRequest.Validate(); err == nil { - t.Error("schema_property kind on the request side: accepted") - } + Subject: Subject{Type: SubjectAPIOperation, Kind: KindOperation, Side: SideRequest, Operation: "POST /v1/billing/feedback_options"}, + Description: "New operation POST /v1/billing/feedback_options (PostBillingFeedbackOptions).", + SourceURL: "https://raw.githubusercontent.com/stripe/openapi/v2468/latest/openapi.spec3.json", + SourcePointer: "/paths/~1v1~1billing~1feedback_options/post", + SourceExcerpt: `{"operationId":"PostBillingFeedbackOptions","summary":"Create a feedback option"}`, + Confidence: 1.0, + DetectedAt: time.Date(2026, 9, 13, 15, 0, 0, 0, time.UTC), } -func TestAValueNeedsTheProperty(t *testing.T) { - e := fixtureOperationAdded - e.Affected = Affected{Kind: AffectedKindOperation, Side: SideRequest, Operation: "POST /v1/chat/completions", Value: "gpt-4"} - if err := e.Validate(); err == nil { - t.Error("a value with no property it belongs to: accepted") - } - e.Affected = Affected{Kind: AffectedKindRequestParameter, Side: SideRequest, Operation: "POST /v1/chat/completions", Property: "model", Value: "gpt-4"} - if err := e.Validate(); err != nil { - t.Errorf("a model retirement: %v", err) - } +func init() { + operationAdded.Fingerprint = Fingerprint(operationAdded.API, operationAdded.Version, operationAdded.ChangeType, operationAdded.Subject, "") } -// Contract test between the hosted service and the patch-it client. -// contract/fixtures/change-events.json is the file the client builds against -// in place of the real feed. The client's tests check the same file against its -// own model, so if either side's idea of a change event drifts from the -// contract, one of the two tests fails. Reading a shared fixture is not an -// import: the two still share only the contract. -func TestSharedFixtureMatchesTheContract(t *testing.T) { - raw, err := os.ReadFile("../../contract/fixtures/change-events.json") +func rawEvents(t *testing.T, name string) []json.RawMessage { + t.Helper() + raw, err := os.ReadFile(fixtures + name) if err != nil { - t.Fatalf("reading the shared fixture: %v", err) + t.Fatal(err) } var feed struct { - Changes []ChangeEvent `json:"changes"` + Changes []json.RawMessage `json:"changes"` } if err := json.Unmarshal(raw, &feed); err != nil { - t.Fatalf("the fixture doesn't decode as change events: %v", err) + t.Fatalf("%s: %v", name, err) } if len(feed.Changes) == 0 { - t.Fatal("the fixture has no events") - } - for _, e := range feed.Changes { - if err := e.Validate(); err != nil { - t.Errorf("fixture event %d fails the service's validation: %v", e.ID, err) - } + t.Fatalf("%s has no events", name) } + return feed.Changes } -// The model retirements fixture is the hosted service's real output, the first to -// carry affected.value. Ingest and the client both check it. -func TestRetirementFixtureMatchesTheContract(t *testing.T) { - raw, err := os.ReadFile("../../contract/fixtures/change-events-model-retirements-2026-10-13.json") - if err != nil { - t.Fatalf("reading the fixture: %v", err) - } - var feed struct { - Changes []ChangeEvent `json:"changes"` - } - if err := json.Unmarshal(raw, &feed); err != nil { - t.Fatalf("decoding: %v", err) - } - if len(feed.Changes) == 0 { - t.Fatal("no events") - } - for _, e := range feed.Changes { - if err := e.Validate(); err != nil || e.Affected.Value == "" { - t.Errorf("event %d: %v (value %q)", e.ID, err, e.Affected.Value) +// The contract's fixtures, the same ones the patch-it client checks, are +// accepted, with the fingerprints the formula gives. +func TestFixturesAreValid(t *testing.T) { + for _, name := range []string{"change-events-v2.json", "change-events-v2-types.json"} { + for _, raw := range rawEvents(t, name) { + e, err := Decode(raw) + if err != nil { + t.Fatalf("%s: %v", name, err) + } + if err := e.Validate(); err != nil { + t.Errorf("%s event %d: %v", name, e.ID, err) + } + // An API event's detail isn't stored, so only the other types are + // recomputed here. + if e.Subject.Type == SubjectAPIOperation && name == "change-events-v2.json" { + continue + } + if want := Fingerprint(e.API, e.Version, e.ChangeType, e.Subject, ""); e.Fingerprint != want { + t.Errorf("%s event %d: fingerprint %s, the formula gives %s", name, e.ID, e.Fingerprint, want) + } } } } -// The negative half of the contract test: every event in the shared invalid -// fixture breaks one rule, and both loops must reject all of them. -func TestSharedInvalidFixtureIsRejected(t *testing.T) { - raw, err := os.ReadFile("../../contract/fixtures/change-events-invalid.json") +// Every case in the contract's invalid fixture breaks one rule, and is +// rejected while decoding or validating. +func TestInvalidFixtureIsRejected(t *testing.T) { + raw, err := os.ReadFile(fixtures + "change-events-v2-invalid.json") if err != nil { - t.Fatalf("reading the shared invalid fixture: %v", err) + t.Fatal(err) } var fixture struct { Cases []struct { @@ -233,15 +87,85 @@ func TestSharedInvalidFixtureIsRejected(t *testing.T) { } `json:"cases"` } if err := json.Unmarshal(raw, &fixture); err != nil { - t.Fatalf("decoding the invalid fixture: %v", err) + t.Fatal(err) + } + if len(fixture.Cases) == 0 { + t.Fatal("no cases") } for _, c := range fixture.Cases { - var e ChangeEvent - if err := json.Unmarshal(c.Event, &e); err != nil { - continue // can't even decode, e.g. a malformed timestamp: rejected + e, err := Decode(c.Event) + if err != nil { + continue // a field the contract doesn't define: rejected while decoding } if err := e.Validate(); err == nil { t.Errorf("accepted an invalid event: %s", c.WhyInvalid) } } } + +func TestValidateRejectsContractViolations(t *testing.T) { + if err := operationAdded.Validate(); err != nil { + t.Fatalf("the valid event: %v", err) + } + cases := map[string]func(e *Event){ + "missing source_url": func(e *Event) { e.SourceURL = "" }, + "missing source_excerpt": func(e *Event) { e.SourceExcerpt = "" }, + "missing detected_at": func(e *Event) { e.DetectedAt = time.Time{} }, + "breaking disagrees with change_type": func(e *Event) { e.Breaking = true }, + "unknown change_type": func(e *Event) { e.ChangeType = "maybe" }, + "confidence above 1": func(e *Event) { e.Confidence = 1.5 }, + "a bad fingerprint": func(e *Event) { e.Fingerprint = "sha256:abc" }, + "operation kind on the response side": func(e *Event) { e.Subject.Side = SideResponse }, + "operation kind without an operation": func(e *Event) { e.Subject.Operation = "" }, + "schema kind on the request side": func(e *Event) { + e.Subject = Subject{Type: SubjectAPIOperation, Kind: KindSchema, Side: SideRequest, Schema: "invoice"} + }, + "a model field on an api_operation": func(e *Event) { e.Subject.Name = "gpt-4" }, + } + for name, breakIt := range cases { + e := operationAdded + breakIt(&e) + if err := e.Validate(); err == nil { + t.Errorf("%s: accepted", name) + } + } +} + +// Regression: the excerpt cap is 2,000 characters, not bytes. Spec text is full of +// non-ASCII, and a byte count rejected valid events. +func TestExcerptLimitCountsCharacters(t *testing.T) { + ok := operationAdded + ok.SourceExcerpt = strings.Repeat("é", 2000) // 2,000 characters, 4,000 bytes + if err := ok.Validate(); err != nil { + t.Errorf("2000-character excerpt rejected: %v", err) + } + tooLong := operationAdded + tooLong.SourceExcerpt = strings.Repeat("é", 2001) + if err := tooLong.Validate(); err == nil { + t.Error("2001-character excerpt accepted") + } +} + +// The same release listed in another order is the same event (found in +// review: otherwise the store keeps it twice). +func TestSymbolOrderDoesntChangeTheFingerprint(t *testing.T) { + s := Subject{Type: SubjectPackageRelease, Ecosystem: "pypi", Package: "anthropic", + Change: PackageRemovedParameter, Parameter: "top_k", Symbols: []string{"messages.stream", "messages.create"}} + r := s + r.Symbols = []string{"messages.create", "messages.stream"} + if Fingerprint("anthropic/python-sdk", "1.0.0", ChangeTypeBreaking, s, "") != Fingerprint("anthropic/python-sdk", "1.0.0", ChangeTypeBreaking, r, "") { + t.Error("symbol order changed the fingerprint") + } + if s.Symbols[0] != "messages.stream" { + t.Error("Fingerprint reordered the caller's symbols") + } +} + +// Two kinds of change that share every other field still get two fingerprints. +func TestTheTypeIsPartOfTheFingerprint(t *testing.T) { + m := Fingerprint("x/y", "1", ChangeTypeBreaking, Subject{Type: SubjectModel, Provider: "p", Name: "n"}, "") + c := Fingerprint("x/y", "1", ChangeTypeBreaking, Subject{Type: SubjectCIRuntime, Platform: "p", Runtime: "n"}, "") + if m == c { + t.Error("a model and a CI runtime with the same values share a fingerprint") + } +} diff --git a/core/event/v2.go b/core/event/v2.go deleted file mode 100644 index cae02b0..0000000 --- a/core/event/v2.go +++ /dev/null @@ -1,262 +0,0 @@ -package event - -import ( - "bytes" - "crypto/sha256" - "encoding/hex" - "encoding/json" - "fmt" - "slices" - "strings" - "time" -) - -// Change event v2 (the change event contract), in force since the -// cut-over: v1's fields with `affected`, which can only describe an OpenAPI -// location, replaced by a typed `subject`. The store holds and serves v2; the -// sources still build v1 events, converted on the way out (migrate/). - -// SubjectType is what kind of thing changed. -type SubjectType string - -const ( - SubjectAPIOperation SubjectType = "api_operation" - SubjectModel SubjectType = "model" - SubjectPackageRelease SubjectType = "package_release" - SubjectCIRuntime SubjectType = "ci_runtime" -) - -// PackageChange is what a package release did to the code that calls it. -type PackageChange string - -const ( - PackageRemovedParameter PackageChange = "removed_parameter" - PackageRemovedSymbol PackageChange = "removed_symbol" - PackageRenamedSymbol PackageChange = "renamed_symbol" - PackageChangedDefault PackageChange = "changed_default" -) - -// Subject is what changed. Type picks which fields it may have; every other -// field must be empty (the contract's "a field its type doesn't define"). -type Subject struct { - Type SubjectType `json:"type"` - - // api_operation: v1's affected, without value (a model has its own type). - Kind AffectedKind `json:"kind,omitempty"` - Side Side `json:"side,omitempty"` - Operation string `json:"operation,omitempty"` - Schema string `json:"schema,omitempty"` - Property string `json:"property,omitempty"` - - // model - Provider string `json:"provider,omitempty"` - Name string `json:"name,omitempty"` - - // package_release - Ecosystem string `json:"ecosystem,omitempty"` - Package string `json:"package,omitempty"` - Change PackageChange `json:"change,omitempty"` - Symbols []string `json:"symbols,omitempty"` - Parameter string `json:"parameter,omitempty"` - - // ci_runtime - Platform string `json:"platform,omitempty"` - Runtime string `json:"runtime,omitempty"` - - // model, package_release (renamed_symbol), ci_runtime - Replacement string `json:"replacement,omitempty"` -} - -// EventV2 is a v2 change event. -type EventV2 struct { - ID int64 `json:"id"` - Fingerprint string `json:"fingerprint"` - API string `json:"api"` - Version string `json:"version"` - PreviousVersion string `json:"previous_version,omitempty"` - ChangeType ChangeType `json:"change_type"` - Breaking bool `json:"breaking"` - Subject Subject `json:"subject"` - Supersedes string `json:"supersedes,omitempty"` - Description string `json:"description"` - MigrationHint string `json:"migration_hint,omitempty"` - SourceURL string `json:"source_url"` - SourcePointer string `json:"source_pointer,omitempty"` - SourceExcerpt string `json:"source_excerpt"` - Confidence float64 `json:"confidence"` - DetectedAt time.Time `json:"detected_at"` -} - -// DecodeV2 reads one v2 event and refuses a field the contract doesn't define, -// at the top level or in subject: the patch-it client's model forbids extra -// fields too, so the hosted service and the client reject the same events. Keys are -// matched exactly ("TYPE" isn't "type", though encoding/json would take it), -// and a subject key belongs to its type even when its value is empty: pydantic -// sees the key, not the value. -func DecodeV2(raw []byte) (EventV2, error) { - var e EventV2 - dec := json.NewDecoder(bytes.NewReader(raw)) - dec.DisallowUnknownFields() - if err := dec.Decode(&e); err != nil { - return EventV2{}, err - } - var keys struct { - Top map[string]json.RawMessage - Subject map[string]json.RawMessage `json:"subject"` - } - if err := json.Unmarshal(raw, &keys.Top); err != nil { - return EventV2{}, err - } - for k := range keys.Top { - if !slices.Contains(eventKeys, k) { - return EventV2{}, fmt.Errorf("%q isn't a field of a change event", k) - } - } - if sub, ok := keys.Top["subject"]; ok { - if err := json.Unmarshal(sub, &keys.Subject); err != nil { - return EventV2{}, err - } - } - allowed := slices.Concat(subjectKeys[e.Subject.Type], []string{"type"}) - for k := range keys.Subject { - if !slices.Contains(allowed, k) { - return EventV2{}, fmt.Errorf("subject.%s isn't a field of type %s", k, e.Subject.Type) - } - } - return e, nil -} - -// eventKeys are the JSON names of EventV2's fields. -var eventKeys = []string{"id", "fingerprint", "api", "version", "previous_version", "change_type", - "breaking", "subject", "supersedes", "description", "migration_hint", "source_url", - "source_pointer", "source_excerpt", "confidence", "detected_at"} - -// subjectKeys are the fields each type may have, besides `type`. -var subjectKeys = map[SubjectType][]string{ - SubjectAPIOperation: {"kind", "side", "operation", "schema", "property"}, - SubjectModel: {"provider", "name", "replacement"}, - SubjectPackageRelease: {"ecosystem", "package", "change", "symbols", "parameter", "replacement"}, - SubjectCIRuntime: {"platform", "runtime", "replacement"}, -} - -// FingerprintV2 identifies one change. For api_operation it is v1's formula -// byte for byte, so every stored Stripe event keeps its fingerprint. For the -// other types, the type's key fields stand where v1's location was and detail -// is empty: the key already says what changed. Symbols are sorted first, so -// the same release always gets the same fingerprint. -func FingerprintV2(api, version string, changeType ChangeType, s Subject, detail string) string { - if s.Type == SubjectAPIOperation { - return Fingerprint(api, version, changeType, Affected{ - Kind: s.Kind, Side: s.Side, Operation: s.Operation, Schema: s.Schema, Property: s.Property, - }, detail) - } - parts := []string{api, version, string(changeType), string(s.Type)} - switch s.Type { - case SubjectModel: - parts = append(parts, s.Provider, s.Name) - case SubjectPackageRelease: - symbols := slices.Clone(s.Symbols) - slices.Sort(symbols) - parts = append(parts, s.Ecosystem, s.Package, string(s.Change), strings.Join(symbols, ","), s.Parameter) - case SubjectCIRuntime: - parts = append(parts, s.Platform, s.Runtime) - } - sum := sha256.Sum256([]byte(strings.Join(append(parts, ""), "|"))) - return "sha256:" + hex.EncodeToString(sum[:]) -} - -// Validate applies the v2 contract: v1's rules for everything outside subject, -// then subject's own. -func (e EventV2) Validate() error { - if err := checkCommon(e.SourceURL, e.SourceExcerpt, e.Fingerprint, e.API, e.Version, - e.Description, e.DetectedAt, e.ChangeType, e.Breaking, e.Confidence); err != nil { - return err - } - if e.Supersedes != "" && !fingerprintPattern.MatchString(e.Supersedes) { - return fmt.Errorf("supersedes must look like sha256:<64 lowercase hex>, got %q", e.Supersedes) - } - return e.Subject.validate() -} - -func (s Subject) validate() error { - allowed, err := s.required() - if err != nil { - return err - } - for name, set := range s.present() { - if set && !slices.Contains(allowed, name) { - return fmt.Errorf("subject.%s isn't a field of type %s", name, s.Type) - } - } - return nil -} - -// required checks the fields the type must have and returns every field it may. -func (s Subject) required() ([]string, error) { - need := func(name, v string) error { - if v == "" { - return fmt.Errorf("subject.%s is required for type %s", name, s.Type) - } - return nil - } - switch s.Type { - case SubjectAPIOperation: - // v1's kind and side rules, unchanged. - a := Affected{Kind: s.Kind, Side: s.Side, Operation: s.Operation, Schema: s.Schema, Property: s.Property} - if err := a.validate(); err != nil { - return nil, fmt.Errorf("subject: %w", err) - } - return subjectKeys[SubjectAPIOperation], nil - case SubjectModel: - for _, f := range [][2]string{{"provider", s.Provider}, {"name", s.Name}} { - if err := need(f[0], f[1]); err != nil { - return nil, err - } - } - return subjectKeys[SubjectModel], nil - case SubjectPackageRelease: - for _, f := range [][2]string{{"ecosystem", s.Ecosystem}, {"package", s.Package}} { - if err := need(f[0], f[1]); err != nil { - return nil, err - } - } - switch s.Change { - case PackageRemovedParameter, PackageChangedDefault: - if err := need("parameter", s.Parameter); err != nil { - return nil, err - } - case PackageRenamedSymbol: - if err := need("replacement", s.Replacement); err != nil { - return nil, err - } - case PackageRemovedSymbol: - default: - return nil, fmt.Errorf("subject.change must be a valid enum value, got %q", s.Change) - } - if len(s.Symbols) == 0 || slices.Contains(s.Symbols, "") { - return nil, fmt.Errorf("subject.symbols must name at least one symbol, none empty") - } - return subjectKeys[SubjectPackageRelease], nil - case SubjectCIRuntime: - for _, f := range [][2]string{{"platform", s.Platform}, {"runtime", s.Runtime}} { - if err := need(f[0], f[1]); err != nil { - return nil, err - } - } - return subjectKeys[SubjectCIRuntime], nil - } - return nil, fmt.Errorf("subject.type must be a valid enum value, got %q", s.Type) -} - -// present is which subject fields are set, by their JSON names. -func (s Subject) present() map[string]bool { - return map[string]bool{ - "kind": s.Kind != "", "side": s.Side != "", "operation": s.Operation != "", - "schema": s.Schema != "", "property": s.Property != "", - "provider": s.Provider != "", "name": s.Name != "", - "ecosystem": s.Ecosystem != "", "package": s.Package != "", "change": s.Change != "", - "symbols": len(s.Symbols) > 0, "parameter": s.Parameter != "", - "platform": s.Platform != "", "runtime": s.Runtime != "", - "replacement": s.Replacement != "", - } -} diff --git a/core/event/v2_test.go b/core/event/v2_test.go deleted file mode 100644 index 0d2dab3..0000000 --- a/core/event/v2_test.go +++ /dev/null @@ -1,147 +0,0 @@ -package event - -import ( - "bytes" - "encoding/json" - "flag" - "os" - "testing" -) - -// -update writes the computed fingerprints into the hand-written v2 fixture: -// go test ./event -update -var update = flag.Bool("update", false, "rewrite fingerprints in change-events-v2-types.json") - -const v2Fixtures = "../../contract/fixtures/" - -func rawEvents(t *testing.T, name string) []json.RawMessage { - t.Helper() - raw, err := os.ReadFile(v2Fixtures + name) - if err != nil { - t.Fatal(err) - } - var feed struct { - Changes []json.RawMessage `json:"changes"` - } - if err := json.Unmarshal(raw, &feed); err != nil { - t.Fatalf("%s: %v", name, err) - } - if len(feed.Changes) == 0 { - t.Fatalf("%s has no events", name) - } - return feed.Changes -} - -// Contract test for v2, the same fixtures the patch-it client checks -// (patch-it's tests/test_contract_v2.py): the converted events and one example per -// type are accepted, with fingerprints the formula gives. -func TestV2FixturesAreValid(t *testing.T) { - for _, name := range []string{"change-events-v2.json", "change-events-v2-types.json"} { - for _, raw := range rawEvents(t, name) { - e, err := DecodeV2(raw) - if err != nil { - t.Fatalf("%s: %v", name, err) - } - if err := e.Validate(); err != nil { - t.Errorf("%s event %d: %v", name, e.ID, err) - } - // An API event's detail isn't stored, so only the other types are - // recomputed here; TestAPIOperationKeepsV1Fingerprint covers it. - if e.Subject.Type == SubjectAPIOperation && name == "change-events-v2.json" { - continue - } - if want := FingerprintV2(e.API, e.Version, e.ChangeType, e.Subject, ""); e.Fingerprint != want && !*update { - t.Errorf("%s event %d: fingerprint %s, the formula gives %s", name, e.ID, e.Fingerprint, want) - } - } - } -} - -func TestUpdateV2TypeFingerprints(t *testing.T) { - if !*update { - t.Skip("only with -update") - } - var out []EventV2 - for _, raw := range rawEvents(t, "change-events-v2-types.json") { - e, err := DecodeV2(raw) - if err != nil { - t.Fatal(err) - } - e.Fingerprint = FingerprintV2(e.API, e.Version, e.ChangeType, e.Subject, "") - out = append(out, e) - } - var buf bytes.Buffer - enc := json.NewEncoder(&buf) - enc.SetEscapeHTML(false) - enc.SetIndent("", " ") - if err := enc.Encode(map[string]any{"changes": out}); err != nil { - t.Fatal(err) - } - if err := os.WriteFile(v2Fixtures+"change-events-v2-types.json", buf.Bytes(), 0o644); err != nil { - t.Fatal(err) - } -} - -// Every case breaks one rule, and both loops must reject all of them. -func TestV2InvalidFixtureIsRejected(t *testing.T) { - raw, err := os.ReadFile(v2Fixtures + "change-events-v2-invalid.json") - if err != nil { - t.Fatal(err) - } - var fixture struct { - Cases []struct { - WhyInvalid string `json:"why_invalid"` - Event json.RawMessage `json:"event"` - } `json:"cases"` - } - if err := json.Unmarshal(raw, &fixture); err != nil { - t.Fatal(err) - } - if len(fixture.Cases) == 0 { - t.Fatal("no cases") - } - for _, c := range fixture.Cases { - e, err := DecodeV2(c.Event) - if err != nil { - continue // a field v2 doesn't define: rejected while decoding - } - if err := e.Validate(); err == nil { - t.Errorf("accepted an invalid v2 event: %s", c.WhyInvalid) - } - } -} - -// Stripe's stored events keep their fingerprints: v2's api_operation formula -// is v1's, byte for byte. -func TestAPIOperationKeepsV1Fingerprint(t *testing.T) { - a := Affected{Kind: AffectedKindSchemaProperty, Side: SideResponse, Schema: "invoice", Property: "subscription"} - s := Subject{Type: SubjectAPIOperation, Kind: a.Kind, Side: a.Side, Schema: a.Schema, Property: a.Property} - v1 := Fingerprint("stripe", "2026-09-30.endive", ChangeTypeBreaking, a, "removed") - if v2 := FingerprintV2("stripe", "2026-09-30.endive", ChangeTypeBreaking, s, "removed"); v2 != v1 { - t.Errorf("v2 %s, v1 %s", v2, v1) - } -} - -// The same release listed in another order is the same event (found in -// review: otherwise the store keeps it twice). -func TestSymbolOrderDoesntChangeTheFingerprint(t *testing.T) { - s := Subject{Type: SubjectPackageRelease, Ecosystem: "pypi", Package: "anthropic", - Change: PackageRemovedParameter, Parameter: "top_k", Symbols: []string{"messages.stream", "messages.create"}} - r := s - r.Symbols = []string{"messages.create", "messages.stream"} - if FingerprintV2("anthropic", "1.0.0", ChangeTypeBreaking, s, "") != FingerprintV2("anthropic", "1.0.0", ChangeTypeBreaking, r, "") { - t.Error("symbol order changed the fingerprint") - } - if s.Symbols[0] != "messages.stream" { - t.Error("FingerprintV2 reordered the caller's symbols") - } -} - -// Two kinds of change that share every other field still get two fingerprints. -func TestTheTypeIsPartOfTheFingerprint(t *testing.T) { - m := FingerprintV2("x", "1", ChangeTypeBreaking, Subject{Type: SubjectModel, Provider: "p", Name: "n"}, "") - c := FingerprintV2("x", "1", ChangeTypeBreaking, Subject{Type: SubjectCIRuntime, Platform: "p", Runtime: "n"}, "") - if m == c { - t.Error("a model and a CI runtime with the same values share a fingerprint") - } -} diff --git a/core/hint/hint.go b/core/hint/hint.go index 7039941..02c6957 100644 --- a/core/hint/hint.go +++ b/core/hint/hint.go @@ -100,8 +100,8 @@ func NewIndex(entries []Entry) *Index { // ("[]" dropped on both sides), and a change kind that fits the event (a row // that *adds* a parameter never explains a breaking change to it). When // several entries name the same key, the first on the release page wins. -func (ix *Index) Lookup(e event.ChangeEvent) (Entry, bool) { - a := e.Affected +func (ix *Index) Lookup(e event.Event) (Entry, bool) { + a := e.Subject if ix == nil || a.Property == "" { return Entry{}, false } @@ -137,7 +137,7 @@ func compatible(rowChange string, ct event.ChangeType) bool { // sending V"), is the precise sentence and stays first; the vendor's prose // follows it. A match only ever adds information. An event nothing matches is // left as it was. -func (ix *Index) Attach(events []event.ChangeEvent) int { +func (ix *Index) Attach(events []event.Event) int { n := 0 for i := range events { e, ok := ix.Lookup(events[i]) diff --git a/core/hint/hint_test.go b/core/hint/hint_test.go index 00ba8f0..1231519 100644 --- a/core/hint/hint_test.go +++ b/core/hint/hint_test.go @@ -30,10 +30,10 @@ func fakeDocs(t *testing.T) *httptest.Server { return srv } -func request(op, property string, ct event.ChangeType, hint string) event.ChangeEvent { - return event.ChangeEvent{ +func request(op, property string, ct event.ChangeType, hint string) event.Event { + return event.Event{ ChangeType: ct, - Affected: event.Affected{Kind: event.AffectedKindRequestParameter, Side: event.SideRequest, + Subject: event.Subject{Type: event.SubjectAPIOperation, Kind: event.KindRequestParameter, Side: event.SideRequest, Operation: op, Property: property}, MigrationHint: hint, } @@ -175,13 +175,13 @@ func TestIndexFetchesAVersionsEntriesAndAttachesHints(t *testing.T) { } breaking := event.ChangeTypeBreaking - events := []event.ChangeEvent{ + events := []event.Event{ request("POST /v1/checkout/sessions", "payment_method_types", breaking, "Stop sending payment_method_types."), request("POST /v1/payment_intents/{intent}/confirm", "payment_method_types", breaking, ""), request("POST /v1/payment_methods/{payment_method}", "payto", breaking, ""), // Same parameter name, an operation no entry names: keeps its placeholder. request("POST /v1/invoices", "payment_settings.payment_method_types[]", breaking, "placeholder"), - {ChangeType: breaking, Affected: event.Affected{Kind: event.AffectedKindSchemaProperty, Side: event.SideResponse, + {ChangeType: breaking, Subject: event.Subject{Type: event.SubjectAPIOperation, Kind: event.KindSchemaProperty, Side: event.SideResponse, Schema: "payment_intent", Property: "charges"}}, // A collision found in review: the top-level billing_cycle_anchor type // change on Subscription#update, and the nested one trial offers added. @@ -233,7 +233,7 @@ func TestIndexFetchesAVersionsEntriesAndAttachesHints(t *testing.T) { func TestAnAddedRowNeverExplainsABreakingChange(t *testing.T) { ix := NewIndex([]Entry{{URL: "https://x/added", WhatsNew: "Adds p.", Rows: []Row{{Parameter: "p", Change: "Added", Targets: []Target{{Operation: "POST /v1/x", Path: "p"}}}}}}) - events := []event.ChangeEvent{ + events := []event.Event{ request("POST /v1/x", "p", event.ChangeTypeBreaking, "Stop sending p."), request("POST /v1/x", "p", event.ChangeTypeNewFeature, ""), } @@ -250,7 +250,7 @@ func TestAnAddedRowNeverExplainsABreakingChange(t *testing.T) { func TestARemovedRowNeverExplainsAnAddition(t *testing.T) { ix := NewIndex([]Entry{{URL: "https://x/removed", WhatsNew: "Removes p.", Rows: []Row{{Parameter: "p", Change: "Removed", Targets: []Target{{Operation: "POST /v1/x", Path: "p"}}}}}}) - events := []event.ChangeEvent{ + events := []event.Event{ request("POST /v1/x", "p", event.ChangeTypeBreaking, ""), request("POST /v1/x", "p", event.ChangeTypeNewFeature, ""), } @@ -281,7 +281,7 @@ func TestReleaseOf(t *testing.T) { func TestAHintIsCappedFromTheFrontAndKeepsItsSource(t *testing.T) { ix := NewIndex([]Entry{{URL: "https://x", WhatsNew: strings.Repeat("a", 5000), Rows: []Row{{Parameter: "p", Change: "Changed", Targets: []Target{{Operation: "POST /v1/x", Path: "p"}}}}}}) - events := []event.ChangeEvent{request("POST /v1/x", "p", event.ChangeTypeBreaking, "Handle p as q.")} + events := []event.Event{request("POST /v1/x", "p", event.ChangeTypeBreaking, "Handle p as q.")} ix.Attach(events) got := events[0].MigrationHint if n := len([]rune(got)); n > hintLimit { diff --git a/core/kit/kit_test.go b/core/kit/kit_test.go index a27881e..ea7b9a6 100644 --- a/core/kit/kit_test.go +++ b/core/kit/kit_test.go @@ -54,7 +54,7 @@ func TestUnchangedComparesWithTheLastBaseline(t *testing.T) { if last, same, err := Unchanged(env, "x", []byte("page")); err != nil || same || last != nil { t.Fatalf("first run: %v %v %v", last, same, err) } - if err := env.Baselines.(kittest.Sink).SaveSpec(plugin.Baseline("x", "1", "t", "https://x.test", []byte("page"), false, time.Now())); err != nil { + if err := env.Baselines.(kittest.Sink).SaveSpec(plugin.Baseline("x", "1", "t", "https://x.test", []byte("page"), time.Now())); err != nil { t.Fatal(err) } if _, same, _ := Unchanged(env, "x", []byte("page")); !same { diff --git a/core/kit/kittest/checksink.go b/core/kit/kittest/checksink.go index 548881d..6ea4002 100644 --- a/core/kit/kittest/checksink.go +++ b/core/kit/kittest/checksink.go @@ -27,8 +27,8 @@ func CheckSink(t *testing.T, open func(t *testing.T) Sink) { } return last.Tag } - spec := func(tag, content string, fetched time.Time, replay bool) plugin.Spec { - return plugin.Baseline("x", tag, tag, "https://example.test/"+tag, []byte(content), replay, fetched) + spec := func(tag, content string, fetched time.Time) plugin.Spec { + return plugin.Baseline("x", tag, tag, "https://example.test/"+tag, []byte(content), fetched) } saveSpecs := func(t *testing.T, s Sink, specs ...plugin.Spec) { t.Helper() @@ -41,11 +41,11 @@ func CheckSink(t *testing.T, open func(t *testing.T) Sink) { t.Run("dedupe and ids", func(t *testing.T) { s := open(t) - first := []event.EventV2{sinkEvent(1), sinkEvent(2), sinkEvent(1)} + first := []event.Event{sinkEvent(1), sinkEvent(2), sinkEvent(1)} if n, err := s.SaveEvents(first); err != nil || n != 2 { t.Fatalf("first save: %d new, %v; want 2 (the repeat in the batch is skipped)", n, err) } - if n, err := s.SaveEvents([]event.EventV2{sinkEvent(2), sinkEvent(3)}); err != nil || n != 1 { + if n, err := s.SaveEvents([]event.Event{sinkEvent(2), sinkEvent(3)}); err != nil || n != 1 { t.Fatalf("second save: %d new, %v; want 1", n, err) } all, err := s.All() @@ -67,7 +67,7 @@ func CheckSink(t *testing.T, open func(t *testing.T) Sink) { s := open(t) bad := sinkEvent(2) bad.SourceExcerpt = "" - if _, err := s.SaveEvents([]event.EventV2{sinkEvent(1), bad}); err == nil { + if _, err := s.SaveEvents([]event.Event{sinkEvent(1), bad}); err == nil { t.Fatal("saved an event without provenance") } if all, _ := s.All(); len(all) != 0 { @@ -81,42 +81,28 @@ func CheckSink(t *testing.T, open func(t *testing.T) Sink) { }) t.Run("latest instant across offsets", func(t *testing.T) { s := open(t) - saveSpecs(t, s, spec("older", "1", at.Add(-time.Hour), false), spec("newer", "2", at.In(time.FixedZone("UTC-11", -11*3600)), false)) + saveSpecs(t, s, spec("older", "1", at.Add(-time.Hour)), spec("newer", "2", at.In(time.FixedZone("UTC-11", -11*3600)))) if got := lastTag(t, s, "x"); got != "newer" { t.Errorf("baseline %s, want newer", got) } }) t.Run("equal times go to the newest save", func(t *testing.T) { s := open(t) - saveSpecs(t, s, spec("first", "1", at, false), spec("second", "2", at, false)) + saveSpecs(t, s, spec("first", "1", at), spec("second", "2", at)) if got := lastTag(t, s, "x"); got != "second" { t.Errorf("baseline %s, want second", got) } }) t.Run("same content is one baseline", func(t *testing.T) { s := open(t) - saveSpecs(t, s, spec("a", "same", at, false), spec("b", "other", at.Add(time.Hour), false), spec("c", "same", at.Add(2*time.Hour), false)) + saveSpecs(t, s, spec("a", "same", at), spec("b", "other", at.Add(time.Hour)), spec("c", "same", at.Add(2*time.Hour))) if got := lastTag(t, s, "x"); got != "b" { t.Errorf("baseline %s, want b: the same bytes again aren't a new baseline", got) } }) - t.Run("replays never move the baseline", func(t *testing.T) { - s := open(t) - saveSpecs(t, s, spec("real", "1", at, false), spec("replayed", "2", at.Add(time.Hour), true)) - if got := lastTag(t, s, "x"); got != "real" { - t.Errorf("baseline %s, want real", got) - } - }) - t.Run("a normal fetch claims what a replay stored", func(t *testing.T) { - s := open(t) - saveSpecs(t, s, spec("old", "1", at, false), spec("replayed", "same", at.Add(-time.Hour), true), spec("fetched", "same", at.Add(time.Hour), false)) - if got := lastTag(t, s, "x"); got != "fetched" { - t.Errorf("baseline %s, want fetched", got) - } - }) t.Run("a baseline keeps every field", func(t *testing.T) { s := open(t) - want := spec("v7", "body", at.Add(123456789), false) + want := spec("v7", "body", at.Add(123456789)) saveSpecs(t, s, want) got, err := s.LastSpec("x") if err != nil || got == nil { @@ -124,19 +110,19 @@ func CheckSink(t *testing.T, open func(t *testing.T) Sink) { } want.FetchedAt = want.FetchedAt.Truncate(time.Microsecond) if got.API != want.API || got.Version != want.Version || got.Tag != want.Tag || got.SHA256 != want.SHA256 || got.SourceURL != want.SourceURL || - !got.FetchedAt.Equal(want.FetchedAt) || got.FetchedAt.Location() != time.UTC || got.Replay || string(got.Content) != "body" { + !got.FetchedAt.Equal(want.FetchedAt) || got.FetchedAt.Location() != time.UTC || string(got.Content) != "body" { t.Errorf("got %+v, want %+v", got, want) } }) } -func sinkEvent(n int) event.EventV2 { +func sinkEvent(n int) event.Event { subject := event.Subject{ - Type: event.SubjectAPIOperation, Kind: event.AffectedKindSchemaProperty, Side: event.SideResponse, + Type: event.SubjectAPIOperation, Kind: event.KindSchemaProperty, Side: event.SideResponse, Schema: "thing", Property: fmt.Sprintf("field_%d", n), } - return event.EventV2{ - Fingerprint: event.FingerprintV2("x", "2", event.ChangeTypeBreaking, subject, ""), + return event.Event{ + Fingerprint: event.Fingerprint("x", "2", event.ChangeTypeBreaking, subject, ""), API: "x", Version: "2", ChangeType: event.ChangeTypeBreaking, diff --git a/core/kit/kittest/kittest.go b/core/kit/kittest/kittest.go index d134f14..f17770c 100644 --- a/core/kit/kittest/kittest.go +++ b/core/kit/kittest/kittest.go @@ -70,7 +70,7 @@ func Env(t testing.TB, pages Pages) plugin.Env { // Ingest runs p twice and returns what the first run stored. Any rejected // event or error fails the test, and so does a second run over the same pages // that stores anything new: the fingerprints must dedupe. -func Ingest(t testing.TB, p plugin.Plugin, pages Pages) []event.EventV2 { +func Ingest(t testing.TB, p plugin.Plugin, pages Pages) []event.Event { t.Helper() env := Env(t, pages) return IngestWith(t, env, p) @@ -79,7 +79,7 @@ func Ingest(t testing.TB, p plugin.Plugin, pages Pages) []event.EventV2 { // IngestWith is Ingest over an Env the test built (its own archive, a baseline // already saved). env.Baselines is where the events are stored too, so it must // be a Sink, as Env's Mem is. -func IngestWith(t testing.TB, env plugin.Env, p plugin.Plugin) []event.EventV2 { +func IngestWith(t testing.TB, env plugin.Env, p plugin.Plugin) []event.Event { t.Helper() sink, ok := env.Baselines.(Sink) if !ok { @@ -99,7 +99,7 @@ func IngestWith(t testing.TB, env plugin.Env, p plugin.Plugin) []event.EventV2 { } // Stored is every event in s, in feed order, or the test fails. -func Stored(t testing.TB, s Sink) []event.EventV2 { +func Stored(t testing.TB, s Sink) []event.Event { t.Helper() all, err := s.All() if err != nil { @@ -110,19 +110,19 @@ func Stored(t testing.TB, s Sink) []event.EventV2 { // Golden compares events with the JSON file at path, or rewrites it with // -update. Every event must also be valid v2, or the golden would pin a bug. -func Golden(t testing.TB, path string, events []event.EventV2) { +func Golden(t testing.TB, path string, events []event.Event) { t.Helper() golden(t, path, events, *update) } // CompareGolden is Golden that never rewrites the file, even with -update: // for a test that checks someone else's golden file. -func CompareGolden(t testing.TB, path string, events []event.EventV2) { +func CompareGolden(t testing.TB, path string, events []event.Event) { t.Helper() golden(t, path, events, false) } -func golden(t testing.TB, path string, events []event.EventV2, rewrite bool) { +func golden(t testing.TB, path string, events []event.Event, rewrite bool) { t.Helper() for _, e := range events { if err := e.Validate(); err != nil { @@ -130,7 +130,7 @@ func golden(t testing.TB, path string, events []event.EventV2, rewrite bool) { } } if events == nil { - events = []event.EventV2{} + events = []event.Event{} } var buf bytes.Buffer enc := json.NewEncoder(&buf) diff --git a/core/kit/kittest/mem.go b/core/kit/kittest/mem.go index 8a04593..1ef098a 100644 --- a/core/kit/kittest/mem.go +++ b/core/kit/kittest/mem.go @@ -20,22 +20,22 @@ type Sink interface { plugin.BaselineReader // SaveEvents stores events, skipping any whose fingerprint is already // stored, and returns how many were new. An invalid event stores nothing. - SaveEvents(events []event.EventV2) (int, error) + SaveEvents(events []event.Event) (int, error) // SaveSpec stores a baseline, once per (api, sha256). SaveSpec(spec plugin.Spec) error // All is every stored event in feed order, each with its id. - All() ([]event.EventV2, error) + All() ([]event.Event, error) } // Mem is a Sink in memory that stores like the hosted service's database does, so a // golden file is the same whichever stored the events: events are deduped by // fingerprint and get ids 1, 2, 3... in the order they were saved, each is // stored as its JSON (what the feed serves), and a baseline is the latest -// non-replay one, by fetch time, then by save order. Ingest's conformance test -// replays every plugin's golden through the real store to keep the two equal. +// one, by fetch time, then by save order. Ingest's conformance test stores +// every plugin's golden through the real store to keep the two equal. type Mem struct { mu sync.Mutex - events []event.EventV2 + events []event.Event seen map[string]bool specs []plugin.Spec // in save order } @@ -45,9 +45,9 @@ var _ Sink = (*Mem)(nil) // NewMem is an empty store. func NewMem() *Mem { return &Mem{seen: map[string]bool{}} } -func (m *Mem) SaveEvents(events []event.EventV2) (int, error) { +func (m *Mem) SaveEvents(events []event.Event) (int, error) { // Like the store's transaction: one invalid event and none are stored. - stored := make([]event.EventV2, 0, len(events)) + stored := make([]event.Event, 0, len(events)) for _, e := range events { if err := e.Validate(); err != nil { return 0, fmt.Errorf("invalid event %s: %w", e.Fingerprint, err) @@ -56,7 +56,7 @@ func (m *Mem) SaveEvents(events []event.EventV2) (int, error) { if err != nil { return 0, fmt.Errorf("marshaling event %s: %w", e.Fingerprint, err) } - var back event.EventV2 + var back event.Event if err := json.Unmarshal(data, &back); err != nil { return 0, fmt.Errorf("unmarshaling event %s: %w", e.Fingerprint, err) } @@ -80,43 +80,36 @@ func (m *Mem) SaveEvents(events []event.EventV2) (int, error) { return saved, nil } -func (m *Mem) All() ([]event.EventV2, error) { +func (m *Mem) All() ([]event.Event, error) { m.mu.Lock() defer m.mu.Unlock() return slices.Clone(m.events), nil } -// SaveSpec stores spec once per (api, sha256). The same content saved again -// is not a new baseline, with one exception kept from the store: a replay saved -// it first and a normal run now has, so the row stops being a replay and takes -// the normal run's time and tag (else LastSpec, which skips replays, would -// never find it). +// SaveSpec stores spec once per (api, sha256): the same content saved again +// is not a new baseline. func (m *Mem) SaveSpec(spec plugin.Spec) error { spec.FetchedAt = spec.FetchedAt.UTC().Truncate(time.Microsecond) // what Postgres keeps: UTC, to the microsecond spec.Content = bytes.Clone(spec.Content) m.mu.Lock() defer m.mu.Unlock() - for i, s := range m.specs { - if s.API != spec.API || s.SHA256 != spec.SHA256 { - continue - } - if s.Replay && !spec.Replay { - m.specs[i].Replay, m.specs[i].FetchedAt, m.specs[i].Tag = false, spec.FetchedAt, spec.Tag + for _, s := range m.specs { + if s.API == spec.API && s.SHA256 == spec.SHA256 { + return nil } - return nil } m.specs = append(m.specs, spec) return nil } -// LastSpec is api's latest non-replay baseline, or nil on a first run. +// LastSpec is api's latest baseline, or nil on a first run. func (m *Mem) LastSpec(api string) (*plugin.Spec, error) { m.mu.Lock() defer m.mu.Unlock() var last *plugin.Spec for i := range m.specs { s := &m.specs[i] - if s.API != api || s.Replay { + if s.API != api { continue } if last == nil || !s.FetchedAt.Before(last.FetchedAt) { // a later save wins a tie @@ -144,13 +137,23 @@ func Run(ctx context.Context, env plugin.Env, sink Sink, p plugin.Plugin) (rejec return save(sink, p.Name(), r) } -// Replay is Run over two releases of a plugin that can replay them. -func Replay(ctx context.Context, env plugin.Env, sink Sink, p plugin.Plugin, from, to string) (rejected bool, err error) { - rp, ok := p.(plugin.Replayer) +// Pair reads two versions of a versioned plugin (by id, read at the same +// ref), extracts the change between them and stores its events in sink: a +// version pair as patch-it's ingestion service does it. +func Pair(ctx context.Context, env plugin.Env, sink Sink, p plugin.Plugin, from, to string) (rejected bool, err error) { + vp, ok := p.(plugin.Versioned) if !ok { - return false, fmt.Errorf("%s has no releases to replay", p.Name()) + return false, fmt.Errorf("%s isn't read version by version", p.Name()) + } + a, err := vp.ReadAt(ctx, env, plugin.Version{ID: from, Ref: from}) + if err != nil { + return false, fmt.Errorf("%s: %w", p.Name(), err) + } + b, err := vp.ReadAt(ctx, env, plugin.Version{ID: to, Ref: to}) + if err != nil { + return false, fmt.Errorf("%s: %w", p.Name(), err) } - r, err := rp.Replay(ctx, env, from, to) + r, err := vp.Extract(ctx, env, a, b) if err != nil { return false, fmt.Errorf("%s: %w", p.Name(), err) } diff --git a/core/kit/kittest/mem_test.go b/core/kit/kittest/mem_test.go index c673613..f7bb357 100644 --- a/core/kit/kittest/mem_test.go +++ b/core/kit/kittest/mem_test.go @@ -15,10 +15,10 @@ func TestMemStoresAsIngestDoes(t *testing.T) { // golden file's ids then depend only on the events it holds. func TestMemIdsHaveNoGaps(t *testing.T) { m := NewMem() - if _, err := m.SaveEvents([]event.EventV2{sinkEvent(1), sinkEvent(1), sinkEvent(2)}); err != nil { + if _, err := m.SaveEvents([]event.Event{sinkEvent(1), sinkEvent(1), sinkEvent(2)}); err != nil { t.Fatal(err) } - if _, err := m.SaveEvents([]event.EventV2{sinkEvent(2), sinkEvent(3)}); err != nil { + if _, err := m.SaveEvents([]event.Event{sinkEvent(2), sinkEvent(3)}); err != nil { t.Fatal(err) } all, _ := m.All() @@ -43,5 +43,5 @@ func TestMemLastSpecIsACopy(t *testing.T) { } func sinkSpec(content string) plugin.Spec { - return plugin.Baseline("x", "1", "v1", "https://example.test/1", []byte(content), false, Clock) + return plugin.Baseline("x", "1", "v1", "https://example.test/1", []byte(content), Clock) } diff --git a/core/migrate/migrate.go b/core/migrate/migrate.go deleted file mode 100644 index 4cc5b0f..0000000 --- a/core/migrate/migrate.go +++ /dev/null @@ -1,120 +0,0 @@ -// Package migrate converts stored v1 change events to the proposed v2 contract -// (the change event contract): `affected` becomes a typed -// `subject`. It runs once, at the cut-over, over every event in the store. -// -// A Stripe event keeps its fingerprint: v2's api_operation formula is v1's. -// A model retirement or an SDK release gets a new one, and `supersedes` names -// the old one, so the patch-it client, which finds its open issues and pull -// requests by the fingerprint in their marker, knows they're the same change -// and opens nothing twice. -package migrate - -import ( - "fmt" - "regexp" - "strings" - - "github.com/patch-it-dev/patch-it-plugins/core/event" - "github.com/patch-it-dev/patch-it-plugins/plugins/migrationguide/sdkguide" - "github.com/patch-it-dev/patch-it-plugins/plugins/notices/retire" -) - -// providers are the model retirement slugs and who retires the models. -var providers = map[string]string{ - retire.OpenAI.API: "openai", - retire.Anthropic.API: "anthropic", -} - -// guides are the SDKs whose v1 events came from a migration guide. -var guides = map[string]sdkguide.Guide{sdkguide.AnthropicV1.API: sdkguide.AnthropicV1} - -// ToV2 converts one v1 event. It refuses an event it can't place rather than -// guess: an unknown slug with a value, or an SDK event that isn't a removed -// request parameter. -func ToV2(e event.ChangeEvent) (event.EventV2, error) { - v2 := event.EventV2{ - ID: e.ID, API: e.API, Version: e.Version, PreviousVersion: e.PreviousVersion, - ChangeType: e.ChangeType, Breaking: e.Breaking, Description: e.Description, - MigrationHint: e.MigrationHint, SourceURL: e.SourceURL, SourcePointer: e.SourcePointer, - SourceExcerpt: e.SourceExcerpt, Confidence: e.Confidence, DetectedAt: e.DetectedAt, - } - a := e.Affected - if provider, ok := providers[e.API]; ok { - if a.Value == "" { - return event.EventV2{}, fmt.Errorf("event %d: a %s event without the model in affected.value", e.ID, e.API) - } - v2.Subject = event.Subject{ - Type: event.SubjectModel, Provider: provider, Name: a.Value, - Replacement: replacement(e.MigrationHint), - } - return rekeyed(v2, e.Fingerprint), nil - } - if g, ok := guides[e.API]; ok { - if a.Kind != event.AffectedKindRequestParameter || a.Property == "" { - return event.EventV2{}, fmt.Errorf("event %d: an %s SDK event that isn't a removed parameter", e.ID, e.API) - } - v2.Subject = event.Subject{ - Type: event.SubjectPackageRelease, Ecosystem: "pypi", Package: g.API, - Change: event.PackageRemovedParameter, Parameter: a.Property, Symbols: g.Symbols, - } - return rekeyed(v2, e.Fingerprint), nil - } - if a.Value != "" { - return event.EventV2{}, fmt.Errorf("event %d: affected.value on %s, which isn't a model retirement", e.ID, e.API) - } - v2.Subject = event.Subject{ - Type: event.SubjectAPIOperation, Kind: a.Kind, Side: a.Side, - Operation: a.Operation, Schema: a.Schema, Property: a.Property, - } - v2.Fingerprint = e.Fingerprint // the same formula: unchanged by construction - return v2, nil -} - -// rekeyed gives the event its v2 fingerprint and says which v1 one it replaces. -func rekeyed(v2 event.EventV2, old string) event.EventV2 { - v2.Fingerprint = event.FingerprintV2(v2.API, v2.Version, v2.ChangeType, v2.Subject, "") - if v2.Fingerprint != old { - v2.Supersedes = old - } - return v2 -} - -// useInstead is the hint retire.Events writes: "Use instead: …". -var useInstead = regexp.MustCompile("^Use (.+?) instead: ") - -// replacement is the one model the provider names, when its replacement cell -// is exactly one model name: not none ("names no replacement model"), not -// several, not a model with a setting (`gpt-5.6-sol` (`reasoning.mode: pro`)). -// The patch-it client opens an issue for the rest, as it does today. -func replacement(hint string) string { - m := useInstead.FindStringSubmatch(hint) - if m == nil { - return "" - } - name := retire.First(m[1]) - if name == "" || strings.TrimSpace(m[1]) != "`"+name+"`" { - return "" - } - return name -} - -// Fresh converts events a source has just produced in the v1 shape. Unlike a -// stored row, a fresh event replaces nothing, so it carries no `supersedes`. An -// event that can't be placed is returned as an error, like a failed validation. -func Fresh(events []event.ChangeEvent) ([]event.EventV2, []error) { - var out []event.EventV2 - var errs []error - for _, e := range events { - v2, err := ToV2(e) - if err == nil { - v2.Supersedes = "" - err = v2.Validate() - } - if err != nil { - errs = append(errs, err) - continue - } - out = append(out, v2) - } - return out, errs -} diff --git a/core/migrate/migrate_test.go b/core/migrate/migrate_test.go deleted file mode 100644 index c6fccb3..0000000 --- a/core/migrate/migrate_test.go +++ /dev/null @@ -1,137 +0,0 @@ -package migrate - -import ( - "bytes" - "encoding/json" - "flag" - "os" - "strings" - "testing" - - "github.com/patch-it-dev/patch-it-plugins/core/event" -) - -// -update rewrites the golden v2 fixture from the v1 ones: go test ./migrate -update -var update = flag.Bool("update", false, "rewrite contract/fixtures/change-events-v2.json") - -const fixtures = "../../contract/fixtures/" - -// The v1 fixtures the golden v2 file is converted from: the shared contract -// fixture, the hosted service's model retirements and the anthropic SDK release. -var v1Files = []string{ - "change-events.json", - "change-events-model-retirements-2026-10-13.json", - "change-events-anthropic-sdk-1.0.0.json", -} - -func read(t *testing.T, name string) []event.ChangeEvent { - t.Helper() - raw, err := os.ReadFile(fixtures + name) - if err != nil { - t.Fatal(err) - } - var feed struct { - Changes []event.ChangeEvent `json:"changes"` - } - if err := json.Unmarshal(raw, &feed); err != nil { - t.Fatalf("%s: %v", name, err) - } - return feed.Changes -} - -// The golden file is what the cut-over will store: both loops check it -// (event's v2 tests, patch-it's tests/test_contract_v2.py). -func TestV2FixtureIsTheConversionOfV1(t *testing.T) { - var out []event.EventV2 - for _, name := range v1Files { - for _, e := range read(t, name) { - v2, err := ToV2(e) - if err != nil { - t.Fatalf("%s: %v", name, err) - } - if err := v2.Validate(); err != nil { - t.Fatalf("%s event %d converts to an invalid v2 event: %v", name, e.ID, err) - } - out = append(out, v2) - } - } - var buf bytes.Buffer - enc := json.NewEncoder(&buf) - enc.SetEscapeHTML(false) - enc.SetIndent("", " ") - if err := enc.Encode(map[string]any{"changes": out}); err != nil { - t.Fatal(err) - } - golden := fixtures + "change-events-v2.json" - if *update { - if err := os.WriteFile(golden, buf.Bytes(), 0o644); err != nil { - t.Fatal(err) - } - } - want, err := os.ReadFile(golden) - if err != nil { - t.Fatalf("%v (run with -update to create it)", err) - } - if !bytes.Equal(buf.Bytes(), want) { - t.Errorf("%s isn't the conversion of the v1 fixtures: run go test ./migrate -update", golden) - } -} - -// A Stripe event keeps its fingerprint, so the 901 stored events of a release -// aren't re-keyed. Checked on the whole endive release, not only the samples. -func TestAStripeEventKeepsItsFingerprint(t *testing.T) { - for _, name := range []string{"change-events.json", "change-events-stripe-2026-09-30.json"} { - for _, e := range read(t, name) { - v2, err := ToV2(e) - if err != nil { - t.Fatalf("%s: %v", name, err) - } - if v2.Fingerprint != e.Fingerprint || v2.Supersedes != "" { - t.Errorf("%s event %d: fingerprint %s → %s, supersedes %q", name, e.ID, e.Fingerprint, v2.Fingerprint, v2.Supersedes) - } - if err := v2.Validate(); err != nil { - t.Errorf("%s event %d: %v", name, e.ID, err) - } - } - } -} - -// A re-keyed event names the fingerprint it replaces: the patch-it client -// finds its open issue or pull request by that one, and opens nothing twice (found in -// review: without it, every repo with an open retirement PR gets a second). -func TestARekeyedEventSupersedesItsV1Fingerprint(t *testing.T) { - for _, name := range v1Files[1:] { - for _, e := range read(t, name) { - v2, err := ToV2(e) - if err != nil { - t.Fatal(err) - } - if v2.Fingerprint == e.Fingerprint || v2.Supersedes != e.Fingerprint { - t.Errorf("%s event %d: fingerprint %s, supersedes %q, v1 %s", name, e.ID, v2.Fingerprint, v2.Supersedes, e.Fingerprint) - } - } - } -} - -func TestReplacementIsOnlyOnePlainModel(t *testing.T) { - for hint, want := range map[string]string{ - "Use `gpt-5.6-sol` instead: OpenAI's recommended replacement.": "gpt-5.6-sol", - "Use `gpt-5.6-terra` instead: OpenAI's recommended replacement. (OpenAI first named `gpt-3.5-turbo`, which is itself retired.)": "gpt-5.6-terra", - "Use `gpt-5.6-sol` (`reasoning.mode: pro`) instead: OpenAI's recommended replacement.": "", - "OpenAI names no replacement model: The most capable cyber model available to you.": "", - "Use `a` or `b` instead: OpenAI's recommended replacement.": "", - } { - if got := replacement(hint); got != want { - t.Errorf("replacement(%q) = %q, want %q", hint, got, want) - } - } -} - -func TestAnEventItCantPlaceIsRefused(t *testing.T) { - e := read(t, "change-events.json")[0] - e.Affected.Value = "gpt-4" - e.Affected.Property = "model" - if _, err := ToV2(e); err == nil || !strings.Contains(err.Error(), "isn't a model retirement") { - t.Errorf("a value on a Stripe event converted: %v", err) - } -} diff --git a/core/normalize/golden_test.go b/core/normalize/golden_test.go index 6fb92a1..9f5dd76 100644 --- a/core/normalize/golden_test.go +++ b/core/normalize/golden_test.go @@ -29,7 +29,7 @@ var update = flag.Bool("update", false, "rewrite the golden events.json files fr // Everything that isn't part of the spec pair is fixed, so the output is exactly // reproducible. var goldenSource = Source{ - API: "stripe", + API: "stripe/api", NewSpecURL: "https://raw.githubusercontent.com/stripe/openapi/v2468/latest/openapi.spec3.json", OldSpecURL: "https://raw.githubusercontent.com/stripe/openapi/v2460/latest/openapi.spec3.json", DetectedAt: time.Date(2026, 9, 27, 12, 0, 0, 0, time.UTC), diff --git a/core/normalize/normalize.go b/core/normalize/normalize.go index 9279fc9..9f8b1ab 100644 --- a/core/normalize/normalize.go +++ b/core/normalize/normalize.go @@ -24,7 +24,7 @@ const excerptLimit = 2000 // Source describes where a pair of specs came from, so each event can point // back at the exact document that proves it. type Source struct { - API string // "stripe" + API string // the source id: "stripe/api" Version string // info.version of the new spec PreviousVersion string // info.version of the old spec NewSpecURL string // pinned URL of the new spec, e.g. .../v2468/... @@ -40,17 +40,17 @@ type Source struct { // is structural, so there is nothing to be unsure about: the change did happen // exactly as described. Whether it matters to a given repository is the // patch-it client's question, not this one's. -func Events(changes []diff.Change, src Source) ([]event.ChangeEvent, []error) { +func Events(changes []diff.Change, src Source) ([]event.Event, []error) { detectedAt := src.DetectedAt if detectedAt.IsZero() { detectedAt = time.Now().UTC() } - events := make([]event.ChangeEvent, 0, len(changes)) + events := make([]event.Event, 0, len(changes)) var errs []error for _, c := range changes { - affected := affectedFor(c) + subject := subjectFor(c) sourceURL := src.NewSpecURL if c.InOld { sourceURL = src.OldSpecURL @@ -62,14 +62,14 @@ func Events(changes []diff.Change, src Source) ([]event.ChangeEvent, []error) { continue } - e := event.ChangeEvent{ - Fingerprint: event.Fingerprint(src.API, src.Version, c.ChangeType, affected, c.Detail), + e := event.Event{ + Fingerprint: event.Fingerprint(src.API, src.Version, c.ChangeType, subject, c.Detail), API: src.API, Version: src.Version, PreviousVersion: src.PreviousVersion, ChangeType: c.ChangeType, Breaking: c.Breaking, - Affected: affected, + Subject: subject, Description: describe(c), MigrationHint: migrationHint(c), SourceURL: sourceURL, @@ -89,11 +89,12 @@ func Events(changes []diff.Change, src Source) ([]event.ChangeEvent, []error) { return events, errs } -// affectedFor maps a change's location onto the contract's four kinds. The +// subjectFor maps a change's location onto the contract's four kinds. The // side already decides the pair: requests are addressed by operation, responses // by schema, and naming a property narrows either one. -func affectedFor(c diff.Change) event.Affected { - a := event.Affected{ +func subjectFor(c diff.Change) event.Subject { + a := event.Subject{ + Type: event.SubjectAPIOperation, Side: c.Side, Operation: c.Operation, Schema: c.Schema, @@ -102,15 +103,15 @@ func affectedFor(c diff.Change) event.Affected { switch { case c.Side == event.SideRequest && c.Property != "": - a.Kind = event.AffectedKindRequestParameter + a.Kind = event.KindRequestParameter case c.Side == event.SideRequest: // A change to the request body's root schema has no property to name, // so it is reported against the operation itself. - a.Kind = event.AffectedKindOperation + a.Kind = event.KindOperation case c.Property != "": - a.Kind = event.AffectedKindSchemaProperty + a.Kind = event.KindSchemaProperty default: - a.Kind = event.AffectedKindSchema + a.Kind = event.KindSchema } return a } diff --git a/core/normalize/normalize_test.go b/core/normalize/normalize_test.go index 89d8025..4e7845f 100644 --- a/core/normalize/normalize_test.go +++ b/core/normalize/normalize_test.go @@ -16,7 +16,7 @@ const ( ) var source = Source{ - API: "stripe", + API: "stripe/api", Version: "2022-11-15", PreviousVersion: "2022-08-01", NewSpecURL: newURL, @@ -61,8 +61,8 @@ func TestEventsAreValidWithFullProvenance(t *testing.T) { } removed, added := events[0], events[1] - if removed.Affected.Kind != event.AffectedKindSchemaProperty || removed.Affected.Schema != "payment_intent" || - removed.Affected.Property != "charges" || !removed.Breaking { + if removed.Subject.Kind != event.KindSchemaProperty || removed.Subject.Schema != "payment_intent" || + removed.Subject.Property != "charges" || !removed.Breaking { t.Errorf("charges removal mapped wrong: %+v", removed) } // Removals cite the old spec: the evidence is gone from the new one. @@ -71,13 +71,13 @@ func TestEventsAreValidWithFullProvenance(t *testing.T) { } for _, e := range events { if e.Confidence != 1.0 { - t.Errorf("%s: confidence %v, want 1.0 for a spec diff", e.Affected.Property, e.Confidence) + t.Errorf("%s: confidence %v, want 1.0 for a spec diff", e.Subject.Property, e.Confidence) } if e.Version != "2022-11-15" || e.PreviousVersion != "2022-08-01" || !e.DetectedAt.Equal(source.DetectedAt) { - t.Errorf("%s: version/time not carried over: %+v", e.Affected.Property, e) + t.Errorf("%s: version/time not carried over: %+v", e.Subject.Property, e) } if e.SourcePointer == "" || e.SourceExcerpt == "" { - t.Errorf("%s: missing pointer or excerpt", e.Affected.Property) + t.Errorf("%s: missing pointer or excerpt", e.Subject.Property) } } } diff --git a/core/normalize/testdata/golden/breaking-property-removed/events.json b/core/normalize/testdata/golden/breaking-property-removed/events.json index 13ab3a5..90c6f77 100644 --- a/core/normalize/testdata/golden/breaking-property-removed/events.json +++ b/core/normalize/testdata/golden/breaking-property-removed/events.json @@ -1,13 +1,14 @@ [ { "id": 0, - "fingerprint": "sha256:ff7dd3f4198ccc46ce89ac4c82249fe9e442478d8c3da6b713596249017f96fb", - "api": "stripe", + "fingerprint": "sha256:77d0d93b830cba06d786c98a2fc3d22c550a775d5ce5df87c43e042083dda138", + "api": "stripe/api", "version": "2026-08-26.dahlia", "previous_version": "2026-07-29.dahlia", "change_type": "breaking", "breaking": true, - "affected": { + "subject": { + "type": "api_operation", "kind": "schema_property", "side": "response", "schema": "payments_primitives_payment_records_resource_payment_method_card_details_resource_three_d_secure", diff --git a/core/normalize/testdata/golden/deprecation/events.json b/core/normalize/testdata/golden/deprecation/events.json index aad6939..c308aed 100644 --- a/core/normalize/testdata/golden/deprecation/events.json +++ b/core/normalize/testdata/golden/deprecation/events.json @@ -1,13 +1,14 @@ [ { "id": 0, - "fingerprint": "sha256:5e6a726296bc4c319b8605eb7e3f67d641ae3d63c9d5038b75bb691d5ac5b6be", - "api": "stripe", + "fingerprint": "sha256:0563cf609d49fe03301efb63f3b071d05ffa98392a443dbccec31b867a4446b9", + "api": "stripe/api", "version": "2026-08-26.dahlia", "previous_version": "2026-07-29.dahlia", "change_type": "deprecation", "breaking": false, - "affected": { + "subject": { + "type": "api_operation", "kind": "operation", "side": "request", "operation": "POST /v1/charges" diff --git a/core/normalize/testdata/golden/new-endpoint/events.json b/core/normalize/testdata/golden/new-endpoint/events.json index d921674..bfa160b 100644 --- a/core/normalize/testdata/golden/new-endpoint/events.json +++ b/core/normalize/testdata/golden/new-endpoint/events.json @@ -1,13 +1,14 @@ [ { "id": 0, - "fingerprint": "sha256:c945f5c4c228e6a9a7fa10537b4f931c4dfdae7ee8688520dc3229b9860862bc", - "api": "stripe", + "fingerprint": "sha256:480b352be42e611c5b6806177349bb7230190f2ee9ccfe8d16c27ade354b6dfb", + "api": "stripe/api", "version": "2026-08-26.dahlia", "previous_version": "2026-07-29.dahlia", "change_type": "new_feature", "breaking": false, - "affected": { + "subject": { + "type": "api_operation", "kind": "operation", "side": "request", "operation": "POST /v1/billing/feedback_options" diff --git a/core/plugin/plugin.go b/core/plugin/plugin.go index 203f092..cc34ef6 100644 --- a/core/plugin/plugin.go +++ b/core/plugin/plugin.go @@ -2,7 +2,7 @@ // one interface, registered by name. A plugin reads its source and returns a // Result; it stores nothing itself. Whoever runs it (patch-it's hosted // ingestion service, or the test kit) stores the events, then the baselines. -// Adding a source is a new package under plugins/ that calls Register; nothing +// Adding a source is a RegisterProvider call in its kind's package; nothing // here changes. package plugin @@ -10,7 +10,6 @@ import ( "context" "crypto/sha256" "encoding/hex" - "fmt" "slices" "sync" "time" @@ -20,20 +19,14 @@ import ( // Plugin is one place changes come from. type Plugin interface { - // Name is the slug the command line selects it by and its events carry in - // `api`: "stripe", "openai-models". + // Name is the source's id, "/", which its events + // carry in `api`: "stripe/api", "openai/models". Name() string // Run reads the source as it is now and returns what changed since the // baseline it saved last (env.Baselines.LastSpec). An error stores nothing. Run(ctx context.Context, env Env) (Result, error) } -// Replayer is a plugin that can also diff two given releases (--from, --to): -// how a historical change is recreated without moving the normal baseline. -type Replayer interface { - Replay(ctx context.Context, env Env, from, to string) (Result, error) -} - // Env is everything a plugin may reach outside itself, so a test can hand it // baselines, the network and a clock of its own. A plugin that fetches through // its own client (the OpenAPI plugin's adapter) ignores Get; its tests fake @@ -67,16 +60,15 @@ type Spec struct { SHA256 string SourceURL string FetchedAt time.Time - Replay bool Content []byte } // Result is what one run found. type Result struct { - Label string // what was read, for the summary: a tag, a snapshot, a URL - Events []event.EventV2 // valid v2 events, to store - Rejected []error // changes that failed to become valid events - Baselines []Spec // what the run read, saved after the events + Label string // what was read, for the summary: a tag, a snapshot, a URL + Events []event.Event // valid v2 events, to store + Rejected []error // changes that failed to become valid events + Baselines []Spec // what the run read, saved after the events } var ( @@ -84,37 +76,16 @@ var ( registry = map[string]Plugin{} ) -// Register adds a plugin. A second plugin with the same name is a programming -// error: two sources would write the same `api`. So is the name "all", which -// `--api all` means. -func Register(p Plugin) { - mu.Lock() - defer mu.Unlock() - if p.Name() == "all" { - panic(`plugin: "all" means every plugin; a plugin can't be named it`) - } - if _, dup := registry[p.Name()]; dup { - panic(fmt.Sprintf("plugin: a plugin named %q is already registered", p.Name())) - } - registry[p.Name()] = p -} - -// Lookup finds a registered plugin by name: its old slug ("algolia-search") -// or its source's full id ("algolia/search-api"). -func Lookup(name string) (Plugin, bool) { +// Lookup finds a registered plugin by its source's id ("algolia/search-api"). +func Lookup(id string) (Plugin, bool) { mu.Lock() defer mu.Unlock() - if p, ok := registry[name]; ok { - return p, true - } - if s, ok := sources[name]; ok { - return s.Source.Plugin, true - } - return nil, false + p, ok := registry[id] + return p, ok } -// Names are the registered plugins' old slugs, sorted: what `--api all` runs. -// Sources lists them with their full ids and metadata. +// Names are the registered sources' ids, sorted. Sources lists them with +// their metadata. func Names() []string { mu.Lock() defer mu.Unlock() @@ -128,7 +99,7 @@ func Names() []string { // Baseline is what a plugin saves as the last thing it read, hashed so the // next run can tell an unchanged source in one comparison. -func Baseline(api, version, tag, sourceURL string, content []byte, replay bool, at time.Time) Spec { +func Baseline(api, version, tag, sourceURL string, content []byte, at time.Time) Spec { return Spec{ API: api, Version: version, @@ -136,7 +107,6 @@ func Baseline(api, version, tag, sourceURL string, content []byte, replay bool, SHA256: SHA256(content), SourceURL: sourceURL, FetchedAt: at, - Replay: replay, Content: content, } } diff --git a/core/plugin/plugin_test.go b/core/plugin/plugin_test.go index 34f3b12..05453f2 100644 --- a/core/plugin/plugin_test.go +++ b/core/plugin/plugin_test.go @@ -21,9 +21,9 @@ func (p testPlugin) Run(_ context.Context, env Env) (Result, error) { if p.err != nil { return Result{}, p.err } - subject := event.Subject{Type: event.SubjectAPIOperation, Kind: event.AffectedKindOperation, Side: event.SideRequest, Operation: "POST /v1/things"} - e := event.EventV2{ - Fingerprint: event.FingerprintV2(p.name, "2", event.ChangeTypeNewFeature, subject, ""), + subject := event.Subject{Type: event.SubjectAPIOperation, Kind: event.KindOperation, Side: event.SideRequest, Operation: "POST /v1/things"} + e := event.Event{ + Fingerprint: event.Fingerprint(p.name, "2", event.ChangeTypeNewFeature, subject, ""), API: p.name, Version: "2", ChangeType: event.ChangeTypeNewFeature, @@ -37,53 +37,47 @@ func (p testPlugin) Run(_ context.Context, env Env) (Result, error) { content := []byte(`{"version":"2"}`) return Result{ Label: "v2", - Events: []event.EventV2{e}, - Baselines: []Spec{Baseline(p.name, "2", "v2", "https://example.test/spec/2.json", content, false, env.Now())}, + Events: []event.Event{e}, + Baselines: []Spec{Baseline(p.name, "2", "v2", "https://example.test/spec/2.json", content, env.Now())}, }, nil } -func TestAPluginRegisteredInATestIsFound(t *testing.T) { - register(t, testPlugin{name: "test-registered"}) - if p, ok := Lookup("test-registered"); !ok || p.Name() != "test-registered" || !slices.Contains(Names(), "test-registered") { +func TestASourceRegisteredInATestIsFound(t *testing.T) { + register(t, "test-registered") + if p, ok := Lookup("test-registered/api"); !ok || p.Name() != "test-registered/api" || !slices.Contains(Names(), "test-registered/api") { t.Fatal("not registered") } } func TestNamesAreSorted(t *testing.T) { - register(t, testPlugin{name: "test-b"}) - register(t, testPlugin{name: "test-a"}) + register(t, "test-b") + register(t, "test-a") if !slices.IsSorted(Names()) { t.Errorf("Names() = %v, want sorted", Names()) } } -// register registers a test plugin for the rest of the test only, so the test -// can run again (-count). -func register(t *testing.T, p Plugin) { +// register registers a test provider with one source, api, for the rest of +// the test only, so the test can run again (-count). +func register(t *testing.T, provider string) { t.Helper() - Register(p) + RegisterProvider(Provider{ID: provider, Name: provider, Category: CategoryDevTools, Homepage: "https://example.test", + Sources: []Source{{ID: "api", Layer: LayerAPI, Watches: "w", URLs: []string{"https://example.test/spec"}, Page: "providers/test.md", Plugin: testPlugin{name: provider + "/api"}}}}) t.Cleanup(func() { mu.Lock() defer mu.Unlock() - delete(registry, p.Name()) + delete(registry, provider+"/api") + delete(sources, provider+"/api") + delete(providers, provider) }) } -func TestTwoPluginsCantShareAName(t *testing.T) { - register(t, testPlugin{name: "test-dup"}) +func TestTwoSourcesCantShareAnID(t *testing.T) { + register(t, "test-dup") defer func() { if recover() == nil { - t.Error("a second plugin named test-dup was registered") + t.Error("a second source test-dup/api was registered") } }() - Register(testPlugin{name: "test-dup"}) -} - -func TestAPluginCantBeNamedAll(t *testing.T) { - defer func() { - if recover() == nil { - t.Error(`a plugin named "all" was registered: --api all would hide it`) - } - }() - Register(testPlugin{name: "all"}) + register(t, "test-dup") } diff --git a/core/plugin/provider.go b/core/plugin/provider.go index 085b8f7..f0a4644 100644 --- a/core/plugin/provider.go +++ b/core/plugin/provider.go @@ -115,9 +115,8 @@ type Source struct { // sources without a table kept elsewhere. Only names checked by hand; // none is fine when no package maps to the source. Packages []string - // Plugin runs it. Its Name is the source's old slug ("algolia-search"): - // what `--api` selects and every event's `api` carries until patch-it's - // change-event contract switches to source ids. + // Plugin runs it. Its Name is the source's id ("algolia/search-api"), + // which every event's `api` carries. Plugin Plugin } @@ -130,19 +129,14 @@ type SourceInfo struct { // FullID is "/". func (s SourceInfo) FullID() string { return s.Provider.ID + "/" + s.Source.ID } -// Alias is the source's old slug, its Plugin's Name: "algolia-search". -func (s SourceInfo) Alias() string { return s.Source.Plugin.Name() } - var ( providers = map[string]Provider{} // by provider ID, Sources merged sources = map[string]SourceInfo{} // by full ID - aliases = map[string]string{} // old slug to full ID slug = regexp.MustCompile(`^[a-z0-9][a-z0-9-]*$`) ) -// RegisterProvider registers p's sources, each under its full id, and each -// source's Plugin under its old slug (Register), so Lookup finds it by -// either. Incomplete metadata is a programming error, as a duplicate is. +// RegisterProvider registers p's sources, each under its id, with its Plugin +// (Lookup). Incomplete metadata is a programming error, as a duplicate is. func RegisterProvider(p Provider) { if err := p.check(); err != nil { panic("plugin: " + err.Error()) @@ -151,27 +145,17 @@ func RegisterProvider(p Provider) { p.Sources[i].Kind = KindOf(p.Sources[i].Plugin) } mu.Lock() + defer mu.Unlock() if have, ok := providers[p.ID]; ok { if have.Name != p.Name || have.Category != p.Category || have.Homepage != p.Homepage { - mu.Unlock() panic(fmt.Sprintf("plugin: provider %q registered twice with different metadata", p.ID)) } } for _, s := range p.Sources { - id := p.ID + "/" + s.ID - if _, dup := sources[id]; dup { - mu.Unlock() - panic(fmt.Sprintf("plugin: source %q is already registered", id)) + if _, dup := sources[p.ID+"/"+s.ID]; dup { + panic(fmt.Sprintf("plugin: source %q is already registered", p.ID+"/"+s.ID)) } } - mu.Unlock() - - for _, s := range p.Sources { - Register(s.Plugin) // panics on a duplicate old slug - } - - mu.Lock() - defer mu.Unlock() have := providers[p.ID] merged := Provider{ID: p.ID, Name: p.Name, Category: p.Category, Homepage: p.Homepage, Sources: append(have.Sources, p.Sources...)} providers[p.ID] = merged @@ -180,7 +164,7 @@ func RegisterProvider(p Provider) { for _, s := range p.Sources { id := p.ID + "/" + s.ID sources[id] = SourceInfo{Provider: bare, Source: s} - aliases[s.Plugin.Name()] = id + registry[id] = s.Plugin } } @@ -208,6 +192,8 @@ func (p Provider) check() error { return fmt.Errorf("source %q is listed twice", id) case s.Plugin == nil: return fmt.Errorf("source %q has no Plugin", id) + case s.Plugin.Name() != id: + return fmt.Errorf("source %q: its plugin's Name is %q; a plugin is named by its source's id", id, s.Plugin.Name()) case !slices.Contains(Layers(), s.Layer): return fmt.Errorf("source %q: layer %q isn't one of plugin.Layers()", id, s.Layer) case strings.TrimSpace(s.Watches) == "": @@ -277,11 +263,6 @@ func Sources() []SourceInfo { return out } -// Aliases are the other names a source answers to (Lookup, LookupSource): -// today its first name, the old slug ("algolia-search"), which events carry -// in `api` and fingerprints hash. -func (s SourceInfo) Aliases() []string { return []string{s.Alias()} } - // ForPackage are the sources that cover a published package // ("pypi:stripe"), sorted by full id: how a lockfile entry finds what to // ask the feed for. @@ -295,14 +276,10 @@ func ForPackage(pkg string) []SourceInfo { return out } -// LookupSource finds a source by its full id ("algolia/search-api") or its -// old slug ("algolia-search"). +// LookupSource finds a source by its id ("algolia/search-api"). func LookupSource(id string) (SourceInfo, bool) { mu.Lock() defer mu.Unlock() - if full, ok := aliases[id]; ok { - id = full - } s, ok := sources[id] return s, ok } diff --git a/core/plugin/provider_test.go b/core/plugin/provider_test.go index 6311bf4..9bd2927 100644 --- a/core/plugin/provider_test.go +++ b/core/plugin/provider_test.go @@ -11,25 +11,27 @@ type fake struct{ name string } func (f fake) Name() string { return f.name } func (fake) Run(context.Context, Env) (Result, error) { return Result{}, nil } -func src(id, slug string) Source { - return Source{ID: id, Layer: LayerAPI, Watches: "w", URLs: []string{"https://example.com/spec"}, Page: "providers/acme.md", Plugin: fake{slug}} +// src is a source of the provider whose id is provider, named by its id. +func src(id, provider string) Source { + return Source{ID: id, Layer: LayerAPI, Watches: "w", URLs: []string{"https://example.com/spec"}, Page: "providers/acme.md", Plugin: fake{provider + "/" + id}} } func acme(sources ...Source) Provider { return Provider{ID: "acme-test", Name: "Acme", Category: CategoryPayments, Homepage: "https://example.com", Sources: sources} } -func TestRegisterProviderResolvesBothIDs(t *testing.T) { - RegisterProvider(acme(src("api", "acme-test-api"))) - RegisterProvider(acme(src("sdk", "acme-test-sdk"))) // a second kind adds a source - for _, id := range []string{"acme-test/api", "acme-test-api"} { - s, ok := LookupSource(id) - if !ok || s.FullID() != "acme-test/api" || s.Alias() != "acme-test-api" || s.Source.Kind != "plugin" { - t.Errorf("LookupSource(%q) = %+v, %v", id, s, ok) - } - if p, ok := Lookup(id); !ok || p.Name() != "acme-test-api" { - t.Errorf("Lookup(%q) = %v, %v", id, p, ok) - } +func TestRegisterProviderRegistersEachSourceByItsID(t *testing.T) { + RegisterProvider(acme(src("api", "acme-test"))) + RegisterProvider(acme(src("sdk", "acme-test"))) // a second kind adds a source + s, ok := LookupSource("acme-test/api") + if !ok || s.FullID() != "acme-test/api" || s.Source.Kind != "plugin" { + t.Errorf("LookupSource = %+v, %v", s, ok) + } + if p, ok := Lookup("acme-test/api"); !ok || p.Name() != "acme-test/api" { + t.Errorf("Lookup = %v, %v", p, ok) + } + if _, ok := Lookup("acme-test-api"); ok { + t.Error("found a source by a name that isn't its id") } var got []string for _, p := range Providers() { @@ -46,6 +48,11 @@ func TestRegisterProviderResolvesBothIDs(t *testing.T) { func TestRegisterProviderRefusesIncompleteMetadata(t *testing.T) { for name, p := range map[string]Provider{ + "named by another id": acme(func() Source { + s := src("named", "acme-test") + s.Plugin = fake{"acme-test-named"} + return s + }()), "no category": {ID: "x1", Name: "X", Homepage: "https://x.example", Sources: []Source{src("api", "x1")}}, "no sources": {ID: "x2", Name: "X", Category: CategoryAI, Homepage: "https://x.example"}, "bad homepage": {ID: "x3", Name: "X", Category: CategoryAI, Homepage: "x.example", Sources: []Source{src("api", "x3")}}, @@ -77,24 +84,24 @@ func TestRegisterProviderRefusesIncompleteMetadata(t *testing.T) { } func TestRegisterProviderRefusesConflictingProvider(t *testing.T) { - RegisterProvider(acme(src("one", "acme-test-one"))) + RegisterProvider(acme(src("one", "acme-test"))) defer func() { if recover() == nil { t.Error("a provider registered again with another name didn't panic") } }() - p := acme(src("two", "acme-test-two")) + p := acme(src("two", "acme-test")) p.Name = "Acme Corp" RegisterProvider(p) } -// A package names its sources, and a source answers to its first name. +// A package names its sources. func TestForPackage(t *testing.T) { - s := src("pkg", "acme-test-pkg") + s := src("pkg", "acme-test") s.Packages = []string{"pypi:acme-test", "npm:@acme/test"} RegisterProvider(acme(s)) got := ForPackage("npm:@acme/test") - if len(got) != 1 || got[0].FullID() != "acme-test/pkg" || strings.Join(got[0].Aliases(), ",") != "acme-test-pkg" { + if len(got) != 1 || got[0].FullID() != "acme-test/pkg" { t.Errorf("ForPackage = %+v", got) } if got := ForPackage("pypi:nobody"); len(got) != 0 { diff --git a/core/plugin/versions.go b/core/plugin/versions.go index 5971490..8daec0e 100644 --- a/core/plugin/versions.go +++ b/core/plugin/versions.go @@ -15,11 +15,12 @@ import ( // result, _ := s.Extract(ctx, env, a, b) // what changed from a to b // // Every consecutive pair is one Extract; a released version never changes, so -// a pair is done once. Run keeps working: it reads the newest version and -// extracts against the last baseline, as before. +// a pair is done once. // -// A source with no versions of its own (a deprecations page, a feed) has only -// Run: patch-it's hosted ingestion service reads it as a living page. +// A living page (a deprecations page, a feed: the notices kind) is also read +// as it is now by Run, which compares it with the last baseline and cites a +// fresh Web Archive snapshot of it; its history is its Web Archive captures, +// listed as versions. // Version is one version of a source. type Version struct { diff --git a/docs/plugins.schema.json b/docs/plugins.schema.json index c5af222..7b1ab8d 100644 --- a/docs/plugins.schema.json +++ b/docs/plugins.schema.json @@ -32,13 +32,10 @@ "type": "array", "items": { "type": "object", - "required": ["id", "alias", "first_name", "aliases", "kind", "layer", "watches", "urls", "packages", "page"], + "required": ["id", "kind", "layer", "watches", "urls", "packages", "page"], "additionalProperties": false, "properties": { - "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*/[a-z0-9][a-z0-9-]*$", "description": "provider/source" }, - "alias": { "type": "string", "pattern": "^[a-z0-9][a-z0-9.-]*$", "description": "The old slug: --api and every event's api field until patch-it's change-event contract switches to source ids." }, - "first_name": { "type": "string", "pattern": "^[a-z0-9][a-z0-9.-]*$", "description": "The source's first name, its old slug: what fingerprints keep hashing after the contract switches to source ids." }, - "aliases": { "type": "array", "items": { "type": "string", "pattern": "^[a-z0-9][a-z0-9.-]*$" }, "description": "Every other name the source answers to." }, + "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*/[a-z0-9][a-z0-9-]*$", "description": "provider/source: every event's api field." }, "packages": { "type": "array", "items": { "type": "string", "pattern": "^(pypi|npm|go|maven|nuget|rubygems|cargo|packagist):[^\\s]+$" }, "description": "The published packages this source covers, as ecosystem:name, so a lockfile entry finds its sources." }, "kind": { "type": "string", "enum": ["openapi", "changelog", "notices", "migrationguide", "catalog", "apisurface"] }, "layer": { "type": "string", "enum": ["api", "sdk", "package", "runtime", "ci", "ai-models", "infra"] }, diff --git a/internal/pluginlist/pluginlist.go b/internal/pluginlist/pluginlist.go index d4bb2e5..bde7fda 100644 --- a/internal/pluginlist/pluginlist.go +++ b/internal/pluginlist/pluginlist.go @@ -38,16 +38,13 @@ type Provider struct { // Source is one source. type Source struct { - ID string `json:"id"` // provider/source - Alias string `json:"alias"` // the old slug: --api and every event's api until the contract switches to source ids - FirstName string `json:"first_name"` // the same old slug, by the name fingerprints keep hashing after the switch - Aliases []string `json:"aliases"` // every other name the source answers to - Kind string `json:"kind"` - Layer string `json:"layer"` - Watches string `json:"watches"` - URLs []string `json:"urls"` - Packages []string `json:"packages"` // ":"; [] when none - Page string `json:"page"` // absolute, at Version + ID string `json:"id"` // provider/source: every event's api + Kind string `json:"kind"` + Layer string `json:"layer"` + Watches string `json:"watches"` + URLs []string `json:"urls"` + Packages []string `json:"packages"` // ":"; [] when none + Page string `json:"page"` // absolute, at Version } // Build is the list of everything registered, with pages linked at ref (a @@ -69,7 +66,7 @@ func Build(ref string) File { for _, s := range p.Sources { info := plugin.SourceInfo{Provider: p, Source: s} out.Sources = append(out.Sources, Source{ - ID: info.FullID(), Alias: info.Alias(), FirstName: info.Alias(), Aliases: info.Aliases(), + ID: info.FullID(), Kind: s.Kind, Layer: string(s.Layer), Watches: s.Watches, URLs: s.URLs, Packages: append([]string{}, s.Packages...), Page: Repo + "/blob/" + ref + "/" + s.Page, }) diff --git a/internal/pluginlist/pluginlist_test.go b/internal/pluginlist/pluginlist_test.go index 21dfb84..6138134 100644 --- a/internal/pluginlist/pluginlist_test.go +++ b/internal/pluginlist/pluginlist_test.go @@ -12,7 +12,7 @@ import ( const root = "../.." // The list is the registry: every registered source once, under its provider, -// with its old slug, and the counts agree. +// once, and the counts agree. func TestBuildListsEveryRegisteredSource(t *testing.T) { f := Build("") if f.Version != "main" { @@ -29,7 +29,7 @@ func TestBuildListsEveryRegisteredSource(t *testing.T) { if !strings.HasPrefix(s.Page, Repo+"/blob/main/providers/") { t.Errorf("%s: page %s", s.ID, s.Page) } - seen[s.Alias] = true + seen[s.ID] = true } } if n != f.Sources || len(f.List) != f.Providers || n != len(plugin.Sources()) { @@ -58,12 +58,12 @@ func TestAlgoliaIsOneProviderWithThreeSources(t *testing.T) { } var ids []string for _, s := range p.Sources { - ids = append(ids, s.ID+"="+s.Alias) + ids = append(ids, s.ID) if !strings.Contains(s.Page, "/blob/v1.2.3/") { t.Errorf("%s: page %s isn't at the release", s.ID, s.Page) } } - if got := strings.Join(ids, " "); got != "algolia/ingestion-api=algolia-ingestion algolia/recommend-api=algolia-recommend algolia/search-api=algolia-search" { + if got := strings.Join(ids, " "); got != "algolia/ingestion-api algolia/recommend-api algolia/search-api" { t.Errorf("algolia's sources: %s", got) } return diff --git a/plugins/all/all_test.go b/plugins/all/all_test.go index 998da1c..27cbde5 100644 --- a/plugins/all/all_test.go +++ b/plugins/all/all_test.go @@ -80,30 +80,19 @@ func TestImportingAllRegistersThePlugins(t *testing.T) { } } -// Every registered plugin is a source with complete metadata (RegisterProvider -// checks the fields), reachable by its full id and its old slug, and its page -// exists. -func TestEveryPluginIsASourceWithMetadata(t *testing.T) { - covered := map[string]bool{} +// Every registered source has complete metadata (RegisterProvider checks the +// fields), is found by its id, and its page exists. +func TestEverySourceHasMetadata(t *testing.T) { for _, s := range plugin.Sources() { - covered[s.Alias()] = true if _, err := os.Stat(filepath.Join("..", "..", s.Source.Page)); err != nil { t.Errorf("%s: its page %s doesn't exist (copy providers/_template.md)", s.FullID(), s.Source.Page) } - for _, id := range []string{s.FullID(), s.Alias()} { - got, ok := plugin.LookupSource(id) - if !ok || got.FullID() != s.FullID() { - t.Errorf("LookupSource(%q) = %q, %v; want %s", id, got.FullID(), ok, s.FullID()) - } - if p, ok := plugin.Lookup(id); !ok || p.Name() != s.Alias() { - t.Errorf("Lookup(%q) didn't find %s", id, s.Alias()) - } + if p, ok := plugin.Lookup(s.FullID()); !ok || p.Name() != s.FullID() { + t.Errorf("Lookup(%q) didn't find it", s.FullID()) } } - for _, name := range plugin.Names() { - if !covered[name] { - t.Errorf("%s is registered with plugin.Register only: register it as a source of its provider (plugin.RegisterProvider) with its metadata", name) - } + if len(plugin.Names()) != len(plugin.Sources()) { + t.Errorf("%d plugins, %d sources", len(plugin.Names()), len(plugin.Sources())) } } diff --git a/plugins/apisurface/apisurface.go b/plugins/apisurface/apisurface.go index 66f9114..1894165 100644 --- a/plugins/apisurface/apisurface.go +++ b/plugins/apisurface/apisurface.go @@ -48,20 +48,21 @@ func init() { // Package is one published package. type Package struct { - Name string // on the registry, and the events' api: "openai" + ID string // the source id the events carry: "openai/python-sdk" + Name string // on the registry: "openai" Ecosystem string // "pypi" Module string // the top-level import name: "openai" } // OpenAIPython is the openai package on PyPI. -var OpenAIPython = Package{Name: "openai", Ecosystem: "pypi", Module: "openai"} +var OpenAIPython = Package{ID: "openai/python-sdk", Name: "openai", Ecosystem: "pypi", Module: "openai"} // Plugin reads one package's releases. type Plugin struct { Package Package } -func (p Plugin) Name() string { return p.Package.Name } +func (p Plugin) Name() string { return p.Package.ID } // Run reads the newest release and extracts it against the last one read // (the baseline), or against nothing on a first run: the surface it stores @@ -75,7 +76,7 @@ func (p Plugin) Run(ctx context.Context, env plugin.Env) (plugin.Result, error) return plugin.Result{}, fmt.Errorf("%s: no release listed", p.Package.Name) } v := vs[len(vs)-1] - last, err := env.Baselines.LastSpec(p.Package.Name) + last, err := env.Baselines.LastSpec(p.Package.ID) if err != nil { return plugin.Result{}, fmt.Errorf("loading the last baseline of %s: %w", p.Package.Name, err) } @@ -95,7 +96,7 @@ func (p Plugin) Run(ctx context.Context, env plugin.Env) (plugin.Result, error) if err != nil { return plugin.Result{}, err } - res.Baselines = []plugin.Spec{plugin.Baseline(p.Package.Name, v.ID, v.Ref, to.SourceURL, to.Content, false, env.Now().UTC())} + res.Baselines = []plugin.Spec{plugin.Baseline(p.Package.ID, v.ID, v.Ref, to.SourceURL, to.Content, env.Now().UTC())} return res, nil } @@ -164,7 +165,7 @@ func (p Plugin) Extract(_ context.Context, env plugin.Env, from, to plugin.Snaps return plugin.Result{}, fmt.Errorf("reading the %s %s surface: %w", p.Package.Name, to.Version.ID, err) } now := env.Now().UTC() - var events []event.EventV2 + var events []event.Event var rejected []error for _, c := range Compare(a, b) { if c.Change == "" { @@ -172,7 +173,7 @@ func (p Plugin) Extract(_ context.Context, env plugin.Env, from, to plugin.Snaps continue } e := p.event(c, from, to, a.Artifact, b.Artifact, now) - e.Fingerprint = event.FingerprintV2(e.API, e.Version, e.ChangeType, e.Subject, "") + e.Fingerprint = event.Fingerprint(e.API, e.Version, e.ChangeType, e.Subject, "") if err := e.Validate(); err != nil { rejected = append(rejected, fmt.Errorf("%s %s %s: %w", p.Package.Name, to.Version.ID, c.Symbol, err)) continue @@ -185,7 +186,7 @@ func (p Plugin) Extract(_ context.Context, env plugin.Env, from, to plugin.Snaps var _ plugin.Versioned = Plugin{} // event is one change as a change event. -func (p Plugin) event(c Change, from, to plugin.Snapshot, fromFile, toFile string, now time.Time) event.EventV2 { +func (p Plugin) event(c Change, from, to plugin.Snapshot, fromFile, toFile string, now time.Time) event.Event { pkg := p.Package sym := p.local(c.Symbol) subject := event.Subject{Type: event.SubjectPackageRelease, Ecosystem: pkg.Ecosystem, Package: pkg.Name, Change: c.Change, Symbols: []string{sym}} @@ -207,8 +208,8 @@ func (p Plugin) event(c Change, from, to plugin.Snapshot, fromFile, toFile strin desc = fmt.Sprintf("`%s`'s parameter `%s` has no default in %s %s (it was `%s`): a call that leaves it out raises a TypeError.", sym, c.Parameter, pkg.Name, to.Version.ID, c.OldDefault) hint = fmt.Sprintf("Pass `%s=%s` to `%s` to keep the old behavior.", c.Parameter, c.OldDefault, sym) } - return event.EventV2{ - API: pkg.Name, + return event.Event{ + API: pkg.ID, Version: to.Version.ID, PreviousVersion: from.Version.ID, ChangeType: event.ChangeTypeBreaking, diff --git a/plugins/apisurface/apisurface_test.go b/plugins/apisurface/apisurface_test.go index eb182ba..abfcbe7 100644 --- a/plugins/apisurface/apisurface_test.go +++ b/plugins/apisurface/apisurface_test.go @@ -30,7 +30,7 @@ var saved = kittest.Pages{ } // pair lists the releases, reads 1.1.1 and 1.1.2 and extracts the pair. -func pair(t *testing.T) []event.EventV2 { +func pair(t *testing.T) []event.Event { t.Helper() ctx, env := context.Background(), kittest.Env(t, saved) p := Plugin{Package: OpenAIPython} diff --git a/plugins/apisurface/testdata/golden/openai-1.1.2.json b/plugins/apisurface/testdata/golden/openai-1.1.2.json index 903bdff..6390e70 100644 --- a/plugins/apisurface/testdata/golden/openai-1.1.2.json +++ b/plugins/apisurface/testdata/golden/openai-1.1.2.json @@ -1,8 +1,8 @@ [ { "id": 0, - "fingerprint": "sha256:9e40f3b8a0940e9ffbdd4aca7642c5bfd240930d6ed176767a90b0a44de567b2", - "api": "openai", + "fingerprint": "sha256:7c2703dd5112b040c64fd384b102f560a1205f2f540f4ec31cd8310e6a604902", + "api": "openai/python-sdk", "version": "1.1.2", "previous_version": "1.1.1", "change_type": "breaking", @@ -25,8 +25,8 @@ }, { "id": 0, - "fingerprint": "sha256:a709e97cddd82b737c84fe4ec727bc040aff0ece129f5517f30da8925b3fcdd9", - "api": "openai", + "fingerprint": "sha256:54fc59ce604c0f5bfa1b1f3886d8d79ea37963f05f2fa694ea4d7b68ad720dbd", + "api": "openai/python-sdk", "version": "1.1.2", "previous_version": "1.1.1", "change_type": "breaking", diff --git a/plugins/catalog/catalog.go b/plugins/catalog/catalog.go index 9c257e4..5ef4459 100644 --- a/plugins/catalog/catalog.go +++ b/plugins/catalog/catalog.go @@ -1,7 +1,7 @@ // Package catalog is the source plugin for a provider that publishes its // whole command or endpoint surface as one structured JSON file, one entry -// keyed by name: fetch the newest snapshot, diff it against the last one -// seen (or two given snapshots, to replay a historical change), and report +// keyed by name: read it at a commit, compare it with the one read before, +// and report // every name that disappeared entirely between them. Unlike openapi's typed // spec, an entry here is opaque: no request or response shape to walk, just // whether the name is still there. Redis first: its command surface has no @@ -42,7 +42,7 @@ func init() { // Catalog is one provider's command or endpoint catalog: a single JSON // object, one key per entry, fetched at a git ref. type Catalog struct { - API string // the events' api: "redis" + API string // the source id the events carry: "redis/commands" Ecosystem string // the package_release subject's ecosystem: "redis" Package string // the package_release subject's package: "redis" Repo string // owner/name on GitHub the catalog lives in @@ -54,7 +54,7 @@ type Catalog struct { // release and read by redis.io's own command reference (checked 2026-11-18). // The repo has no tags, so a ref here is a commit SHA, not a release. var Redis = Catalog{ - API: "redis", Ecosystem: "redis", Package: "redis", + API: "redis/commands", Ecosystem: "redis", Package: "redis", Repo: "redis/redis-doc", Path: "commands.json", RefsURL: "https://api.github.com/repos/redis/redis-doc/commits/master", } @@ -129,38 +129,43 @@ func (p Plugin) Run(ctx context.Context, env plugin.Env) (plugin.Result, error) Label: ref, Events: events, Rejected: rejected, - Baselines: []plugin.Spec{plugin.Baseline(c.API, ref, ref, c.URL(ref), newContent, false, now)}, + Baselines: []plugin.Spec{plugin.Baseline(c.API, ref, ref, c.URL(ref), newContent, now)}, }, nil } -// Replay diffs two given snapshots. Both are saved marked as replays, so the -// normal-run baseline never moves; the events are stored like any others. -func (p Plugin) Replay(ctx context.Context, env plugin.Env, from, to string) (plugin.Result, error) { - c := p.Catalog - oldContent, err := env.Get(ctx, c.URL(from)) +// ListVersions is the catalog repo's newest commit: the catalog has no +// releases, so each commit read is a version, and the change into it is +// extracted against the one read before. +func (p Plugin) ListVersions(ctx context.Context, env plugin.Env) ([]plugin.Version, error) { + ref, err := p.latestRef(ctx, env) if err != nil { - return plugin.Result{}, fmt.Errorf("fetching %s: %w", c.URL(from), err) + return nil, err } - newContent, err := env.Get(ctx, c.URL(to)) + return []plugin.Version{{ID: ref, Ref: ref}}, nil +} + +// ReadAt fetches the catalog at v's commit. +func (p Plugin) ReadAt(ctx context.Context, env plugin.Env, v plugin.Version) (plugin.Snapshot, error) { + url := p.Catalog.URL(v.Ref) + body, err := env.Get(ctx, url) if err != nil { - return plugin.Result{}, fmt.Errorf("fetching %s: %w", c.URL(to), err) + return plugin.Snapshot{}, fmt.Errorf("fetching %s: %w", url, err) } - now := env.Now() - events, rejected, err := p.events(oldContent, newContent, from, to, now) + return plugin.Snapshot{Version: v, Content: body, SourceURL: url}, nil +} + +// Extract is an event per command in from's catalog that isn't in to's, +// with previous_version from's commit. A zero from has nothing to compare. +func (p Plugin) Extract(_ context.Context, env plugin.Env, from, to plugin.Snapshot) (plugin.Result, error) { + events, rejected, err := p.events(from.Content, to.Content, from.Version.Ref, to.Version.Ref, env.Now()) if err != nil { return plugin.Result{}, err } - return plugin.Result{ - Label: to, - Events: events, - Rejected: rejected, - Baselines: []plugin.Spec{ - plugin.Baseline(c.API, from, from, c.URL(from), oldContent, true, now), - plugin.Baseline(c.API, to, to, c.URL(to), newContent, true, now), - }, - }, nil + return plugin.Result{Label: to.Version.Ref, Events: events, Rejected: rejected}, nil } +var _ plugin.Versioned = Plugin{} + // latestRef asks GitHub for the catalog repo's newest commit. func (p Plugin) latestRef(ctx context.Context, env plugin.Env) (string, error) { sha, err := github.Head(ctx, env.Get, p.Catalog.RefsURL) @@ -173,7 +178,7 @@ func (p Plugin) latestRef(ctx context.Context, env plugin.Env) (string, error) { // events diffs two parsed snapshots into events. oldContent is empty on a // plugin's first run (no baseline yet): diffing against no snapshot reports // nothing, the same as an unchanged one. -func (p Plugin) events(oldContent, newContent []byte, from, to string, now time.Time) ([]event.EventV2, []error, error) { +func (p Plugin) events(oldContent, newContent []byte, from, to string, now time.Time) ([]event.Event, []error, error) { c := p.Catalog newEntries, err := parse(newContent) if err != nil { @@ -187,14 +192,14 @@ func (p Plugin) events(oldContent, newContent []byte, from, to string, now time. } } - var events []event.EventV2 + var events []event.Event var rejected []error for _, name := range removed(oldEntries, newEntries) { subject := event.Subject{ Type: event.SubjectPackageRelease, Ecosystem: c.Ecosystem, Package: c.Package, Change: event.PackageRemovedSymbol, Symbols: []string{name}, } - e := event.EventV2{ + e := event.Event{ API: c.API, Version: to, PreviousVersion: from, ChangeType: event.ChangeTypeBreaking, Breaking: true, @@ -205,7 +210,7 @@ func (p Plugin) events(oldContent, newContent []byte, from, to string, now time. Confidence: 1.0, DetectedAt: now, } - e.Fingerprint = event.FingerprintV2(e.API, e.Version, e.ChangeType, subject, "") + e.Fingerprint = event.Fingerprint(e.API, e.Version, e.ChangeType, subject, "") if err := e.Validate(); err != nil { rejected = append(rejected, fmt.Errorf("%s: %w", name, err)) continue diff --git a/plugins/catalog/catalog_test.go b/plugins/catalog/catalog_test.go index ad636b2..7d24792 100644 --- a/plugins/catalog/catalog_test.go +++ b/plugins/catalog/catalog_test.go @@ -44,7 +44,7 @@ func TestReplayRecreatesTheRealFunctionCommandRemoval(t *testing.T) { s := kittest.NewMem() e := env(s, fixturePages(), t) - rejected, err := kittest.Replay(ctx, e, s, Plugin{Catalog: Redis}, oldRef, newRef) + rejected, err := kittest.Pair(ctx, e, s, Plugin{Catalog: Redis}, oldRef, newRef) if err != nil || rejected { t.Fatalf("replay: rejected=%v err=%v", rejected, err) } @@ -75,8 +75,8 @@ func TestReplayRecreatesTheRealFunctionCommandRemoval(t *testing.T) { // Acceptance criteria: every event carries source_url and a non-empty // source_excerpt, is marked breaking, and is placed on the real refs. for _, ev := range events { - if ev.API != "redis" || ev.Version != newRef || ev.PreviousVersion != oldRef { - t.Errorf("event %v: api=%s version=%s previous_version=%s, want redis %s from %s", + if ev.API != "redis/commands" || ev.Version != newRef || ev.PreviousVersion != oldRef { + t.Errorf("event %v: api=%s version=%s previous_version=%s, want redis/commands %s from %s", ev.Subject.Symbols, ev.API, ev.Version, ev.PreviousVersion, newRef, oldRef) } if ev.ChangeType != event.ChangeTypeBreaking || !ev.Breaking { @@ -91,7 +91,7 @@ func TestReplayRecreatesTheRealFunctionCommandRemoval(t *testing.T) { } // Replaying the same pair again must not duplicate the events. - if _, err := kittest.Replay(ctx, e, s, Plugin{Catalog: Redis}, oldRef, newRef); err != nil { + if _, err := kittest.Pair(ctx, e, s, Plugin{Catalog: Redis}, oldRef, newRef); err != nil { t.Fatalf("second replay: %v", err) } if again, _ := s.All(); len(again) != len(events) { diff --git a/plugins/changelog/changelog.go b/plugins/changelog/changelog.go index bfbc293..d7bde86 100644 --- a/plugins/changelog/changelog.go +++ b/plugins/changelog/changelog.go @@ -65,7 +65,8 @@ func init() { // read release by release: every version on the package registry, the file at // that release's tag (TagPrefix + version). Pinned (At), it is one release. type File struct { - Package string // the installed name and the events' api: "urllib3" + API string // the source id the events carry: "urllib3/urllib3" + Package string // the installed name: "urllib3" Ecosystem string // where its releases are listed: "pypi" Module string // the import name, stripped from a symbol's front: "urllib3" Repo string // owner/name on GitHub @@ -85,7 +86,7 @@ func (f File) At(release string) File { // v0.86.0: "## [0.86.0] - 2024-11-16", "### Removed", and "Breaking change:" // bullets under "### Changed"), tagged v. var Textual = File{ - Package: "textual", Ecosystem: "pypi", Module: "textual", + API: "textual/textual", Package: "textual", Ecosystem: "pypi", Module: "textual", Repo: "Textualize/textual", TagPrefix: "v", Path: "CHANGELOG.md", } @@ -93,7 +94,7 @@ var Textual = File{ // (2023-04-26)" over "=====", "Removed" and "Deprecated" over "-----"), // tagged . var Urllib3 = File{ - Package: "urllib3", Ecosystem: "pypi", Module: "urllib3", + API: "urllib3/urllib3", Package: "urllib3", Ecosystem: "pypi", Module: "urllib3", Repo: "urllib3/urllib3", Path: "CHANGES.rst", } @@ -178,7 +179,7 @@ func (p Plugin) Name() string { if p.isLog() { return p.Log.API } - return p.File.Package + return p.File.API } // Run reads the pinned release, or the newest one on the registry, and @@ -207,7 +208,7 @@ func (p Plugin) Run(ctx context.Context, env plugin.Env) (plugin.Result, error) if err != nil { return plugin.Result{}, err } - res.Baselines = []plugin.Spec{plugin.Baseline(p.File.Package, v.ID, v.Ref, to.SourceURL, to.Content, false, env.Now().UTC())} + res.Baselines = []plugin.Spec{plugin.Baseline(p.File.API, v.ID, v.Ref, to.SourceURL, to.Content, env.Now().UTC())} return res, nil } @@ -269,7 +270,7 @@ func (p Plugin) Extract(_ context.Context, env plugin.Env, from, to plugin.Snaps return plugin.Result{}, fmt.Errorf("reading %s: %w", f.URL(), err) } now := env.Now().UTC() - var events []event.EventV2 + var events []event.Event var rejected []error for _, fd := range findings { if fd.Dropped != "" { @@ -281,8 +282,8 @@ func (p Plugin) Extract(_ context.Context, env plugin.Env, from, to plugin.Snaps Type: event.SubjectPackageRelease, Ecosystem: f.Ecosystem, Package: f.Package, Change: c.Change, Symbols: c.Symbols, Replacement: c.Replacement, } - e := event.EventV2{ - API: f.Package, + e := event.Event{ + API: f.API, Version: f.Release, PreviousVersion: from.Version.ID, ChangeType: c.ChangeType, @@ -295,7 +296,7 @@ func (p Plugin) Extract(_ context.Context, env plugin.Env, from, to plugin.Snaps Confidence: 1.0, DetectedAt: now, } - e.Fingerprint = event.FingerprintV2(e.API, e.Version, e.ChangeType, subject, "") + e.Fingerprint = event.Fingerprint(e.API, e.Version, e.ChangeType, subject, "") if err := e.Validate(); err != nil { rejected = append(rejected, fmt.Errorf("%s %s %v: %w", f.Package, f.Release, c.Symbols, err)) continue diff --git a/plugins/changelog/json.go b/plugins/changelog/json.go index 421bfff..dd340af 100644 --- a/plugins/changelog/json.go +++ b/plugins/changelog/json.go @@ -35,7 +35,7 @@ import ( // Log is one vendor's changelog file. type Log struct { - API string // the events' api: "mongodb-atlas" + API string // the source id the events carry: "mongodb/atlas-admin-api" Vendor string // for sentences: "MongoDB" Name string // the API, for sentences: "Atlas Administration API" Repo string // owner/name on GitHub @@ -50,7 +50,7 @@ type Log struct { // is built from it). Atlas versions each resource by date (`2023-01-01`), // chosen per request in the Accept header. var MongoDBAtlas = Log{ - API: "mongodb-atlas", Vendor: "MongoDB", Name: "Atlas Administration API", + API: "mongodb/atlas-admin-api", Vendor: "MongoDB", Name: "Atlas Administration API", Repo: "mongodb/openapi", Path: "changelog/changelog.json", } @@ -223,7 +223,7 @@ func (p Plugin) runLog(ctx context.Context, env plugin.Env) (plugin.Result, erro if err != nil { return plugin.Result{}, err } - res.Baselines = []plugin.Spec{plugin.Baseline(l.API, sha, sha, to.SourceURL, to.Content, false, env.Now().UTC())} + res.Baselines = []plugin.Spec{plugin.Baseline(l.API, sha, sha, to.SourceURL, to.Content, env.Now().UTC())} return res, nil } @@ -270,15 +270,15 @@ func (p Plugin) extractLog(env plugin.Env, from, to plugin.Snapshot) (plugin.Res findings = kept } now := env.Now().UTC() - var events []event.EventV2 + var events []event.Event var rejected []error for _, f := range findings { - e := event.EventV2{ + e := event.Event{ API: l.API, Version: f.Version, ChangeType: f.ChangeType, Breaking: f.ChangeType == event.ChangeTypeBreaking, - Subject: event.Subject{Type: event.SubjectAPIOperation, Kind: event.AffectedKindOperation, Side: event.SideRequest, Operation: f.Operation}, + Subject: event.Subject{Type: event.SubjectAPIOperation, Kind: event.KindOperation, Side: event.SideRequest, Operation: f.Operation}, Description: describeLog(l, f), SourceURL: to.SourceURL, SourcePointer: f.Pointer, @@ -286,7 +286,7 @@ func (p Plugin) extractLog(env plugin.Env, from, to plugin.Snapshot) (plugin.Res Confidence: 1.0, DetectedAt: now, } - e.Fingerprint = event.FingerprintV2(e.API, e.Version, e.ChangeType, e.Subject, "") + e.Fingerprint = event.Fingerprint(e.API, e.Version, e.ChangeType, e.Subject, "") if err := e.Validate(); err != nil { rejected = append(rejected, fmt.Errorf("%s %s %s: %w", l.API, f.Operation, f.Version, err)) continue diff --git a/plugins/changelog/testdata/golden/mongodb-atlas.json b/plugins/changelog/testdata/golden/mongodb-atlas.json index 16b42fe..cacc1ea 100644 --- a/plugins/changelog/testdata/golden/mongodb-atlas.json +++ b/plugins/changelog/testdata/golden/mongodb-atlas.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:50ef7eaf307f672feed4318a5eff83b1ca03e59cdf359968942902f1bc678654", - "api": "mongodb-atlas", + "fingerprint": "sha256:cc24f6195c643b2ebaa07b4ede7d4dfe00bdcb0874c1347e01e017af1fc8fb6f", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "deprecation", "breaking": false, @@ -21,8 +21,8 @@ }, { "id": 2, - "fingerprint": "sha256:e89692319125245d7c80793b7eb504058bcbf8f488e236c5fbb5e040548da6cb", - "api": "mongodb-atlas", + "fingerprint": "sha256:58fc100be70cb15a7e2c83d5977433fc552dcbd271eed4bca7ad55026d72e3d8", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "deprecation", "breaking": false, @@ -41,8 +41,8 @@ }, { "id": 3, - "fingerprint": "sha256:dea2f243f988750bb33e958845f0f4a024e4eb38c4b13f1900b98168e3f74b57", - "api": "mongodb-atlas", + "fingerprint": "sha256:f1a7c1dde961ea7c2da23e52e9a789b096755da256c4f07bde16ab26448e7db5", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "deprecation", "breaking": false, @@ -61,8 +61,8 @@ }, { "id": 4, - "fingerprint": "sha256:f4789d649ddc19243976e6eb6444fcc2203092164ec1d3e439971b3c48c5386c", - "api": "mongodb-atlas", + "fingerprint": "sha256:f912840ec1cdfbde49c8958870be43bf49c4c740308434e1176bd3b9a8a8cd0a", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "deprecation", "breaking": false, @@ -81,8 +81,8 @@ }, { "id": 5, - "fingerprint": "sha256:19c4e00f9bd462ee470d63241dcaa7e6f413857fd9201bad8cf608d76afadbcf", - "api": "mongodb-atlas", + "fingerprint": "sha256:d86286f29ec943830ed073221731f182bbc6402413fc976d09384abf2adf3553", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "deprecation", "breaking": false, @@ -101,8 +101,8 @@ }, { "id": 6, - "fingerprint": "sha256:67f702f781d255a453e2d18add555de1dd91ce40b5a1222f4b3f319401145d7b", - "api": "mongodb-atlas", + "fingerprint": "sha256:2bc605298b2197c441f892d8b363b1d4d906a0fe5852c68a62f751f3f95d2ddc", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "deprecation", "breaking": false, @@ -121,8 +121,8 @@ }, { "id": 7, - "fingerprint": "sha256:5ca6cb3cc62d9bbc71e84ac4cd7735d33299f6473e536ef5fbdeea41053a7551", - "api": "mongodb-atlas", + "fingerprint": "sha256:af5b6044d2d4daafeee3bb3cfc171208ef70fb74d226a9c816bccedf5269b6c7", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "deprecation", "breaking": false, @@ -141,8 +141,8 @@ }, { "id": 8, - "fingerprint": "sha256:46899051fe514ee07d164c2979467dfafdea21d65e6dba23cca45b7ff9616626", - "api": "mongodb-atlas", + "fingerprint": "sha256:7f07e58557631d8d00e31a56f0c5ea611fb3a31675049aa344c08f87f93a3906", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "deprecation", "breaking": false, @@ -161,8 +161,8 @@ }, { "id": 9, - "fingerprint": "sha256:46680413445e23986eef34f9db57581aa73e12e0aa63646c327a8b33966c17f3", - "api": "mongodb-atlas", + "fingerprint": "sha256:ef82850143544d5fa34eb2c35dec55de7eea3f859b77bb4ec5a49a63ef251d4d", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "deprecation", "breaking": false, @@ -181,8 +181,8 @@ }, { "id": 10, - "fingerprint": "sha256:a1a0b7b37522ac72a47b7be98e75f77a669d9ee8a6b09006cf55f738efcf1599", - "api": "mongodb-atlas", + "fingerprint": "sha256:c8e80b8e19b699e5a4419b8ad98140959520fbe6f66a1c24672d1793e9457a09", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "deprecation", "breaking": false, @@ -201,8 +201,8 @@ }, { "id": 11, - "fingerprint": "sha256:7f6cd26e2522029635a6ecadd24701f962f47df8f5036c1ba32f0323d84028b8", - "api": "mongodb-atlas", + "fingerprint": "sha256:bfb77e886c515a27e002946c9dfe495a44612c21c33d545acb72f5477af7f53c", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "deprecation", "breaking": false, @@ -221,8 +221,8 @@ }, { "id": 12, - "fingerprint": "sha256:6bb5f654f1469098b227606ea2c16afecf39e23236b0c84a9003f7a98da9e067", - "api": "mongodb-atlas", + "fingerprint": "sha256:8bb4a901d1c83e82e67c4accbdf2ee67e3fe170d29ba289835a9e68e2f5558b3", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "deprecation", "breaking": false, @@ -241,8 +241,8 @@ }, { "id": 13, - "fingerprint": "sha256:619ee5f02d8f470115a668894c73e84afabf0b73712b88719fd034912283cebd", - "api": "mongodb-atlas", + "fingerprint": "sha256:92d94ba56f6811cc4dad18ede386020e893f66ff9ff9b28f6993e4677ea7be8d", + "api": "mongodb/atlas-admin-api", "version": "2023-02-01", "change_type": "deprecation", "breaking": false, @@ -261,8 +261,8 @@ }, { "id": 14, - "fingerprint": "sha256:6d41076ed7a4d69f43173d15235aed71a9bed14a467e6afb2d78fc73c3ae1150", - "api": "mongodb-atlas", + "fingerprint": "sha256:665bf236dcb1319e2cd5c5da8a271bb0d235917d99e7d9384b7730f35cf9b80f", + "api": "mongodb/atlas-admin-api", "version": "2023-02-01", "change_type": "deprecation", "breaking": false, @@ -281,8 +281,8 @@ }, { "id": 15, - "fingerprint": "sha256:e677922ed71b6fa1309859291b22e7fcd83900a4e713e62576760b18e2a37a40", - "api": "mongodb-atlas", + "fingerprint": "sha256:f3fc7367c663e20fd644b6b96befb1cf5d2185dd3cefab1092897f488580cb50", + "api": "mongodb/atlas-admin-api", "version": "2023-02-01", "change_type": "deprecation", "breaking": false, @@ -301,8 +301,8 @@ }, { "id": 16, - "fingerprint": "sha256:3409590c0cb537abe2844ebd3e1a419ac3ed3a867af1aa53a42c5587b026ad9b", - "api": "mongodb-atlas", + "fingerprint": "sha256:ca95618f62b1986840a47ea36d5ff501008d104abb52318a1af6ab1f847d86d8", + "api": "mongodb/atlas-admin-api", "version": "2023-02-01", "change_type": "deprecation", "breaking": false, @@ -321,8 +321,8 @@ }, { "id": 17, - "fingerprint": "sha256:1cf20285e31ba739ba8323ebd0a83338d211cf6085d92a72e52b5d04ed2ab459", - "api": "mongodb-atlas", + "fingerprint": "sha256:9c307d0bb3ce60d32a75da2afa0555d1233500095be5f51e9c440b49b6f0098d", + "api": "mongodb/atlas-admin-api", "version": "2023-11-15", "change_type": "deprecation", "breaking": false, @@ -341,8 +341,8 @@ }, { "id": 18, - "fingerprint": "sha256:fa893cc89e9484c23596401e9c6310933d44cec878600fe13e2cd3593195129c", - "api": "mongodb-atlas", + "fingerprint": "sha256:dcecedf2e09ebd4a3156b58b05d495c5c4074af97cbd044a06cb9deffaa5eaa9", + "api": "mongodb/atlas-admin-api", "version": "2023-11-15", "change_type": "deprecation", "breaking": false, @@ -361,8 +361,8 @@ }, { "id": 19, - "fingerprint": "sha256:dad53552c64ff83dcf3982d94fc35836e193387b19eff06db98d33f2a4a557c8", - "api": "mongodb-atlas", + "fingerprint": "sha256:160f906532581397e3ebddda5b1b7f056509ae3def7884dd6a9ede41a5f493cc", + "api": "mongodb/atlas-admin-api", "version": "2024-05-30", "change_type": "deprecation", "breaking": false, @@ -381,8 +381,8 @@ }, { "id": 20, - "fingerprint": "sha256:4242099b4346f85c168c78d56530b0e1f90c6bc6273294c59f84d91bf7857916", - "api": "mongodb-atlas", + "fingerprint": "sha256:627be9a47ff6458c73002e89125b40400721e03603963ac478905deee028d8d3", + "api": "mongodb/atlas-admin-api", "version": "2024-05-30", "change_type": "deprecation", "breaking": false, @@ -401,8 +401,8 @@ }, { "id": 21, - "fingerprint": "sha256:1afe4f94a3cce7183aef8c1d6e21032f00f7b2ce1131842b646a584f19c942b9", - "api": "mongodb-atlas", + "fingerprint": "sha256:af242c9e3aae3b5ba5489753c4ecc410ce889cf05fe4f1b1c1fe1a840bb25f2d", + "api": "mongodb/atlas-admin-api", "version": "2024-05-30", "change_type": "deprecation", "breaking": false, @@ -421,8 +421,8 @@ }, { "id": 22, - "fingerprint": "sha256:71f43a23b671e9daf1c2f222b2d3c8ea79c03fc2cbc1a5bbcb83db12337d590c", - "api": "mongodb-atlas", + "fingerprint": "sha256:30d873ec4a52dbb90d6d6fa49fc26e4bcb5e1e8e63601e9743737f002344084b", + "api": "mongodb/atlas-admin-api", "version": "2024-05-30", "change_type": "deprecation", "breaking": false, @@ -441,8 +441,8 @@ }, { "id": 23, - "fingerprint": "sha256:cc873b6a1a7aa887528d4855b37aa875e8d0f16eb3bca2b34ec10ae9f6ee357e", - "api": "mongodb-atlas", + "fingerprint": "sha256:ddb7365f8bf1b14590d796042c46bfc9a2e3fc12991561e835bf5bf9ebbd16f5", + "api": "mongodb/atlas-admin-api", "version": "2024-05-30", "change_type": "deprecation", "breaking": false, @@ -461,8 +461,8 @@ }, { "id": 24, - "fingerprint": "sha256:9fa2bc2f6047482a51e348d90f85206697611d410d1c50f5d672876ce842c2b0", - "api": "mongodb-atlas", + "fingerprint": "sha256:51fabed35665b97a15ad2af6ec7f4de6e7f6c8913b075fae8f3d2badd866f80c", + "api": "mongodb/atlas-admin-api", "version": "2024-08-05", "change_type": "deprecation", "breaking": false, @@ -481,8 +481,8 @@ }, { "id": 25, - "fingerprint": "sha256:4c43bffec1a1b6d75d88120ba84d88fe4b15f63af7968317b513476904974fa3", - "api": "mongodb-atlas", + "fingerprint": "sha256:cb70fc3369d62e371c873c7590d8e64a4aae64e2591e645811fe119eb2cc520c", + "api": "mongodb/atlas-admin-api", "version": "2024-08-05", "change_type": "deprecation", "breaking": false, @@ -501,8 +501,8 @@ }, { "id": 26, - "fingerprint": "sha256:32f76147eba78d0d68c2c3000f347dab77f79dfbd058d077d41907a2d3a5b992", - "api": "mongodb-atlas", + "fingerprint": "sha256:e2ce2e1195ccb2dec2f38d3e2aabd126ef5757e9807cdff3aa27a598fbfdd0e5", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -521,8 +521,8 @@ }, { "id": 27, - "fingerprint": "sha256:91ca0b855ef7e21507fb3566e1550ce8fa1546c341b1dcdeb6a0d5a0aa1cd69e", - "api": "mongodb-atlas", + "fingerprint": "sha256:bef9488df24c4837d134696508790c87450785aeb715017483aa4efce11a5920", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -541,8 +541,8 @@ }, { "id": 28, - "fingerprint": "sha256:411f855ffdfab7f911477ce957b11b5aab210836b348f690982dfd61e9146de9", - "api": "mongodb-atlas", + "fingerprint": "sha256:6f26729ebc2b23eb9cfbf54274a08b8a052333c332fd22ba1600353dd4cd5500", + "api": "mongodb/atlas-admin-api", "version": "2025-02-19", "change_type": "deprecation", "breaking": false, @@ -561,8 +561,8 @@ }, { "id": 29, - "fingerprint": "sha256:63de08074aa4fb46afcadde08c2cd4ff080ecf6de5ec38f24b054509f50c271a", - "api": "mongodb-atlas", + "fingerprint": "sha256:5cc945d7dfc328833dab035345f094a55b0056a6c4c9ebb8dee8d1e16212e7e4", + "api": "mongodb/atlas-admin-api", "version": "2025-02-19", "change_type": "deprecation", "breaking": false, @@ -581,8 +581,8 @@ }, { "id": 30, - "fingerprint": "sha256:44a13d91fbbb011d09ff9987a3209d4b20719ebf1647560a10a268d24ea1a0a8", - "api": "mongodb-atlas", + "fingerprint": "sha256:33e575770ae4ee93abc83c3297a204b9fac76804f78b5afdb9445087cc5a7ebc", + "api": "mongodb/atlas-admin-api", "version": "2025-02-19", "change_type": "deprecation", "breaking": false, @@ -601,8 +601,8 @@ }, { "id": 31, - "fingerprint": "sha256:cc8867400b2014bb76a4eb2ee3c6022ca905b4f12bf861995797088525a8dce4", - "api": "mongodb-atlas", + "fingerprint": "sha256:8de6ab83507db7269db3a639255a2068c387e9785875b2c21d1e7d995be7c482", + "api": "mongodb/atlas-admin-api", "version": "2025-02-19", "change_type": "deprecation", "breaking": false, @@ -621,8 +621,8 @@ }, { "id": 32, - "fingerprint": "sha256:0ab238669bee716ea8d4cec64ef439f6581792bb7bd36f52b2acf543f61d99d1", - "api": "mongodb-atlas", + "fingerprint": "sha256:542ae91c8f1ad44bf462d703f155afbaa85908ac86c09a6d4a4c93b756144e98", + "api": "mongodb/atlas-admin-api", "version": "2025-02-19", "change_type": "deprecation", "breaking": false, @@ -641,8 +641,8 @@ }, { "id": 33, - "fingerprint": "sha256:e31a4aed0ee30ac65ea435e9d158616cb780ddec4456000b7a011631c85b72a8", - "api": "mongodb-atlas", + "fingerprint": "sha256:d2b323f2d8dd032dd30e1646e666563a89226e1a0078c532e5139a348eaeed13", + "api": "mongodb/atlas-admin-api", "version": "2025-02-19", "change_type": "deprecation", "breaking": false, @@ -661,8 +661,8 @@ }, { "id": 34, - "fingerprint": "sha256:dd55ba070d997c95d749cbf99de28482abf1523af6d13941f291ecec8e3e542f", - "api": "mongodb-atlas", + "fingerprint": "sha256:5f6e8e3f099b05d54e52927c9c468842df69607f7a28c3fa86e3f1d0fdf8b86a", + "api": "mongodb/atlas-admin-api", "version": "2025-02-19", "change_type": "deprecation", "breaking": false, @@ -681,8 +681,8 @@ }, { "id": 35, - "fingerprint": "sha256:42879593863a7dc1aedfc565738307e0ac43d6b9df1a25c1ff1ae75b8b069db4", - "api": "mongodb-atlas", + "fingerprint": "sha256:690d31fcafd5209816ad6c16c0ed9199c7599bdba84872bdfa5b6b126238d985", + "api": "mongodb/atlas-admin-api", "version": "2025-02-19", "change_type": "deprecation", "breaking": false, @@ -701,8 +701,8 @@ }, { "id": 36, - "fingerprint": "sha256:5c39826bcf8a1e7b89d02e7184393a051ab979a694b886a8e509853c5fa361f5", - "api": "mongodb-atlas", + "fingerprint": "sha256:d146c472539b4b5494c7f9749a708129bad45aa22ebe8a966e2061f2d68a4c06", + "api": "mongodb/atlas-admin-api", "version": "2025-02-19", "change_type": "deprecation", "breaking": false, @@ -721,8 +721,8 @@ }, { "id": 37, - "fingerprint": "sha256:f56222e59c33af0df85f93982e17731a352995c3eef36a9ac9fc2020f7184de0", - "api": "mongodb-atlas", + "fingerprint": "sha256:9c3c5c4e3f219e8954c0f98003c889eb5b0ee10ddfa858a3350736b48e2a263e", + "api": "mongodb/atlas-admin-api", "version": "2025-02-19", "change_type": "deprecation", "breaking": false, @@ -741,8 +741,8 @@ }, { "id": 38, - "fingerprint": "sha256:e9189cd3bdbc215acb1076908c37f3d5f6433d7237edd71092e66c06de5c7e98", - "api": "mongodb-atlas", + "fingerprint": "sha256:58a98f24cdcd722bad12234a6e5d3d013f63f31b1f121670e93801e2a27713c0", + "api": "mongodb/atlas-admin-api", "version": "2025-02-19", "change_type": "deprecation", "breaking": false, @@ -761,8 +761,8 @@ }, { "id": 39, - "fingerprint": "sha256:7b5bbba472d7e1eda4277c6bdb501c46089e2a1d6643e455bea78658485db85e", - "api": "mongodb-atlas", + "fingerprint": "sha256:329a4a061813ba41a8e5e2ce063df7ce6542b48922730c70778e181a287ad576", + "api": "mongodb/atlas-admin-api", "version": "2025-02-19", "change_type": "deprecation", "breaking": false, @@ -781,8 +781,8 @@ }, { "id": 40, - "fingerprint": "sha256:ec397066f10e29a807ff5482499a1e0bfba612c006569950f6a65190c5d9d57f", - "api": "mongodb-atlas", + "fingerprint": "sha256:e5c8117858980a087db6a750044cc9be9ac1d70e6fa2921191d9affd006bb891", + "api": "mongodb/atlas-admin-api", "version": "2025-02-19", "change_type": "deprecation", "breaking": false, @@ -801,8 +801,8 @@ }, { "id": 41, - "fingerprint": "sha256:6f45d005e7a76d4125801aa194648161a5202993730527cce3d110f4a4f13190", - "api": "mongodb-atlas", + "fingerprint": "sha256:366c39d16e92feed3c2ad2eb125b18d547062da23306e4aeaa96c12446f723f3", + "api": "mongodb/atlas-admin-api", "version": "2025-02-19", "change_type": "deprecation", "breaking": false, @@ -821,8 +821,8 @@ }, { "id": 42, - "fingerprint": "sha256:a2d2f80b7f05c7247a8588a1c44f4b8d62e976691763f49f74d2ecf43e9e56d3", - "api": "mongodb-atlas", + "fingerprint": "sha256:4890187b0f4c5115a06d1b522f78d9c007ac952e2885a00a8096e3ea6b8ea8c6", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -841,8 +841,8 @@ }, { "id": 43, - "fingerprint": "sha256:6bbee9940ba8a7236704d2444c05feed0457a272bcedf08cf501f6191bd7fdc1", - "api": "mongodb-atlas", + "fingerprint": "sha256:f8dd816c9f01dc6dbe5812a32baf1ee83206fe4d4d1aed161d89ebde4ac146d8", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -861,8 +861,8 @@ }, { "id": 44, - "fingerprint": "sha256:63cb4f92c961bab0d93b68e763eaee78b4d88ed6a021a1695dac64e55921c68a", - "api": "mongodb-atlas", + "fingerprint": "sha256:63208e5db910ade6c6639860a329dcab961adf38accb6e17b11d4a0a2dca688c", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -881,8 +881,8 @@ }, { "id": 45, - "fingerprint": "sha256:beda0e8e02b2d2d29d40d535701112cbd3ffda08bd23d5ddf58901fda579571f", - "api": "mongodb-atlas", + "fingerprint": "sha256:9ab1025568f8c14c44bc5b398eb311331d92eda892182eaf7317ef692a3a1415", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -901,8 +901,8 @@ }, { "id": 46, - "fingerprint": "sha256:c559849c75e65a4883544df8d9d1af688d5f91b69657bcc5a78f54e6d0494207", - "api": "mongodb-atlas", + "fingerprint": "sha256:de768eabbd9ddc3f8f7137fbd7e0927f777a18862b48f438c2e94706bcb37b9f", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -921,8 +921,8 @@ }, { "id": 47, - "fingerprint": "sha256:0d8788bcd5ed94aa5c76deeb205ca5adf0e4b2012b74d7f79b3c5620eb5d683d", - "api": "mongodb-atlas", + "fingerprint": "sha256:e7e53fdccbfd094a9c4a8bb9cddfcfe2fc09b668ad0ec23db1e48419018c1f64", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -941,8 +941,8 @@ }, { "id": 48, - "fingerprint": "sha256:93c4af0d3a4bc4c2b94dd3013520cfcfb31278880f15bd0dc6f7b56bdad1d71d", - "api": "mongodb-atlas", + "fingerprint": "sha256:f35f36f036476ee5ac4ddd620455bf07485f1543d37ade3401927505ef3d4a81", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -961,8 +961,8 @@ }, { "id": 49, - "fingerprint": "sha256:54ca7abca1b50f035126b10eb340a7c164ac7de25dd3ce3fa337d3bf42e484d0", - "api": "mongodb-atlas", + "fingerprint": "sha256:78e8e41965696a2ee9a654ec04b8e0aba0da1001908d02f4436497f9a31cbd77", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -981,8 +981,8 @@ }, { "id": 50, - "fingerprint": "sha256:c3ac92ed105577633d90a0e5f5f191a883930d00946c1ad5e6fd6e6e5e17bc19", - "api": "mongodb-atlas", + "fingerprint": "sha256:fdb48987835b96b82d519cf71db83020ea0e356631dcf3fca44e574d700872d2", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1001,8 +1001,8 @@ }, { "id": 51, - "fingerprint": "sha256:726c64e89a6b36fb0500512112a41f779be225b5f6e9d0250c1efe5b4f46d849", - "api": "mongodb-atlas", + "fingerprint": "sha256:6cf42e038f9a85ce22f032648a2ef29433d2dad4a9ac64c76810374e87729d47", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1021,8 +1021,8 @@ }, { "id": 52, - "fingerprint": "sha256:15660fe03839d3b8e5284cb48710d65f8014d04a681abc5c15ee0e4d624cf205", - "api": "mongodb-atlas", + "fingerprint": "sha256:7adb19759eded477fd14b56d08342d1fc625237d32d241f2aa53b34b04eaaa59", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1041,8 +1041,8 @@ }, { "id": 53, - "fingerprint": "sha256:33345023b57650ffa23fed8a9152bd0b90ba5b254a43456c0815c93f6304e660", - "api": "mongodb-atlas", + "fingerprint": "sha256:5477185bf15848e9d350630af08a953686c5c0ce5bc723f70aca7b51c3322820", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1061,8 +1061,8 @@ }, { "id": 54, - "fingerprint": "sha256:1ba28c2c601a54d4af8660ed53a0ba558c89b8d7efc1b8f03c5e2dec9fd6e14c", - "api": "mongodb-atlas", + "fingerprint": "sha256:4e17ab6c53866e464715eab44c347d868a8edc504310292a57887c5f522774a0", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1081,8 +1081,8 @@ }, { "id": 55, - "fingerprint": "sha256:3cd0c0f5938f723a8577bde110e95a8792ffbc84efbc1db35e1b178ee8efaf47", - "api": "mongodb-atlas", + "fingerprint": "sha256:3ecfbb5e27cafcf1d7d2d420151284423f0ab29286866952e555fe2f440b3afb", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1101,8 +1101,8 @@ }, { "id": 56, - "fingerprint": "sha256:6957a0e099d2ff3dd5c2262774cc61c976bf598d7d3cffccb12411f6fe177494", - "api": "mongodb-atlas", + "fingerprint": "sha256:c18980b3f5677145215991caf64657f8c60728bceb9bb521f0456e7411a5288e", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1121,8 +1121,8 @@ }, { "id": 57, - "fingerprint": "sha256:d0eaa7a2ed37c2ae73ca0de17b57d62398bded0891051b77d53529ffe121f0ca", - "api": "mongodb-atlas", + "fingerprint": "sha256:bb1c6412e90a6fd06acfa4ea522059f8cc35c05d0657b1ec9c9ba18d6a855394", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1141,8 +1141,8 @@ }, { "id": 58, - "fingerprint": "sha256:f5b2df23e481440adefc6c3424ec6e6a0ecc85ef0a6b95399ba8fdb4567deeb5", - "api": "mongodb-atlas", + "fingerprint": "sha256:75b2abc3ffbf51bbd3054fc0eff45f6e634c79714829d3143284ce879f910a29", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1161,8 +1161,8 @@ }, { "id": 59, - "fingerprint": "sha256:1cf6ef93cfab02876c2b6e5d99524375dd7d9573cfe603b263f7a7a6641c3bf0", - "api": "mongodb-atlas", + "fingerprint": "sha256:d4b564c377109df103774c094235e12c57a91aa3c175f937df4cebf0b85e8c7d", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1181,8 +1181,8 @@ }, { "id": 60, - "fingerprint": "sha256:ed98366a3075ac9faa6e9031bb45e5a70ec9e2873d3b46af4a367b134e8dee6b", - "api": "mongodb-atlas", + "fingerprint": "sha256:85da70f97ee83f2b7e20f558827e85c0ae5495c9ed2d0d5f29f660149f3a0c6d", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1201,8 +1201,8 @@ }, { "id": 61, - "fingerprint": "sha256:1c05da02feae11760a790f58cbd37ad6e36825c671a962f8ea6ba8c1117c65e8", - "api": "mongodb-atlas", + "fingerprint": "sha256:f5a4afc82f69d52e2d338ab66ab99d992d6dca427c8e01a4233816c36395e559", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1221,8 +1221,8 @@ }, { "id": 62, - "fingerprint": "sha256:3c5493c5b2e8445c3ad9358b8b5572847ccdaa64674daf36eab253fddb597b4c", - "api": "mongodb-atlas", + "fingerprint": "sha256:8c76d61398f0274d7d124ba7317cefa454002ad52f876e50ce7125142f779411", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1241,8 +1241,8 @@ }, { "id": 63, - "fingerprint": "sha256:93700769859f8dc5099263338888560948f31e966f2c5128e1b6716e388e519f", - "api": "mongodb-atlas", + "fingerprint": "sha256:3c9ef94fb769309eb53458f755b3bc93dff3d65e24c295ab41dfbc45721e66fd", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1261,8 +1261,8 @@ }, { "id": 64, - "fingerprint": "sha256:7e34764073a7756ef2a208cc8794400db225889028d74e2503bbb4c1e42f0d8b", - "api": "mongodb-atlas", + "fingerprint": "sha256:4905693ad5f2aff385bffea0f61718029280874bcd59fe50a3b592a018ca205f", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1281,8 +1281,8 @@ }, { "id": 65, - "fingerprint": "sha256:6a81be0741702e412860c93199c4bba18b3f1672362e3398095587ed29e33608", - "api": "mongodb-atlas", + "fingerprint": "sha256:6f9dc9d86fa2003c7a2f1c196f6dc09f082ace53d395808a3d850d4a71359377", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1301,8 +1301,8 @@ }, { "id": 66, - "fingerprint": "sha256:f92a56db838792d8369658259baa021b0ffe4d7b2ffd6661dff4c1d310244d8e", - "api": "mongodb-atlas", + "fingerprint": "sha256:3c3975b9a70621c359747fa9c8597c3f1456108a8382de5f95e3852fd6c8063a", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1321,8 +1321,8 @@ }, { "id": 67, - "fingerprint": "sha256:5307201604174c3d36f1a5ea3b3390273295382d16f3f183f932924fcf81969e", - "api": "mongodb-atlas", + "fingerprint": "sha256:7ef39f4601e0bce6744f057c9b9e4c34bc8d07b10f6f8fe6a1ecce0a2cbccb30", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1341,8 +1341,8 @@ }, { "id": 68, - "fingerprint": "sha256:0568f4a2ede88a3227fc1660d4dd5ee04e44995fa6e119283d9f2495965d5da0", - "api": "mongodb-atlas", + "fingerprint": "sha256:82a31b85f9ab9bc72917add466d2777b231db5be1e432c24faaae68f4446885e", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1361,8 +1361,8 @@ }, { "id": 69, - "fingerprint": "sha256:9e9664ff4538b4ed4208a0e50bf83361e90c7f7f9135fccdcfe0988341df215a", - "api": "mongodb-atlas", + "fingerprint": "sha256:ea55329b1a7e5b44dbd7497720a0ca34bbc3d54a72ebd3dbeb0620db50fc18b2", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1381,8 +1381,8 @@ }, { "id": 70, - "fingerprint": "sha256:0df0d4a2b82712ff2cd52af1c28a2945a5759496200bca855bf7a435f792c108", - "api": "mongodb-atlas", + "fingerprint": "sha256:faaad8344369d497fbc754cdbbcfedc0261b525476d232cefab22d14e8b93229", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1401,8 +1401,8 @@ }, { "id": 71, - "fingerprint": "sha256:1060a1305d0217033202e87fea7961651bb6525430537b4df13e1aea79aab12f", - "api": "mongodb-atlas", + "fingerprint": "sha256:9b50bf722ec1eae087c5f8c15eead886c6d744b0a0b1285ca8270528678c0fb1", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1421,8 +1421,8 @@ }, { "id": 72, - "fingerprint": "sha256:f2a4460f5cbb72fe9f5d5f075caf02f45dadf9f6a1d7cfd5c872f38061ff41f0", - "api": "mongodb-atlas", + "fingerprint": "sha256:afd8e5317d1698efecca262b0bba602ef658e6178cec2045f47f2bd906c0aa79", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1441,8 +1441,8 @@ }, { "id": 73, - "fingerprint": "sha256:1fb2c016f4f1eaac2a9ef9f73ba51def2a0f7c59c2ff4d8782938e73fd3e9476", - "api": "mongodb-atlas", + "fingerprint": "sha256:297eff6dc3b5ec919ddd92f130c1059a75af839a5275f465f5f03d65d64bc3e0", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1461,8 +1461,8 @@ }, { "id": 74, - "fingerprint": "sha256:b2a3a650e62f542192bb958288825b4919d8f1a3e0951a99e198ceaff3427cd3", - "api": "mongodb-atlas", + "fingerprint": "sha256:771dabda44befcc4292720b7492b668e55a0851ca50a9ca65e64422caec4f975", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1481,8 +1481,8 @@ }, { "id": 75, - "fingerprint": "sha256:046c27b9778b7fa8e0573fbf89730f915e74d6173b8ef61e6b67e7a213e03f68", - "api": "mongodb-atlas", + "fingerprint": "sha256:3f3a9dd94fb934fcd26949ca865abfc990630cd24db5cb40623a78ba7d516ef6", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1501,8 +1501,8 @@ }, { "id": 76, - "fingerprint": "sha256:e43bb00876edede8dd1d2837f347e49a222fb4567189638686dd0b30689b8f0c", - "api": "mongodb-atlas", + "fingerprint": "sha256:d131e731e86b2fbe4b3e546d785602d6f65422ebfaed33195c9bae954a094e09", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1521,8 +1521,8 @@ }, { "id": 77, - "fingerprint": "sha256:72a6f60e65e9cd394ee7d73f80476d39f5183d827073b5df2987842906490bfb", - "api": "mongodb-atlas", + "fingerprint": "sha256:a78eea7be07575a3bb36c5526348ab752fee07176bae200dce40fa316fdd08dc", + "api": "mongodb/atlas-admin-api", "version": "2023-01-01", "change_type": "breaking", "breaking": true, @@ -1541,8 +1541,8 @@ }, { "id": 78, - "fingerprint": "sha256:a75e1b8df2609ec96a117c6b652c54558169c6f8034077e975c61d5daa63e23f", - "api": "mongodb-atlas", + "fingerprint": "sha256:16c25ef30e3ca196af5f94eb2a15c327b7408a059e08647eb3952c0c260a5750", + "api": "mongodb/atlas-admin-api", "version": "2025-03-12", "change_type": "deprecation", "breaking": false, @@ -1561,8 +1561,8 @@ }, { "id": 79, - "fingerprint": "sha256:ca9f6b16fbf65ba9dc544dad643af4216bdb3b042a52bca3cab7082e094c8568", - "api": "mongodb-atlas", + "fingerprint": "sha256:2bb72b9a509e7e1c82c80f7c19d34d5840d0dff7b9d2db6283729f52c111c2eb", + "api": "mongodb/atlas-admin-api", "version": "2025-03-12", "change_type": "deprecation", "breaking": false, @@ -1581,8 +1581,8 @@ }, { "id": 80, - "fingerprint": "sha256:d13a8cfe17a4970d9465f4add7f7e50bc854c16884c4650cbe16cb6275575c1b", - "api": "mongodb-atlas", + "fingerprint": "sha256:3d8712c8fd430ebc1c2ca68ce8f2db339d7b5521eeecf35ebfccfe5abdb009c4", + "api": "mongodb/atlas-admin-api", "version": "2025-03-12", "change_type": "deprecation", "breaking": false, @@ -1601,8 +1601,8 @@ }, { "id": 81, - "fingerprint": "sha256:3fad7a4fa2890912db0292412ae49168dae5305846eb2628fc251bd521165c10", - "api": "mongodb-atlas", + "fingerprint": "sha256:b1da7820ea9b85583c0270feae07d446556fb0468da2b61b1dd666f9d0b63f9d", + "api": "mongodb/atlas-admin-api", "version": "2025-03-12", "change_type": "deprecation", "breaking": false, diff --git a/plugins/changelog/testdata/golden/textual-0.86.0.json b/plugins/changelog/testdata/golden/textual-0.86.0.json index 39aa147..2beb129 100644 --- a/plugins/changelog/testdata/golden/textual-0.86.0.json +++ b/plugins/changelog/testdata/golden/textual-0.86.0.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:24d9bb42e9abe2644dbb30433702c9d94f1598d7143ad708c2fe09568f9437c0", - "api": "textual", + "fingerprint": "sha256:fac4cb01fbe4eb33b37f1ec953ac0abfe97c3444aaa22cdbe9118fb6f4b56e48", + "api": "textual/textual", "version": "0.86.0", "change_type": "breaking", "breaking": true, @@ -24,8 +24,8 @@ }, { "id": 2, - "fingerprint": "sha256:852863d8d05a5753b2d64b4b0dc3717fce11f753727c586cd18eae7f7059dfc9", - "api": "textual", + "fingerprint": "sha256:6a0ba08e00b5d4d4f349a526a43ddef1bb84fe2bad9ef83111074fc2a690723c", + "api": "textual/textual", "version": "0.86.0", "change_type": "breaking", "breaking": true, diff --git a/plugins/changelog/testdata/golden/urllib3-2.0.0.json b/plugins/changelog/testdata/golden/urllib3-2.0.0.json index 8e790dc..019ee37 100644 --- a/plugins/changelog/testdata/golden/urllib3-2.0.0.json +++ b/plugins/changelog/testdata/golden/urllib3-2.0.0.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:eae9f46e65df370e9a389913f8b726cb59479f97e0f1a0379ece1a1ac02ee084", - "api": "urllib3", + "fingerprint": "sha256:565fb74f16769a316da5d73cfb0c28c3aaa71b380cc6ac892e3c6a1b3532c4f9", + "api": "urllib3/urllib3", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -24,8 +24,8 @@ }, { "id": 2, - "fingerprint": "sha256:4b651d9f82fa23c1f044e54df1f3f2201ed75f95e88906229250ff101f40d4de", - "api": "urllib3", + "fingerprint": "sha256:e1c8e0509a8217a6f9a8e5ed8966f1ea13f1c713068e3065879b3e4ad2841e4c", + "api": "urllib3/urllib3", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -47,8 +47,8 @@ }, { "id": 3, - "fingerprint": "sha256:076ecf01a372ed8249425c78f9567484ba6bb2b93b014920b88ab993af3428a7", - "api": "urllib3", + "fingerprint": "sha256:2bd2e3969f9bf6485261b2fce984053fb86f92f8da9c7286574067e4aff75779", + "api": "urllib3/urllib3", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -70,8 +70,8 @@ }, { "id": 4, - "fingerprint": "sha256:044a3e14ed78e58031de6193746551f0855f3e7d2301ea245bec5b912f98c5bb", - "api": "urllib3", + "fingerprint": "sha256:a70d74d5ec403834ee6b3983da713930c891e9c9e5a2c6b2ac9ffcd10bd1af68", + "api": "urllib3/urllib3", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -93,8 +93,8 @@ }, { "id": 5, - "fingerprint": "sha256:81faaf5c8d89b30236258585ff6e5cfb0f200aa6d0cf68d7c471efda7c4edf4e", - "api": "urllib3", + "fingerprint": "sha256:7606c6922d7e3efda6589fc8266028b28ac7a74710c58fdc37358398855ac98c", + "api": "urllib3/urllib3", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -116,8 +116,8 @@ }, { "id": 6, - "fingerprint": "sha256:ce792af7dd7bc3ed3318e89507e60f495a431a8e840d30763a706d48d7238dc3", - "api": "urllib3", + "fingerprint": "sha256:8af004c9a0ba8e72258d2f43ab47b92a007468f6aee662b332afdef3370e5b1f", + "api": "urllib3/urllib3", "version": "2.0.0", "change_type": "deprecation", "breaking": false, @@ -140,8 +140,8 @@ }, { "id": 7, - "fingerprint": "sha256:30d4426399a9705181de125e34e186ef1aef9bcd9f12f6212513bb371a8cd979", - "api": "urllib3", + "fingerprint": "sha256:bbef62c5f4f8c4a73497468084c88085703613cf84ca801fc166f660970dd802", + "api": "urllib3/urllib3", "version": "2.0.0", "change_type": "deprecation", "breaking": false, @@ -163,8 +163,8 @@ }, { "id": 8, - "fingerprint": "sha256:aa634fb973e53235a99b7c8e1aaba98b3d11efcd404e1c87a7a43db0310653f2", - "api": "urllib3", + "fingerprint": "sha256:286dce48e3ed461fe14bb2350c560709459821ffa331e7eea09922ae59db1491", + "api": "urllib3/urllib3", "version": "2.0.0", "change_type": "deprecation", "breaking": false, @@ -186,8 +186,8 @@ }, { "id": 9, - "fingerprint": "sha256:862dd1626f30afb034581ba6d00d7c02b262e9f0bf50e49afd4d8d8e132a12c0", - "api": "urllib3", + "fingerprint": "sha256:d85bf269a9bc3ef4e5282d3fb165481b04d7206e75bbd5f655c11ab5f1ad69fa", + "api": "urllib3/urllib3", "version": "2.0.0", "change_type": "deprecation", "breaking": false, @@ -209,8 +209,8 @@ }, { "id": 10, - "fingerprint": "sha256:29623796f12a6dfdda28b88b2bf4fc020c8f14955a132bf890bb65c02b440ff8", - "api": "urllib3", + "fingerprint": "sha256:deaa904363334a867a2a212042a73358699122b789858feb014268773d8a7979", + "api": "urllib3/urllib3", "version": "2.0.0", "change_type": "deprecation", "breaking": false, @@ -234,8 +234,8 @@ }, { "id": 11, - "fingerprint": "sha256:68e644ae2a7f6386b541a7a5faaae32c2b4897d63154b18c3d0fe41b1ce85222", - "api": "urllib3", + "fingerprint": "sha256:90ab9071df0b3a7b40197842b4a9966eb64e099dfb474d3c231dc11da00a7a7a", + "api": "urllib3/urllib3", "version": "2.0.0", "change_type": "deprecation", "breaking": false, @@ -257,8 +257,8 @@ }, { "id": 12, - "fingerprint": "sha256:e933598726e75efd4be2f3c08639f52648119833b6f4846f452e4138061c534b", - "api": "urllib3", + "fingerprint": "sha256:84d7a90515e16d4ef2b7af2b15ec076e8b165c1201cef525d7fbdf5a55f1777d", + "api": "urllib3/urllib3", "version": "2.0.0", "change_type": "deprecation", "breaking": false, diff --git a/plugins/migrationguide/members/members.go b/plugins/migrationguide/members/members.go index ddd25f3..7344699 100644 --- a/plugins/migrationguide/members/members.go +++ b/plugins/migrationguide/members/members.go @@ -36,7 +36,8 @@ import ( // Guide is one package's guide to one release. type Guide struct { - Package string // the PyPI name and the events' api: "numpy" + API string // the source id the events carry: "numpy/numpy" + Package string // the PyPI name: "numpy" Module string // how the guide writes the module in a replacement: "np" Release string // "2.0.0" Repo string // owner/name on GitHub @@ -139,6 +140,7 @@ func (g Guide) header() string { // NumPy2 is NumPy's 2.0 migration guide, "Main namespace" table. var NumPy2 = Guide{ + API: "numpy/numpy", Package: "numpy", Module: "np", Release: "2.0.0", @@ -240,8 +242,8 @@ func parseRST(page []byte, g Guide) ([]Removal, error) { return out, nil } -// Slug is the events' api and the source's old slug: the PyPI name. -func (g Guide) Slug() string { return g.Package } +// Slug is the source id the events carry: "numpy/numpy". +func (g Guide) Slug() string { return g.API } // Current is the release the guide documents: what a plain run reads. func (g Guide) Current(context.Context, plugin.Env) (plugin.Version, error) { @@ -272,10 +274,10 @@ func (g Guide) GuideURL(v plugin.Version) string { // Read is an event per removed member in the guide, with previous_version // from's release. -func (g Guide) Read(page []byte, from, _ plugin.Version, now time.Time) (_ []event.ChangeEvent, events []event.EventV2, rejected []error, err error) { +func (g Guide) Read(page []byte, from, _ plugin.Version, now time.Time) (events []event.Event, rejected []error, err error) { removals, err := Parse(page, g) if err != nil { - return nil, nil, nil, err + return nil, nil, err } for _, r := range removals { if r.Dropped != "" { @@ -293,8 +295,8 @@ func (g Guide) Read(page []byte, from, _ plugin.Version, now time.Time) (_ []eve if r.Replacement != "" && !g.NewReplacements && (g.DropIns == nil || slices.Contains(g.DropIns, r.Member)) { subject.Change, subject.Replacement = event.PackageRenamedSymbol, r.Replacement } - e := event.EventV2{ - API: g.Package, + e := event.Event{ + API: g.API, PreviousVersion: from.ID, Version: g.Release, ChangeType: event.ChangeTypeBreaking, @@ -307,14 +309,14 @@ func (g Guide) Read(page []byte, from, _ plugin.Version, now time.Time) (_ []eve Confidence: 1.0, DetectedAt: now, } - e.Fingerprint = event.FingerprintV2(e.API, e.Version, e.ChangeType, subject, "") + e.Fingerprint = event.Fingerprint(e.API, e.Version, e.ChangeType, subject, "") if err := e.Validate(); err != nil { rejected = append(rejected, fmt.Errorf("%s %s: %w", g.Package, r.Member, err)) continue } events = append(events, e) } - return nil, events, rejected, nil + return events, rejected, nil } // absoluteLinks prefixes LinkBase to every Markdown link target in s that diff --git a/plugins/migrationguide/members/members_test.go b/plugins/migrationguide/members/members_test.go index 2cd1247..c413c77 100644 --- a/plugins/migrationguide/members/members_test.go +++ b/plugins/migrationguide/members/members_test.go @@ -78,14 +78,14 @@ func TestTheGuideStoresOneEventPerMemberAndARerunNothing(t *testing.T) { if len(events) != 56 { t.Fatalf("%d events, want 56", len(events)) } - var float *event.EventV2 + var float *event.Event for i := range events { if events[i].Subject.Symbols[0] == "float_" { float = &events[i] } } if float == nil || float.Subject.Change != event.PackageRenamedSymbol || float.Subject.Replacement != "float64" || - float.API != "numpy" || float.Version != "2.0.0" || !strings.Contains(float.SourceExcerpt, "float\\_") { + float.API != "numpy/numpy" || float.Version != "2.0.0" || !strings.Contains(float.SourceExcerpt, "float\\_") { t.Errorf("float_: %+v", float) } } diff --git a/plugins/migrationguide/members/newrelic.go b/plugins/migrationguide/members/newrelic.go index 7a3baf0..a4bc4fb 100644 --- a/plugins/migrationguide/members/newrelic.go +++ b/plugins/migrationguide/members/newrelic.go @@ -62,6 +62,7 @@ package members // Setting |, lists configuration settings (newrelic.ini keys), not members // of the package: only the section's first table is read, so it never is. var NewRelic11 = Guide{ + API: "newrelic/python-agent", Package: "newrelic", Module: "newrelic", Release: "11.0.0", diff --git a/plugins/migrationguide/members/newrelic_test.go b/plugins/migrationguide/members/newrelic_test.go index 9115acb..bf00468 100644 --- a/plugins/migrationguide/members/newrelic_test.go +++ b/plugins/migrationguide/members/newrelic_test.go @@ -42,7 +42,7 @@ func TestNewRelicEachRowOfTheTable(t *testing.T) { if len(e.Subject.Symbols) != 1 { t.Fatalf("%v: one symbol per event", e.Subject.Symbols) } - if e.API != "newrelic" || e.Version != "11.0.0" || e.Subject.Ecosystem != "pypi" || e.Subject.Package != "newrelic" || + if e.API != "newrelic/python-agent" || e.Version != "11.0.0" || e.Subject.Ecosystem != "pypi" || e.Subject.Package != "newrelic" || e.ChangeType != event.ChangeTypeBreaking || !strings.HasPrefix(e.SourceExcerpt, "Removed features\n | Legacy API ") || !strings.HasSuffix(e.MigrationHint, "(newrelic's release notes for 11.0.0)") { t.Errorf("%+v", e) @@ -190,7 +190,7 @@ func TestDropInsLimitsRenames(t *testing.T) { "| `old_a` | [`new_a`](/a) |", "| `old_b` | `new_b` |", }, "\n") - g := Guide{Package: "acme", Module: "acme", Release: "2.0.0", Repo: "acme/acme", Path: "MIGRATION.md", + g := Guide{API: "acme/sdk", Package: "acme", Module: "acme", Release: "2.0.0", Repo: "acme/acme", Path: "MIGRATION.md", Section: "Removed", Format: FormatMarkdown, Header: "Removed", Paths: map[string]string{"old_a": "mod.old_a", "new_a": "mod.new_a"}} run := func(g Guide) map[string]string { @@ -234,7 +234,7 @@ func readNames(t *testing.T, page string, g Guide) []string { } // newrelicIngest runs the plugin over the saved excerpt. -func newrelicIngest(t *testing.T) []event.EventV2 { +func newrelicIngest(t *testing.T) []event.Event { t.Helper() return kittest.Ingest(t, migrationguide.Plugin{Guide: NewRelic11}, kittest.Pages{NewRelic11.URL(): newrelicSource}) } diff --git a/plugins/migrationguide/members/posthog.go b/plugins/migrationguide/members/posthog.go index d35b74e..c22c1f3 100644 --- a/plugins/migrationguide/members/posthog.go +++ b/plugins/migrationguide/members/posthog.go @@ -56,6 +56,7 @@ package members // fields, retries, dropped events, options, and "Rename deprecated settings", // whose old names still work) aren't under the heading, so they're never read. var PostHog8 = Guide{ + API: "posthog/python-sdk", Package: "posthog", Module: "posthog", Release: "8.0.0", diff --git a/plugins/migrationguide/members/posthog_test.go b/plugins/migrationguide/members/posthog_test.go index 44b8dee..f082ee4 100644 --- a/plugins/migrationguide/members/posthog_test.go +++ b/plugins/migrationguide/members/posthog_test.go @@ -38,7 +38,7 @@ func TestPostHogEachRowOfTheTable(t *testing.T) { if len(e.Subject.Symbols) != 1 { t.Fatalf("%v: one symbol per event", e.Subject.Symbols) } - if e.API != "posthog" || e.Version != "8.0.0" || e.Subject.Ecosystem != "pypi" || e.Subject.Package != "posthog" || + if e.API != "posthog/python-sdk" || e.Version != "8.0.0" || e.Subject.Ecosystem != "pypi" || e.Subject.Package != "posthog" || e.ChangeType != event.ChangeTypeBreaking || !strings.HasPrefix(e.SourceExcerpt, "Fix removed APIs\n| Removed | Use instead |") { t.Errorf("%+v", e) } @@ -234,7 +234,7 @@ func TestMarkdownTable(t *testing.T) { } // posthogIngest runs the plugin over the saved guide. -func posthogIngest(t *testing.T) []event.EventV2 { +func posthogIngest(t *testing.T) []event.Event { t.Helper() return kittest.Ingest(t, migrationguide.Plugin{Guide: PostHog8}, kittest.Pages{PostHog8.URL(): posthogSource}) } diff --git a/plugins/migrationguide/migrationguide.go b/plugins/migrationguide/migrationguide.go index 15e8fa6..ab63625 100644 --- a/plugins/migrationguide/migrationguide.go +++ b/plugins/migrationguide/migrationguide.go @@ -17,7 +17,6 @@ import ( "time" "github.com/patch-it-dev/patch-it-plugins/core/event" - "github.com/patch-it-dev/patch-it-plugins/core/migrate" "github.com/patch-it-dev/patch-it-plugins/core/plugin" "github.com/patch-it-dev/patch-it-plugins/plugins/migrationguide/members" "github.com/patch-it-dev/patch-it-plugins/plugins/migrationguide/sdkguide" @@ -70,7 +69,7 @@ func init() { // guide is at each, and how its table reads. sdkguide.Guide and // members.Guide are the two readers. type Guide interface { - // Slug is the events' api and the source's old slug: "anthropic". + // Slug is the source id the events carry in api: "anthropic/python-sdk". Slug() string // Releases are the versions, oldest first, each with the ref its guide // would be read at. @@ -81,9 +80,9 @@ type Guide interface { // has no guide (a release that isn't a new major). GuideURL(v plugin.Version) string // Read turns the guide, as read at to, into events with - // previous_version from: v1 events (converted here) or v2 ones, and the - // rows that failed to become events. err is a guide it can't read. - Read(page []byte, from, to plugin.Version, now time.Time) (v1 []event.ChangeEvent, v2 []event.EventV2, rejected []error, err error) + // previous_version from, and the rows that failed to become events. err + // is a guide it can't read. + Read(page []byte, from, to plugin.Version, now time.Time) (events []event.Event, rejected []error, err error) } // Plugin reads one source's migration guide. @@ -107,7 +106,7 @@ func (p Plugin) Run(ctx context.Context, env plugin.Env) (plugin.Result, error) if err != nil { return plugin.Result{}, err } - res.Baselines = []plugin.Spec{plugin.Baseline(p.Name(), v.ID, v.Ref, to.SourceURL, to.Content, false, env.Now().UTC())} + res.Baselines = []plugin.Spec{plugin.Baseline(p.Name(), v.ID, v.Ref, to.SourceURL, to.Content, env.Now().UTC())} return res, nil } @@ -136,12 +135,11 @@ func (p Plugin) Extract(_ context.Context, env plugin.Env, from, to plugin.Snaps if to.Content == nil { return plugin.Result{Label: to.Version.ID}, nil } - v1, v2, rejected, err := p.Guide.Read(to.Content, from.Version, to.Version, env.Now().UTC()) + events, rejected, err := p.Guide.Read(to.Content, from.Version, to.Version, env.Now().UTC()) if err != nil { return plugin.Result{}, fmt.Errorf("reading %s: %w", to.SourceURL, err) } - converted, invalid := migrate.Fresh(v1) - return plugin.Result{Label: to.SourceURL, Events: append(converted, v2...), Rejected: append(rejected, invalid...)}, nil + return plugin.Result{Label: to.SourceURL, Events: events, Rejected: rejected}, nil } var _ plugin.Versioned = Plugin{} diff --git a/plugins/migrationguide/sdkguide/sdkguide.go b/plugins/migrationguide/sdkguide/sdkguide.go index 903d194..42071ff 100644 --- a/plugins/migrationguide/sdkguide/sdkguide.go +++ b/plugins/migrationguide/sdkguide/sdkguide.go @@ -22,29 +22,28 @@ import ( // Guide is one SDK's migration guide for one major release. type Guide struct { - API string // the SDK's slug in change events and its PyPI name, e.g. "anthropic" - Repo string // its GitHub repository, owner/name - Major int // pinned: the release the guide describes, 1 for "Migrating to v1"; 0 lists them - Operation string // the API operation the removed parameters were sent to + API string // the source id the events carry: "anthropic/python-sdk" + Package string // its PyPI name: "anthropic" + Repo string // its GitHub repository, owner/name + Major int // pinned: the release the guide describes, 1 for "Migrating to v1"; 0 lists them // Methods is what a table row's method cell must name for its parameters to // count: the plain call, so a row about beta-only methods (where the same // name can still be valid on a helper) isn't read as a removal. Methods string // Symbols are the calls the removed parameters can no longer be passed to, as // code writes them after the import: the plain methods the guide's table names - // first (`messages.create()`, `messages.stream()`, `messages.parse()`). A v2 - // event carries them (the change event contract). + // first (`messages.create()`, `messages.stream()`, `messages.parse()`). Symbols []string } // Anthropic is anthropic-sdk-python's MIGRATION.md, unpinned: read at the // first release of each major (Major 0; At pins it). var Anthropic = Guide{ - API: "anthropic", - Repo: "anthropics/anthropic-sdk-python", - Operation: "POST /v1/messages", - Methods: "`messages.create()`", - Symbols: []string{"messages.create", "messages.stream", "messages.parse"}, + API: "anthropic/python-sdk", + Package: "anthropic", + Repo: "anthropics/anthropic-sdk-python", + Methods: "`messages.create()`", + Symbols: []string{"messages.create", "messages.stream", "messages.parse"}, } // AnthropicV1 is anthropic-sdk-python's guide to 1.0.0: what the golden pins. @@ -147,26 +146,24 @@ func cut(s string, n int) string { return string([]rune(s)[:n-1]) + "…" } -// Events turns removals into change events: one `breaking` request_parameter -// event per parameter, on the operation the SDK's methods send it to. -func Events(g Guide, rs []Removal, now time.Time) ([]event.ChangeEvent, []error) { - var events []event.ChangeEvent +// Events turns removals into change events: one breaking removed_parameter +// event per parameter, on the SDK calls it can no longer be passed to. +func Events(g Guide, rs []Removal, now time.Time) ([]event.Event, []error) { + var events []event.Event var errs []error for _, r := range rs { - affected := event.Affected{ - Kind: event.AffectedKindRequestParameter, - Side: event.SideRequest, - Operation: g.Operation, - Property: r.Param, + subject := event.Subject{ + Type: event.SubjectPackageRelease, Ecosystem: "pypi", Package: g.Package, + Change: event.PackageRemovedParameter, Parameter: r.Param, Symbols: g.Symbols, } - e := event.ChangeEvent{ - Fingerprint: event.Fingerprint(g.API, g.Version(), event.ChangeTypeBreaking, affected, "removed"), + e := event.Event{ + Fingerprint: event.Fingerprint(g.API, g.Version(), event.ChangeTypeBreaking, subject, ""), API: g.API, Version: g.Version(), ChangeType: event.ChangeTypeBreaking, Breaking: true, - Affected: affected, - Description: fmt.Sprintf("Parameter %s removed from %s and its sibling methods in the %s SDK %s: passing it raises a TypeError.", r.Param, g.Methods, g.API, g.Version()), + Subject: subject, + Description: fmt.Sprintf("Parameter %s removed from %s and its sibling methods in the %s SDK %s: passing it raises a TypeError.", r.Param, g.Methods, g.Package, g.Version()), MigrationHint: fmt.Sprintf("%s Source: %s", r.Instead, g.Page()), SourceURL: g.URL(), SourceExcerpt: r.Excerpt, diff --git a/plugins/migrationguide/sdkguide/sdkguide_test.go b/plugins/migrationguide/sdkguide/sdkguide_test.go index d0c3fcb..5e6055a 100644 --- a/plugins/migrationguide/sdkguide/sdkguide_test.go +++ b/plugins/migrationguide/sdkguide/sdkguide_test.go @@ -58,8 +58,9 @@ func TestEventsAreValidAndCiteTheTag(t *testing.T) { t.Fatalf("%d events, %v", len(events), errs) } e := events[0] - if e.API != "anthropic" || e.Version != "1.0.0" || !e.Breaking || - e.Affected != (event.Affected{Kind: event.AffectedKindRequestParameter, Side: event.SideRequest, Operation: "POST /v1/messages", Property: "temperature"}) || + if e.API != "anthropic/python-sdk" || e.Version != "1.0.0" || !e.Breaking || + e.Subject.Type != event.SubjectPackageRelease || e.Subject.Package != "anthropic" || e.Subject.Change != event.PackageRemovedParameter || + e.Subject.Parameter != "temperature" || strings.Join(e.Subject.Symbols, ",") != "messages.create,messages.stream,messages.parse" || e.SourceURL != "https://raw.githubusercontent.com/anthropics/anthropic-sdk-python/v1.0.0/MIGRATION.md" { t.Errorf("%+v", e) } diff --git a/plugins/migrationguide/sdkguide/versions.go b/plugins/migrationguide/sdkguide/versions.go index 592daab..4174213 100644 --- a/plugins/migrationguide/sdkguide/versions.go +++ b/plugins/migrationguide/sdkguide/versions.go @@ -12,7 +12,7 @@ import ( // What the migration-guide kind (plugins/migrationguide) asks of a guide. -// Slug is the events' api and the source's old slug: the SDK's PyPI name. +// Slug is the source id the events carry: "anthropic/python-sdk". func (g Guide) Slug() string { return g.API } // Releases is every final release of the SDK on PyPI, oldest first, each @@ -21,7 +21,7 @@ func (g Guide) Releases(ctx context.Context, env plugin.Env) ([]plugin.Version, if g.Major != 0 { return []plugin.Version{{ID: g.Version(), Ref: "v" + g.Version()}}, nil } - vs, err := versions.PyPIReleases(ctx, env.Get, g.API) + vs, err := versions.PyPIReleases(ctx, env.Get, g.Package) if err != nil { return nil, err } @@ -62,21 +62,19 @@ func (g Guide) GuideURL(v plugin.Version) string { return g.At(versions.Major(v.ID)).URL() } -// Read is an event per request parameter the to major removed, read from -// its guide, with previous_version from's release. They're v1 events -// (the kind converts them to v2: core/migrate reads this package, so it -// can't be called from here). -func (g Guide) Read(page []byte, from, to plugin.Version, now time.Time) (v1 []event.ChangeEvent, _ []event.EventV2, rejected []error, err error) { +// Read is an event per parameter the to major removed, read from its +// guide, with previous_version from's release. +func (g Guide) Read(page []byte, from, to plugin.Version, now time.Time) (_ []event.Event, rejected []error, err error) { g = g.At(versions.Major(to.ID)) removals, err := Parse(page, g) if err != nil { - return nil, nil, nil, err + return nil, nil, err } events, errs := Events(g, removals, now) for i := range events { events[i].PreviousVersion = from.ID } - return events, nil, errs, nil + return events, errs, nil } // FirstOfMajor is true for X.0.0, the release a major's guide is tagged at. diff --git a/plugins/migrationguide/testdata/golden/anthropic-1.0.0.json b/plugins/migrationguide/testdata/golden/anthropic-1.0.0.json index 80a6518..038306b 100644 --- a/plugins/migrationguide/testdata/golden/anthropic-1.0.0.json +++ b/plugins/migrationguide/testdata/golden/anthropic-1.0.0.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:16f13db8470e2299ccdfc6564519417bacb8101ff6884ebfcaf989f59c7ed021", - "api": "anthropic", + "fingerprint": "sha256:07170c43fdc6d298df0a7752b72ad8977df95bccaaadb95fdfafbcf5d30286a0", + "api": "anthropic/python-sdk", "version": "1.0.0", "change_type": "breaking", "breaking": true, @@ -27,8 +27,8 @@ }, { "id": 2, - "fingerprint": "sha256:61b3739d72b6dff1f2192fb4f553ff86ef77c2d33bbb6def80c99ac58ebb4382", - "api": "anthropic", + "fingerprint": "sha256:61c02ba43dda9bf576bc55cd9564fbad623951df898b2653a79e572806bd70e2", + "api": "anthropic/python-sdk", "version": "1.0.0", "change_type": "breaking", "breaking": true, @@ -53,8 +53,8 @@ }, { "id": 3, - "fingerprint": "sha256:b39ce1b3d18e8f138ae5a09d03edab9f1793ddbe030d090c90f8c2cd958ac474", - "api": "anthropic", + "fingerprint": "sha256:0845af07684a241eb1300ad5b161b21fa6a026584ee8f088a416c7c918cfffd0", + "api": "anthropic/python-sdk", "version": "1.0.0", "change_type": "breaking", "breaking": true, diff --git a/plugins/migrationguide/testdata/golden/newrelic-11.0.0.json b/plugins/migrationguide/testdata/golden/newrelic-11.0.0.json index 4d1544f..0cd06f3 100644 --- a/plugins/migrationguide/testdata/golden/newrelic-11.0.0.json +++ b/plugins/migrationguide/testdata/golden/newrelic-11.0.0.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:a2f86cae07b29326ca93be5f66515f27d1040d5f189e103911dd93ba739e0b96", - "api": "newrelic", + "fingerprint": "sha256:7f09f0bebf3e229d1a8f43574c224b8a6e186b4e0228f62c793afd10156569fe", + "api": "newrelic/python-agent", "version": "11.0.0", "change_type": "breaking", "breaking": true, @@ -24,8 +24,8 @@ }, { "id": 2, - "fingerprint": "sha256:dfc0f5f20b000248f48960b089533d37b2a98857ab86b34ef58bbadc2a79a331", - "api": "newrelic", + "fingerprint": "sha256:033c7dc942625f1d07ef976edf7dcc22b458dd2786eeab3d5a7a0889dfe100e3", + "api": "newrelic/python-agent", "version": "11.0.0", "change_type": "breaking", "breaking": true, @@ -48,8 +48,8 @@ }, { "id": 3, - "fingerprint": "sha256:76b3c3353469c9b8fa468e742f019b0a625fba73be37263cec6db0c8a616a512", - "api": "newrelic", + "fingerprint": "sha256:2260cefe21b2807a9abc2144b46fd967e728f7e73dc2a489babb8ca0d77fa2b8", + "api": "newrelic/python-agent", "version": "11.0.0", "change_type": "breaking", "breaking": true, @@ -72,8 +72,8 @@ }, { "id": 4, - "fingerprint": "sha256:cc82dac7778ed8efcd9e407d06f00b5bd3180f3c7d471363c6b5b0f55feaa6fa", - "api": "newrelic", + "fingerprint": "sha256:a26a9a7d453398aa11ba51c77edf340e83d0eee8657c87a8a25ee517729648ba", + "api": "newrelic/python-agent", "version": "11.0.0", "change_type": "breaking", "breaking": true, @@ -95,8 +95,8 @@ }, { "id": 5, - "fingerprint": "sha256:c8d9b51b7477b5f17f7cd121463061fe58b21ebc7deeb51d64087eb84569b20a", - "api": "newrelic", + "fingerprint": "sha256:0d2b52b1e7f8601a5ccb6efa65ad4c028f2c8faceec43672af3f8e9f3de7183a", + "api": "newrelic/python-agent", "version": "11.0.0", "change_type": "breaking", "breaking": true, @@ -118,8 +118,8 @@ }, { "id": 6, - "fingerprint": "sha256:67f424f610fbafc21776c15219e51662c6f8b21d12db8039a104afe6a6ca6138", - "api": "newrelic", + "fingerprint": "sha256:6dac3561485ac1b50b934c773fbdf9d34244b6a238d4ffba84649653093ae020", + "api": "newrelic/python-agent", "version": "11.0.0", "change_type": "breaking", "breaking": true, @@ -141,8 +141,8 @@ }, { "id": 7, - "fingerprint": "sha256:8940a71ce47a561fd62c949d2b0ba691cd8b7f7d0a5fa8366dc5d56d411bfbf2", - "api": "newrelic", + "fingerprint": "sha256:726ecaafb7ec01c6471fa78cb1d90ba403489b8900b1d403c24f087e18cccbb7", + "api": "newrelic/python-agent", "version": "11.0.0", "change_type": "breaking", "breaking": true, diff --git a/plugins/migrationguide/testdata/golden/numpy-2.0.0.json b/plugins/migrationguide/testdata/golden/numpy-2.0.0.json index aaddc0d..991600d 100644 --- a/plugins/migrationguide/testdata/golden/numpy-2.0.0.json +++ b/plugins/migrationguide/testdata/golden/numpy-2.0.0.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:15ca3bff786fc3561429e5eb69ac1da7d0bce22bd5bded3d12bbdf878cec1237", - "api": "numpy", + "fingerprint": "sha256:b0783c632fa593bf60b79b17a531b3b57a421e999cf53927142ba7edb8ce3169", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -24,8 +24,8 @@ }, { "id": 2, - "fingerprint": "sha256:31adef4fb433c3a1cd5aec6cf01b2ce4a39767aa19890bb87637ec5b52d7597b", - "api": "numpy", + "fingerprint": "sha256:b41e888a7433412bc61a81d6ceba463fcafc9276fc09976ed6b32319388d2f81", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -47,8 +47,8 @@ }, { "id": 3, - "fingerprint": "sha256:e0ca458b9411438867eb70927c36c4e76ddb97ec52c3b9c931962f0b897653e0", - "api": "numpy", + "fingerprint": "sha256:126c06d99b4ddc08be5f6c574d69f5593f73bdaa9dfe4551741a54962aa902a1", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -70,8 +70,8 @@ }, { "id": 4, - "fingerprint": "sha256:a880a83ae4a2e2214a51d4fe3ab1f67c5bdf70141e3966e41509581817586d3c", - "api": "numpy", + "fingerprint": "sha256:143771722bc49885b35d3b9c7001fd19e56b9c26f4b21946e73c2e40e6fa4504", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -93,8 +93,8 @@ }, { "id": 5, - "fingerprint": "sha256:4080d657c3e2a0e548af8dc3658ca06f91023cf64533e4f56a00dcc5b3e0b0f6", - "api": "numpy", + "fingerprint": "sha256:4327f8787005edc444aece39bda8bdde02c8bbb2c725882200ae14674ca1116c", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -116,8 +116,8 @@ }, { "id": 6, - "fingerprint": "sha256:8bc3175f3e0e197a5fd4c9b1a4f8cee790e2663b526ca1dd1bcd94a1d9b63131", - "api": "numpy", + "fingerprint": "sha256:34eb3c1db0e9914ab4b3e0f7f4dc80cc1d1d5d2d1d743663aede4bcaaa5d66c1", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -139,8 +139,8 @@ }, { "id": 7, - "fingerprint": "sha256:bdd935da224960adcfd1d2b049fa065acb21b9964847030e40233f67caf95dc3", - "api": "numpy", + "fingerprint": "sha256:7b413031e868403cfadd2229a68286bc67c12fcfd9f99ae6936cc89333b7ad60", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -162,8 +162,8 @@ }, { "id": 8, - "fingerprint": "sha256:31be9451beae30671892b9c9cc9fb7853a978184758bca179c864f40a548cc24", - "api": "numpy", + "fingerprint": "sha256:96efba0d4e96431f67360a67c792c4d2e6a7d3b300593d3f5499d402a8a141fe", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -186,8 +186,8 @@ }, { "id": 9, - "fingerprint": "sha256:67a3cf67691368680dee4a27e2efa922cf3aab8860a3f21968c5a89bc706b812", - "api": "numpy", + "fingerprint": "sha256:2c9778be1dd3f63b98e74f9c07c0a6bdf18e26784c8f002ed2cc39b9f52aec8d", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -210,8 +210,8 @@ }, { "id": 10, - "fingerprint": "sha256:6e5320feb35889323ccd3d0296e4aeb7ee23114e6298966a3fa570d1d48e73bc", - "api": "numpy", + "fingerprint": "sha256:17cf21d49a707d39eb5bac336e6e915ba800f76cfe50d3aa7a33d5de7fbc3543", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -233,8 +233,8 @@ }, { "id": 11, - "fingerprint": "sha256:d3efb66bfb97ffe7095f82a1b6ea589e52e34a9f23b465c619fac2af5ca08b53", - "api": "numpy", + "fingerprint": "sha256:ff51f64a013851f451e5776574e3a65e81cf2656c1573635f21323da7861c455", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -257,8 +257,8 @@ }, { "id": 12, - "fingerprint": "sha256:a0c45f87acdd2ecfc8231e86b58dcbdfde45d15dc63ff23d9b8dd8da01c647ae", - "api": "numpy", + "fingerprint": "sha256:69a3ba2862b32c578da907e78f05206cee14710ef791fdb55c8996f2268984d3", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -281,8 +281,8 @@ }, { "id": 13, - "fingerprint": "sha256:0030b240846eb6fcf0c4298e29ed2fb7d04dc6d4c0296e5a6e078fc0cb45528a", - "api": "numpy", + "fingerprint": "sha256:e9143511f87c438ed0ab56301560b4daba766c10b336bea7be5bcc97efb9b4bf", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -304,8 +304,8 @@ }, { "id": 14, - "fingerprint": "sha256:7cda747a751f26ff3e7b9bd74eba2597feab78e1e9cd8c9e73c07fc7f99a26ff", - "api": "numpy", + "fingerprint": "sha256:764794a1bf403c2c6095e79a508ef212f954b1ec6f6619d3ae54355adef33d4b", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -327,8 +327,8 @@ }, { "id": 15, - "fingerprint": "sha256:8f0cd5edeab67e754702c65c3a3ed4b85dbc115dcc1462334fdfa711dcd92bde", - "api": "numpy", + "fingerprint": "sha256:8715ec0959044c083b44c8c9535f74c742ae3a544671f43d5abfa5087be7790e", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -350,8 +350,8 @@ }, { "id": 16, - "fingerprint": "sha256:58706e17b74f39ebfb8a82edaee01e0639d3c31cbeb2ec8df6e0e50ecd3dfc07", - "api": "numpy", + "fingerprint": "sha256:2be00bcbf01b6dd7451390a12425e16d9cc3d994b01f17fc6278f479c746b062", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -373,8 +373,8 @@ }, { "id": 17, - "fingerprint": "sha256:296d49650c8693884ae3462931747e2855d76d007d7a4c15b5a6d78cf7112842", - "api": "numpy", + "fingerprint": "sha256:f56cd36c2524684fbcbe8bd45bf74610d19797ab9cfc045f209c065d5c6a2b15", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -396,8 +396,8 @@ }, { "id": 18, - "fingerprint": "sha256:f0027b95736ab12febb6e08f480bfe95de911cfaa817b27d867cce069ec29b83", - "api": "numpy", + "fingerprint": "sha256:dd911afbc6bdb4121681393823532d3eed009a278ce1e0eec6452b3e43deedaa", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -419,8 +419,8 @@ }, { "id": 19, - "fingerprint": "sha256:43741a40b134e0770d1c4d6d1d6f1ed5515f64b18d68015455cb9035ce566ed8", - "api": "numpy", + "fingerprint": "sha256:7b44dc9e7fe08590408c8f94edacfcb036286de2c7e2e80d9a92c81afdcd6a46", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -442,8 +442,8 @@ }, { "id": 20, - "fingerprint": "sha256:18938bf76e659fe0e7f7180141f9d35f9ea93fa79a91f91a9f72aeb1c58bba14", - "api": "numpy", + "fingerprint": "sha256:8711daa446d6d4a8683f49f9db118ae5bdf53c31b4c9f77a0398d816fc25980a", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -466,8 +466,8 @@ }, { "id": 21, - "fingerprint": "sha256:7cacd8aaadd83c25504c353adbdc041e12620a438136765ef807f47b6b50f8b6", - "api": "numpy", + "fingerprint": "sha256:dfbe1b3d248418215f52b5f2c8e8c0b69d2b71989fa5f94f98c855f02ac5eb97", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -489,8 +489,8 @@ }, { "id": 22, - "fingerprint": "sha256:e872dbb246ccc076a0316c2b8976bb7136a30af743bcafca7df46ee19e91d5f1", - "api": "numpy", + "fingerprint": "sha256:f129fb52117ed68b20a0aa025644c24e048a6bf66deabbe05ec506094c2550ef", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -513,8 +513,8 @@ }, { "id": 23, - "fingerprint": "sha256:9759a187d780c88637c0715501f9b6702cbea6be1c2ea4c4958bece3455ba117", - "api": "numpy", + "fingerprint": "sha256:c527e0e526ce8934592299baf54a586aca4a7668a12f9e74b71cc7cc39738dc4", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -537,8 +537,8 @@ }, { "id": 24, - "fingerprint": "sha256:a09224e2ef5444c9eccb6e5d7dca373bb19cae967839bc3b22fecc6defb8dd6b", - "api": "numpy", + "fingerprint": "sha256:0daa283517da38834730ed51076b83f24d0ad28e9fa5baf7efc56247623fdcf8", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -561,8 +561,8 @@ }, { "id": 25, - "fingerprint": "sha256:dbdd41b69dfec3cd9e6cd11a464ed14f45b2d2c46da45dbd7532bd7eb0622060", - "api": "numpy", + "fingerprint": "sha256:4e160f1fe78740c45b7668fb06a5176734867992b9f37ac4eb1680b18bf87260", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -584,8 +584,8 @@ }, { "id": 26, - "fingerprint": "sha256:e65a1389f496e28b194eadce0cd227a359ff361bee0db4cb5a55f25d31597f0d", - "api": "numpy", + "fingerprint": "sha256:154c87acc07c26f96f8516063d516eee04a1d6b60840e7acf505b651d6677add", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -607,8 +607,8 @@ }, { "id": 27, - "fingerprint": "sha256:c02c17094b4d43e477530bc816219f322d2a41272fc62152540926cf78ede9fa", - "api": "numpy", + "fingerprint": "sha256:4bbfbf7969500581b7d16e9651d80d1b9358921bf589307704e2385bbedc59ac", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -631,8 +631,8 @@ }, { "id": 28, - "fingerprint": "sha256:25253550b494a1da396614b2b35dbebc138501c541e093e2f52ff588dbea5a73", - "api": "numpy", + "fingerprint": "sha256:d4a1985a0357792efe4789c2233bad139cf8928458e0ec785ce1b1cd7fb11e73", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -655,8 +655,8 @@ }, { "id": 29, - "fingerprint": "sha256:1cf8b9821742bc5dc37853fd44b300cdd367d935697f97570f075749f0a5cb20", - "api": "numpy", + "fingerprint": "sha256:c88871cfc1ecb72bc4aad8cd5b6f23bcf15e380846669f8af005e30de83ef47c", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -678,8 +678,8 @@ }, { "id": 30, - "fingerprint": "sha256:943c39007430553d0618e207c7d22227f1adae5e034e95430d33a5352acb5f19", - "api": "numpy", + "fingerprint": "sha256:4863038fb9b91d931b5fdc30826b3ad1ea5ba69328c37260ae0959fadbed7aee", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -702,8 +702,8 @@ }, { "id": 31, - "fingerprint": "sha256:36ef006fd617b6fea0238bd570a894bcc58664d7ce3b0cdb9112dfce8be40166", - "api": "numpy", + "fingerprint": "sha256:ec88ce6ee9843e242b2389245d90ddc4f9ec7dc22e1116f6bfe430949da19005", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -725,8 +725,8 @@ }, { "id": 32, - "fingerprint": "sha256:dece31f907bc1de0e1f62c40575ea06f1fc38caa0cfedf11c1325c75452c7f2d", - "api": "numpy", + "fingerprint": "sha256:eed7dac5bb066436ce0df5666bc15e405ec3955c9e167439b588243e878bff11", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -748,8 +748,8 @@ }, { "id": 33, - "fingerprint": "sha256:13aa7c2a699cbf1ef45bb673f17dbd2deac81957a6f59d0a150df5392bade17b", - "api": "numpy", + "fingerprint": "sha256:caca0ecc8275dd7119f4f04f80c3e8b9783d6016ba28221a4238eb2dff79e3bb", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -771,8 +771,8 @@ }, { "id": 34, - "fingerprint": "sha256:288ad6e666d5a56a2f47647c111151b9db456eef88d276bed86ae0bb3b6e2f3e", - "api": "numpy", + "fingerprint": "sha256:dc18158f7f52098c8fa5647ad0f3ac016020f23d684bf3e8a204c33cf855a394", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -795,8 +795,8 @@ }, { "id": 35, - "fingerprint": "sha256:26b2f0ce1ba6a884e6dafea4f8cc9b8377ad85feb628895b7c493a896a322e72", - "api": "numpy", + "fingerprint": "sha256:abdf8696910cd0012a63c8c7826a3a4ed1c43872627247b449a69d2bad8434de", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -819,8 +819,8 @@ }, { "id": 36, - "fingerprint": "sha256:9dfe8575c70bcd4246326930a7f9f55910f187b79d914e4de158d3e93cd21155", - "api": "numpy", + "fingerprint": "sha256:863640a58894e351474344af0dbdfafd91fd40aef2323e21ded6b6d43ba5da23", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -842,8 +842,8 @@ }, { "id": 37, - "fingerprint": "sha256:276d393aac6bcd797df9065d46af3b097c1777ad6f5e3bfd6cd006576cdf1468", - "api": "numpy", + "fingerprint": "sha256:5a8b83d2b15698a7e304bc6b5d7b2ccd073f4502705fb64e5db5d60218d594c1", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -865,8 +865,8 @@ }, { "id": 38, - "fingerprint": "sha256:73549489018185907fb06522b14b37dba277fda5ff38ac98120455cc9cee1371", - "api": "numpy", + "fingerprint": "sha256:35c02de167c3581dbfbbd1cb2ef0a42398a7fe0759792b5c71ba2f45ffa6af7a", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -889,8 +889,8 @@ }, { "id": 39, - "fingerprint": "sha256:966e363f14bb09c9e62ff95a5407f03edba58391171de8ed47f1691971c2aba4", - "api": "numpy", + "fingerprint": "sha256:868ad45a4f8c29663f19bdeb84ee97653721419c4457ec2431271509ed57387f", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -913,8 +913,8 @@ }, { "id": 40, - "fingerprint": "sha256:efdbf7cfe045999a63e9c7bbf2e5735dc536d537ae9b186fc580d7a3d95eb409", - "api": "numpy", + "fingerprint": "sha256:13f12000b0678c2a9990c8aba54e12e4574edd78f624e0d88fcdb981ac2d32e2", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -936,8 +936,8 @@ }, { "id": 41, - "fingerprint": "sha256:6a4405f736f938b02903ba7f9b8d5b38df782fbda7ae257795b82b946a458e80", - "api": "numpy", + "fingerprint": "sha256:136c816d0e1236b96b4f5b19fa9fd6675cf09e64048d459cd14cc014f4aafd49", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -959,8 +959,8 @@ }, { "id": 42, - "fingerprint": "sha256:e97c77fcc18491acc9ed4cd1ea6fd7f29aae24ee1fa169db62b7f7a31b7bc827", - "api": "numpy", + "fingerprint": "sha256:5ed93388730232ca923f22a1647cba930bedc3114dde3a5433ab2f8698dee684", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -983,8 +983,8 @@ }, { "id": 43, - "fingerprint": "sha256:6c959fbdd43160b9a41db2011948c1fd88ce7198b32b6eded5a71bdde5e39fe2", - "api": "numpy", + "fingerprint": "sha256:b6db560c04fea4149c33667d36aeba13d6706d1f78887f9e7e7f38dcdd61f92d", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -1007,8 +1007,8 @@ }, { "id": 44, - "fingerprint": "sha256:7f3fad835d10581ee56dc0a6ad91cb67e144d12a973ce9c969c5940213217ad3", - "api": "numpy", + "fingerprint": "sha256:bee468fe3c58f14587d4a58871a1662d9f0d832361b740634683a7a285ac43f0", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -1030,8 +1030,8 @@ }, { "id": 45, - "fingerprint": "sha256:9611a26e2eb09d38e7433fa076d1bb2ec839c5d902dcbac4c1938af197f6a8bd", - "api": "numpy", + "fingerprint": "sha256:914dfac763acc9361bbfdec6541a697ae7763bf09a2240c9cbd1fafe78d1f531", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -1053,8 +1053,8 @@ }, { "id": 46, - "fingerprint": "sha256:f9f9805e34a27f268e063aa6d53ba51a02ed5b07e4af35cd2ebfb5141bd841b2", - "api": "numpy", + "fingerprint": "sha256:ba6b201483db19e04bacc9e46ee1c2c9e58ec4cd51bb9216e2be39fe3a76d594", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -1076,8 +1076,8 @@ }, { "id": 47, - "fingerprint": "sha256:aae912e01e4f6aa9bb104dea9d74df1afeb980f8f624ba717b05f234f6d05f76", - "api": "numpy", + "fingerprint": "sha256:7d680b6a440b3a14ac495e905a379f0eec3527c49e1cc98403bff35ff6bd66f0", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -1099,8 +1099,8 @@ }, { "id": 48, - "fingerprint": "sha256:c9d99c27e0930ff70cf589356f74ab0114dab15abeb8e2795f4f151fa1fbf20e", - "api": "numpy", + "fingerprint": "sha256:9ed3f595c62d8e9780887a58970e82c9af7d416b0457ceac0bf1cc55a518b0c6", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -1122,8 +1122,8 @@ }, { "id": 49, - "fingerprint": "sha256:c1df4a2128af0680e401486f20180186da52ff92ea0c5bdf2dedc11fecccddb4", - "api": "numpy", + "fingerprint": "sha256:ced822e6a5b1ef208d6a8df0f78f9f542bd19bf3219fffeda83039d3bdd3c492", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -1145,8 +1145,8 @@ }, { "id": 50, - "fingerprint": "sha256:c3efb85726892dc1421804f037cd85247d642fc99fb44fc916ce88bb2d510b38", - "api": "numpy", + "fingerprint": "sha256:d94b2c6839f05465a1c6437c3e1a5316596258e5d999abca0e3f942cf8b1bdd7", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -1169,8 +1169,8 @@ }, { "id": 51, - "fingerprint": "sha256:3ce841cef5c56603ffda8bc14ace116d8eb54c9e367b8c4f9925ca4cc13aec0e", - "api": "numpy", + "fingerprint": "sha256:da92a61aba8cbc8ae017a52ed418811d6c464e05c7df1945bf513e2f1617c667", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -1193,8 +1193,8 @@ }, { "id": 52, - "fingerprint": "sha256:62f3f736f96c393c86870c3817cb03305abe0b98ee04fbc2d019809318ee279d", - "api": "numpy", + "fingerprint": "sha256:0d4bd197cb31ba8d395640fe104102c0e549b4e0f63c3a6557159f62f28255d1", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -1216,8 +1216,8 @@ }, { "id": 53, - "fingerprint": "sha256:35df9a18690f8a99e2f519b0edc215e4a7ac9f605d70ae8f37895493dfc9d972", - "api": "numpy", + "fingerprint": "sha256:0244a14e2f675fc4f2d854012e79e2242c3441b855dfc0acad32a69fcd837121", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -1239,8 +1239,8 @@ }, { "id": 54, - "fingerprint": "sha256:700e9b695d9c57e1dfe878849f3829d1023334cfab92727806c861e025db1ab8", - "api": "numpy", + "fingerprint": "sha256:120004adecac61928b41859f183e0ea707c9218d6d1270b743699b1980984c7b", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -1262,8 +1262,8 @@ }, { "id": 55, - "fingerprint": "sha256:e8b05f5f78a91df2ab0925e7569580527a21de6ef70eda22f2ebfa1e9fd44f93", - "api": "numpy", + "fingerprint": "sha256:a142b4adeea44bce0f23cdd28e54f874fd13f180494362e26aa85ae825ec80a8", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, @@ -1286,8 +1286,8 @@ }, { "id": 56, - "fingerprint": "sha256:60c6a22d6aab5ef8d2c3a1e48d86ace1f9a2a85d7b462ea0554df76db7be0e40", - "api": "numpy", + "fingerprint": "sha256:d2ba751b9e8289c6e868330d2ea952ba118290c301dea8c809e8b617bbdc1f1c", + "api": "numpy/numpy", "version": "2.0.0", "change_type": "breaking", "breaking": true, diff --git a/plugins/migrationguide/testdata/golden/posthog-8.0.0.json b/plugins/migrationguide/testdata/golden/posthog-8.0.0.json index 4439b59..83330ff 100644 --- a/plugins/migrationguide/testdata/golden/posthog-8.0.0.json +++ b/plugins/migrationguide/testdata/golden/posthog-8.0.0.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:cc0790387fbe50505a8c3116cb1678892d2b49643002a99259eeb81144bc4159", - "api": "posthog", + "fingerprint": "sha256:75d945cf03e52543a2fdabae1c94e6e81322a2fee42c6623830c6b9b5ffc4e40", + "api": "posthog/python-sdk", "version": "8.0.0", "change_type": "breaking", "breaking": true, @@ -24,8 +24,8 @@ }, { "id": 2, - "fingerprint": "sha256:0ac3ae87979a15b9bd217da712b7deb2c20063e72f2a717a436c11040384fd37", - "api": "posthog", + "fingerprint": "sha256:d91ba129157bb359c50102c4c532f811a949d0612abb8d45d0992e4dc7aefcbf", + "api": "posthog/python-sdk", "version": "8.0.0", "change_type": "breaking", "breaking": true, @@ -47,8 +47,8 @@ }, { "id": 3, - "fingerprint": "sha256:1a38df0902754ee8485ccc7462afb9cff35c7de933e11b3205c93babbdb05863", - "api": "posthog", + "fingerprint": "sha256:7b1dbda0f8429ab629a5a041205a2e2e036e348e6810f9ee62f372e7446b2dd8", + "api": "posthog/python-sdk", "version": "8.0.0", "change_type": "breaking", "breaking": true, @@ -70,8 +70,8 @@ }, { "id": 4, - "fingerprint": "sha256:0736d4f7aee4ddfa0c13654ba26a45586844d6628d353e5d43b84f646b6dd0f6", - "api": "posthog", + "fingerprint": "sha256:94d72e7984b7e207ea3eee48a2047efdcfb651bb3774a0af926c5368b351a3e4", + "api": "posthog/python-sdk", "version": "8.0.0", "change_type": "breaking", "breaking": true, @@ -93,8 +93,8 @@ }, { "id": 5, - "fingerprint": "sha256:417930dab98562db2bb15d2bd3926baf9689950100e9e9ffe78d5bc9c26602ad", - "api": "posthog", + "fingerprint": "sha256:fcee60f271c6aec47734b6a4577de6b3f06e32f1e025e98a625f675fa794c41c", + "api": "posthog/python-sdk", "version": "8.0.0", "change_type": "breaking", "breaking": true, @@ -116,8 +116,8 @@ }, { "id": 6, - "fingerprint": "sha256:4184ff3cbb866e22be67075e91e9e1d05b6ac9711ea5fc0bbae6b7a8d3b2d814", - "api": "posthog", + "fingerprint": "sha256:9fb8ed99a7840f76c8148d3da79ee9d391a5db28579219d944d3d2ecc96418ae", + "api": "posthog/python-sdk", "version": "8.0.0", "change_type": "breaking", "breaking": true, @@ -139,8 +139,8 @@ }, { "id": 7, - "fingerprint": "sha256:8639fcae424bb8a4c15aebef34c5aa1f6c1fd80ed5d5817b7ff07d8ea57c6ef6", - "api": "posthog", + "fingerprint": "sha256:c39d1f380b736e1e5bb84d008ef468e59469aec919aabeef97ea412549c9e139", + "api": "posthog/python-sdk", "version": "8.0.0", "change_type": "breaking", "breaking": true, diff --git a/plugins/notices/eol/eol.go b/plugins/notices/eol/eol.go index 823b707..76d85d8 100644 --- a/plugins/notices/eol/eol.go +++ b/plugins/notices/eol/eol.go @@ -38,7 +38,7 @@ import ( // Page is one vendor's end-of-life table. type Page struct { - API string // the events' api: "salesforce" + API string // the source id the events carry: "salesforce/rest-api" Vendor string // for sentences: "Salesforce" URL string // the page, as HTML // Operation names the one real, documented, version-rooted resource a @@ -58,7 +58,7 @@ type Page struct { // policy text above the table says the notice is at least a year ahead of // retirement. var Salesforce = Page{ - API: "salesforce", Vendor: "Salesforce", + API: "salesforce/rest-api", Vendor: "Salesforce", URL: "https://developer.salesforce.com/docs/platform/api-rest/guide/api-rest-eol.html", Operation: func(v string) string { return "GET /services/data/v" + v + "/" }, } @@ -178,7 +178,7 @@ type Read []Finding // Count is how many findings the page gave. func (r Read) Count() int { return len(r) } -// Slug is the events' api: "salesforce". +// Slug is the source id the events carry: "salesforce/rest-api". func (pg Page) Slug() string { return pg.API } // PageURL is the page, as HTML. @@ -197,22 +197,22 @@ func (Page) ArchiveWhenBlocked() bool { return true } // Events are an event per version number a row retires or deprecates, // citing citeURL; a dropped row is logged with why. -func (pg Page) Events(found kit.Notices, citeURL string, now time.Time) ([]event.ChangeEvent, []event.EventV2, []error) { - var events []event.EventV2 +func (pg Page) Events(found kit.Notices, citeURL string, now time.Time) ([]event.Event, []error) { + var events []event.Event var rejected []error for _, f := range found.(Read) { if f.Dropped != "" { log.Printf("%s: dropped %s: %s", pg.API, f.Row, f.Dropped) continue } - e := event.EventV2{ + e := event.Event{ API: pg.API, Version: f.Version, ChangeType: f.ChangeType, Breaking: f.ChangeType == event.ChangeTypeBreaking, Subject: event.Subject{ Type: event.SubjectAPIOperation, - Kind: event.AffectedKindOperation, + Kind: event.KindOperation, Side: event.SideRequest, Operation: pg.Operation(f.Version), }, @@ -223,14 +223,14 @@ func (pg Page) Events(found kit.Notices, citeURL string, now time.Time) ([]event Confidence: 1.0, DetectedAt: now, } - e.Fingerprint = event.FingerprintV2(e.API, e.Version, e.ChangeType, e.Subject, "") + e.Fingerprint = event.Fingerprint(e.API, e.Version, e.ChangeType, e.Subject, "") if err := e.Validate(); err != nil { rejected = append(rejected, fmt.Errorf("%s %s: %w", pg.API, f.Version, err)) continue } events = append(events, e) } - return nil, events, rejected + return events, rejected } func describe(pg Page, f Finding) string { diff --git a/plugins/notices/feed/cloudflare_test.go b/plugins/notices/feed/cloudflare_test.go index 83d23fe..2989a10 100644 --- a/plugins/notices/feed/cloudflare_test.go +++ b/plugins/notices/feed/cloudflare_test.go @@ -47,7 +47,7 @@ func TestCloudflareRegistrarEndOfLife(t *testing.T) { if f.ChangeType != event.ChangeTypeBreaking || f.Version != "2026-09-27" { t.Errorf("%s: %s %s, want breaking 2026-09-27", f.Subject.Operation, f.ChangeType, f.Version) } - if f.Subject.Type != event.SubjectAPIOperation || f.Subject.Kind != event.AffectedKindOperation || f.Subject.Side != event.SideRequest { + if f.Subject.Type != event.SubjectAPIOperation || f.Subject.Kind != event.KindOperation || f.Subject.Side != event.SideRequest { t.Errorf("%s: subject %+v", f.Subject.Operation, f.Subject) } for _, line := range []string{"API deprecations - Legacy Registrar Domain Management API", "End of life date: September 27, 2026", diff --git a/plugins/notices/feed/feed.go b/plugins/notices/feed/feed.go index a4a40d7..59f5deb 100644 --- a/plugins/notices/feed/feed.go +++ b/plugins/notices/feed/feed.go @@ -31,7 +31,7 @@ import ( // Feed is one vendor feed and how to read its entries. type Feed struct { - API string // the events' api: "github-actions" + API string // the source id the events carry: "github/actions" Vendor string // for sentences: "GitHub" URL string // the feed itself Read Reader @@ -75,7 +75,7 @@ type Findings []Finding // Count is how many findings the feed gave. func (fs Findings) Count() int { return len(fs) } -// Slug is the events' api: "github-actions". +// Slug is the source id the events carry: "github/actions". func (f Feed) Slug() string { return f.API } // PageURL is the feed itself. @@ -89,15 +89,15 @@ func (f Feed) Find(b []byte) (kit.Notices, error) { // Events are an event per finding, citing citeURL; a dropped finding is // logged with why. -func (f Feed) Events(found kit.Notices, citeURL string, now time.Time) ([]event.ChangeEvent, []event.EventV2, []error) { - var events []event.EventV2 +func (f Feed) Events(found kit.Notices, citeURL string, now time.Time) ([]event.Event, []error) { + var events []event.Event var rejected []error for _, fd := range found.(Findings) { if fd.Dropped != "" { log.Printf("%s: dropped %s: %s", f.API, fd.Entry, fd.Dropped) continue } - e := event.EventV2{ + e := event.Event{ API: f.API, Version: fd.Version, ChangeType: fd.ChangeType, @@ -110,12 +110,12 @@ func (f Feed) Events(found kit.Notices, citeURL string, now time.Time) ([]event. Confidence: 1.0, DetectedAt: now, } - e.Fingerprint = event.FingerprintV2(e.API, e.Version, e.ChangeType, e.Subject, "") + e.Fingerprint = event.Fingerprint(e.API, e.Version, e.ChangeType, e.Subject, "") if err := e.Validate(); err != nil { rejected = append(rejected, fmt.Errorf("%s %s: %w", f.API, fd.Entry, err)) continue } events = append(events, e) } - return nil, events, rejected + return events, rejected } diff --git a/plugins/notices/feed/readers.go b/plugins/notices/feed/readers.go index b343708..2e69318 100644 --- a/plugins/notices/feed/readers.go +++ b/plugins/notices/feed/readers.go @@ -15,7 +15,7 @@ import ( // runner image retirement names the date ("The macOS 14 runner image will be // retired on November 2, 2026.") and lists the `runs-on` labels it removes. var GitHubActions = Feed{ - API: "github-actions", + API: "github/actions", Vendor: "GitHub", URL: "https://github.blog/changelog/label/actions/feed/", Read: readGitHubActions, @@ -27,7 +27,7 @@ var GitHubActions = Feed{ // deprecation is a "Deprecated" section with a table of model ids in // (discontinued, recommended migration) and the date to move by. var VertexAIModels = Feed{ - API: "vertex-ai-models", + API: "google/vertex-ai-models", Vendor: "Google", URL: "https://docs.cloud.google.com/feeds/generative-ai-on-vertex-ai-release-notes.xml", Read: readVertexAI, @@ -40,7 +40,7 @@ var VertexAIModels = Feed{ // list item, kept apart from "Affected APIs:" (endpoints that only change), // and gives "Deprecation date:" and, for most since 2025, "End of life date:". var CloudflareAPI = Feed{ - API: "cloudflare", + API: "cloudflare/api", Vendor: "Cloudflare", URL: "https://developers.cloudflare.com/fundamentals/api/reference/deprecations/index.xml", Read: readCloudflareAPI, @@ -335,7 +335,7 @@ func readCloudflareAPI(e Entry) []Finding { out = append(out, Finding{ ChangeType: ct, Version: date, - Subject: event.Subject{Type: event.SubjectAPIOperation, Kind: event.AffectedKindOperation, Side: event.SideRequest, Operation: operation}, + Subject: event.Subject{Type: event.SubjectAPIOperation, Kind: event.KindOperation, Side: event.SideRequest, Operation: operation}, Description: desc, Hint: "Move to the replacement Cloudflare names in its deprecation notice: " + e.Link, Excerpt: excerpt(append(quote, "Deprecated APIs:", text)...), diff --git a/plugins/notices/feed_golden_test.go b/plugins/notices/feed_golden_test.go index 05a986e..40953b0 100644 --- a/plugins/notices/feed_golden_test.go +++ b/plugins/notices/feed_golden_test.go @@ -1,6 +1,7 @@ package notices import ( + "strings" "testing" "github.com/patch-it-dev/patch-it-plugins/core/kit/kittest" @@ -27,7 +28,7 @@ func TestFeedsGolden(t *testing.T) { if archive.Calls != 1 { t.Errorf("%d snapshots, want 1", archive.Calls) } - kittest.Golden(t, "testdata/golden/"+c.feed.API+".json", got) + kittest.Golden(t, "testdata/golden/"+strings.ReplaceAll(c.feed.API, "/", "-")+".json", got) }) } } diff --git a/plugins/notices/notices.go b/plugins/notices/notices.go index 03f160c..a01d8a9 100644 --- a/plugins/notices/notices.go +++ b/plugins/notices/notices.go @@ -24,7 +24,6 @@ import ( "github.com/patch-it-dev/patch-it-plugins/core/event" "github.com/patch-it-dev/patch-it-plugins/core/fetch" "github.com/patch-it-dev/patch-it-plugins/core/kit" - "github.com/patch-it-dev/patch-it-plugins/core/migrate" "github.com/patch-it-dev/patch-it-plugins/core/plugin" "github.com/patch-it-dev/patch-it-plugins/core/versions" "github.com/patch-it-dev/patch-it-plugins/plugins/notices/eol" @@ -95,16 +94,15 @@ func init() { // Page is one live page of notices and how it reads: retire.Page, // feed.Feed and eol.Page. type Page interface { - // Slug is the events' api and the source's old slug: "openai-models". + // Slug is the source id the events carry in api: "openai/models". Slug() string // PageURL is the live page. PageURL() string // Find reads the page's notices. Find(page []byte) (kit.Notices, error) - // Events turn what Find read into events citing citeURL: v1 events - // (converted here) or v2 ones, and the notices that failed to become - // events. - Events(found kit.Notices, citeURL string, now time.Time) (v1 []event.ChangeEvent, v2 []event.EventV2, rejected []error) + // Events turn what Find read into events citing citeURL, and the + // notices that failed to become events. + Events(found kit.Notices, citeURL string, now time.Time) ([]event.Event, []error) } // shapeGuarded is a Page whose read with far fewer notices than the last @@ -165,12 +163,11 @@ func (p Plugin) Run(ctx context.Context, env plugin.Env) (plugin.Result, error) } now := env.Now().UTC() - v1, v2, rejected := pg.Events(got, snapURL, now) - converted, invalid := migrate.Fresh(v1) + events, rejected := pg.Events(got, snapURL, now) // The hash of the live page, so the next run compares like with like. - baseline := plugin.Baseline(api, now.Format("2006-01-02"), snapURL, snapURL, snap, false, now) + baseline := plugin.Baseline(api, now.Format("2006-01-02"), snapURL, snapURL, snap, now) baseline.SHA256 = hash - return plugin.Result{Label: snapURL, Events: append(converted, v2...), Rejected: append(rejected, invalid...), Baselines: []plugin.Spec{baseline}}, nil + return plugin.Result{Label: snapURL, Events: events, Rejected: rejected, Baselines: []plugin.Spec{baseline}}, nil } // fetch reads the live page. When the page's reader asks for it @@ -256,15 +253,14 @@ func (p Plugin) Extract(_ context.Context, env plugin.Env, from, to plugin.Snaps return plugin.Result{Label: to.SourceURL, Events: events, Rejected: rejected}, nil } -// events reads one snapshot's notices into v2 events citing it. -func (p Plugin) events(s plugin.Snapshot, now time.Time) ([]event.EventV2, []error, error) { +// events reads one snapshot's notices into events citing it. +func (p Plugin) events(s plugin.Snapshot, now time.Time) ([]event.Event, []error, error) { found, err := p.Page.Find(s.Content) if err != nil { return nil, nil, fmt.Errorf("reading %s: %w", s.SourceURL, err) } - v1, v2, rejected := p.Page.Events(found, s.SourceURL, now) - converted, invalid := migrate.Fresh(v1) - return append(converted, v2...), append(rejected, invalid...), nil + events, rejected := p.Page.Events(found, s.SourceURL, now) + return events, rejected, nil } var _ plugin.Versioned = Plugin{} diff --git a/plugins/notices/retire/notices.go b/plugins/notices/retire/notices.go index 3fb2ced..dc365f8 100644 --- a/plugins/notices/retire/notices.go +++ b/plugins/notices/retire/notices.go @@ -15,7 +15,7 @@ type Retirements []Retirement // Count is how many retirements the page lists. func (rs Retirements) Count() int { return len(rs) } -// Slug is the events' api: "openai-models". +// Slug is the source id the events carry: "openai/models". func (p Page) Slug() string { return p.API } // PageURL is the page, as markdown. @@ -27,12 +27,9 @@ func (p Page) Find(page []byte) (kit.Notices, error) { return Retirements(rs), err } -// Events are a v1 event per retired model, citing citeURL (the kind -// converts them to v2: core/migrate reads this package, so it can't be -// called from here). -func (p Page) Events(found kit.Notices, citeURL string, now time.Time) ([]event.ChangeEvent, []event.EventV2, []error) { - v1, errs := Events(p, found.(Retirements), citeURL, now) - return v1, nil, errs +// Events are an event per retired model, citing citeURL. +func (p Page) Events(found kit.Notices, citeURL string, now time.Time) ([]event.Event, []error) { + return Events(p, found.(Retirements), citeURL, now) } // ShapeGuard is on: past retirements stay on the page, so a read with far diff --git a/plugins/notices/retire/providers.go b/plugins/notices/retire/providers.go index 9495561..61fbc03 100644 --- a/plugins/notices/retire/providers.go +++ b/plugins/notices/retire/providers.go @@ -8,21 +8,21 @@ import "strings" // sends (a fine-tuned model is "ft:gpt-4-0613:org::id"), and the "-completions" // aliases belong to the legacy Completions endpoint. var OpenAI = Page{ - API: "openai-models", - Vendor: "OpenAI", - URL: "https://developers.openai.com/api/docs/deprecations.md", - Operation: "POST /v1/chat/completions", - Keep: openAIText, + API: "openai/models", + Provider: "openai", + Vendor: "OpenAI", + URL: "https://developers.openai.com/api/docs/deprecations.md", + Keep: openAIText, } // Anthropic's model deprecations page (checked 2026-10-13): every model in // its deprecation history is a Messages API model. var Anthropic = Page{ - API: "anthropic-models", - Vendor: "Anthropic", - URL: "https://platform.claude.com/docs/en/about-claude/model-deprecations.md", - Operation: "POST /v1/messages", - Keep: func(name string) bool { return strings.HasPrefix(name, "claude-") }, + API: "anthropic/models", + Provider: "anthropic", + Vendor: "Anthropic", + URL: "https://platform.claude.com/docs/en/about-claude/model-deprecations.md", + Keep: func(name string) bool { return strings.HasPrefix(name, "claude-") }, } var ( diff --git a/plugins/notices/retire/retire.go b/plugins/notices/retire/retire.go index 1c3d673..4b5960d 100644 --- a/plugins/notices/retire/retire.go +++ b/plugins/notices/retire/retire.go @@ -21,10 +21,10 @@ import ( // Page is one provider's deprecations page and what its models are sent to. type Page struct { - API string // the api slug the events carry, e.g. "openai-models" - Vendor string // for sentences: "OpenAI" - URL string // the page as markdown - Operation string // the provider's main call that takes a model name + API string // the source id the events carry: "openai/models" + Provider string // the model subject's provider: "openai" + Vendor string // for sentences: "OpenAI" + URL string // the page as markdown // Keep says whether a model name belongs to this source: the operations // above take text models, not image, audio or embedding ones. Keep func(name string) bool @@ -191,33 +191,27 @@ func parseDate(s string) (string, error) { return "", fmt.Errorf("not a date: %q", s) } -// Events turns retirements into change events, one per model name: the -// `model` parameter can no longer take that name, in any of the provider's -// calls. affected.operation is the provider's main one; the patch-it client -// looks for the name wherever it reaches the provider's SDK, so one event per -// name gives one fix per repo, not one per operation for the same line. -// version is the shutdown date, so a provider moving the date is a new event. -// sourceURL is the snapshot the retirements were read from. -func Events(p Page, rs []Retirement, sourceURL string, now time.Time) ([]event.ChangeEvent, []error) { - var events []event.ChangeEvent +// Events turns retirements into change events, one per model name: a model +// subject, the provider and the name, and the replacement when the provider +// names exactly one model. The patch-it client looks for the name wherever +// it reaches the provider's SDK, so one event per name gives one fix per +// repo. version is the shutdown date, so a provider moving the date is a new +// event. sourceURL is the snapshot the retirements were read from. +func Events(p Page, rs []Retirement, sourceURL string, now time.Time) ([]event.Event, []error) { + var events []event.Event var errs []error for _, r := range rs { - affected := event.Affected{ - Kind: event.AffectedKindRequestParameter, - Side: event.SideRequest, - Operation: p.Operation, - Property: "model", - Value: r.Model, - } - e := event.ChangeEvent{ - Fingerprint: event.Fingerprint(p.API, r.Date, event.ChangeTypeBreaking, affected, r.Model), + h := hint(p.Vendor, r) + subject := event.Subject{Type: event.SubjectModel, Provider: p.Provider, Name: r.Model, Replacement: replacement(r.Replacement)} + e := event.Event{ + Fingerprint: event.Fingerprint(p.API, r.Date, event.ChangeTypeBreaking, subject, ""), API: p.API, Version: r.Date, ChangeType: event.ChangeTypeBreaking, Breaking: true, - Affected: affected, + Subject: subject, Description: fmt.Sprintf("Model %q is shut down on %s: %s requests naming it fail from that date.", r.Model, r.Date, p.Vendor), - MigrationHint: hint(p.Vendor, r), + MigrationHint: h, SourceURL: sourceURL, SourceExcerpt: r.Excerpt, Confidence: 1.0, @@ -232,6 +226,19 @@ func Events(p Page, rs []Retirement, sourceURL string, now time.Time) ([]event.C return events, errs } +// replacement is the one model the provider names, when its replacement cell +// is exactly one model name: not none, not several, not a model with a +// setting (`gpt-5.6-sol` (`reasoning.mode: pro`)). The patch-it client opens +// an issue for the rest. +func replacement(cell string) string { + cell = strings.TrimSpace(cell) + name := First(cell) + if name == "" || cell != "`"+name+"`" { + return "" + } + return name +} + func hint(vendor string, r Retirement) string { repl := strings.TrimSpace(r.Replacement) if First(repl) == "" { diff --git a/plugins/notices/retire/retire_test.go b/plugins/notices/retire/retire_test.go index 02f3c20..505108e 100644 --- a/plugins/notices/retire/retire_test.go +++ b/plugins/notices/retire/retire_test.go @@ -168,16 +168,22 @@ func TestEventsOnePerModel(t *testing.T) { t.Fatalf("events %d, errs %v", len(events), errs) } e := events[0] - want := event.Affected{Kind: event.AffectedKindRequestParameter, Side: event.SideRequest, Operation: "POST /v1/chat/completions", Property: "model", Value: "gpt-4"} - if e.Affected != want { - t.Errorf("affected: %+v", e.Affected) + want := event.Subject{Type: event.SubjectModel, Provider: "openai", Name: "gpt-4", Replacement: "gpt-5.6-sol"} + if e.Subject.Type != want.Type || e.Subject.Provider != want.Provider || e.Subject.Name != want.Name || e.Subject.Replacement != want.Replacement { + t.Errorf("subject: %+v", e.Subject) } - if e.API != "openai-models" || e.Version != "2026-10-23" || e.PreviousVersion != "" || !e.Breaking || + if e.API != "openai/models" || e.Version != "2026-10-23" || e.PreviousVersion != "" || !e.Breaking || e.SourceURL != src || e.SourceExcerpt != rs[0].Excerpt || e.Confidence != 1.0 { t.Errorf("event: %+v", e) } - if e.Fingerprint != event.Fingerprint("openai-models", "2026-10-23", event.ChangeTypeBreaking, e.Affected, "gpt-4") { - t.Error("the fingerprint's detail is the model name") + if e.Fingerprint != event.Fingerprint("openai/models", "2026-10-23", event.ChangeTypeBreaking, e.Subject, "") { + t.Error("the fingerprint is the contract's formula over the model subject") + } + // The replacement is set only when the provider names exactly one model. + for cell, want := range map[string]string{"`gpt-5.6-sol`": "gpt-5.6-sol", "`a` or `b`": "", "`gpt-5.6-sol` (`reasoning.mode: pro`)": "", "none": ""} { + if got := replacement(cell); got != want { + t.Errorf("replacement(%q) = %q, want %q", cell, got, want) + } } if !strings.Contains(e.Description, `"gpt-4"`) || !strings.Contains(e.MigrationHint, "gpt-5.6-sol") { t.Errorf("%q / %q", e.Description, e.MigrationHint) diff --git a/plugins/notices/retirements_golden_test.go b/plugins/notices/retirements_golden_test.go index e3b356d..2ec3eb0 100644 --- a/plugins/notices/retirements_golden_test.go +++ b/plugins/notices/retirements_golden_test.go @@ -1,6 +1,7 @@ package notices import ( + "strings" "testing" "github.com/patch-it-dev/patch-it-plugins/core/kit/kittest" @@ -22,7 +23,7 @@ func TestRetirementsGolden(t *testing.T) { if archive.Calls != 1 { t.Errorf("%d snapshots, want 1: the second run's page is unchanged", archive.Calls) } - kittest.Golden(t, "testdata/golden/"+page.API+".json", got) + kittest.Golden(t, "testdata/golden/"+strings.ReplaceAll(page.API, "/", "-")+".json", got) }) } } diff --git a/plugins/notices/testdata/golden/anthropic-models.json b/plugins/notices/testdata/golden/anthropic-models.json index 39f5393..911286f 100644 --- a/plugins/notices/testdata/golden/anthropic-models.json +++ b/plugins/notices/testdata/golden/anthropic-models.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:084327582be7b72ed1dab946e16cc3df07f54e24294a0e23ffb14169ff822b26", - "api": "anthropic-models", + "fingerprint": "sha256:bf9dc66e694d48792f443cfa0a83407438ba84d9908fe8d159440896068ac486", + "api": "anthropic/models", "version": "2026-11-30", "change_type": "breaking", "breaking": true, @@ -21,8 +21,8 @@ }, { "id": 2, - "fingerprint": "sha256:de5c53ea734f00774aee2b30102294a59218f270d9eba3d1134b54a44a38e6b3", - "api": "anthropic-models", + "fingerprint": "sha256:bb9908fbd60b90f608a4d2527ab5e1b0e308387e7f95fbd5434712668555db03", + "api": "anthropic/models", "version": "2026-08-05", "change_type": "breaking", "breaking": true, @@ -41,8 +41,8 @@ }, { "id": 3, - "fingerprint": "sha256:fd964537b6da9ee4f3164f4cb710a53b31a1e97941aebaf6f573052dbdfaece3", - "api": "anthropic-models", + "fingerprint": "sha256:acbe6e761b6bc504fcc0a76745325c1debee73580cde96660d9831f57269fad9", + "api": "anthropic/models", "version": "2026-06-15", "change_type": "breaking", "breaking": true, @@ -61,8 +61,8 @@ }, { "id": 4, - "fingerprint": "sha256:ebe12a21a35277f4d52a341cef868461b12d1eb6af273acde8c55039e1f50dc0", - "api": "anthropic-models", + "fingerprint": "sha256:e8595a6279ec27c8401bb8e22040ea635d62229de1895e07272ba147b8f23cc0", + "api": "anthropic/models", "version": "2026-06-15", "change_type": "breaking", "breaking": true, @@ -81,8 +81,8 @@ }, { "id": 5, - "fingerprint": "sha256:03eea9104a387fd961d2700e4003239a78a00792cb7398f40f7a796f20848cbd", - "api": "anthropic-models", + "fingerprint": "sha256:dd9954ebdca4a5b7bebc9a3eb90b12692d5aef06cbeb83f98d35c1b613fc4144", + "api": "anthropic/models", "version": "2026-04-20", "change_type": "breaking", "breaking": true, @@ -101,8 +101,8 @@ }, { "id": 6, - "fingerprint": "sha256:22bf5e0f9b79bc77948998da9f0a5d198aa9281cbb0ec5942c123b6b9c4236c8", - "api": "anthropic-models", + "fingerprint": "sha256:806bb2b5795722c4fa651bc70f43f812fc28a7f02c97c75c6080b1a5ae234878", + "api": "anthropic/models", "version": "2026-02-19", "change_type": "breaking", "breaking": true, @@ -121,8 +121,8 @@ }, { "id": 7, - "fingerprint": "sha256:90cca623ba7cffd30a8c0538ed15709408cee309c8b6708497d178576ff64f20", - "api": "anthropic-models", + "fingerprint": "sha256:17b575b6086b4189e150014dca87c0e6bf856e64f772b24b538f180beea81f56", + "api": "anthropic/models", "version": "2026-02-19", "change_type": "breaking", "breaking": true, @@ -141,8 +141,8 @@ }, { "id": 8, - "fingerprint": "sha256:05c32a5887d178daa274431aefe103f86af244ab71e16c61b8043aa3bd2112ab", - "api": "anthropic-models", + "fingerprint": "sha256:bd42e7d7a185f3edd5d21f300d5f350f960079ce1de4676949a0d83e6140ce74", + "api": "anthropic/models", "version": "2025-10-28", "change_type": "breaking", "breaking": true, @@ -161,8 +161,8 @@ }, { "id": 9, - "fingerprint": "sha256:0c9ee5a399c70ff35b35767313d79b794d8f3d8c2673a70b15eb2930f2f7741c", - "api": "anthropic-models", + "fingerprint": "sha256:1f6698c66029b5d94cb452eeb8ecc6a03f623759833b6f21a69f53a0c5b2984d", + "api": "anthropic/models", "version": "2025-10-28", "change_type": "breaking", "breaking": true, @@ -181,8 +181,8 @@ }, { "id": 10, - "fingerprint": "sha256:f53cd0d0bb782d85312468938c7fe5a6236d49564db0d26405e4e5289e99c4ee", - "api": "anthropic-models", + "fingerprint": "sha256:0428d4c806abbf7ccf25718a3fe238279b280d2e8f6b8fe689d1a786481f9f40", + "api": "anthropic/models", "version": "2026-01-05", "change_type": "breaking", "breaking": true, @@ -201,8 +201,8 @@ }, { "id": 11, - "fingerprint": "sha256:7927bd5d04931984a0fe16766ec971df4a833bc651608a3ebe811f6c5ec5ba67", - "api": "anthropic-models", + "fingerprint": "sha256:bbe44fbfc6527ac3b4fd0b481eff836c6f0995700ecc4b94d930bc8941e0d597", + "api": "anthropic/models", "version": "2025-07-21", "change_type": "breaking", "breaking": true, @@ -221,8 +221,8 @@ }, { "id": 12, - "fingerprint": "sha256:ca052eb79284d07aa694e624136a1d7b5faef1a73ac909a516d76a3e8d1313df", - "api": "anthropic-models", + "fingerprint": "sha256:146d061d088109e98ae03d63a075e5e06ebb513d5d2143fafc0596b91daa4256", + "api": "anthropic/models", "version": "2025-07-21", "change_type": "breaking", "breaking": true, @@ -241,8 +241,8 @@ }, { "id": 13, - "fingerprint": "sha256:6d728cac5aa3315f62b432608b50f17746b1440c23be6fbabcc6dbc69eceb6c9", - "api": "anthropic-models", + "fingerprint": "sha256:eadc4ebf13f46a084d4331c734ac8e6550dc6d53c0f93b9083ceb849b8fe1be6", + "api": "anthropic/models", "version": "2025-07-21", "change_type": "breaking", "breaking": true, @@ -261,8 +261,8 @@ }, { "id": 14, - "fingerprint": "sha256:8ed0aa3c3bc723fb037da3081e121465555e9ffb5974f8d352fac3e6ae11d673", - "api": "anthropic-models", + "fingerprint": "sha256:8b03c1ec82e23fe22c0d178d92ea22b1154adbffede5509af1d77439009c70c2", + "api": "anthropic/models", "version": "2024-11-06", "change_type": "breaking", "breaking": true, @@ -281,8 +281,8 @@ }, { "id": 15, - "fingerprint": "sha256:f08e6cd2a06258d5d814fc971cc135e90c7341f94debd60376103924e1de07a4", - "api": "anthropic-models", + "fingerprint": "sha256:7527709cc6692b6c31ae8149fcfda97149b28d41a9fa7437c2848c17e639893d", + "api": "anthropic/models", "version": "2024-11-06", "change_type": "breaking", "breaking": true, @@ -301,8 +301,8 @@ }, { "id": 16, - "fingerprint": "sha256:13efff6d094eb24a1b2965a07b52338bdce99f41a9e35dceed8532b583585738", - "api": "anthropic-models", + "fingerprint": "sha256:5e4dd9e6a098fc16bf1db022e3d9aab838a657ef4b7284996a0f39c1475bdaac", + "api": "anthropic/models", "version": "2024-11-06", "change_type": "breaking", "breaking": true, @@ -321,8 +321,8 @@ }, { "id": 17, - "fingerprint": "sha256:d7486d997bc1263f928dec6d235cfb953d7d7b9498d84bb47cf91af328216d75", - "api": "anthropic-models", + "fingerprint": "sha256:33f19a2640035c553ab915ec77169bc3f74e7664733c391eb509587977c6b180", + "api": "anthropic/models", "version": "2024-11-06", "change_type": "breaking", "breaking": true, @@ -341,8 +341,8 @@ }, { "id": 18, - "fingerprint": "sha256:e86ec257be0151e390960ebabd7ce295dee95ea5f61ae3c99ea1173eb3850fd9", - "api": "anthropic-models", + "fingerprint": "sha256:deda532ae210b3cef3858d6e93d60c6bf1d399da9cf4a3e5cc99878ba28dbe3e", + "api": "anthropic/models", "version": "2024-11-06", "change_type": "breaking", "breaking": true, @@ -361,8 +361,8 @@ }, { "id": 19, - "fingerprint": "sha256:9da76f1f748a2dc4b385db61dc185b78ecd20a8fffb2ddbac5b2ed8f248b62ab", - "api": "anthropic-models", + "fingerprint": "sha256:a6b4d99422328b062908402e3099c31ae310217f7fec120a3edc7fed68e6d761", + "api": "anthropic/models", "version": "2024-11-06", "change_type": "breaking", "breaking": true, @@ -381,8 +381,8 @@ }, { "id": 20, - "fingerprint": "sha256:38f84d91196bce749ca3796d9fe6b29150f98b80c954bc4483a9c80783cfae27", - "api": "anthropic-models", + "fingerprint": "sha256:bb55c886fefe4e73c8aeed5252eec689481baa9778c2bc3c75f89eb3882b16d9", + "api": "anthropic/models", "version": "2024-11-06", "change_type": "breaking", "breaking": true, diff --git a/plugins/notices/testdata/golden/cloudflare.json b/plugins/notices/testdata/golden/cloudflare-api.json similarity index 89% rename from plugins/notices/testdata/golden/cloudflare.json rename to plugins/notices/testdata/golden/cloudflare-api.json index ea3315b..8f49629 100644 --- a/plugins/notices/testdata/golden/cloudflare.json +++ b/plugins/notices/testdata/golden/cloudflare-api.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:209ddd00515aa5cebf08cb938b875fd2ef664727df8bb83fdea189732f5168e8", - "api": "cloudflare", + "fingerprint": "sha256:cb56adac1f3a1b3f106171fbc370c0ed910ca4e26c265a8af4d9b611a8ccd28d", + "api": "cloudflare/api", "version": "2026-10-02", "change_type": "deprecation", "breaking": false, @@ -21,8 +21,8 @@ }, { "id": 2, - "fingerprint": "sha256:095bb0d08a6d7ab6159f96dd4c191b56dd836f287cb96d969e5a6d6350d5754a", - "api": "cloudflare", + "fingerprint": "sha256:09b314da125464c093d1f10907f3fbe93ba350f997632cac22cc01c508128c0d", + "api": "cloudflare/api", "version": "2026-10-02", "change_type": "deprecation", "breaking": false, @@ -41,8 +41,8 @@ }, { "id": 3, - "fingerprint": "sha256:706bbb62f4ff0de0061393f4c4c18e854cd2360ccd4f726d032d1cb8b43c1a82", - "api": "cloudflare", + "fingerprint": "sha256:30a6eacd3f6453c61a3c773d58d7562cf8a385bd5a27a0d63ebf1b4d0ebd2a7c", + "api": "cloudflare/api", "version": "2026-10-02", "change_type": "deprecation", "breaking": false, @@ -61,8 +61,8 @@ }, { "id": 4, - "fingerprint": "sha256:3df534ff61a7b210ebe1310dbf47e1ba32229f9bcf1e7585d652b79235749168", - "api": "cloudflare", + "fingerprint": "sha256:c7819950049c77f39919033207cbc15c099ab07cb905ca86160ecb8a155082cd", + "api": "cloudflare/api", "version": "2027-03-31", "change_type": "breaking", "breaking": true, @@ -81,8 +81,8 @@ }, { "id": 5, - "fingerprint": "sha256:a09cf2e8d23cf3ade9289ce97b91df9b314daa6050d14b4c86157f6c51520e5a", - "api": "cloudflare", + "fingerprint": "sha256:bedb26c4e258748b9b5cc003f057ec7f35f4d24d06fa20f6f8c9ff2f31057e92", + "api": "cloudflare/api", "version": "2027-03-31", "change_type": "breaking", "breaking": true, @@ -101,8 +101,8 @@ }, { "id": 6, - "fingerprint": "sha256:189782cdada124dcd9ea5e8cd3e6dcdac707d6209fdc7da6174dc8a404273362", - "api": "cloudflare", + "fingerprint": "sha256:42e4b366ee1ff7e298943b79aa8a6dc4463d359040fab9dad8b01c151d3e778b", + "api": "cloudflare/api", "version": "2026-07-21", "change_type": "deprecation", "breaking": false, @@ -121,8 +121,8 @@ }, { "id": 7, - "fingerprint": "sha256:7eb4e1ca1ad0bb61ea024565a99ee48e76a3adbb77b6ac8f2f57026c1d2eaf78", - "api": "cloudflare", + "fingerprint": "sha256:bb96b97266df769aa7fcaccb9acb5a9c45d6710dae6cdd7dbe896b0f8ae2c50e", + "api": "cloudflare/api", "version": "2026-07-21", "change_type": "deprecation", "breaking": false, @@ -141,8 +141,8 @@ }, { "id": 8, - "fingerprint": "sha256:d128202f22ae680b9a03f9d3d3475a91140ae84044c4b98152dfc7d96121bf13", - "api": "cloudflare", + "fingerprint": "sha256:5e8f496408a25bba3b6e1df484c6bad28589213a2ed30ad95d60bf9b7248ca36", + "api": "cloudflare/api", "version": "2026-07-15", "change_type": "deprecation", "breaking": false, @@ -161,8 +161,8 @@ }, { "id": 9, - "fingerprint": "sha256:1afde189e87011f919bb956877bfa84c1d2f3b4c958f611bd391943b94d8011e", - "api": "cloudflare", + "fingerprint": "sha256:c74cc4fe6bd7220de67702e2c4b95c769b5a25ae9268568fc0dfb8cb7b511284", + "api": "cloudflare/api", "version": "2026-07-15", "change_type": "deprecation", "breaking": false, @@ -181,8 +181,8 @@ }, { "id": 10, - "fingerprint": "sha256:83bad8063ef5cd42941e191cb55f9ca0da0c9943708d94c1d91f6b3bf353bca1", - "api": "cloudflare", + "fingerprint": "sha256:18cad2ef2fe48e787f1aa8f03a2585bf488789b96454cf62f33dc110a7fd7faa", + "api": "cloudflare/api", "version": "2026-07-09", "change_type": "deprecation", "breaking": false, @@ -201,8 +201,8 @@ }, { "id": 11, - "fingerprint": "sha256:a755942720b697c4c3de6632044774b926263ba4ba7af49fe6e513ac8f35eb44", - "api": "cloudflare", + "fingerprint": "sha256:a6adf32eab7e1b63c7147678a4954ba76bff4b087e0ac7fcc3c6c5e738ff16d3", + "api": "cloudflare/api", "version": "2026-07-09", "change_type": "deprecation", "breaking": false, @@ -221,8 +221,8 @@ }, { "id": 12, - "fingerprint": "sha256:e60470c34960ec5b86ddc473e4cb3452f8398499338b0a42cd0ccbda1f08c6ea", - "api": "cloudflare", + "fingerprint": "sha256:3ea497d35767362d916e4a043f4f5b9c1305ef5a195a83bab759492e980f5d2a", + "api": "cloudflare/api", "version": "2026-07-09", "change_type": "deprecation", "breaking": false, @@ -241,8 +241,8 @@ }, { "id": 13, - "fingerprint": "sha256:8398452c438a2b45a3d0a959957372e493aa23550e0138668d3700fe686417f4", - "api": "cloudflare", + "fingerprint": "sha256:a22b1027c2c81b3b926ba8e9efba378a018be84818dd90e46d6e18173bda543a", + "api": "cloudflare/api", "version": "2025-09-18", "change_type": "deprecation", "breaking": false, @@ -261,8 +261,8 @@ }, { "id": 14, - "fingerprint": "sha256:7232528a748069c053a9e96e9fb8f43a6d7cdfacfad100fb69095d57b1f66791", - "api": "cloudflare", + "fingerprint": "sha256:17b581c0fb930cece080b79d7274e6d5b6a0d3008bd35c42d02dfe61664bc486", + "api": "cloudflare/api", "version": "2025-09-18", "change_type": "deprecation", "breaking": false, @@ -281,8 +281,8 @@ }, { "id": 15, - "fingerprint": "sha256:7f3f03f8b019badcf7557176aef5644abdbe8362c7347f0a2b7c3e7358259536", - "api": "cloudflare", + "fingerprint": "sha256:75d26824c9ee18c8106edf4ddbae2a72d8a437fc109b4d76c029a43076e2311b", + "api": "cloudflare/api", "version": "2026-09-27", "change_type": "breaking", "breaking": true, @@ -301,8 +301,8 @@ }, { "id": 16, - "fingerprint": "sha256:ed9ddd02851073a6d0bac4c12f236d61a5d6af16ceb55ed4b32dc87c2741a6b3", - "api": "cloudflare", + "fingerprint": "sha256:f40cf57ea9ebde836781999db0c4ed64e61d03ccf1d9f52842c9b3df9d54bc9b", + "api": "cloudflare/api", "version": "2026-09-27", "change_type": "breaking", "breaking": true, @@ -321,8 +321,8 @@ }, { "id": 17, - "fingerprint": "sha256:907cc7e4b5f4e00cbdc0dba6d090b5a957fea0fa1ba1ea11b73747a53160d5c8", - "api": "cloudflare", + "fingerprint": "sha256:1c722f6fea1c80a215657c119c6a26790387d00a538a95005a82e46c9488e56c", + "api": "cloudflare/api", "version": "2026-09-27", "change_type": "breaking", "breaking": true, @@ -341,8 +341,8 @@ }, { "id": 18, - "fingerprint": "sha256:59a179a3b256a1a8fb6aa1ca82415bb1aa6731ecd370144b010ec45ba871fdda", - "api": "cloudflare", + "fingerprint": "sha256:9c4478afa6ea8f69da6bb8621392fd5d8c02e3ccb3f5c75670fe10e720983428", + "api": "cloudflare/api", "version": "2025-12-09", "change_type": "deprecation", "breaking": false, @@ -361,8 +361,8 @@ }, { "id": 19, - "fingerprint": "sha256:f04495a8c3948059289f591d613fee71644907251bf014999e9f6b10dfc3d562", - "api": "cloudflare", + "fingerprint": "sha256:1b1459ce03ac27a49e8d75678ca4f389130da1083b4042b4ad92fe9ed022beb5", + "api": "cloudflare/api", "version": "2025-12-09", "change_type": "deprecation", "breaking": false, @@ -381,8 +381,8 @@ }, { "id": 20, - "fingerprint": "sha256:f71e2b70483429b09ed8234c4c65467a547bca6cc748739d52c5f52ea0cca242", - "api": "cloudflare", + "fingerprint": "sha256:3d3a8051a8e6fafad5e79bc47334f8a4fbd4c01d3796d96d52583f674dd28e45", + "api": "cloudflare/api", "version": "2025-11-11", "change_type": "deprecation", "breaking": false, @@ -401,8 +401,8 @@ }, { "id": 21, - "fingerprint": "sha256:d7fce55c7ed5362902f9d79ac3abcc126915b4cf5798af923641a3f2feb19ad8", - "api": "cloudflare", + "fingerprint": "sha256:4e60f8fa58582e8def499610e7b81eab46dade7ec3964299482626980995d627", + "api": "cloudflare/api", "version": "2025-11-11", "change_type": "deprecation", "breaking": false, @@ -421,8 +421,8 @@ }, { "id": 22, - "fingerprint": "sha256:96de321c4419cf143ce9103ad9018c4cf4e634c5fe279532e148197bcddd8d3d", - "api": "cloudflare", + "fingerprint": "sha256:1853eaf0d910625df4d8d43bb8f2440f9d92c0465c4cf64dc5c4d96c129510a0", + "api": "cloudflare/api", "version": "2025-11-11", "change_type": "deprecation", "breaking": false, @@ -441,8 +441,8 @@ }, { "id": 23, - "fingerprint": "sha256:961a36a4de964359c0732a579fa61417731a7c3cb9ab3c1932c08f6594971996", - "api": "cloudflare", + "fingerprint": "sha256:e36dc8458b216953d0efd03dd378d68ec7cf0cf6ddea8a2fe38887399f7abeec", + "api": "cloudflare/api", "version": "2025-11-11", "change_type": "deprecation", "breaking": false, @@ -461,8 +461,8 @@ }, { "id": 24, - "fingerprint": "sha256:172b49f795efc781579953e0400d0007b618e5a7b0e115ef464d8abef5cfc86b", - "api": "cloudflare", + "fingerprint": "sha256:ad3e460c87337f2a896091614fdcd3b88d72720dc312a79b0aebe50246fbbf8d", + "api": "cloudflare/api", "version": "2025-11-11", "change_type": "deprecation", "breaking": false, @@ -481,8 +481,8 @@ }, { "id": 25, - "fingerprint": "sha256:daaf98779f5f83c9a5f34d0ed67847230d45f1825e94456fdc5111cae820dbfb", - "api": "cloudflare", + "fingerprint": "sha256:f8a8cfd845a7c2ab4c1b7c050d847ae2c47c804e8b99b7f60e9097a945a273a7", + "api": "cloudflare/api", "version": "2025-11-03", "change_type": "deprecation", "breaking": false, @@ -501,8 +501,8 @@ }, { "id": 26, - "fingerprint": "sha256:c57dea043cc2a04ce7df956b4b61c63e40657b336e37be3ba65c46d3fda64d87", - "api": "cloudflare", + "fingerprint": "sha256:8c78397dd771f2d2bb226d7dcaaaf583ed67953839244a16df26e77348fbcf52", + "api": "cloudflare/api", "version": "2025-11-03", "change_type": "deprecation", "breaking": false, @@ -521,8 +521,8 @@ }, { "id": 27, - "fingerprint": "sha256:e987c02319e1f96b95aaec1b23ee4ee9fedc1cd98130fc23a4e8f0cc015062a1", - "api": "cloudflare", + "fingerprint": "sha256:d87ac63c4f437079a03c4ce1cb086d0c2e3359d1430aae6868feace096519e7b", + "api": "cloudflare/api", "version": "2025-07-01", "change_type": "deprecation", "breaking": false, @@ -541,8 +541,8 @@ }, { "id": 28, - "fingerprint": "sha256:3f004d30d18cd6ad9586fe4f48e0318e47918357fd2d7ce67bf675d5a76128b3", - "api": "cloudflare", + "fingerprint": "sha256:3415b78258b0540ed234add1379e0e735f46b695e98096dba089e707e3d1b045", + "api": "cloudflare/api", "version": "2025-07-01", "change_type": "deprecation", "breaking": false, @@ -561,8 +561,8 @@ }, { "id": 29, - "fingerprint": "sha256:e5dc3d6affae56a3b6e97af875cc96e1f0dd7b75ef52437e0adfb2b8bd467549", - "api": "cloudflare", + "fingerprint": "sha256:ce2ffc810d604c55bec6b39856d3a81e2c97a8283b88e49dc7558f58f29ae344", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -581,8 +581,8 @@ }, { "id": 30, - "fingerprint": "sha256:402f5e42634b5eeeb4de6e3f1b1cb1a234669a84b870ddd9c5d6b2c46a3abe3c", - "api": "cloudflare", + "fingerprint": "sha256:425ed49112f2e3782b9094a56fb34b5151353382ecef7bec60afc83aa67910f4", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -601,8 +601,8 @@ }, { "id": 31, - "fingerprint": "sha256:e0e4c986cc8f7c03bcabeb77569c816e4597aaefb5cbbb015904c10d2627deef", - "api": "cloudflare", + "fingerprint": "sha256:33414c74a174db4bed18b866950ab5369f7225077c2d2733c3c5edb19d3a834f", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -621,8 +621,8 @@ }, { "id": 32, - "fingerprint": "sha256:ed927ea74c0cdddd52eeb7fc9269f34fb70d1df4b849698a0cf1f00f9f514d78", - "api": "cloudflare", + "fingerprint": "sha256:64805446332835abca89e331bb8f3916f8cabe89c49dff6fc2ea491717b1a938", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -641,8 +641,8 @@ }, { "id": 33, - "fingerprint": "sha256:ad3882c16f87d633df7ddc6e012be0d9363557a5a45bde019fc2ec8c051654a8", - "api": "cloudflare", + "fingerprint": "sha256:9a10ede8b22e5eb07b0270642d9d39e2ba8b3e00e4aace6fc438ce3fdb3f55a7", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -661,8 +661,8 @@ }, { "id": 34, - "fingerprint": "sha256:196bcef2f268e3e088f14c0ddecb9cec7671a8c15a93c0ae64be882fb814cf6b", - "api": "cloudflare", + "fingerprint": "sha256:f9cc9aa0cc85b5387ef64d7f9425d900227ee0b1aa04ec006e98f54cec0107c5", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -681,8 +681,8 @@ }, { "id": 35, - "fingerprint": "sha256:1bde4fe7f5ec72fda97db844589f7e14277a0106295a235fe4ca99e8bb49c604", - "api": "cloudflare", + "fingerprint": "sha256:a180c38f16c53abdebcee4a7965a74d83c2a1183d997b6511fd5db39759f9fd9", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -701,8 +701,8 @@ }, { "id": 36, - "fingerprint": "sha256:da138a45d989dae74388c2b44f85921a8a44890cf123b299062b962b4df36399", - "api": "cloudflare", + "fingerprint": "sha256:7bc7e7bdfa4d514d8036aff3230c68729db4071ea4a31eef78cae0429da7a8aa", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -721,8 +721,8 @@ }, { "id": 37, - "fingerprint": "sha256:67ca1d4437e0e2290b10dd8715dec045bd96eab914eca999825fc97391cae79f", - "api": "cloudflare", + "fingerprint": "sha256:3eb5ba7e10f2f270de01e4ae557d65309444fc7d1e44a12393c284806a8f274a", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -741,8 +741,8 @@ }, { "id": 38, - "fingerprint": "sha256:84cc22ea52e09053729b1019e63a0a13a1bf4cf4ec51afd21999beb293f9889d", - "api": "cloudflare", + "fingerprint": "sha256:1191798fc9d356794bb34dacbb1c4ee0eefb8ef43cfe003507249c6d38bb8ddd", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -761,8 +761,8 @@ }, { "id": 39, - "fingerprint": "sha256:13373688facf20f79d9306387f66d8ec67ea30174d4327e83fa556cc73b38822", - "api": "cloudflare", + "fingerprint": "sha256:d869c9d886727d0a740569404f4cb6204ef9c90f951ef4b5068671fd2966247d", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -781,8 +781,8 @@ }, { "id": 40, - "fingerprint": "sha256:ad704018da18a5e7f72a901f3b4f3d93c8cd61a5521cb2864e03d7ae3eb23e66", - "api": "cloudflare", + "fingerprint": "sha256:06436d2eebf1ca793d5866ebb84b07f631f591a2efa15e0d2c52cad055ce0cd2", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -801,8 +801,8 @@ }, { "id": 41, - "fingerprint": "sha256:abef4b70fe7bd32c3f85cbd888c46e906e424466a945337feaa5de3ebe3132e1", - "api": "cloudflare", + "fingerprint": "sha256:b137d7f6e30122960f81975f3db97d7dc65291be284820b2e8595d7a517da2ad", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -821,8 +821,8 @@ }, { "id": 42, - "fingerprint": "sha256:2b0b3f686fa6c635cfa6fcb866562eb43bfaa2c14cd15846208963f79d515ed7", - "api": "cloudflare", + "fingerprint": "sha256:f52cb95e17a1267a8712549f2ea7b74748bcf0e0cd49fc2e5b2b0f289556b2d2", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -841,8 +841,8 @@ }, { "id": 43, - "fingerprint": "sha256:140e71667d384915cb91380499c9fc811b30abc13cb522b19809e3da114ba4fe", - "api": "cloudflare", + "fingerprint": "sha256:259a3b7f1d8fd6ad5af3a6b5ce2448c0dc4b0720e5be5b962956d2cf89f13618", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -861,8 +861,8 @@ }, { "id": 44, - "fingerprint": "sha256:abab68d6a871edbeafd0934b4747b1eb0b5ea456bb0a7120ab71f15d685d3ac0", - "api": "cloudflare", + "fingerprint": "sha256:be17ebd2c1ae1257cc3466756f3becd673cffaccc7cfbd51c78c7a8bb4a68f2f", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -881,8 +881,8 @@ }, { "id": 45, - "fingerprint": "sha256:a1f14c52f06417de1dbba847e4b3a18cdcec344eeaf1be192e3f304664d4a75b", - "api": "cloudflare", + "fingerprint": "sha256:498acad448ff11d1ca7b4adf1743dc8319610e1e363cb8eef6ef06fb894fd752", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -901,8 +901,8 @@ }, { "id": 46, - "fingerprint": "sha256:fcb029390bb09704f2b6b66d86eaaff0cf6b1a44657ba17546ba954f36c59b1a", - "api": "cloudflare", + "fingerprint": "sha256:cecdafa7ca394cd10c66b4d1391d8cd0cb1406a98d562306945b65cf12f7d95c", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -921,8 +921,8 @@ }, { "id": 47, - "fingerprint": "sha256:cd6aa6460c6515dfaa77ad4132f7d7e302ed9dce79410ef089a1a96d50cd4ce9", - "api": "cloudflare", + "fingerprint": "sha256:8e18580b12de646fced9e8639c075485602934bbecf31fb3fcd4626965e3130d", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -941,8 +941,8 @@ }, { "id": 48, - "fingerprint": "sha256:82241cac7c0e6880c0604bb63eab3acfa518084190d764c8b0bc526ad938e084", - "api": "cloudflare", + "fingerprint": "sha256:5cf1987f172cad5871dc6e3431a88d91ac22d9d71139d76b1796382afd9ac354", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -961,8 +961,8 @@ }, { "id": 49, - "fingerprint": "sha256:ef787080dfebbf6a83df76a4798732ce81cf8c5bb194bd90b09628cfdde91954", - "api": "cloudflare", + "fingerprint": "sha256:6ffc521452c053a0219f42d91aee94d7258cc86595367653bfe258cbb9a58461", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -981,8 +981,8 @@ }, { "id": 50, - "fingerprint": "sha256:722ad19c762df8abc40217d69ace0f58a1793ddfa8dac95a9a58bed2a43e36be", - "api": "cloudflare", + "fingerprint": "sha256:23496598d02a7dacc0db57301a3b758249b00c6f9bbd8d4db7b8d46c0ac6d9d8", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -1001,8 +1001,8 @@ }, { "id": 51, - "fingerprint": "sha256:c00265a6469a5f58b5a2daee7134aa5d956efd6fbef8c5e805574dc4aa738f57", - "api": "cloudflare", + "fingerprint": "sha256:503a4d7c97c38f6ea08752cde821c0013a3ea1b255a23e1ea261150d4728e110", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -1021,8 +1021,8 @@ }, { "id": 52, - "fingerprint": "sha256:6b913d06ac816d2691178a00c39edf8bcb8626e97be59f083add9223fd3ef4b6", - "api": "cloudflare", + "fingerprint": "sha256:3135305369b1b70e2f7d7e013de4dada5ee453d10af6b06f4c1079a929294bae", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -1041,8 +1041,8 @@ }, { "id": 53, - "fingerprint": "sha256:873623d5814c1dc0cf3d3f0ce6512d307f2b9594a62808424f2276f96ee2c8aa", - "api": "cloudflare", + "fingerprint": "sha256:adec4debce9bb93c7982100da8ea92300e9340bcb6f7d812a6af3683568094ca", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -1061,8 +1061,8 @@ }, { "id": 54, - "fingerprint": "sha256:113ba45ec5dea21a28854d7f85e0152fb1214e9f20c15d0dcd31d9d7615e9623", - "api": "cloudflare", + "fingerprint": "sha256:fc10048108b7ca3d08aba952289499ffa4ce3bd9a7f7bd16dddee5aef857e7ca", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -1081,8 +1081,8 @@ }, { "id": 55, - "fingerprint": "sha256:9292f2552dab12753439ba70cd7a43cf04b73a113782a4c9ced690ce1c61fb93", - "api": "cloudflare", + "fingerprint": "sha256:1bfef3838571477e1fa07a240dbd0aa4d7dbc5bbcd5ee6e3c039906ca230277d", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -1101,8 +1101,8 @@ }, { "id": 56, - "fingerprint": "sha256:052e0fe801ccf77c57f0971651bc0b21a5672de1fedaf5e8c4170f49bcc1cac2", - "api": "cloudflare", + "fingerprint": "sha256:295c6ae1775686ce83ddc54c0f37fdfa1ce0fbcb402f41386a9d657f9875ad2a", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -1121,8 +1121,8 @@ }, { "id": 57, - "fingerprint": "sha256:e83d1f1f71310ffcbd0acfbc178e9f0088b579eb5b4459065410281b6eb0165a", - "api": "cloudflare", + "fingerprint": "sha256:8661542398e02bcc1177b42fdea573219d96c63f95e0e8da732e8c2ae29e2a70", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -1141,8 +1141,8 @@ }, { "id": 58, - "fingerprint": "sha256:215f05da01f561e584b3f9f91f725be059a30573cbe65067007f6eb6ef552b81", - "api": "cloudflare", + "fingerprint": "sha256:3ba9c7a5958e72c3fc7126273c692fae0c764ff0a6ebbc5b95259913a4edce36", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -1161,8 +1161,8 @@ }, { "id": 59, - "fingerprint": "sha256:2c0bf4eda7cd1f3fd9e90ed90825400c6312931949f175b90764835dd2510120", - "api": "cloudflare", + "fingerprint": "sha256:f0e7ad06ea3277a4913178fb4496ca6f97c54ceb82a58d17da8fd1f01df0213e", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -1181,8 +1181,8 @@ }, { "id": 60, - "fingerprint": "sha256:593d2524280b0af8d52087b7a1172214eecc201b03edef47f9d19ec9e8f2109f", - "api": "cloudflare", + "fingerprint": "sha256:d21dcb330f6468445190911528a37aadb910918003ea905a09854c99ba329af7", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -1201,8 +1201,8 @@ }, { "id": 61, - "fingerprint": "sha256:9009e4cdae0f774732d80f8ebffb71ca9f0d20964aaae67db7b8af9efd7a9907", - "api": "cloudflare", + "fingerprint": "sha256:36bcd50c977f7fdc6a5454e930bd68320f86c25ead8c812748c3201f82a067f6", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -1221,8 +1221,8 @@ }, { "id": 62, - "fingerprint": "sha256:f4ad2fc70533dc70e0a94cb08f9397dc9dcf2ca25df1d0fa1a07bfcf1348bd16", - "api": "cloudflare", + "fingerprint": "sha256:99d329002c578abd3af2041c2b4682d55de66c529a3a9fbe89d433ffa01b8481", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -1241,8 +1241,8 @@ }, { "id": 63, - "fingerprint": "sha256:fefbd411b03a645d2149f585808e334cb7fcf9253b043a2c16fc6f762f0024bc", - "api": "cloudflare", + "fingerprint": "sha256:de8b13bb295b1ff6caae04a075e87216f0587cefd47662958966a24cb5e3aa4e", + "api": "cloudflare/api", "version": "2025-06-15", "change_type": "deprecation", "breaking": false, @@ -1261,8 +1261,8 @@ }, { "id": 64, - "fingerprint": "sha256:3ea68d670fadd202cc5740ff08b2ded911977053f59707ad3f3a977f1f8fca0a", - "api": "cloudflare", + "fingerprint": "sha256:b4fbb0d5da10ef76dd972b661434a6384f51c5da400e35fa0e5b3a223c560f4e", + "api": "cloudflare/api", "version": "2025-06-08", "change_type": "deprecation", "breaking": false, @@ -1281,8 +1281,8 @@ }, { "id": 65, - "fingerprint": "sha256:8b928cc39b74991bc8dd7abac061d79b152c514803afe408130ba223cb73cac7", - "api": "cloudflare", + "fingerprint": "sha256:c7d5d01f2cbe9dc85c2d26beba55283a2d3d342bb7c4d86b575e39ea2acdb039", + "api": "cloudflare/api", "version": "2025-06-08", "change_type": "deprecation", "breaking": false, @@ -1301,8 +1301,8 @@ }, { "id": 66, - "fingerprint": "sha256:a656a715771f1d9d50ad38125f2508f5ba5a778288ee28d06e524ba5c1f8e9d4", - "api": "cloudflare", + "fingerprint": "sha256:936804624340abb866835350b87afd294a4a0c2a14720ee399fa971fe99722a1", + "api": "cloudflare/api", "version": "2025-03-23", "change_type": "deprecation", "breaking": false, @@ -1321,8 +1321,8 @@ }, { "id": 67, - "fingerprint": "sha256:76143718cd7007d1f64bbc070d221a5421ac0849862b22e4c6cda855c262f8e3", - "api": "cloudflare", + "fingerprint": "sha256:ae54224a3bc5f6c162d2a39c7ad1e2d8bfc294e8f095a6fb425b7fa92453991b", + "api": "cloudflare/api", "version": "2024-09-13", "change_type": "deprecation", "breaking": false, @@ -1341,8 +1341,8 @@ }, { "id": 68, - "fingerprint": "sha256:41ce262b4808d88a988fb9d2a060ea0a557ce5b98808c8ac12d7f79eb3e8ec10", - "api": "cloudflare", + "fingerprint": "sha256:109443f03dbd74f10fe9f23473f35c6c1a77a7a52fb1eeae2bc598e4da27d374", + "api": "cloudflare/api", "version": "2024-09-13", "change_type": "deprecation", "breaking": false, @@ -1361,8 +1361,8 @@ }, { "id": 69, - "fingerprint": "sha256:3772460f2e087f788df4d1a25bf8e7ef8729f397e24925982689e861db517c64", - "api": "cloudflare", + "fingerprint": "sha256:369c1017e008311e30160fe237ba412fdfd5f7ea7fa371b0898aa9a6f1641c20", + "api": "cloudflare/api", "version": "2024-09-13", "change_type": "deprecation", "breaking": false, @@ -1381,8 +1381,8 @@ }, { "id": 70, - "fingerprint": "sha256:d22b6deadefd215c5b664fb54ff74364c3e44234ce27e71053617da46167df47", - "api": "cloudflare", + "fingerprint": "sha256:3ed49bd15de4fe5681062e4ada006ef5db3a5c74d7e49297978b1f57750d8117", + "api": "cloudflare/api", "version": "2024-09-13", "change_type": "deprecation", "breaking": false, @@ -1401,8 +1401,8 @@ }, { "id": 71, - "fingerprint": "sha256:d895cf63ec92441421d1fc15ea1d5c6defecb4926d14a5134f2faa6d8c23a71d", - "api": "cloudflare", + "fingerprint": "sha256:1bbcf47531039df6cf26589463f5a2f842ceb391955619ee7870e81de246ea54", + "api": "cloudflare/api", "version": "2024-08-15", "change_type": "deprecation", "breaking": false, @@ -1421,8 +1421,8 @@ }, { "id": 72, - "fingerprint": "sha256:ef87cb5946658e40cefeaa43f40fd8739220167676a40aa45e4c2c43877910ff", - "api": "cloudflare", + "fingerprint": "sha256:236695e093c2ccc67a5d0e6934ed284839882d9d3f90fc090c9a835ac820c425", + "api": "cloudflare/api", "version": "2024-08-15", "change_type": "deprecation", "breaking": false, @@ -1441,8 +1441,8 @@ }, { "id": 73, - "fingerprint": "sha256:bdac35c4e1066ef7f2f97f44a07b477834ec8477f1f581a55d257052de56d3b0", - "api": "cloudflare", + "fingerprint": "sha256:8c9c7efb1ab475de41a640b1a5beacce9a7fb432140d7f6ef2c1ed59ca5b2a43", + "api": "cloudflare/api", "version": "2024-08-05", "change_type": "deprecation", "breaking": false, @@ -1461,8 +1461,8 @@ }, { "id": 74, - "fingerprint": "sha256:1e193b2db1b32d1f598fdafdc0de01506cda1c1ecd43f6042d2691aff325327f", - "api": "cloudflare", + "fingerprint": "sha256:e4bf3bfcd9b07ccea28cd701297ebcd097a8c076b278e433c421289ccbb97fd3", + "api": "cloudflare/api", "version": "2024-08-05", "change_type": "deprecation", "breaking": false, @@ -1481,8 +1481,8 @@ }, { "id": 75, - "fingerprint": "sha256:69bb9383f8c9161b003beac80477548824351264c8add2f755a6f72be3214842", - "api": "cloudflare", + "fingerprint": "sha256:9aafe90e8006993b02af0a7598b9fe358b7461a50a26c9ef3bcd476bb7117151", + "api": "cloudflare/api", "version": "2024-06-30", "change_type": "deprecation", "breaking": false, @@ -1501,8 +1501,8 @@ }, { "id": 76, - "fingerprint": "sha256:c13e8c0cb8a66167b2897de1bfbe019cc48380acbf8057c2b77b3e906c6986de", - "api": "cloudflare", + "fingerprint": "sha256:8509160822c4ef1a919f6aa3dd4398cfcebd69871640d77e4157fcf2e15e3132", + "api": "cloudflare/api", "version": "2024-06-30", "change_type": "deprecation", "breaking": false, @@ -1521,8 +1521,8 @@ }, { "id": 77, - "fingerprint": "sha256:8524fcd9c28f92e0d657e1d5bc1040c33d95847bba5ab1ca20cf3555d498c4ae", - "api": "cloudflare", + "fingerprint": "sha256:0aaac98e595e36b46ceb4254db6cc4962321843161ca40d0bdf18bcbed8b8b95", + "api": "cloudflare/api", "version": "2024-06-14", "change_type": "deprecation", "breaking": false, @@ -1541,8 +1541,8 @@ }, { "id": 78, - "fingerprint": "sha256:494c35d7a6b5f12c713cac51ded1c05d63633672a81e11639bf47759f8fee2fe", - "api": "cloudflare", + "fingerprint": "sha256:a8456ffb133b7cb1820c54e4d18d9f0c183b4a883f7f1350d778be153b193849", + "api": "cloudflare/api", "version": "2024-06-14", "change_type": "deprecation", "breaking": false, @@ -1561,8 +1561,8 @@ }, { "id": 79, - "fingerprint": "sha256:8a0414167374e569a3bd93198ad56f1f1e86b28dd80322ae2508e150109118ac", - "api": "cloudflare", + "fingerprint": "sha256:f2cfb40aaeeab4290539cebc6893fca6e587f52077a98afbe884b0b32d225eb6", + "api": "cloudflare/api", "version": "2024-03-31", "change_type": "deprecation", "breaking": false, @@ -1581,8 +1581,8 @@ }, { "id": 80, - "fingerprint": "sha256:9ce9f1cf3ac03ff226946c714571bd82de15e49f9095d7591d58b76e7b48c7b4", - "api": "cloudflare", + "fingerprint": "sha256:fcc3a0e044104a636e7af25ca521259f1414eda448a7332a7fdf2099e9d5d39f", + "api": "cloudflare/api", "version": "2024-03-31", "change_type": "deprecation", "breaking": false, @@ -1601,8 +1601,8 @@ }, { "id": 81, - "fingerprint": "sha256:29c3d85b45378dfefb2629ad15e0e8688aa3d0c8d02acfdd8cd9d9a33193c39f", - "api": "cloudflare", + "fingerprint": "sha256:ee771e91c7b543523172bbdfb878a4af0ee347e11fadb7ed1033c0b6f14dd409", + "api": "cloudflare/api", "version": "2024-02-04", "change_type": "deprecation", "breaking": false, @@ -1621,8 +1621,8 @@ }, { "id": 82, - "fingerprint": "sha256:11429b81a8878d5a7b076a0d7989ee8c74ee56d0ee5690a20a452a566adcc587", - "api": "cloudflare", + "fingerprint": "sha256:a6142510065d1ffcf3c9c9a8f3388407a4ebc6cc3ef6981d82a159182f7ff0d5", + "api": "cloudflare/api", "version": "2024-02-04", "change_type": "deprecation", "breaking": false, @@ -1641,8 +1641,8 @@ }, { "id": 83, - "fingerprint": "sha256:612f7a78f42051e7acb4fd42401bdf14617a7b897c444d781281a024413ea7de", - "api": "cloudflare", + "fingerprint": "sha256:5be7bbc18164d845bb6d4adf5279c70cec4bd5fafd8299cea0aaeda47e7a84ba", + "api": "cloudflare/api", "version": "2024-02-04", "change_type": "deprecation", "breaking": false, @@ -1661,8 +1661,8 @@ }, { "id": 84, - "fingerprint": "sha256:71d87a69068d827ef0ef8f7adbeead373413c231bd1fcebd01532b1f7036053f", - "api": "cloudflare", + "fingerprint": "sha256:365dabe9d8029ff07060a034692552147bd5a2dc6f4c244f473972bcceb3904d", + "api": "cloudflare/api", "version": "2024-02-04", "change_type": "deprecation", "breaking": false, @@ -1681,8 +1681,8 @@ }, { "id": 85, - "fingerprint": "sha256:7746689ebb3f0f202baab80b57fa327be8a72379950fbba0e6789e2112104d92", - "api": "cloudflare", + "fingerprint": "sha256:c06f2d43b44ce024984cc1ca7f8bfc5b91e8fe0f8a9572722dd894f650aab269", + "api": "cloudflare/api", "version": "2023-06-06", "change_type": "deprecation", "breaking": false, @@ -1701,8 +1701,8 @@ }, { "id": 86, - "fingerprint": "sha256:4ac06fe9f65fa856441dd1a7a94db17e19f47464e00ed806e33aa1607cba03fb", - "api": "cloudflare", + "fingerprint": "sha256:d786e20b8b7fbfdf71c9f93ddeac2af72f846b0d205d06a0537090868dafbeb6", + "api": "cloudflare/api", "version": "2023-06-06", "change_type": "deprecation", "breaking": false, @@ -1721,8 +1721,8 @@ }, { "id": 87, - "fingerprint": "sha256:a82e21186295d77b70978ef4b1d43090311f80cd3d2e611d9b1e3caa8240603b", - "api": "cloudflare", + "fingerprint": "sha256:b2afbae55523fba186e40b5bfbb15aa462217115282bce343803f3ddb0877f08", + "api": "cloudflare/api", "version": "2023-06-06", "change_type": "deprecation", "breaking": false, @@ -1741,8 +1741,8 @@ }, { "id": 88, - "fingerprint": "sha256:25ede29cbeb851c1f3a4600e7b6c4ef2720ffec4977a422af69801679310b844", - "api": "cloudflare", + "fingerprint": "sha256:726e750596fe086865365c9e5eec48b163a17a4bb5d0b3b1abb6e24f1c6b59b0", + "api": "cloudflare/api", "version": "2023-03-19", "change_type": "deprecation", "breaking": false, @@ -1761,8 +1761,8 @@ }, { "id": 89, - "fingerprint": "sha256:a13ebcfcb9c339ee8bb1218581ee1c37690fee295ff6806ace36bea51e9ca506", - "api": "cloudflare", + "fingerprint": "sha256:9d7a295c950e6fc992e756fe4b308a0a7cbe6848b748dceb1e577644f63a2b30", + "api": "cloudflare/api", "version": "2023-03-19", "change_type": "deprecation", "breaking": false, @@ -1781,8 +1781,8 @@ }, { "id": 90, - "fingerprint": "sha256:e89180ebef6a0c40a2a49204fc9dc9a27491a4fc5bf2d42a065899dd60d40731", - "api": "cloudflare", + "fingerprint": "sha256:e7702469b58b59996a7c31f6d209015972cc45baafdb1dde110612124691ae29", + "api": "cloudflare/api", "version": "2023-03-19", "change_type": "deprecation", "breaking": false, @@ -1801,8 +1801,8 @@ }, { "id": 91, - "fingerprint": "sha256:f17d0456bb3a0a51b070f5609cee1cbdbb60919cb3a67c38f1cef4e0ba80fc54", - "api": "cloudflare", + "fingerprint": "sha256:610abf032e5253a64d0750e8681965f304f4d06d793408c8e08bf484faec226f", + "api": "cloudflare/api", "version": "2023-03-19", "change_type": "deprecation", "breaking": false, @@ -1821,8 +1821,8 @@ }, { "id": 92, - "fingerprint": "sha256:dcb342032e2d34bd5e1a6c05bfcc974af327558dd827245e821c318999d27135", - "api": "cloudflare", + "fingerprint": "sha256:2b731caf0e50c134499509637343797743b8a2023659200500aa13ded66c67ba", + "api": "cloudflare/api", "version": "2023-03-19", "change_type": "deprecation", "breaking": false, @@ -1841,8 +1841,8 @@ }, { "id": 93, - "fingerprint": "sha256:1b433d97fddf5d472973a72d9d1972e2b56b7227611ff97ba8773e6eaa38d866", - "api": "cloudflare", + "fingerprint": "sha256:355a1b1dccc1f6848805f1db00f2ce6e0f9a1109a2419e04e33d8f37c7a6fdc5", + "api": "cloudflare/api", "version": "2021-03-01", "change_type": "deprecation", "breaking": false, @@ -1861,8 +1861,8 @@ }, { "id": 94, - "fingerprint": "sha256:85d501de27a68f98047b68cc467ac05d76ea3438365e36858674d079a5a34f57", - "api": "cloudflare", + "fingerprint": "sha256:e7c7fb5bff926f4f70853f4e1870f11094b77c7127bf353f33b193fcde2e0e49", + "api": "cloudflare/api", "version": "2021-03-01", "change_type": "deprecation", "breaking": false, @@ -1881,8 +1881,8 @@ }, { "id": 95, - "fingerprint": "sha256:e4396b53f421754a972237ce1d33f05aba1af22defdf03375c17847f406e3a6f", - "api": "cloudflare", + "fingerprint": "sha256:b5255ba6484e57bf92ebccbed2bd621177ad3d7e3b7971bae28f86ba9b6e09e6", + "api": "cloudflare/api", "version": "2020-04-02", "change_type": "deprecation", "breaking": false, @@ -1901,8 +1901,8 @@ }, { "id": 96, - "fingerprint": "sha256:2742091f3a755e16ea63265caf9f371b25f9530a0bad23437c5c17d8537ac0e4", - "api": "cloudflare", + "fingerprint": "sha256:24877e00b429dd7e1584482a562806e2e5da591145ff82d13219ffaea8886b8c", + "api": "cloudflare/api", "version": "2020-04-02", "change_type": "deprecation", "breaking": false, @@ -1921,8 +1921,8 @@ }, { "id": 97, - "fingerprint": "sha256:ae6856bdf958dedf74897bbfabf97b7a1415419ebfd43d48194422e46c639196", - "api": "cloudflare", + "fingerprint": "sha256:b1b258188b319bdf1081f66da17b8e10c17fb7cc27f9dde1e8543bd4f9b6afd0", + "api": "cloudflare/api", "version": "2020-04-02", "change_type": "deprecation", "breaking": false, @@ -1941,8 +1941,8 @@ }, { "id": 98, - "fingerprint": "sha256:91aa1804bb4fcf3b868af8d143bb82c36ad0e3830087f4a319db1c74b538dc71", - "api": "cloudflare", + "fingerprint": "sha256:b079a8269aa22a30276a3a69e8b93f74ab8e9d1fb515ee292986e6e0380d8d79", + "api": "cloudflare/api", "version": "2020-04-02", "change_type": "deprecation", "breaking": false, @@ -1961,8 +1961,8 @@ }, { "id": 99, - "fingerprint": "sha256:8cda3ee46a442608a8494c295869db1b5fec639e3a1ea5fcb487a3848484be6c", - "api": "cloudflare", + "fingerprint": "sha256:fe435ea852be1ef8de5a64415eb78b6b2919b116784fc2c8cc8230bef77ad18c", + "api": "cloudflare/api", "version": "2020-04-02", "change_type": "deprecation", "breaking": false, @@ -1981,8 +1981,8 @@ }, { "id": 100, - "fingerprint": "sha256:eb2ade41a06d3aed8a4f916720379309d8f748636023584d0e14587090c9fac0", - "api": "cloudflare", + "fingerprint": "sha256:7b9f1d90fa4b5fa3bd6d6a00710899b1c498a342e7acd16878ed5bc5c91c67db", + "api": "cloudflare/api", "version": "2020-04-02", "change_type": "deprecation", "breaking": false, @@ -2001,8 +2001,8 @@ }, { "id": 101, - "fingerprint": "sha256:2f45cd9a65a329b3276385b4e0922df23ad25f8ea71c6c55cce0c4f0775430b9", - "api": "cloudflare", + "fingerprint": "sha256:671bde92a237483c9a9eedb2e1a71b8232c5a0ded304d482526a99dcdcc9a054", + "api": "cloudflare/api", "version": "2020-04-02", "change_type": "deprecation", "breaking": false, @@ -2021,8 +2021,8 @@ }, { "id": 102, - "fingerprint": "sha256:77bc63f086fc2e1ce770b590c83e18e37a29e61e679a817750a84054bb22e661", - "api": "cloudflare", + "fingerprint": "sha256:db3297f35829831ac31d4104ffe1a20351ea7dd8755befb052587f1b7ef6c961", + "api": "cloudflare/api", "version": "2020-04-02", "change_type": "deprecation", "breaking": false, @@ -2041,8 +2041,8 @@ }, { "id": 103, - "fingerprint": "sha256:53cd2ca671825f0fabe62fed3a7a1f17233a95902ddf733f9e8b8ee22aa930c1", - "api": "cloudflare", + "fingerprint": "sha256:ab70507b04fd7821be636e6c23c700bb3dd4c8a08a8bcd7a69cca6d2b8d64b2d", + "api": "cloudflare/api", "version": "2020-04-02", "change_type": "deprecation", "breaking": false, @@ -2061,8 +2061,8 @@ }, { "id": 104, - "fingerprint": "sha256:950cd3ec3decbed9961241b5f1f2dda9006459b2be6a78bf9a98e1f9581df344", - "api": "cloudflare", + "fingerprint": "sha256:c268766c19deb3e42cafc70b0dc8a985ab4916225e175696d9cb440637d713f1", + "api": "cloudflare/api", "version": "2020-04-02", "change_type": "deprecation", "breaking": false, @@ -2081,8 +2081,8 @@ }, { "id": 105, - "fingerprint": "sha256:ceeaf6f0e663b587a2b886dd3ce3fa5980d3671450e804d38d99d574b8366a21", - "api": "cloudflare", + "fingerprint": "sha256:a187bc3652c53e1ac3fc4c1eed3e46c2dd381b9012be5553a4fac5acc6828d45", + "api": "cloudflare/api", "version": "2020-04-02", "change_type": "deprecation", "breaking": false, @@ -2101,8 +2101,8 @@ }, { "id": 106, - "fingerprint": "sha256:07b26bf4f30b8203ad1f87e8e74bc1dfcce573eb311a4554ccc97d4026c466b5", - "api": "cloudflare", + "fingerprint": "sha256:6d4f2d565998c8a63c6ed6dea40e33ba734e531b0c4ce473cfde38e47128990f", + "api": "cloudflare/api", "version": "2020-04-02", "change_type": "deprecation", "breaking": false, @@ -2121,8 +2121,8 @@ }, { "id": 107, - "fingerprint": "sha256:f77532cf6a888d0c58adc1b28817260805264525b65aa800d9dc2972c6c92cc8", - "api": "cloudflare", + "fingerprint": "sha256:07b87c3debecbe821246c3cd1ff699edbe01235447c7b115d889bb3690752cdc", + "api": "cloudflare/api", "version": "2020-04-02", "change_type": "deprecation", "breaking": false, @@ -2141,8 +2141,8 @@ }, { "id": 108, - "fingerprint": "sha256:4a4051bd43d0c13a08b5c25ef661a80ba3d417efb4d0ea316315af99b16848fa", - "api": "cloudflare", + "fingerprint": "sha256:0026aad502bf82ec5afdc69f049a5b20930d1f62f0ec8401416f4b16a69e7089", + "api": "cloudflare/api", "version": "2020-04-02", "change_type": "deprecation", "breaking": false, @@ -2161,8 +2161,8 @@ }, { "id": 109, - "fingerprint": "sha256:138291351a584f62faae1f0185294f4c9222e3c81052878158f4c502ad6f73e3", - "api": "cloudflare", + "fingerprint": "sha256:de966d817e65f6765628df10f79e7fc1dea3ca99da31d41373992476cabab73e", + "api": "cloudflare/api", "version": "2020-04-02", "change_type": "deprecation", "breaking": false, @@ -2181,8 +2181,8 @@ }, { "id": 110, - "fingerprint": "sha256:3eb1b2160bd4f145e391c297796259d1b0d6e6b7c645308cf934e829f04ed961", - "api": "cloudflare", + "fingerprint": "sha256:fa54d9d710ccf64cce5de99d76ffeefac524a1e7a2bd54a50665a3cde74b20a5", + "api": "cloudflare/api", "version": "2020-04-02", "change_type": "deprecation", "breaking": false, @@ -2201,8 +2201,8 @@ }, { "id": 111, - "fingerprint": "sha256:0ae28a40c9eb7d42d1c0c2d4754104e403839d9af513aced01289e678b6c9b01", - "api": "cloudflare", + "fingerprint": "sha256:19c8ac3a1f58527481afe59697f2c1a3e74f0dcd43db9fca373e3e2ca5130456", + "api": "cloudflare/api", "version": "2020-04-02", "change_type": "deprecation", "breaking": false, @@ -2221,8 +2221,8 @@ }, { "id": 112, - "fingerprint": "sha256:69933e9ad14fcbd1a15b5c8777b44364582163546de1bbc2bed48b8dca0eb090", - "api": "cloudflare", + "fingerprint": "sha256:2d2bff1a5afd28fd3b2e075980fd6eb896a78c4c0eab50a1ab6b181af012bd17", + "api": "cloudflare/api", "version": "2020-04-02", "change_type": "deprecation", "breaking": false, @@ -2241,8 +2241,8 @@ }, { "id": 113, - "fingerprint": "sha256:25c9b731e783cbea7c577bc0ddbffd4c78a535e4d38699f7e97f6f5f533a28d4", - "api": "cloudflare", + "fingerprint": "sha256:67c9f4884ff77bc7d09bd034d69d3589beb7cc43d651685a9663722a29b2117c", + "api": "cloudflare/api", "version": "2020-04-02", "change_type": "deprecation", "breaking": false, @@ -2261,8 +2261,8 @@ }, { "id": 114, - "fingerprint": "sha256:7ae73318dc7f30d3c47f74c2b01332c81c777f0c89fa831dcbd8bb95ae5182b5", - "api": "cloudflare", + "fingerprint": "sha256:e9f5ebfee335467683ad29c64f264d5ab45ca22c9c25a7d7c724e27c9a76f0ee", + "api": "cloudflare/api", "version": "2020-04-02", "change_type": "deprecation", "breaking": false, diff --git a/plugins/notices/testdata/golden/github-actions.json b/plugins/notices/testdata/golden/github-actions.json index 0892839..4b5cda7 100644 --- a/plugins/notices/testdata/golden/github-actions.json +++ b/plugins/notices/testdata/golden/github-actions.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:d067089552e48ba93490a1dd4ed264e0c374abf1a7c32d31f654333b8ef29383", - "api": "github-actions", + "fingerprint": "sha256:bdfcfa49f99297e3e205a803e01a25285fa7b5b07b1cb98b4c9d716aec4c12f4", + "api": "github/actions", "version": "2026-11-02", "change_type": "breaking", "breaking": true, @@ -20,8 +20,8 @@ }, { "id": 2, - "fingerprint": "sha256:f12c343a95fdc0d86525094476637ab2b1b05cc1d0d10e3c9e0ef606cc559bec", - "api": "github-actions", + "fingerprint": "sha256:a4de3d5a12c726e5ed2733253429730a0a456113302b879f0d0219419d3ca474", + "api": "github/actions", "version": "2026-11-02", "change_type": "breaking", "breaking": true, @@ -39,8 +39,8 @@ }, { "id": 3, - "fingerprint": "sha256:ae17303775653df724346bd47eea5997a342378f78c2e8bf80510d50d424ea7b", - "api": "github-actions", + "fingerprint": "sha256:2f2185ea0c64bbed2075d64d5a8f697a0b9ef179ae65a221d19816305ad11030", + "api": "github/actions", "version": "2026-11-02", "change_type": "breaking", "breaking": true, diff --git a/plugins/notices/testdata/golden/vertex-ai-models.json b/plugins/notices/testdata/golden/google-vertex-ai-models.json similarity index 89% rename from plugins/notices/testdata/golden/vertex-ai-models.json rename to plugins/notices/testdata/golden/google-vertex-ai-models.json index ae9f8ec..ed7b170 100644 --- a/plugins/notices/testdata/golden/vertex-ai-models.json +++ b/plugins/notices/testdata/golden/google-vertex-ai-models.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:0f5e79c13e364f582195949330aa17e5c9d4151362f0914d3e5b55bec4fcebbf", - "api": "vertex-ai-models", + "fingerprint": "sha256:4627337a65ee7ecc6e02ac97ae51834d56722fa732ef67a19eca027b566a4f44", + "api": "google/vertex-ai-models", "version": "2026-06-30", "change_type": "deprecation", "breaking": false, @@ -21,8 +21,8 @@ }, { "id": 2, - "fingerprint": "sha256:5ea59f6bae5251fdddc19dfd2068487e38e16f3ed4c14d3732f89ad80ba9f3f0", - "api": "vertex-ai-models", + "fingerprint": "sha256:7da0d2dd46fa4f16ed41f9857ac90de07be28a2e165544c3212e2b975296a0e5", + "api": "google/vertex-ai-models", "version": "2026-06-30", "change_type": "deprecation", "breaking": false, @@ -41,8 +41,8 @@ }, { "id": 3, - "fingerprint": "sha256:4b3d8e8e9a9c26b15641b76047fbdd751eb38d02dc67184bd41a42c5123dba9a", - "api": "vertex-ai-models", + "fingerprint": "sha256:366d6614ee42be4bd650704aa459e9d7a338cb682119f0b66123d030184ebc8d", + "api": "google/vertex-ai-models", "version": "2026-06-30", "change_type": "deprecation", "breaking": false, @@ -61,8 +61,8 @@ }, { "id": 4, - "fingerprint": "sha256:7a869d0728c23c1d9467b8339cca9d3a1d6bd6bfb713d97bba14aafee33b8156", - "api": "vertex-ai-models", + "fingerprint": "sha256:54113780d0f2717208cd90ff8f76e4ac24f19302aa2e89ca10dfb4ca767f6236", + "api": "google/vertex-ai-models", "version": "2026-06-30", "change_type": "deprecation", "breaking": false, @@ -81,8 +81,8 @@ }, { "id": 5, - "fingerprint": "sha256:788404627769b8fa60709fce8e1d3ad22631bdd2007c90d883a9c0ad704308ab", - "api": "vertex-ai-models", + "fingerprint": "sha256:e4cf8857ddd3731ed2853071312f49588e79c47e81de698aa3458e0ed551b6fa", + "api": "google/vertex-ai-models", "version": "2026-06-30", "change_type": "deprecation", "breaking": false, @@ -101,8 +101,8 @@ }, { "id": 6, - "fingerprint": "sha256:692c4163cdb6bea77df0f41930d396e076cac4ca5ffbbca4608497da1595cf36", - "api": "vertex-ai-models", + "fingerprint": "sha256:70e23f95c88d498b93825af99e0790a21b80cdd1903b522f36ccf7a76fa09182", + "api": "google/vertex-ai-models", "version": "2026-06-30", "change_type": "deprecation", "breaking": false, @@ -121,8 +121,8 @@ }, { "id": 7, - "fingerprint": "sha256:6dc7af5708772ad89a8af1458dcdbeaba4aa1edbac81ef24a24dd4019301c4a2", - "api": "vertex-ai-models", + "fingerprint": "sha256:7ccb799cf84268de5106b8509e4c0706f7165eab3b189bcf171df9c4b08f9bf9", + "api": "google/vertex-ai-models", "version": "2026-06-30", "change_type": "deprecation", "breaking": false, @@ -141,8 +141,8 @@ }, { "id": 8, - "fingerprint": "sha256:8f4954dc8110183332daa2c0599acf1eb480fe8a7625681acc19260c52469279", - "api": "vertex-ai-models", + "fingerprint": "sha256:2edea0439cd41993804f3165d122d92f88f95fa5d22da1ae8a72c54562df56b9", + "api": "google/vertex-ai-models", "version": "2026-06-30", "change_type": "deprecation", "breaking": false, @@ -161,8 +161,8 @@ }, { "id": 9, - "fingerprint": "sha256:18882130e85984f1289667a0336174179192417971a1256038b4391e3f2d202e", - "api": "vertex-ai-models", + "fingerprint": "sha256:ab4cd57e14aa05f619251f4e234f9b6faa5719f2599efd9c0f0ddf17242bf400", + "api": "google/vertex-ai-models", "version": "2026-06-30", "change_type": "deprecation", "breaking": false, @@ -181,8 +181,8 @@ }, { "id": 10, - "fingerprint": "sha256:66bdd91e4b7bd86a67547ad13be1ff17c0143aa82563d2df07a07563b19d4aeb", - "api": "vertex-ai-models", + "fingerprint": "sha256:8d25d3020603811f27cfd86a17ddd27626682a65a09bd6286fad5488dfa04800", + "api": "google/vertex-ai-models", "version": "2026-06-30", "change_type": "deprecation", "breaking": false, @@ -201,8 +201,8 @@ }, { "id": 11, - "fingerprint": "sha256:f600afe7780213164a28b9f471eea689ae3c982cbc6079d1e15a9c93d1934227", - "api": "vertex-ai-models", + "fingerprint": "sha256:39ca8174998ababa3c0c7c5438e1792de7b4133980c2038cce2f0e5eefde9ac9", + "api": "google/vertex-ai-models", "version": "2026-06-30", "change_type": "deprecation", "breaking": false, @@ -221,8 +221,8 @@ }, { "id": 12, - "fingerprint": "sha256:eda860833ba104f4fc5d1dfcaf19f17888218f405743c32929549c46025ca72b", - "api": "vertex-ai-models", + "fingerprint": "sha256:dfba27e6493a553e4976424fe316649f6111d3925c8443ac562ace71c5327183", + "api": "google/vertex-ai-models", "version": "2026-06-30", "change_type": "deprecation", "breaking": false, @@ -241,8 +241,8 @@ }, { "id": 13, - "fingerprint": "sha256:f88d17b03256295e4cbd2c63d32fedf768c9e6d09afbb9aa8d916a7a1434b451", - "api": "vertex-ai-models", + "fingerprint": "sha256:e498e7d1768eb1327445f5589b9b5cf1eeede6a8fccecd98896ac39fdb6cf93b", + "api": "google/vertex-ai-models", "version": "2026-06-30", "change_type": "deprecation", "breaking": false, @@ -261,8 +261,8 @@ }, { "id": 14, - "fingerprint": "sha256:c00c71e4574c444cc0123067d8e22f1f23aeb81f1869d58b6da824eb7b0503d4", - "api": "vertex-ai-models", + "fingerprint": "sha256:91583fe5103284396c784ccc01d805ff0b3df116b2f39a1ff594292c6c19f3c9", + "api": "google/vertex-ai-models", "version": "2026-06-30", "change_type": "deprecation", "breaking": false, @@ -281,8 +281,8 @@ }, { "id": 15, - "fingerprint": "sha256:db4114d7dd166f3bbe3e8f41d3a635609646688714c2b97bf54e3eaff0447021", - "api": "vertex-ai-models", + "fingerprint": "sha256:5d95e1087917d0ca68631f30d564790fbf485bf9f8c946d38b602191bcc5eff2", + "api": "google/vertex-ai-models", "version": "2026-06-30", "change_type": "deprecation", "breaking": false, @@ -301,8 +301,8 @@ }, { "id": 16, - "fingerprint": "sha256:ffce6cb7b473d003b1ef369d2e71467f81fda18ed6cfe9759da5dd1f16fc2d55", - "api": "vertex-ai-models", + "fingerprint": "sha256:8e8d56f1d8bd361be7f4eb6516da283bec666b26d4cc5d8eea5efe3c979aadd6", + "api": "google/vertex-ai-models", "version": "2026-06-30", "change_type": "deprecation", "breaking": false, @@ -321,8 +321,8 @@ }, { "id": 17, - "fingerprint": "sha256:f911516ae80652bed0283094892f9c446c556553b01d346b50dd302de8b71eee", - "api": "vertex-ai-models", + "fingerprint": "sha256:97f4aacf7dd601956041e3d0bca0708cf5236e4e26e71019919fc9cf9c7b9c36", + "api": "google/vertex-ai-models", "version": "2026-06-30", "change_type": "deprecation", "breaking": false, @@ -341,8 +341,8 @@ }, { "id": 18, - "fingerprint": "sha256:7f4058ca7aa25de9dbcd4c545af314f505fc6fdc0428cddea60ebe87a4cd1496", - "api": "vertex-ai-models", + "fingerprint": "sha256:717de8a8c0f4ffbcb5e35f0440648d2ff8533165261a04e8f3d7112ce265ba20", + "api": "google/vertex-ai-models", "version": "2026-04-02", "change_type": "deprecation", "breaking": false, @@ -361,8 +361,8 @@ }, { "id": 19, - "fingerprint": "sha256:0c51a24744cecbf0fb1421e97c90ac6a87dfd8c86291eebbdaeeb3c9e25fd6bb", - "api": "vertex-ai-models", + "fingerprint": "sha256:43c9247f0fe52ba4f8b04d0efd09eb724b997fb9fd6d2ccf2f4cf8e39eaab770", + "api": "google/vertex-ai-models", "version": "2026-04-02", "change_type": "deprecation", "breaking": false, @@ -380,8 +380,8 @@ }, { "id": 20, - "fingerprint": "sha256:fff7b3ac8fd2afe26bf625af257c58ca932e147bc1d1efc6aaa8c44a3fbadb4c", - "api": "vertex-ai-models", + "fingerprint": "sha256:81c5020f2b5e4bf5ac41f41d74ab25411de5709661e6bf2c58880b2dc334eb5e", + "api": "google/vertex-ai-models", "version": "2026-04-02", "change_type": "deprecation", "breaking": false, @@ -400,8 +400,8 @@ }, { "id": 21, - "fingerprint": "sha256:2ee0383f5522593eac8bf36472897a414ba3f4919896e584acaf36d414c1fbfc", - "api": "vertex-ai-models", + "fingerprint": "sha256:f603b43ee261cb8092b8dea3fb0ef7f11d7052595a5aaa23b2a350fae0744aff", + "api": "google/vertex-ai-models", "version": "2026-04-02", "change_type": "deprecation", "breaking": false, @@ -420,8 +420,8 @@ }, { "id": 22, - "fingerprint": "sha256:1c9b4de87f0ffa9300fedde2b15ea587c2fcaa789878fa0d4263f13a831966a6", - "api": "vertex-ai-models", + "fingerprint": "sha256:f522717bee23205fa997dd1a055708e7ca210c5dc035f88920463fa14e57af5a", + "api": "google/vertex-ai-models", "version": "2026-04-02", "change_type": "deprecation", "breaking": false, @@ -440,8 +440,8 @@ }, { "id": 23, - "fingerprint": "sha256:b2c129ec35c2078aabf91b7a4fe8a1e7b32f75b2d24f71429679d42794efe595", - "api": "vertex-ai-models", + "fingerprint": "sha256:8f8284129c2702e11752022571ae87f6b1c383bedf0e97b57cb4448ec0f5ca98", + "api": "google/vertex-ai-models", "version": "2026-04-02", "change_type": "deprecation", "breaking": false, @@ -460,8 +460,8 @@ }, { "id": 24, - "fingerprint": "sha256:84f3822d9f8220fdd5698435944a3855a3a3695ac5307a22a8c8bb8909561953", - "api": "vertex-ai-models", + "fingerprint": "sha256:94012bcb9d12655a7703235f5fcd7686f4ab638449b1dcf4274021c2d57e15b3", + "api": "google/vertex-ai-models", "version": "2026-04-02", "change_type": "deprecation", "breaking": false, @@ -480,8 +480,8 @@ }, { "id": 25, - "fingerprint": "sha256:eee28c0d67a8bde3b4457e586bc15d45e41145c2c1cf3df0ce4b87221db21817", - "api": "vertex-ai-models", + "fingerprint": "sha256:f940d36a57c55555c4a77ad0e81374a5384b2dc465a2545d8d80856ed5ceb0e9", + "api": "google/vertex-ai-models", "version": "2026-04-02", "change_type": "deprecation", "breaking": false, @@ -500,8 +500,8 @@ }, { "id": 26, - "fingerprint": "sha256:ff545ee513d1836e9886341c232ec1b97c3a7d5695d56eb8ae28ab0f8f519986", - "api": "vertex-ai-models", + "fingerprint": "sha256:ead9022ac7480a58f5e5592aa1052a795436440bf8f1c44f06bd0dfa924b3fd3", + "api": "google/vertex-ai-models", "version": "2026-03-19", "change_type": "deprecation", "breaking": false, @@ -520,8 +520,8 @@ }, { "id": 27, - "fingerprint": "sha256:984c2fed1d81d1a7855bb5482a25be0e5dbca8d7df4a6efcb311cb7e772be980", - "api": "vertex-ai-models", + "fingerprint": "sha256:6d498a1d266365bad2125ea26ed5f34d10c55d1dcc59d72d7feb2db19d63a17b", + "api": "google/vertex-ai-models", "version": "2026-03-19", "change_type": "deprecation", "breaking": false, @@ -539,8 +539,8 @@ }, { "id": 28, - "fingerprint": "sha256:755d77bc3a6469fffe3ba3469343217103bf796b20c7fbca8c765b8236c3e97e", - "api": "vertex-ai-models", + "fingerprint": "sha256:1f62ea6bf271e2b64a26cd0f64b679d0058b1d63e3551dd64fbe58fe849fc1b4", + "api": "google/vertex-ai-models", "version": "2026-03-19", "change_type": "deprecation", "breaking": false, @@ -558,8 +558,8 @@ }, { "id": 29, - "fingerprint": "sha256:7bd941e020f89704dd588745a801d7ca06be040a01ffbb5bd6cdbcbf355379d9", - "api": "vertex-ai-models", + "fingerprint": "sha256:7f6da3ceb3be5b19a4a84b34bfc738a3c907f79614f6924b79bb9d8fe5e15f04", + "api": "google/vertex-ai-models", "version": "2026-03-19", "change_type": "deprecation", "breaking": false, @@ -577,8 +577,8 @@ }, { "id": 30, - "fingerprint": "sha256:3890b3e4167e6e14e6b4010cc5efa73e8a2477a8ad0b632dbec1be14064591be", - "api": "vertex-ai-models", + "fingerprint": "sha256:aaf7a42341e623059379622c1f42b13ac3db869956d0c7783c2c6b208e8fc9cb", + "api": "google/vertex-ai-models", "version": "2026-03-19", "change_type": "deprecation", "breaking": false, @@ -596,8 +596,8 @@ }, { "id": 31, - "fingerprint": "sha256:0a742cc5aa7b799359ec3ce39c831f19e33e9bde4b3c96f37232697685f01ec3", - "api": "vertex-ai-models", + "fingerprint": "sha256:a1634ca7146b93f7d208e08f064923ac3bc2c39fd5e838706a36c0891f70f4d2", + "api": "google/vertex-ai-models", "version": "2026-03-19", "change_type": "deprecation", "breaking": false, @@ -615,8 +615,8 @@ }, { "id": 32, - "fingerprint": "sha256:fecc1a31c266860d32797c9d105ec12cee5ab85ce670c6299f96f0dbd115c74e", - "api": "vertex-ai-models", + "fingerprint": "sha256:94fff9b9d36a3cc8ce8b764ecbc4cf78c7544fab37518ed1ddc09ba7b77de150", + "api": "google/vertex-ai-models", "version": "2026-03-19", "change_type": "deprecation", "breaking": false, @@ -635,8 +635,8 @@ }, { "id": 33, - "fingerprint": "sha256:080e7458169bf6776309ebdcb9089a6d4379173f022a35c23c8cb570e9175218", - "api": "vertex-ai-models", + "fingerprint": "sha256:76dc2c9d131c5f4440bb4d3359bb613fbd78762b5fb63e969d93205bc8914a03", + "api": "google/vertex-ai-models", "version": "2026-03-19", "change_type": "deprecation", "breaking": false, @@ -655,8 +655,8 @@ }, { "id": 34, - "fingerprint": "sha256:53a7cf907dd48b38b6f41e079ca637c1b057e3a44d45d4194da00bee7633013b", - "api": "vertex-ai-models", + "fingerprint": "sha256:5ce0ba566a3c908960246f8a12eb65a096c47730c7947c81371c8c01e2071717", + "api": "google/vertex-ai-models", "version": "2026-03-19", "change_type": "deprecation", "breaking": false, @@ -675,8 +675,8 @@ }, { "id": 35, - "fingerprint": "sha256:b8aa1a9f5bf9e02375d6b65c32606474db34cb2afcec0b2568a60c173e940cd4", - "api": "vertex-ai-models", + "fingerprint": "sha256:ae6ad7fcb917173ee50e45c04736c2f9cabec071da307402916398d6203a9ab2", + "api": "google/vertex-ai-models", "version": "2026-03-19", "change_type": "deprecation", "breaking": false, diff --git a/plugins/notices/testdata/golden/openai-models.json b/plugins/notices/testdata/golden/openai-models.json index 49db9a7..c55deda 100644 --- a/plugins/notices/testdata/golden/openai-models.json +++ b/plugins/notices/testdata/golden/openai-models.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:42388e820b0a7d00e7bf964ab1b152758ed364860f4bab2b4d0fe584429af14e", - "api": "openai-models", + "fingerprint": "sha256:e83a8785aa6d1906e4892462f0f62fa5b84084e2329286623563aecdf88249ba", + "api": "openai/models", "version": "2027-04-01", "change_type": "breaking", "breaking": true, @@ -21,8 +21,8 @@ }, { "id": 2, - "fingerprint": "sha256:a2b093fef6f16658554b0ad905366380f557a1807af2995df4da7b09196d919b", - "api": "openai-models", + "fingerprint": "sha256:9c716074471064f27c0955e58528789627b3e305f8e9f484f802ffce272a02b1", + "api": "openai/models", "version": "2027-04-01", "change_type": "breaking", "breaking": true, @@ -41,8 +41,8 @@ }, { "id": 3, - "fingerprint": "sha256:f79902ee8c07c3e2757e4d216f4a09b0a0f501bbceeff28bca11b40a9ea5a861", - "api": "openai-models", + "fingerprint": "sha256:5468ca8ed9e11617bf886b8295f73ae0dab23e44cd09ff066dfe205f0f532453", + "api": "openai/models", "version": "2027-04-01", "change_type": "breaking", "breaking": true, @@ -61,8 +61,8 @@ }, { "id": 4, - "fingerprint": "sha256:c140d34b0457a6dc57a688e7c360f4dedac5b18d539ff974b8aae202bbe9b6a4", - "api": "openai-models", + "fingerprint": "sha256:fd7343b0764b86973207e103c720c03cc5ad27ad09e0f178b5c02c2706d883e3", + "api": "openai/models", "version": "2026-12-11", "change_type": "breaking", "breaking": true, @@ -81,8 +81,8 @@ }, { "id": 5, - "fingerprint": "sha256:db17dd17b62923090964c8c5d13a6c6fa510f1ad9d34dd0124ee6b321b184fa8", - "api": "openai-models", + "fingerprint": "sha256:9a9550f80f08e21273eda077e7419d2e3bb18846552791072afcb0059e95b2fe", + "api": "openai/models", "version": "2026-12-11", "change_type": "breaking", "breaking": true, @@ -101,8 +101,8 @@ }, { "id": 6, - "fingerprint": "sha256:07df9f561719ef7a15a7f6dd80259b01795c468966630625e2d68d41756a5915", - "api": "openai-models", + "fingerprint": "sha256:158fd36994686a79bf82bfbd377ed17c6567546fbbbb36791f11ca390faa4081", + "api": "openai/models", "version": "2026-12-11", "change_type": "breaking", "breaking": true, @@ -121,8 +121,8 @@ }, { "id": 7, - "fingerprint": "sha256:5bbc72be619dacebd8411eac696e94509a079171f491a2587e42f2658b24cf50", - "api": "openai-models", + "fingerprint": "sha256:2513bab92d4daf80ce3a3341677c48567a142a27968890bddaa39b349443ac4a", + "api": "openai/models", "version": "2026-12-11", "change_type": "breaking", "breaking": true, @@ -140,8 +140,8 @@ }, { "id": 8, - "fingerprint": "sha256:d8a013a8cf1c6cee2e3e1b90357b521ad3ced146318be596ae77e7011353e8f0", - "api": "openai-models", + "fingerprint": "sha256:3aaa754c27ec3dcf296ba9eca13168cc0c4260f578dd5487fa452ae0406444dd", + "api": "openai/models", "version": "2026-12-11", "change_type": "breaking", "breaking": true, @@ -160,8 +160,8 @@ }, { "id": 9, - "fingerprint": "sha256:fd7c2fabbd94c0eb6fd24ae7568a31533b83a63a61bb71d7d89ed966efe7f58f", - "api": "openai-models", + "fingerprint": "sha256:e38b1b847caef42cbed0c277347fe0dcab40032ff344b7252a00fd3c18e49b5c", + "api": "openai/models", "version": "2026-12-11", "change_type": "breaking", "breaking": true, @@ -179,8 +179,8 @@ }, { "id": 10, - "fingerprint": "sha256:4b1daccf92b70cbd4191989c452248915ff017a7b98697f711645ccf4b55695a", - "api": "openai-models", + "fingerprint": "sha256:0bc7c996a01e3dd0fae14537400f8bf77fb9ec8dd33c10c5b6458315ba8eb6d5", + "api": "openai/models", "version": "2026-10-01", "change_type": "breaking", "breaking": true, @@ -198,8 +198,8 @@ }, { "id": 11, - "fingerprint": "sha256:396c799693251a663ae5b5f06d1457fce990d7e25828e4d7d7ecbd73c6482856", - "api": "openai-models", + "fingerprint": "sha256:9f118e5bd24e073e6ed3cd7dc41a27322b18f714a30a2c3dff9ced089c9c6832", + "api": "openai/models", "version": "2026-08-10", "change_type": "breaking", "breaking": true, @@ -218,8 +218,8 @@ }, { "id": 12, - "fingerprint": "sha256:860adbaee02f25c0cdaeba0bfb21a14274d0a775cb1571a7144f12ef8d74be0c", - "api": "openai-models", + "fingerprint": "sha256:b843df920a2fb85eedc486fab1ca241676cf4d3e15ed6983e2913d38dc602bc2", + "api": "openai/models", "version": "2026-08-10", "change_type": "breaking", "breaking": true, @@ -238,8 +238,8 @@ }, { "id": 13, - "fingerprint": "sha256:ce26aa764cab39b9d0a9e69a55c1a8bb089f9d76b4babff17f5abd032d842864", - "api": "openai-models", + "fingerprint": "sha256:9de4b398a49814fc611c1f914d0caa04e3b49bb8bd820030e6dfa3d008eb525c", + "api": "openai/models", "version": "2026-10-23", "change_type": "breaking", "breaking": true, @@ -258,8 +258,8 @@ }, { "id": 14, - "fingerprint": "sha256:4192b9a11d08c878837cde100ccb5295ed2d6e684f9c34730a994eb90202cf1f", - "api": "openai-models", + "fingerprint": "sha256:f22d331f61c1e7558b711cc8fdec2c60f563f52a132dbdc3e297c38440460453", + "api": "openai/models", "version": "2026-10-23", "change_type": "breaking", "breaking": true, @@ -278,8 +278,8 @@ }, { "id": 15, - "fingerprint": "sha256:0b728cec3efd96ef7ca8765c34aef84c2e13887fdc5274c069984c8aee120aee", - "api": "openai-models", + "fingerprint": "sha256:addb33cfa80c881094a669f95b412315e962f57818d9b2c60bf10b457384fd06", + "api": "openai/models", "version": "2026-10-23", "change_type": "breaking", "breaking": true, @@ -298,8 +298,8 @@ }, { "id": 16, - "fingerprint": "sha256:8339104fec6d3ac38394a5902bfd896a1fbe864a6434ecf607e22faaae7662e9", - "api": "openai-models", + "fingerprint": "sha256:fa804d562f3745055a2a0102bfc04b2e9bf83c1f009b01b6011da54a42698743", + "api": "openai/models", "version": "2026-10-23", "change_type": "breaking", "breaking": true, @@ -318,8 +318,8 @@ }, { "id": 17, - "fingerprint": "sha256:ff6ba96f8b5e4b0788e3a4267215fc864b7afa24deb44a1427602089af35f6db", - "api": "openai-models", + "fingerprint": "sha256:e7368b0ebebe0b0d76c287216e5028a43aa67c5bd19d93100b0a5f578f4de3a1", + "api": "openai/models", "version": "2026-10-23", "change_type": "breaking", "breaking": true, @@ -338,8 +338,8 @@ }, { "id": 18, - "fingerprint": "sha256:ff410b834f7b61c26f5f6efa6d2925a8ad7b8fe9836be048b18afcc5649b7bf0", - "api": "openai-models", + "fingerprint": "sha256:d028abbd1dbe941ef3ddc502493237ac63618d5bb6dfddb97f865238b953e87b", + "api": "openai/models", "version": "2026-10-23", "change_type": "breaking", "breaking": true, @@ -358,8 +358,8 @@ }, { "id": 19, - "fingerprint": "sha256:6e193d723a4d3b995ceb4a14acfe60a7346f2fc479432e053f2e8d421ee1e8cc", - "api": "openai-models", + "fingerprint": "sha256:2366f086a80491576145afe7cf510c55ac4e0d2de7bf441bc75ef612d6167e2b", + "api": "openai/models", "version": "2026-10-23", "change_type": "breaking", "breaking": true, @@ -378,8 +378,8 @@ }, { "id": 20, - "fingerprint": "sha256:44528ba7f19ebb51ec9055123c0774263a3deb77d8fd8ccb0c3629e8968efb34", - "api": "openai-models", + "fingerprint": "sha256:94b73f3151693c11fde24e3848af27c40865037cbd9cf4115e3bc19fd8c60052", + "api": "openai/models", "version": "2026-10-23", "change_type": "breaking", "breaking": true, @@ -398,8 +398,8 @@ }, { "id": 21, - "fingerprint": "sha256:6ebc3787c51d8082fe265819faa8d32c50c5989a404144cdfb9d593d71a03bc5", - "api": "openai-models", + "fingerprint": "sha256:d759ff817c84f9d74272fcb91cbdae5221e974eb47b0b55b7dd7147aa1e31602", + "api": "openai/models", "version": "2026-10-23", "change_type": "breaking", "breaking": true, @@ -418,8 +418,8 @@ }, { "id": 22, - "fingerprint": "sha256:5484892bfe6ea2a10d9f2f858b646814273888619cfa77ffefb14e474ae91ddd", - "api": "openai-models", + "fingerprint": "sha256:0480d1edc177c250b09e7a924a9b40657b44783e7c9bbbb0ffacb80db251fc7f", + "api": "openai/models", "version": "2026-10-23", "change_type": "breaking", "breaking": true, @@ -438,8 +438,8 @@ }, { "id": 23, - "fingerprint": "sha256:b63b86a39ecf25bb85b58e670346ab72b7b5d9017862c20749cfd47cdbbea309", - "api": "openai-models", + "fingerprint": "sha256:ba214836ceb8d67ee994e2dc21f34390630a25c9980f28027d406a6e6cf20aa8", + "api": "openai/models", "version": "2026-10-23", "change_type": "breaking", "breaking": true, @@ -458,8 +458,8 @@ }, { "id": 24, - "fingerprint": "sha256:45307e4078b45d31ae96526982d65375586045547491465a7fcd2939d29afbcd", - "api": "openai-models", + "fingerprint": "sha256:12144bbcd4bc23bd91febd9d2f96b3a9e9579dc4e04bb63422771f69f18721ce", + "api": "openai/models", "version": "2026-10-23", "change_type": "breaking", "breaking": true, @@ -478,8 +478,8 @@ }, { "id": 25, - "fingerprint": "sha256:a6a5649fce6528970f9594cccb059977ec95d6acab772672615c179b4ed29d01", - "api": "openai-models", + "fingerprint": "sha256:3ea97dbeb2ae5fd8b306c204b89426d83f17e1beb06f435b482e50355f0c4205", + "api": "openai/models", "version": "2026-10-23", "change_type": "breaking", "breaking": true, @@ -497,8 +497,8 @@ }, { "id": 26, - "fingerprint": "sha256:e8f619b1367f98f14d21392595abb6ecaeb7cc5aa04d7d3fa9318407f4af2b1f", - "api": "openai-models", + "fingerprint": "sha256:e363ee6a9fae0c10ff5e99b538929cb5fb8df270659832f5dfca1c193f54a6ec", + "api": "openai/models", "version": "2026-10-23", "change_type": "breaking", "breaking": true, @@ -516,8 +516,8 @@ }, { "id": 27, - "fingerprint": "sha256:89d91a7ec88dd9ad6b51f5d1eb1f77071cd7de7f7bfe2c52f41ed1b4a02e97ca", - "api": "openai-models", + "fingerprint": "sha256:059635ab8cb64b86d7650d4d42358d1df622089f98660b185409f348314f71b7", + "api": "openai/models", "version": "2026-10-23", "change_type": "breaking", "breaking": true, @@ -536,8 +536,8 @@ }, { "id": 28, - "fingerprint": "sha256:0d59189db33469b6118d40b1579c4089b30bfd296989ef5530b0af2525b54d78", - "api": "openai-models", + "fingerprint": "sha256:21bc5747c723b0cfeca2e75de8d84ef25dd917f07c6a2ac265e2c357a8acf249", + "api": "openai/models", "version": "2026-10-23", "change_type": "breaking", "breaking": true, @@ -556,8 +556,8 @@ }, { "id": 29, - "fingerprint": "sha256:01dd3828678189ac6cdfa4d5d9b25c49cc81067f90b211afc0283bcf90eac9f2", - "api": "openai-models", + "fingerprint": "sha256:a6aa8b28c72878f6c9e1ac51de793db65b5c56ce74e868cb0f0a662f1feda5b2", + "api": "openai/models", "version": "2026-10-23", "change_type": "breaking", "breaking": true, @@ -576,8 +576,8 @@ }, { "id": 30, - "fingerprint": "sha256:c81454c4dfd092f9d68a5240d0304bb9a78a623e08a446adbf58877906624284", - "api": "openai-models", + "fingerprint": "sha256:cd2490b99479131812970751179d5b2d096f418b46c7dcf29a82fa5af87cbadc", + "api": "openai/models", "version": "2026-10-23", "change_type": "breaking", "breaking": true, @@ -596,8 +596,8 @@ }, { "id": 31, - "fingerprint": "sha256:a7d99c56423521bfdd1994d830eb98ed9eadb95ba4d914e5ac6e7cc3336d4768", - "api": "openai-models", + "fingerprint": "sha256:ae0f2cf43e75ed043a653886b7978c010d5b195b1b4be4609d7a2b080b29c348", + "api": "openai/models", "version": "2026-07-23", "change_type": "breaking", "breaking": true, @@ -616,8 +616,8 @@ }, { "id": 32, - "fingerprint": "sha256:ca9d0a7234b4d5f8b9fde6059522d24b6fec292d0ec596aaad25f5c4653c6f43", - "api": "openai-models", + "fingerprint": "sha256:f64b3b40fa81e5b72254b5d7a165b0be6936f6ee31963e69e93a6cd2c4b17905", + "api": "openai/models", "version": "2026-07-23", "change_type": "breaking", "breaking": true, @@ -636,8 +636,8 @@ }, { "id": 33, - "fingerprint": "sha256:2b70c42f6edc749874d81ad5179b6ec024e14071e1e223522a0d0d308e120b96", - "api": "openai-models", + "fingerprint": "sha256:3184eaa1b6321186722ddf12d85c295ca6732c56325354c3c265a430d2d51414", + "api": "openai/models", "version": "2026-07-23", "change_type": "breaking", "breaking": true, @@ -656,8 +656,8 @@ }, { "id": 34, - "fingerprint": "sha256:2c77ece4681f5c6a00ee2ab7d758ee2b117608730e84bd6634de019def746fd5", - "api": "openai-models", + "fingerprint": "sha256:fd572c9b7dae1089003abd9a293d105bf70673081d4d878fb74135e17062ac02", + "api": "openai/models", "version": "2026-07-23", "change_type": "breaking", "breaking": true, @@ -676,8 +676,8 @@ }, { "id": 35, - "fingerprint": "sha256:f36568905d53276d44f4d9098a3c1eb188b1ba2b72fb7cc0e22d76cd226f59e9", - "api": "openai-models", + "fingerprint": "sha256:33518065dd3aa5c749949289dd72055b6fdb79f3835073b34a412b2e451c93d0", + "api": "openai/models", "version": "2026-07-23", "change_type": "breaking", "breaking": true, @@ -696,8 +696,8 @@ }, { "id": 36, - "fingerprint": "sha256:dfd970dc0f07fb5070dcff7e58b4563e823c1d4e1bb7cc5ea2b463c2dd39118a", - "api": "openai-models", + "fingerprint": "sha256:40d04868cd14e2aff7523f717367a5a6632542015a489c31b27f9b85aae3052c", + "api": "openai/models", "version": "2026-07-23", "change_type": "breaking", "breaking": true, @@ -716,8 +716,8 @@ }, { "id": 37, - "fingerprint": "sha256:f762416989e9e7631f165724833a191eda5ed1137207de696c9f9e9243cd7927", - "api": "openai-models", + "fingerprint": "sha256:ff2bbf4f9bb9231f9b4a5603899c0fc752f6a37f6e26a5c7e1fe5790f409ca48", + "api": "openai/models", "version": "2026-07-23", "change_type": "breaking", "breaking": true, @@ -736,8 +736,8 @@ }, { "id": 38, - "fingerprint": "sha256:43124e10c999e062a69b7b8b1d2dbd4c077ce160376e46c6343623cccc3848a4", - "api": "openai-models", + "fingerprint": "sha256:362e7e03afadd59d0cdbfff7e736e0f735ae9eea79fe5720bf920bfceb62162a", + "api": "openai/models", "version": "2026-07-23", "change_type": "breaking", "breaking": true, @@ -756,8 +756,8 @@ }, { "id": 39, - "fingerprint": "sha256:126ac994f3aa3ad3c09c156bcdf5bc718745f4a5eb3446ade01fd9763c78c6d4", - "api": "openai-models", + "fingerprint": "sha256:af71610f01e6ddf5b3afb5d282bf8946761ae2b998b2a2b331e222fc56c7ca74", + "api": "openai/models", "version": "2026-07-23", "change_type": "breaking", "breaking": true, @@ -776,8 +776,8 @@ }, { "id": 40, - "fingerprint": "sha256:64f6c89efb82a96dcd2ea6eb444532e2014fe58abeb714571799e64446d1d298", - "api": "openai-models", + "fingerprint": "sha256:f24c2a080eba5b89e6ea591af12a14645c80791266b45856420396ffd532f939", + "api": "openai/models", "version": "2026-07-23", "change_type": "breaking", "breaking": true, @@ -796,8 +796,8 @@ }, { "id": 41, - "fingerprint": "sha256:490b8746c969a8c57b52c5703c0cf9904d329d76cbe46d5cd2910e608084e512", - "api": "openai-models", + "fingerprint": "sha256:0e2a5ba7b05b9c093526bdf9afcabf862d9f31e84e42a4ba14b159838ecd880a", + "api": "openai/models", "version": "2026-07-23", "change_type": "breaking", "breaking": true, @@ -816,8 +816,8 @@ }, { "id": 42, - "fingerprint": "sha256:dde88b1c5c95adc94870279136f242a0fe034ef61cbcb0508185c603f6af719e", - "api": "openai-models", + "fingerprint": "sha256:c6b498786a70cce3450693d63d40983af1593a32ef9dd1dfdd5d8bd36922ca58", + "api": "openai/models", "version": "2026-07-23", "change_type": "breaking", "breaking": true, @@ -836,8 +836,8 @@ }, { "id": 43, - "fingerprint": "sha256:c414f177cfa703eb48624f92ef7a5b26c3161649f4e880766deb2e3e4bdd7383", - "api": "openai-models", + "fingerprint": "sha256:1bb911d293d7d2dbd20f2a89a97d9c3fab308d0bbff74bfea2d220a8e3fc1f07", + "api": "openai/models", "version": "2026-07-23", "change_type": "breaking", "breaking": true, @@ -856,8 +856,8 @@ }, { "id": 44, - "fingerprint": "sha256:4c57ce2ffdb86f2c2d7b6b9019efafa40b560b0126112cdc524770f7d65ee8cb", - "api": "openai-models", + "fingerprint": "sha256:a56b2eb3fce5c64b1981cb90610e8d3eb4f4f5917203b5b2d36d574de381c171", + "api": "openai/models", "version": "2026-07-23", "change_type": "breaking", "breaking": true, @@ -876,8 +876,8 @@ }, { "id": 45, - "fingerprint": "sha256:10ffc1a4720af9fc00d34d0d25a1717c154e1582e21fc5609084a703f74f8410", - "api": "openai-models", + "fingerprint": "sha256:e92ab5f3acdea6243818e8cc5645187cd71ac3ea985bc7a0900f8b856b50c923", + "api": "openai/models", "version": "2026-07-23", "change_type": "breaking", "breaking": true, @@ -896,8 +896,8 @@ }, { "id": 46, - "fingerprint": "sha256:537f3ede89cbedfcd88c69705210766610f288f2f946a7d09d5efb180b667ce7", - "api": "openai-models", + "fingerprint": "sha256:22c3df936ace8a0652431ca2a769dd8b039404c588b4c7f911dabd1d64e770b0", + "api": "openai/models", "version": "2026-02-17", "change_type": "breaking", "breaking": true, @@ -916,8 +916,8 @@ }, { "id": 47, - "fingerprint": "sha256:bcf6128e377c8d7f1dbedec1b6ad6002cf11a67561eceab7e40a98f88a937c52", - "api": "openai-models", + "fingerprint": "sha256:e2b44aa8420f408ceab29fb272f2e0f2baec9893a04c62f93688995ed53481c8", + "api": "openai/models", "version": "2026-02-12", "change_type": "breaking", "breaking": true, @@ -936,8 +936,8 @@ }, { "id": 48, - "fingerprint": "sha256:d4827e4f335eaac69ad1df195901c290acf963f0d6fdc9163c151439049ff26b", - "api": "openai-models", + "fingerprint": "sha256:298d52e2df997a412541c04406569482b54cc7b2736b7a54b64a47636ee5adac", + "api": "openai/models", "version": "2026-09-28", "change_type": "breaking", "breaking": true, @@ -956,8 +956,8 @@ }, { "id": 49, - "fingerprint": "sha256:d4ac9adae612e7b32462578d10fffc3f8c60801069e7b453948f95018626b755", - "api": "openai-models", + "fingerprint": "sha256:6e31004123e3abadcfd61472f45a91f584a5216750debd24a7893c1e3f1d74be", + "api": "openai/models", "version": "2026-09-28", "change_type": "breaking", "breaking": true, @@ -976,8 +976,8 @@ }, { "id": 50, - "fingerprint": "sha256:d6b036197bebb4d320f56fbb1b9703dfb826aacb44015558f6db69f4b49f8d45", - "api": "openai-models", + "fingerprint": "sha256:ce07a31125e454c6347940c57d9f3954c1464e7c4d115b9e613f608fc311fd39", + "api": "openai/models", "version": "2025-07-28", "change_type": "breaking", "breaking": true, @@ -996,8 +996,8 @@ }, { "id": 51, - "fingerprint": "sha256:cbfe4a6c507234baa08fe888d106b0315094568d4c037c51ff4088a7b2cf5a70", - "api": "openai-models", + "fingerprint": "sha256:df9d790a772a62b909bf66d840de74633c2a1389f66cca3ba5bda96343b237eb", + "api": "openai/models", "version": "2025-10-27", "change_type": "breaking", "breaking": true, @@ -1016,8 +1016,8 @@ }, { "id": 52, - "fingerprint": "sha256:a31c2dbbc2b61b192a3f7c600b930258a92054516e289e11fdfd9aeae4ece698", - "api": "openai-models", + "fingerprint": "sha256:47cf31bd0a2dc60fd9bbdce8cc286426e2cc28baebd2072c5c1bfce1e8108a40", + "api": "openai/models", "version": "2025-07-14", "change_type": "breaking", "breaking": true, @@ -1036,8 +1036,8 @@ }, { "id": 53, - "fingerprint": "sha256:981faa711b568aba0c1a83997c9344c09a00313f10c721d06477101ba4fe6bc6", - "api": "openai-models", + "fingerprint": "sha256:9ca7706bae32fba43a64b7089716eb87a6b90c91b15aaf6b32b120e3f6399a79", + "api": "openai/models", "version": "2025-06-06", "change_type": "breaking", "breaking": true, @@ -1056,8 +1056,8 @@ }, { "id": 54, - "fingerprint": "sha256:3a21d230a15dc0d80a4d49753c88cc14540c3ffeda0f23aa57db6fbf742f4d0a", - "api": "openai-models", + "fingerprint": "sha256:72ccffb5565f02b44b1f0f106fbfe718533126191db0ec66fa622b3510a45247", + "api": "openai/models", "version": "2025-06-06", "change_type": "breaking", "breaking": true, @@ -1076,8 +1076,8 @@ }, { "id": 55, - "fingerprint": "sha256:6af617bed4ade27661a14252e84fe3d493152285c673df7847f32ce2343b526d", - "api": "openai-models", + "fingerprint": "sha256:e3b22f3e67667c12321d23412ea6c1b2f98ef44d345f2b0ca173fcb6353037ee", + "api": "openai/models", "version": "2025-06-06", "change_type": "breaking", "breaking": true, @@ -1096,8 +1096,8 @@ }, { "id": 56, - "fingerprint": "sha256:a4b36dbb16c42d2abaf0e83b491b7d3253d5ae86ab88617be69dff190bbdc3eb", - "api": "openai-models", + "fingerprint": "sha256:1bd4a6f96c1537c7f8cde0f2643a337c0497e994226bb3a88739f197ed57ba1e", + "api": "openai/models", "version": "2024-12-06", "change_type": "breaking", "breaking": true, @@ -1116,8 +1116,8 @@ }, { "id": 57, - "fingerprint": "sha256:34d631767f5ec467ba6d50f3c0ceae19b6e4557a1444079ae70005bfb38728ac", - "api": "openai-models", + "fingerprint": "sha256:23b7fa9ef60a7125375298ead1585c704724d03667dbeb24e6e23caa94b6be55", + "api": "openai/models", "version": "2024-12-06", "change_type": "breaking", "breaking": true, @@ -1136,8 +1136,8 @@ }, { "id": 58, - "fingerprint": "sha256:f1628b016c89c646af7b5899f831cfd1f14134691dfaa8a2b1073a12078509c8", - "api": "openai-models", + "fingerprint": "sha256:ea4d8ba55b674c1a828858251ff7506a9fcb5d229db0dddfc7cca370e063c148", + "api": "openai/models", "version": "2024-09-13", "change_type": "breaking", "breaking": true, @@ -1156,8 +1156,8 @@ }, { "id": 59, - "fingerprint": "sha256:986a2a4648ac8603c829df3890977fb6bf934df01254a817f8dfcc82a2a0040b", - "api": "openai-models", + "fingerprint": "sha256:e3a9e9a088427c22fae9b2199e34612bd62d03753de88defe42b55c0df16a17f", + "api": "openai/models", "version": "2024-09-13", "change_type": "breaking", "breaking": true, @@ -1176,8 +1176,8 @@ }, { "id": 60, - "fingerprint": "sha256:8277d56d92a81586e3eab30094661964e1c32212dd1eb14e1c7f620b362f4056", - "api": "openai-models", + "fingerprint": "sha256:18546ec0a58809196edb87d8141cfecd799cdc4dc50aba6314401318002aa002", + "api": "openai/models", "version": "2024-09-13", "change_type": "breaking", "breaking": true, diff --git a/plugins/notices/testdata/golden/salesforce.json b/plugins/notices/testdata/golden/salesforce.json index 4d9140c..4d0c678 100644 --- a/plugins/notices/testdata/golden/salesforce.json +++ b/plugins/notices/testdata/golden/salesforce.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:5712d5a3f809b2edd3032446bfe6a0a654eb113f1f7e0e80b0d673132dced685", - "api": "salesforce", + "fingerprint": "sha256:96a4bf95d203b442628962583c15c58ce031da50dfe37335ddde6269fb426feb", + "api": "salesforce/rest-api", "version": "31.0", "change_type": "deprecation", "breaking": false, @@ -21,8 +21,8 @@ }, { "id": 2, - "fingerprint": "sha256:d5cd04d4a65a7ba09f4a71e7c346a4be3309451212787016d5c614498b556516", - "api": "salesforce", + "fingerprint": "sha256:012c28a49c2340048dc090672525f2982c8f3f2dca395972738e7964b2d192b0", + "api": "salesforce/rest-api", "version": "32.0", "change_type": "deprecation", "breaking": false, @@ -41,8 +41,8 @@ }, { "id": 3, - "fingerprint": "sha256:c009d4f0635e311b34acfbb6696c6d2aacbcd7c102ebc56d13036044f10910bf", - "api": "salesforce", + "fingerprint": "sha256:1f2b8339e9ef0ff5c5febe23dc2a21908b8d5523c3116adcec7fb364d328ac94", + "api": "salesforce/rest-api", "version": "33.0", "change_type": "deprecation", "breaking": false, @@ -61,8 +61,8 @@ }, { "id": 4, - "fingerprint": "sha256:08ef4a0e2b7798dd6e15087bfc30505dd412de40c553d3617f3d4533730b3931", - "api": "salesforce", + "fingerprint": "sha256:3a0d271a4843c6933542538bcb8d6e8073e264f4fef985ae8ea45545a64c5079", + "api": "salesforce/rest-api", "version": "34.0", "change_type": "deprecation", "breaking": false, @@ -81,8 +81,8 @@ }, { "id": 5, - "fingerprint": "sha256:f8b44ec3074f7f9d2ea45e3d2e681dc7e0bfca83a3c046d188e90a63295c06bd", - "api": "salesforce", + "fingerprint": "sha256:b0f532972d7edeac88234c226f9d13aa739e22ccdb76d0c715cc9a983909ced4", + "api": "salesforce/rest-api", "version": "35.0", "change_type": "deprecation", "breaking": false, @@ -101,8 +101,8 @@ }, { "id": 6, - "fingerprint": "sha256:edc028b547f9ed0ec5559febeb2ea9a04eb681e4d53fd15fe98961d110fbe3d3", - "api": "salesforce", + "fingerprint": "sha256:df9e4eab6337c0b0ac95964aa2d55048c5010280fb695f5472639939d9cfaa2d", + "api": "salesforce/rest-api", "version": "36.0", "change_type": "deprecation", "breaking": false, @@ -121,8 +121,8 @@ }, { "id": 7, - "fingerprint": "sha256:a00a996c75520031b4df78d500f327f9b9c94706753f2e8beb8ec123ee3e37e1", - "api": "salesforce", + "fingerprint": "sha256:beb4c877840a1e54436cdec1b331ba770a018e50a459286d71198becdef92b80", + "api": "salesforce/rest-api", "version": "37.0", "change_type": "deprecation", "breaking": false, @@ -141,8 +141,8 @@ }, { "id": 8, - "fingerprint": "sha256:ae8c254aa2eeb784a0cda9eaafeedf617991223b3ebcdf6c12bfd56e496712f9", - "api": "salesforce", + "fingerprint": "sha256:0ac93a885e8f93f3d5a0c254f80a2f9d3cc342f0a42049cae8c0db64a66a1580", + "api": "salesforce/rest-api", "version": "38.0", "change_type": "deprecation", "breaking": false, @@ -161,8 +161,8 @@ }, { "id": 9, - "fingerprint": "sha256:5f738a2088c9e818c5da229746de80ff1966e94b454eddcd1ea7e2fb6323bb27", - "api": "salesforce", + "fingerprint": "sha256:d4e47848b8cce83fcd7a5bab59a04cd0c799fd677066634e5d2c158c01bf11d3", + "api": "salesforce/rest-api", "version": "39.0", "change_type": "deprecation", "breaking": false, @@ -181,8 +181,8 @@ }, { "id": 10, - "fingerprint": "sha256:01287da0f76665a83b6d2cf46f99ea4b189e3b5e4a3f1370d03e59da9928fc09", - "api": "salesforce", + "fingerprint": "sha256:0ad4bdfbe6fb425cf970046b57277acc27139d72d3fc671d9c8088622087b00d", + "api": "salesforce/rest-api", "version": "40.0", "change_type": "deprecation", "breaking": false, @@ -201,8 +201,8 @@ }, { "id": 11, - "fingerprint": "sha256:3196e696d971115984b011f675c6625471769a9bed370f39fa34697cabb2a568", - "api": "salesforce", + "fingerprint": "sha256:c4dca9562fd787bfba9d73d3d942cf9f86c4fa297950dae813ef45755fd9f422", + "api": "salesforce/rest-api", "version": "21.0", "change_type": "breaking", "breaking": true, @@ -221,8 +221,8 @@ }, { "id": 12, - "fingerprint": "sha256:b01efdc1068b028b253b16195c3a40220f2c38a47692b039c972ad860fd04aa5", - "api": "salesforce", + "fingerprint": "sha256:ce3136f63f99d74730d055a9ae0b9786b3cb09afda65e679ee7ca4f02f0bbb4f", + "api": "salesforce/rest-api", "version": "22.0", "change_type": "breaking", "breaking": true, @@ -241,8 +241,8 @@ }, { "id": 13, - "fingerprint": "sha256:6d416539f96a25434c34a311bbc0f5c946c07a9a2f87bcb3c58b04e0d47fb15f", - "api": "salesforce", + "fingerprint": "sha256:bcfef560d3295295df22bb0e1e23dbe2073f7ccdeca0af60939d7f473bc2d2a7", + "api": "salesforce/rest-api", "version": "23.0", "change_type": "breaking", "breaking": true, @@ -261,8 +261,8 @@ }, { "id": 14, - "fingerprint": "sha256:54e2b6dde407bf4e2cbe571daf71c7759c625b079c6e7fc9e0b9ed630745edcf", - "api": "salesforce", + "fingerprint": "sha256:9533ab4a1f46c424c9bb551eb7caaee1d30adabae3ef275fcfa9bfb321bcd273", + "api": "salesforce/rest-api", "version": "24.0", "change_type": "breaking", "breaking": true, @@ -281,8 +281,8 @@ }, { "id": 15, - "fingerprint": "sha256:0c4183136450ca1afccd23bf6e4e9f25f08f2a0470c55032e0724312b616a7e1", - "api": "salesforce", + "fingerprint": "sha256:479da007024f7c36ae3c0406e8fe5c438362b8f1c30d725833bd3e37d7b965ae", + "api": "salesforce/rest-api", "version": "25.0", "change_type": "breaking", "breaking": true, @@ -301,8 +301,8 @@ }, { "id": 16, - "fingerprint": "sha256:2f8518fb4d77876618e24c6848977e471825e305404f234c349b9af56e731078", - "api": "salesforce", + "fingerprint": "sha256:9d42c0cb78dd8add1cf01e74eadb1bb1b765c95e5bd201b6c003e83f8290386d", + "api": "salesforce/rest-api", "version": "26.0", "change_type": "breaking", "breaking": true, @@ -321,8 +321,8 @@ }, { "id": 17, - "fingerprint": "sha256:44ed65c3d55263ee40bdf9324715ad0b31c727f927a172a38cc0162bf796d325", - "api": "salesforce", + "fingerprint": "sha256:832dfa7fcacaf76ceac4b91e281458a87f0c8d3f973d1d53aac55026e4b1fb7b", + "api": "salesforce/rest-api", "version": "27.0", "change_type": "breaking", "breaking": true, @@ -341,8 +341,8 @@ }, { "id": 18, - "fingerprint": "sha256:3da22cdfd664c8f52ebb476cd278bfdeb460918c50d8b0184a542ce091fd72e8", - "api": "salesforce", + "fingerprint": "sha256:409dbd170c4aa71923824e95d9b458d1b88c37b255104a6c86dec67b8a100ac8", + "api": "salesforce/rest-api", "version": "28.0", "change_type": "breaking", "breaking": true, @@ -361,8 +361,8 @@ }, { "id": 19, - "fingerprint": "sha256:f3d260b9acef562eaf5f530d3a253176d878d7788bf827441745ee93b32c6787", - "api": "salesforce", + "fingerprint": "sha256:561d8e2e8c4ffee2fd071b62d03f8d7d37fa21ec0c9faf9f3efde1943a4fd83c", + "api": "salesforce/rest-api", "version": "29.0", "change_type": "breaking", "breaking": true, @@ -381,8 +381,8 @@ }, { "id": 20, - "fingerprint": "sha256:01ccee5cbdd725ba99be6328151e1366be0efa49d6431a3b0e93bb09a3676131", - "api": "salesforce", + "fingerprint": "sha256:a8f3b6a7ef22d26b047ffa1beeb398afcd5c3d73af7263d1ddfd60796b18f45f", + "api": "salesforce/rest-api", "version": "30.0", "change_type": "breaking", "breaking": true, @@ -401,8 +401,8 @@ }, { "id": 21, - "fingerprint": "sha256:e9867faae1b6920e6c39cedeaf143997102f9a91d9515a442e1cc4f9cffae820", - "api": "salesforce", + "fingerprint": "sha256:0fcc2e13469764fdb95343e3c97aa15232f5a46ba6e09e091ed1618d22858c6b", + "api": "salesforce/rest-api", "version": "7.0", "change_type": "breaking", "breaking": true, @@ -421,8 +421,8 @@ }, { "id": 22, - "fingerprint": "sha256:d35aebdfad2134fd75a451817b2a347633eed5d94a53e96b1665bb800d557863", - "api": "salesforce", + "fingerprint": "sha256:1836f945f91e9c4bfd6393341729d5c795894db8988d5c53af017f902e529b2e", + "api": "salesforce/rest-api", "version": "8.0", "change_type": "breaking", "breaking": true, @@ -441,8 +441,8 @@ }, { "id": 23, - "fingerprint": "sha256:f5af0d2c541f41c371b8dbfe80cb9abeedb7758c6fd8a79d0251c1b763578549", - "api": "salesforce", + "fingerprint": "sha256:4aca007478f276b46117b3c9f4aa5a289cebd818e69e3e83dfacb3e1583d1072", + "api": "salesforce/rest-api", "version": "9.0", "change_type": "breaking", "breaking": true, @@ -461,8 +461,8 @@ }, { "id": 24, - "fingerprint": "sha256:1975b2eb2a035e983a81cfe32fa432edaa62ec0ab7b1d7aea1b542f194ca6170", - "api": "salesforce", + "fingerprint": "sha256:cce9cf0404b112076ffd3814efaa70238c942420a9893a1fc6a93250904a75c6", + "api": "salesforce/rest-api", "version": "10.0", "change_type": "breaking", "breaking": true, @@ -481,8 +481,8 @@ }, { "id": 25, - "fingerprint": "sha256:39d1421f1d4675f662bd0d3e984fd813de2ba740438c09d9ecdd96f9c5e517cc", - "api": "salesforce", + "fingerprint": "sha256:2314981ead2820e1523bf7ca29b8cefde9b445c3a5ddaaf501ffbeabf56a8a99", + "api": "salesforce/rest-api", "version": "11.0", "change_type": "breaking", "breaking": true, @@ -501,8 +501,8 @@ }, { "id": 26, - "fingerprint": "sha256:9a3cb32fac90139da92e6e9de3e67261309654ee5ee2fc0f149133af811ad96e", - "api": "salesforce", + "fingerprint": "sha256:8acca78bbf8ce6adb5d16d7b767a36c79b1ad32f2e3a00c09e29b41e3b061cc6", + "api": "salesforce/rest-api", "version": "12.0", "change_type": "breaking", "breaking": true, @@ -521,8 +521,8 @@ }, { "id": 27, - "fingerprint": "sha256:ac37dc2324273bc9523c0ff620f7de402ad0e6350d930c9f6f2d4c3644e2a956", - "api": "salesforce", + "fingerprint": "sha256:759fd344f34b106ccd906a70c2d0830f0e85ecaf1e5058a9c4d2be70b317874d", + "api": "salesforce/rest-api", "version": "13.0", "change_type": "breaking", "breaking": true, @@ -541,8 +541,8 @@ }, { "id": 28, - "fingerprint": "sha256:4364f685eb1cb5b90db0a979bc329dc7df0a03ca0e85626c981a5119f0acdd41", - "api": "salesforce", + "fingerprint": "sha256:3900ae246cbcde03edddb7b23644c2219e0db3b476ed1369ef8b9457f87e05e8", + "api": "salesforce/rest-api", "version": "14.0", "change_type": "breaking", "breaking": true, @@ -561,8 +561,8 @@ }, { "id": 29, - "fingerprint": "sha256:c26fd727091b806bd34d1761e4b7801d24256e7567e9c65dd41171c6e3b7b1ff", - "api": "salesforce", + "fingerprint": "sha256:a54e091c042d0b6207daae68c86fff56a610db97f3c5efed453eb39120e10cc5", + "api": "salesforce/rest-api", "version": "15.0", "change_type": "breaking", "breaking": true, @@ -581,8 +581,8 @@ }, { "id": 30, - "fingerprint": "sha256:0241eda116305ecfd420fa6f42900e4db478297db732a21beff08b1e21ae96b6", - "api": "salesforce", + "fingerprint": "sha256:a8f6e65b0994234b81fd370d6647ba1a478206398c27967aa3d2e59ce2fbee8c", + "api": "salesforce/rest-api", "version": "16.0", "change_type": "breaking", "breaking": true, @@ -601,8 +601,8 @@ }, { "id": 31, - "fingerprint": "sha256:b95ba1dc0afc72b21b40e934ec2d8549da5bf406a5cae9feaba94e7a0fb7ec63", - "api": "salesforce", + "fingerprint": "sha256:7ca796235cd5f96170640fdc6c381cf5c08822d860d2baf8e13c59f03070c76b", + "api": "salesforce/rest-api", "version": "17.0", "change_type": "breaking", "breaking": true, @@ -621,8 +621,8 @@ }, { "id": 32, - "fingerprint": "sha256:44912e7a1618ccf57e957a8219609236f6757381eb4f590c66f95978fffe5af2", - "api": "salesforce", + "fingerprint": "sha256:841b996096bd90d89db132bd96fd8386913fc2f05f26c8c268b550c883d4f506", + "api": "salesforce/rest-api", "version": "18.0", "change_type": "breaking", "breaking": true, @@ -641,8 +641,8 @@ }, { "id": 33, - "fingerprint": "sha256:94cefbc9eb19323ce7fcf84fc0ee7b2f0a9064046959c52c64bfa755e3ba13c6", - "api": "salesforce", + "fingerprint": "sha256:a3f3f6021a40ab52092b92f59b1ced42891e298a6b75486c93971cc1a63feaf9", + "api": "salesforce/rest-api", "version": "19.0", "change_type": "breaking", "breaking": true, @@ -661,8 +661,8 @@ }, { "id": 34, - "fingerprint": "sha256:8f15f28dabaee09688f5588d5c939c72053f0c6002bb4c239c48eb22ba20e3cc", - "api": "salesforce", + "fingerprint": "sha256:718d1a6a17fe65fd7a7cd327ed6167f20f99f9ac87c05bda663b878684cd3e3c", + "api": "salesforce/rest-api", "version": "20.0", "change_type": "breaking", "breaking": true, diff --git a/plugins/openapi/adapter/adapter.go b/plugins/openapi/adapter/adapter.go index 871d23e..32349ef 100644 --- a/plugins/openapi/adapter/adapter.go +++ b/plugins/openapi/adapter/adapter.go @@ -22,7 +22,7 @@ type Spec struct { // Adapter is the shape every source adapter follows. Community and private // adapters implement the same three methods. type Adapter interface { - API() string // lowercase slug, e.g. "stripe" + API() string // the source id events carry, e.g. "stripe/api" LatestTag(ctx context.Context) (string, error) // newest release tag Fetch(ctx context.Context, tag string) (Spec, error) // spec for that exact tag } diff --git a/plugins/openapi/adapter/algolia.go b/plugins/openapi/adapter/algolia.go index 2628fb8..b49cff2 100644 --- a/plugins/openapi/adapter/algolia.go +++ b/plugins/openapi/adapter/algolia.go @@ -35,7 +35,7 @@ type Algolia struct { var _ Adapter = Algolia{} -func (a Algolia) API() string { return "algolia-" + a.Spec } +func (a Algolia) API() string { return "algolia/" + a.Spec + "-api" } var algoliaTag = regexp.MustCompile(`^released-(\d{4}-\d{2}-\d{2})(-[0-9a-f]+)?$`) diff --git a/plugins/openapi/adapter/algolia_test.go b/plugins/openapi/adapter/algolia_test.go index 4c75673..80432a2 100644 --- a/plugins/openapi/adapter/algolia_test.go +++ b/plugins/openapi/adapter/algolia_test.go @@ -93,7 +93,7 @@ func TestAlgoliaFetch(t *testing.T) { if spec.Version != "2025-04-01" || string(spec.Content) != want || !strings.HasSuffix(spec.SourceURL, "/released-2025-04-01-c19ee6afb/search.yml") { t.Errorf("got %q %s %s", spec.Version, spec.Content, spec.SourceURL) } - if (Algolia{Spec: "search"}).API() != "algolia-search" { + if (Algolia{Spec: "search"}).API() != "algolia/search-api" { t.Error("api slug") } for _, tag := range []string{"v4.0.0", "released-2025-04-01-c19ee6afb-x", "released-xx"} { diff --git a/plugins/openapi/adapter/appwrite.go b/plugins/openapi/adapter/appwrite.go index c458936..837c2cf 100644 --- a/plugins/openapi/adapter/appwrite.go +++ b/plugins/openapi/adapter/appwrite.go @@ -28,7 +28,7 @@ var appwriteMethods = []string{"get", "put", "post", "delete", "patch", "head", // Appwrite adapts Appwrite's REST API spec in appwrite/specs (BSD-3-Clause) // for the openapi plugin. The repo has one directory per server minor, // specs/.x/, and no tags or releases (checked 2026-11-19), so a tag here -// is a commit SHA: the newest minor's spec at that commit. To replay an older +// is a commit SHA: the newest minor's spec at that commit. To read an older // minor, a tag can name its directory, "1.8.x@". // // A directory holds one of two layouts: @@ -59,7 +59,7 @@ type Appwrite struct { var _ Adapter = Appwrite{} -func (Appwrite) API() string { return "appwrite" } +func (Appwrite) API() string { return "appwrite/api" } func (a Appwrite) api(path string) string { return cmp.Or(a.APIBase, "https://api.github.com") + "/repos/appwrite/specs" + path diff --git a/plugins/openapi/adapter/convex.go b/plugins/openapi/adapter/convex.go index fe0e020..75ca537 100644 --- a/plugins/openapi/adapter/convex.go +++ b/plugins/openapi/adapter/convex.go @@ -37,7 +37,7 @@ type Convex struct{} var _ Adapter = Convex{} -func (Convex) API() string { return "convex" } +func (Convex) API() string { return "convex/deployment-api" } // LatestTag is the SHA of the newest commit that changed the spec. func (Convex) LatestTag(ctx context.Context) (string, error) { diff --git a/plugins/openapi/adapter/datadog.go b/plugins/openapi/adapter/datadog.go index 8a5f9d3..c25fded 100644 --- a/plugins/openapi/adapter/datadog.go +++ b/plugins/openapi/adapter/datadog.go @@ -27,7 +27,7 @@ type Datadog struct{} var _ Adapter = Datadog{} -func (Datadog) API() string { return "datadog" } +func (Datadog) API() string { return "datadog/api" } // LatestTag asks GitHub for the client's newest release tag, e.g. "2.62.0". // Datadog has no release process of its own to ask instead: the spec has no diff --git a/plugins/openapi/adapter/elasticsearch.go b/plugins/openapi/adapter/elasticsearch.go index 9bd8aaf..288d249 100644 --- a/plugins/openapi/adapter/elasticsearch.go +++ b/plugins/openapi/adapter/elasticsearch.go @@ -38,7 +38,7 @@ type Elasticsearch struct{} var _ Adapter = Elasticsearch{} -func (Elasticsearch) API() string { return "elasticsearch" } +func (Elasticsearch) API() string { return "elastic/elasticsearch-api" } var ( esRelease = regexp.MustCompile(`^v(\d+)\.(\d+)\.(\d+)$`) diff --git a/plugins/openapi/adapter/flagsmith.go b/plugins/openapi/adapter/flagsmith.go index 1c5c182..659b30c 100644 --- a/plugins/openapi/adapter/flagsmith.go +++ b/plugins/openapi/adapter/flagsmith.go @@ -33,7 +33,7 @@ type Flagsmith struct{} var _ Adapter = Flagsmith{} -func (Flagsmith) API() string { return "flagsmith" } +func (Flagsmith) API() string { return "flagsmith/api" } // LatestTag asks GitHub for Flagsmith's newest release tag, e.g. "v2.293.0". // Flagsmith tags a release on (almost) every merge to main via release-please, diff --git a/plugins/openapi/adapter/github.go b/plugins/openapi/adapter/github.go index f8c29f6..fa9d6b7 100644 --- a/plugins/openapi/adapter/github.go +++ b/plugins/openapi/adapter/github.go @@ -32,7 +32,7 @@ type GitHub struct{} var _ Adapter = GitHub{} -func (GitHub) API() string { return "github" } +func (GitHub) API() string { return "github/rest-api" } // LatestTag asks GitHub for every API version it currently supports and // returns the newest, by string order (the dates sort correctly as text). diff --git a/plugins/openapi/adapter/gitlab.go b/plugins/openapi/adapter/gitlab.go index b3ebb94..95b6191 100644 --- a/plugins/openapi/adapter/gitlab.go +++ b/plugins/openapi/adapter/gitlab.go @@ -50,7 +50,7 @@ type GitLab struct { var _ Adapter = GitLab{} -func (GitLab) API() string { return "gitlab" } +func (GitLab) API() string { return "gitlab/rest-api" } // LatestTag is the highest stable release tag, e.g. "v19.5.5-ee". The tags API // sorts by version, but its handling of the "-ee" suffix and of release diff --git a/plugins/openapi/adapter/neon.go b/plugins/openapi/adapter/neon.go index b767b2b..1de323b 100644 --- a/plugins/openapi/adapter/neon.go +++ b/plugins/openapi/adapter/neon.go @@ -32,7 +32,7 @@ type Neon struct{} var _ Adapter = Neon{} -func (Neon) API() string { return "neon" } +func (Neon) API() string { return "neon/api" } // LatestTag is the SHA of the newest commit that changed the spec. func (Neon) LatestTag(ctx context.Context) (string, error) { diff --git a/plugins/openapi/adapter/planetscale.go b/plugins/openapi/adapter/planetscale.go index 5c83d61..3d77cf9 100644 --- a/plugins/openapi/adapter/planetscale.go +++ b/plugins/openapi/adapter/planetscale.go @@ -34,7 +34,7 @@ type PlanetScale struct { var _ Adapter = PlanetScale{} -func (PlanetScale) API() string { return "planetscale" } +func (PlanetScale) API() string { return "planetscale/api" } func (p PlanetScale) api(path string) string { return cmp.Or(p.APIBase, "https://api.github.com") + "/repos/" + planetscaleRepo + path diff --git a/plugins/openapi/adapter/sentry.go b/plugins/openapi/adapter/sentry.go index 4b8bda6..9db5510 100644 --- a/plugins/openapi/adapter/sentry.go +++ b/plugins/openapi/adapter/sentry.go @@ -51,7 +51,7 @@ type Sentry struct { var _ Adapter = Sentry{} -func (Sentry) API() string { return "sentry" } +func (Sentry) API() string { return "sentry/api" } func (s Sentry) api(path string) string { return cmp.Or(s.APIBase, "https://api.github.com") + path diff --git a/plugins/openapi/adapter/stripe.go b/plugins/openapi/adapter/stripe.go index 171f736..4c94628 100644 --- a/plugins/openapi/adapter/stripe.go +++ b/plugins/openapi/adapter/stripe.go @@ -29,7 +29,7 @@ type Stripe struct{} // Compile-time check that Stripe actually satisfies Adapter. var _ Adapter = Stripe{} -func (Stripe) API() string { return "stripe" } +func (Stripe) API() string { return "stripe/api" } // LatestTag asks GitHub for Stripe's newest openapi release tag, e.g. "v2468". func (Stripe) LatestTag(ctx context.Context) (string, error) { diff --git a/plugins/openapi/adapter/supabase.go b/plugins/openapi/adapter/supabase.go index bd4ab86..fc7291d 100644 --- a/plugins/openapi/adapter/supabase.go +++ b/plugins/openapi/adapter/supabase.go @@ -31,7 +31,7 @@ type Supabase struct{} var _ Adapter = Supabase{} -func (Supabase) API() string { return "supabase" } +func (Supabase) API() string { return "supabase/management-api" } // LatestTag is the SHA of the newest commit that changed the spec. func (Supabase) LatestTag(ctx context.Context) (string, error) { diff --git a/plugins/openapi/adapter/vercel.go b/plugins/openapi/adapter/vercel.go index ae0d5e1..7d3afb3 100644 --- a/plugins/openapi/adapter/vercel.go +++ b/plugins/openapi/adapter/vercel.go @@ -27,7 +27,7 @@ type Vercel struct{} var _ Adapter = Vercel{} -func (Vercel) API() string { return "vercel" } +func (Vercel) API() string { return "vercel/api" } // LatestTag asks GitHub for vercel/sdk's newest release tag, e.g. "v1.28.65". // The canary tags (v14.0.0-canary.9) aren't releases, so releases/latest never diff --git a/plugins/openapi/algolia_test.go b/plugins/openapi/algolia_test.go index 6689e85..6fa3494 100644 --- a/plugins/openapi/algolia_test.go +++ b/plugins/openapi/algolia_test.go @@ -20,7 +20,7 @@ import ( // from YAML to JSON like adapter.Algolia.Fetch, and cited by the real URL. type fakeAlgoliaAdapter struct{ spec string } -func (f fakeAlgoliaAdapter) API() string { return "algolia-" + f.spec } +func (f fakeAlgoliaAdapter) API() string { return "algolia/" + f.spec + "-api" } func (fakeAlgoliaAdapter) LatestTag(context.Context) (string, error) { return "", fmt.Errorf("replay only") @@ -76,7 +76,7 @@ func TestAlgoliaGolden(t *testing.T) { t.Run(c.spec, func(t *testing.T) { ctx := context.Background() s := openStore(t) - if rejected, err := kittest.Replay(ctx, vercelEnv(s), s, algoliaPlugin(c.spec), c.from, c.to); err != nil || rejected { + if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, algoliaPlugin(c.spec), c.from, c.to); err != nil || rejected { t.Fatalf("replay: rejected=%v err=%v", rejected, err) } events := kittest.Stored(t, s) @@ -113,7 +113,7 @@ func TestAlgoliaDropsRemovalsThatWerentDeprecated(t *testing.T) { ctx := context.Background() const from, to = "released-2024-09-18-cc190fae3", "released-2024-09-19-a62c27d3b" s := openStore(t) - if rejected, err := kittest.Replay(ctx, vercelEnv(s), s, algoliaPlugin("ingestion"), from, to); err != nil || rejected { + if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, algoliaPlugin("ingestion"), from, to); err != nil || rejected { t.Fatalf("replay: rejected=%v err=%v", rejected, err) } if events := kittest.Stored(t, s); len(events) != 0 { @@ -122,7 +122,7 @@ func TestAlgoliaDropsRemovalsThatWerentDeprecated(t *testing.T) { s = openStore(t) p := algoliaPlugin("ingestion") p.Keep = nil - if _, err := kittest.Replay(ctx, vercelEnv(s), s, p, from, to); err != nil { + if _, err := kittest.Pair(ctx, vercelEnv(s), s, p, from, to); err != nil { t.Fatal(err) } var removed int @@ -165,7 +165,7 @@ func TestAlgoliaRecommendCustomRequestMoveIsNoEvent(t *testing.T) { ctx := context.Background() const from, to = "released-2024-03-19-2eac6f410", "released-2024-03-25-30207fcd0" s := openStore(t) - if rejected, err := kittest.Replay(ctx, vercelEnv(s), s, algoliaPlugin("recommend"), from, to); err != nil || rejected { + if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, algoliaPlugin("recommend"), from, to); err != nil || rejected { t.Fatalf("replay: rejected=%v err=%v", rejected, err) } if events := kittest.Stored(t, s); len(events) != 0 { @@ -174,7 +174,7 @@ func TestAlgoliaRecommendCustomRequestMoveIsNoEvent(t *testing.T) { s = openStore(t) p := algoliaPlugin("recommend") p.Keep = nil - if _, err := kittest.Replay(ctx, vercelEnv(s), s, p, from, to); err != nil { + if _, err := kittest.Pair(ctx, vercelEnv(s), s, p, from, to); err != nil { t.Fatal(err) } var removed int diff --git a/plugins/openapi/appwrite_test.go b/plugins/openapi/appwrite_test.go index 04f84cc..2a0ac82 100644 --- a/plugins/openapi/appwrite_test.go +++ b/plugins/openapi/appwrite_test.go @@ -98,10 +98,10 @@ func appwritePlugin(t *testing.T) (Plugin, string) { return Plugin{Adapter: a, Diff: appwriteDiff, Keep: appwriteKeep}, srv.URL + "/raw/appwrite/specs" } -func replayAppwrite(t *testing.T, p Plugin, from, to string) []event.EventV2 { +func replayAppwrite(t *testing.T, p Plugin, from, to string) []event.Event { t.Helper() s := openStore(t) - if rejected, err := kittest.Replay(context.Background(), vercelEnv(s), s, p, from, to); err != nil || rejected { + if rejected, err := kittest.Pair(context.Background(), vercelEnv(s), s, p, from, to); err != nil || rejected { t.Fatalf("replay %s -> %s: rejected=%v err=%v", from, to, rejected, err) } return kittest.Stored(t, s) @@ -160,7 +160,7 @@ func TestAppwriteDropsRemovals(t *testing.T) { p.Keep = nil var removed int for _, e := range replayAppwrite(t, p, appwrite24Old, appwrite24New) { - if e.ChangeType == event.ChangeTypeBreaking && e.Subject.Kind == event.AffectedKindOperation { + if e.ChangeType == event.ChangeTypeBreaking && e.Subject.Kind == event.KindOperation { removed++ } } diff --git a/plugins/openapi/convex_test.go b/plugins/openapi/convex_test.go index 21c7613..c548fbd 100644 --- a/plugins/openapi/convex_test.go +++ b/plugins/openapi/convex_test.go @@ -26,7 +26,7 @@ var convexCommits = map[string][2]string{ // copied from, as adapter.Convex.Fetch cites it. type fakeConvexAdapter struct{ latest string } -func (fakeConvexAdapter) API() string { return "convex" } +func (fakeConvexAdapter) API() string { return "convex/deployment-api" } func (f fakeConvexAdapter) LatestTag(context.Context) (string, error) { return f.latest, nil } @@ -84,7 +84,7 @@ var convexReplacements = map[string]string{ func TestConvexGolden(t *testing.T) { ctx := context.Background() s := openStore(t) - if rejected, err := kittest.Replay(ctx, vercelEnv(s), s, convexPlugin(""), "f35879bb", "5e5159cb"); err != nil || rejected { + if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, convexPlugin(""), "f35879bb", "5e5159cb"); err != nil || rejected { t.Fatalf("replay: rejected=%v err=%v", rejected, err) } events := kittest.Stored(t, s) @@ -137,7 +137,7 @@ func TestConvexGolden(t *testing.T) { func TestConvexDropsPropertyChangesThatWerentDeprecations(t *testing.T) { ctx := context.Background() s := openStore(t) - if rejected, err := kittest.Replay(ctx, vercelEnv(s), s, convexPlugin(""), "3f6edf7a", "3ead9091"); err != nil || rejected { + if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, convexPlugin(""), "3f6edf7a", "3ead9091"); err != nil || rejected { t.Fatalf("replay: rejected=%v err=%v", rejected, err) } if events := kittest.Stored(t, s); len(events) != 0 { @@ -148,7 +148,7 @@ func TestConvexDropsPropertyChangesThatWerentDeprecations(t *testing.T) { s = openStore(t) p := convexPlugin("") p.Keep = nil - if _, err := kittest.Replay(ctx, vercelEnv(s), s, p, "3f6edf7a", "3ead9091"); err != nil { + if _, err := kittest.Pair(ctx, vercelEnv(s), s, p, "3f6edf7a", "3ead9091"); err != nil { t.Fatal(err) } unfiltered := kittest.Stored(t, s) diff --git a/plugins/openapi/datadog_test.go b/plugins/openapi/datadog_test.go index 908ba5c..e1b0c0c 100644 --- a/plugins/openapi/datadog_test.go +++ b/plugins/openapi/datadog_test.go @@ -16,7 +16,7 @@ import ( // YAML to JSON the same way adapter.Datadog.Fetch does. type fakeDatadogAdapter struct{} -func (fakeDatadogAdapter) API() string { return "datadog" } +func (fakeDatadogAdapter) API() string { return "datadog/api" } func (fakeDatadogAdapter) LatestTag(context.Context) (string, error) { return "2.61.0", nil } @@ -78,8 +78,8 @@ func TestDatadogReplayRecreatesTheRealPropertyRemoval(t *testing.T) { // Acceptance criteria: every event carries source_url and a non-empty // source_excerpt, and is placed on the real tags, not stand-ins. for _, e := range events { - if e.API != "datadog" || e.Version != "2.61.0" || e.PreviousVersion != "2.60.0" { - t.Errorf("event %s: api=%s version=%s previous_version=%s, want datadog 2.61.0 from 2.60.0", + if e.API != "datadog/api" || e.Version != "2.61.0" || e.PreviousVersion != "2.60.0" { + t.Errorf("event %s: api=%s version=%s previous_version=%s, want datadog/api 2.61.0 from 2.60.0", e.Subject.Property, e.API, e.Version, e.PreviousVersion) } if e.SourceURL == "" || e.SourceExcerpt == "" { diff --git a/plugins/openapi/elasticsearch_test.go b/plugins/openapi/elasticsearch_test.go index 402ad23..9103f4e 100644 --- a/plugins/openapi/elasticsearch_test.go +++ b/plugins/openapi/elasticsearch_test.go @@ -24,7 +24,7 @@ var esHeads = map[string]string{ type fakeESAdapter struct{} -func (fakeESAdapter) API() string { return "elasticsearch" } +func (fakeESAdapter) API() string { return "elastic/elasticsearch-api" } func (fakeESAdapter) LatestTag(context.Context) (string, error) { return "", fmt.Errorf("replay only") } @@ -71,7 +71,7 @@ func TestElasticsearchNoRemovalWithinAMinor(t *testing.T) { s := openStore(t) p := esPlugin() p.Adapter = sameMinor{} - if rejected, err := kittest.Replay(ctx, vercelEnv(s), s, p, "8.19", "9.0"); err != nil || rejected { + if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, p, "8.19", "9.0"); err != nil || rejected { t.Fatalf("replay: rejected=%v err=%v", rejected, err) } n := map[event.ChangeType]int{} @@ -92,7 +92,7 @@ func TestElasticsearchNoRemovalWithinAMinor(t *testing.T) { func TestElasticsearchGolden(t *testing.T) { ctx := context.Background() s := openStore(t) - if rejected, err := kittest.Replay(ctx, vercelEnv(s), s, esPlugin(), "8.19", "9.0"); err != nil || rejected { + if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, esPlugin(), "8.19", "9.0"); err != nil || rejected { t.Fatalf("replay: rejected=%v err=%v", rejected, err) } events := kittest.Stored(t, s) @@ -142,7 +142,7 @@ func TestElasticsearchGolden(t *testing.T) { func TestElasticsearchDropsUndeprecatedRemovals(t *testing.T) { ctx := context.Background() s := openStore(t) - if rejected, err := kittest.Replay(ctx, vercelEnv(s), s, esPlugin(), "9.1", "9.2"); err != nil || rejected { + if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, esPlugin(), "9.1", "9.2"); err != nil || rejected { t.Fatalf("replay: rejected=%v err=%v", rejected, err) } if events := kittest.Stored(t, s); len(events) != 0 { @@ -151,7 +151,7 @@ func TestElasticsearchDropsUndeprecatedRemovals(t *testing.T) { s = openStore(t) p := esPlugin() p.Keep = nil - if _, err := kittest.Replay(ctx, vercelEnv(s), s, p, "9.1", "9.2"); err != nil { + if _, err := kittest.Pair(ctx, vercelEnv(s), s, p, "9.1", "9.2"); err != nil { t.Fatal(err) } var removed int diff --git a/plugins/openapi/flagsmith_test.go b/plugins/openapi/flagsmith_test.go index eaea1df..921b805 100644 --- a/plugins/openapi/flagsmith_test.go +++ b/plugins/openapi/flagsmith_test.go @@ -44,7 +44,7 @@ func TestFlagsmithRegistersItself(t *testing.T) { // trimmed from Version the same way adapter.Flagsmith.Fetch does. type fakeFlagsmithAdapter struct{} -func (fakeFlagsmithAdapter) API() string { return "flagsmith" } +func (fakeFlagsmithAdapter) API() string { return "flagsmith/api" } func (fakeFlagsmithAdapter) LatestTag(context.Context) (string, error) { return "v2.287.0", nil } @@ -79,7 +79,7 @@ func TestFlagsmithGolden(t *testing.T) { env := kittest.Env(t, nil) sink := env.Baselines.(kittest.Sink) p := Plugin{Adapter: fakeFlagsmithAdapter{}, Keep: requestSide} - if rejected, err := kittest.Replay(ctx, env, sink, p, "v2.286.0", "v2.287.0"); err != nil || rejected { + if rejected, err := kittest.Pair(ctx, env, sink, p, "v2.286.0", "v2.287.0"); err != nil || rejected { t.Fatalf("replay: rejected=%v err=%v", rejected, err) } kittest.Golden(t, "testdata/golden/flagsmith.json", kittest.Stored(t, sink)) @@ -92,7 +92,7 @@ func TestFlagsmithDropsADescriptionOnlyChange(t *testing.T) { env := kittest.Env(t, nil) sink := env.Baselines.(kittest.Sink) p := Plugin{Adapter: fakeFlagsmithAdapter{}, Keep: requestSide} - if rejected, err := kittest.Replay(ctx, env, sink, p, "c3ef832", "f504f16"); err != nil || rejected { + if rejected, err := kittest.Pair(ctx, env, sink, p, "c3ef832", "f504f16"); err != nil || rejected { t.Fatalf("replay: rejected=%v err=%v", rejected, err) } if got := kittest.Stored(t, sink); len(got) != 0 { diff --git a/plugins/openapi/github_test.go b/plugins/openapi/github_test.go index 4496f7a..00e7ea1 100644 --- a/plugins/openapi/github_test.go +++ b/plugins/openapi/github_test.go @@ -14,7 +14,7 @@ import ( // Datadog's, github's spec is already JSON, so there's no conversion step. type fakeGitHubAdapter struct{} -func (fakeGitHubAdapter) API() string { return "github" } +func (fakeGitHubAdapter) API() string { return "github/rest-api" } func (fakeGitHubAdapter) LatestTag(context.Context) (string, error) { return "2026-03-10", nil } @@ -59,8 +59,8 @@ func TestGitHubReplayRecreatesTheRealPropertyRemoval(t *testing.T) { // Acceptance criteria: the event carries source_url and a non-empty // source_excerpt, and is placed on the real dated versions, not stand-ins. - if e.API != "github" || e.Version != "2026-03-10" || e.PreviousVersion != "2022-11-28" { - t.Errorf("event %s: api=%s version=%s previous_version=%s, want github 2026-03-10 from 2022-11-28", + if e.API != "github/rest-api" || e.Version != "2026-03-10" || e.PreviousVersion != "2022-11-28" { + t.Errorf("event %s: api=%s version=%s previous_version=%s, want github/rest-api 2026-03-10 from 2022-11-28", e.Subject.Property, e.API, e.Version, e.PreviousVersion) } if e.SourceURL == "" || e.SourceExcerpt == "" { diff --git a/plugins/openapi/gitlab_test.go b/plugins/openapi/gitlab_test.go index a61851f..da2a8c6 100644 --- a/plugins/openapi/gitlab_test.go +++ b/plugins/openapi/gitlab_test.go @@ -84,7 +84,7 @@ func TestGitLabReplayRecreatesTheBitbucketAppPasswordRemoval(t *testing.T) { t.Errorf("unexpected event: %s", e.Description) continue } - if e.API != "gitlab" || e.Version != "19.0.0" || e.PreviousVersion != "18.11.0" { + if e.API != "gitlab/rest-api" || e.Version != "19.0.0" || e.PreviousVersion != "18.11.0" { t.Errorf("%s: api=%s version=%s previous=%s", e.Subject.Property, e.API, e.Version, e.PreviousVersion) } if string(e.ChangeType) != "breaking" || !e.Breaking { diff --git a/plugins/openapi/neon_test.go b/plugins/openapi/neon_test.go index ac726f6..aff90c4 100644 --- a/plugins/openapi/neon_test.go +++ b/plugins/openapi/neon_test.go @@ -30,7 +30,7 @@ var neonCommits = map[string][2]string{ // copied from and reshaped, as adapter.Neon.Fetch cites and reshapes it. type fakeNeonAdapter struct{ latest string } -func (fakeNeonAdapter) API() string { return "neon" } +func (fakeNeonAdapter) API() string { return "neon/api" } func (f fakeNeonAdapter) LatestTag(context.Context) (string, error) { return f.latest, nil } @@ -77,7 +77,7 @@ func neonPlugin(a adapter.Adapter) Plugin { func TestNeonGolden(t *testing.T) { ctx := context.Background() s := openStore(t) - if rejected, err := kittest.Replay(ctx, vercelEnv(s), s, neonPlugin(fakeNeonAdapter{}), "5c57d009", "93b93dc9"); err != nil || rejected { + if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, neonPlugin(fakeNeonAdapter{}), "5c57d009", "93b93dc9"); err != nil || rejected { t.Fatalf("replay: rejected=%v err=%v", rejected, err) } events := kittest.Stored(t, s) @@ -117,7 +117,7 @@ func TestNeonGolden(t *testing.T) { func TestNeonDropsRemovalsThatWerentDeprecated(t *testing.T) { ctx := context.Background() s := openStore(t) - if rejected, err := kittest.Replay(ctx, vercelEnv(s), s, neonPlugin(fakeNeonAdapter{}), "4c6b3be4", "4497de89"); err != nil || rejected { + if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, neonPlugin(fakeNeonAdapter{}), "4c6b3be4", "4497de89"); err != nil || rejected { t.Fatalf("replay: rejected=%v err=%v", rejected, err) } if events := kittest.Stored(t, s); len(events) != 0 { @@ -127,7 +127,7 @@ func TestNeonDropsRemovalsThatWerentDeprecated(t *testing.T) { s = openStore(t) p := neonPlugin(fakeNeonAdapter{}) p.Keep = nil - if _, err := kittest.Replay(ctx, vercelEnv(s), s, p, "4c6b3be4", "4497de89"); err != nil { + if _, err := kittest.Pair(ctx, vercelEnv(s), s, p, "4c6b3be4", "4497de89"); err != nil { t.Fatal(err) } var removals []string @@ -152,7 +152,7 @@ func TestNeonDropsRemovalsThatWerentDeprecated(t *testing.T) { // /consumption_history/account` endpoint has been removed." type neonAPIClient struct{} -func (neonAPIClient) API() string { return "neon" } +func (neonAPIClient) API() string { return "neon/api" } func (neonAPIClient) LatestTag(context.Context) (string, error) { return "2.7.3", nil } @@ -178,7 +178,7 @@ func (neonAPIClient) Fetch(_ context.Context, version string) (adapter.Spec, err func TestNeonKeepsTheRemovalOfADeprecatedOperation(t *testing.T) { ctx := context.Background() s := openStore(t) - if rejected, err := kittest.Replay(ctx, vercelEnv(s), s, neonPlugin(neonAPIClient{}), "2.7.2", "2.7.3"); err != nil || rejected { + if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, neonPlugin(neonAPIClient{}), "2.7.2", "2.7.3"); err != nil || rejected { t.Fatalf("replay: rejected=%v err=%v", rejected, err) } events := kittest.Stored(t, s) diff --git a/plugins/openapi/openapi.go b/plugins/openapi/openapi.go index ef0cceb..a0e3ac7 100644 --- a/plugins/openapi/openapi.go +++ b/plugins/openapi/openapi.go @@ -14,7 +14,6 @@ import ( "github.com/patch-it-dev/patch-it-plugins/core/diff" "github.com/patch-it-dev/patch-it-plugins/core/event" "github.com/patch-it-dev/patch-it-plugins/core/hint" - "github.com/patch-it-dev/patch-it-plugins/core/migrate" "github.com/patch-it-dev/patch-it-plugins/core/normalize" "github.com/patch-it-dev/patch-it-plugins/core/plugin" "github.com/patch-it-dev/patch-it-plugins/plugins/openapi/adapter" @@ -250,32 +249,7 @@ func (p Plugin) Run(ctx context.Context, env plugin.Env) (plugin.Result, error) return plugin.Result{}, err } res.Label = tag - res.Baselines = []plugin.Spec{plugin.Baseline(a.API(), to.Version.ID, tag, to.SourceURL, to.Content, false, env.Now())} - return res, nil -} - -// Replay diffs two given releases. Both specs are saved marked as replays, so -// the normal-run baseline never moves; the events are stored like any others: -// that's how a historical change becomes something the feed can serve. -func (p Plugin) Replay(ctx context.Context, env plugin.Env, from, to string) (plugin.Result, error) { - old, err := p.ReadAt(ctx, env, plugin.Version{ID: from, Ref: from}) - if err != nil { - return plugin.Result{}, err - } - next, err := p.ReadAt(ctx, env, plugin.Version{ID: to, Ref: to}) - if err != nil { - return plugin.Result{}, err - } - res, err := p.Extract(ctx, env, old, next) - if err != nil { - return plugin.Result{}, err - } - now := env.Now() - res.Label = to - res.Baselines = []plugin.Spec{ - plugin.Baseline(p.Adapter.API(), old.Version.ID, from, old.SourceURL, old.Content, true, now), - plugin.Baseline(p.Adapter.API(), next.Version.ID, to, next.SourceURL, next.Content, true, now), - } + res.Baselines = []plugin.Spec{plugin.Baseline(a.API(), to.Version.ID, tag, to.SourceURL, to.Content, env.Now())} return res, nil } @@ -326,15 +300,14 @@ func (p Plugin) Extract(ctx context.Context, env plugin.Env, from, to plugin.Sna DetectedAt: env.Now().UTC(), }) p.attachHints(ctx, to.Version.ID, events) - converted, invalid := migrate.Fresh(events) - return plugin.Result{Label: to.Version.Ref, Events: converted, Rejected: append(errs, invalid...)}, nil + return plugin.Result{Label: to.Version.Ref, Events: events, Rejected: errs}, nil } var _ plugin.Versioned = Plugin{} // events diffs two parsed specs into events, applying Keep, and pointing each // event's source_pointer into the published file when the adapter reshaped it. -func (p Plugin) events(oldParsed, newParsed *diff.Spec, oldContent, newContent []byte, src normalize.Source) ([]event.ChangeEvent, []error) { +func (p Plugin) events(oldParsed, newParsed *diff.Spec, oldContent, newContent []byte, src normalize.Source) ([]event.Event, []error) { changes := diff.ChangesWith(oldParsed, newParsed, p.Diff) if p.Keep != nil { kept := changes[:0:0] @@ -380,7 +353,7 @@ func (p Plugin) events(oldParsed, newParsed *diff.Spec, oldContent, newContent [ // attachHints looks the events up in the API's changelog for their version. // Never fails the run: a hint is help for the fix, not provenance for the event. -func (p Plugin) attachHints(ctx context.Context, version string, events []event.ChangeEvent) { +func (p Plugin) attachHints(ctx context.Context, version string, events []event.Event) { if p.Hints == nil || len(events) == 0 { return } diff --git a/plugins/openapi/openapi_test.go b/plugins/openapi/openapi_test.go index d76c60c..0b041cd 100644 --- a/plugins/openapi/openapi_test.go +++ b/plugins/openapi/openapi_test.go @@ -48,7 +48,7 @@ func replay(ctx context.Context, s *kittest.Mem, a adapter.Adapter, from, to str } func replayWith(ctx context.Context, s *kittest.Mem, p Plugin, from, to string) (bool, error) { - return kittest.Replay(ctx, env(s), s, p, from, to) + return kittest.Pair(ctx, env(s), s, p, from, to) } // fakeAdapter serves specs from memory, one per tag, so the whole ingest flow @@ -58,7 +58,7 @@ type fakeAdapter struct { specs map[string]string // tag -> spec JSON } -func (fakeAdapter) API() string { return "stripe" } +func (fakeAdapter) API() string { return "stripe/api" } func (f fakeAdapter) LatestTag(context.Context) (string, error) { return f.latest, nil } @@ -131,7 +131,7 @@ func TestIngestStoresTheEventsItFinds(t *testing.T) { } // The baseline moved to v2 only after the events were safely stored. - last, _ := s.LastSpec("stripe") + last, _ := s.LastSpec("stripe/api") if last == nil || last.Version != "version-v2" { t.Errorf("baseline after the second run = %+v, want version-v2", last) } @@ -157,7 +157,7 @@ func TestReplayStoresEventsWithoutMovingTheBaseline(t *testing.T) { if got := storedEvents(t, s); len(got) != 2 { t.Errorf("replay stored %d events, want 2: %v", len(got), got) } - if last, _ := s.LastSpec("stripe"); last != nil { + if last, _ := s.LastSpec("stripe/api"); last != nil { t.Errorf("replay moved the baseline to %s; replays must never set it", last.Version) } @@ -200,7 +200,7 @@ func TestReplayAttachesMigrationHintsFromTheChangelog(t *testing.T) { t.Fatalf("replay: %v", err) } events, _ := s.All() - var removed *event.EventV2 + var removed *event.Event for i := range events { if events[i].Subject.Property == "charges" { removed = &events[i] diff --git a/plugins/openapi/planetscale_test.go b/plugins/openapi/planetscale_test.go index ecf51f3..19318c3 100644 --- a/plugins/openapi/planetscale_test.go +++ b/plugins/openapi/planetscale_test.go @@ -56,10 +56,10 @@ func planetscalePlugin(t *testing.T) (Plugin, string) { return Plugin{Adapter: a, Diff: planetscaleDiff, Keep: planetscaleKeep}, srv.URL + "/raw" + repo } -func replayPlanetScale(t *testing.T, p Plugin, from, to string) []event.EventV2 { +func replayPlanetScale(t *testing.T, p Plugin, from, to string) []event.Event { t.Helper() s := openStore(t) - if rejected, err := kittest.Replay(context.Background(), vercelEnv(s), s, p, from, to); err != nil || rejected { + if rejected, err := kittest.Pair(context.Background(), vercelEnv(s), s, p, from, to); err != nil || rejected { t.Fatalf("replay %s -> %s: rejected=%v err=%v", from, to, rejected, err) } return kittest.Stored(t, s) @@ -133,7 +133,7 @@ func TestPlanetScaleDropsRemovalsThatWerentDeprecated(t *testing.T) { p.Keep = nil var removed []string for _, e := range replayPlanetScale(t, p, from, to) { - if e.Breaking && e.Subject.Kind == event.AffectedKindOperation && strings.HasSuffix(e.Description, " removed.") { + if e.Breaking && e.Subject.Kind == event.KindOperation && strings.HasSuffix(e.Description, " removed.") { removed = append(removed, e.Subject.Operation) } } diff --git a/plugins/openapi/sentry_test.go b/plugins/openapi/sentry_test.go index c435b28..6e02f4f 100644 --- a/plugins/openapi/sentry_test.go +++ b/plugins/openapi/sentry_test.go @@ -80,11 +80,11 @@ func sentryPlugin(t *testing.T) (Plugin, string) { return Plugin{Adapter: a, Diff: sentryDiff, Keep: sentryKeep}, srv.URL + "/raw/getsentry/sentry-api-schema" } -func replaySentry(t *testing.T, p Plugin, pairs ...[2]string) []event.EventV2 { +func replaySentry(t *testing.T, p Plugin, pairs ...[2]string) []event.Event { t.Helper() s := openStore(t) for _, pair := range pairs { - if rejected, err := kittest.Replay(context.Background(), vercelEnv(s), s, p, pair[0], pair[1]); err != nil || rejected { + if rejected, err := kittest.Pair(context.Background(), vercelEnv(s), s, p, pair[0], pair[1]); err != nil || rejected { t.Fatalf("replay %s -> %s: rejected=%v err=%v", pair[0], pair[1], rejected, err) } } @@ -173,7 +173,7 @@ func TestSentryFlagAfterWordsIsNotNew(t *testing.T) { // moving /api/0 into the paths. type rawSentry struct{} -func (rawSentry) API() string { return "sentry" } +func (rawSentry) API() string { return "sentry/api" } func (rawSentry) LatestTag(context.Context) (string, error) { return "", fmt.Errorf("replay only") } func (rawSentry) Fetch(_ context.Context, tag string) (adapter.Spec, error) { body, err := os.ReadFile(sentryFile(tag)) @@ -195,7 +195,7 @@ func TestSentryBasePathMoveIsNoChange(t *testing.T) { // pointer names a node in the file as published, without /api/0. p.Keep = nil for _, e := range replaySentry(t, p, [2]string{"2.0.1", "2.1.0"}) { - if e.ChangeType == event.ChangeTypeBreaking && e.Subject.Kind == event.AffectedKindOperation { + if e.ChangeType == event.ChangeTypeBreaking && e.Subject.Kind == event.KindOperation { t.Errorf("unfiltered: %s %s", e.ChangeType, e.Subject.Operation) } ref := strings.TrimSuffix(strings.TrimPrefix(e.SourceURL, base+"/"), "/openapi-derefed.json") @@ -208,7 +208,7 @@ func TestSentryBasePathMoveIsNoChange(t *testing.T) { raw := Plugin{Adapter: rawSentry{}, Diff: sentryDiff} var removed []string for _, e := range replaySentry(t, raw, [2]string{"2.0.1", "2.1.0"}) { - if e.ChangeType == event.ChangeTypeBreaking && e.Subject.Kind == event.AffectedKindOperation { + if e.ChangeType == event.ChangeTypeBreaking && e.Subject.Kind == event.KindOperation { removed = append(removed, e.Subject.Operation) } } diff --git a/plugins/openapi/supabase_test.go b/plugins/openapi/supabase_test.go index a9ae173..52d0f27 100644 --- a/plugins/openapi/supabase_test.go +++ b/plugins/openapi/supabase_test.go @@ -31,7 +31,7 @@ var supabaseCommits = map[string][2]string{ // copied from, as adapter.Supabase.Fetch cites it. type fakeSupabaseAdapter struct{ latest string } -func (fakeSupabaseAdapter) API() string { return "supabase" } +func (fakeSupabaseAdapter) API() string { return "supabase/management-api" } func (f fakeSupabaseAdapter) LatestTag(context.Context) (string, error) { return f.latest, nil } @@ -75,7 +75,7 @@ func TestSupabaseGolden(t *testing.T) { t.Fatalf("run %s: rejected=%v err=%v", tag, rejected, err) } } - if rejected, err := kittest.Replay(ctx, env, s, supabasePlugin(""), "693bdc38", "eb21ae25"); err != nil || rejected { + if rejected, err := kittest.Pair(ctx, env, s, supabasePlugin(""), "693bdc38", "eb21ae25"); err != nil || rejected { t.Fatalf("replay: rejected=%v err=%v", rejected, err) } @@ -123,7 +123,7 @@ func TestSupabaseGolden(t *testing.T) { func TestSupabaseDropsRemovalsThatWerentDeprecated(t *testing.T) { ctx := context.Background() s := openStore(t) - if rejected, err := kittest.Replay(ctx, vercelEnv(s), s, supabasePlugin(""), "8aef4a08", "90b71e3e"); err != nil || rejected { + if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, supabasePlugin(""), "8aef4a08", "90b71e3e"); err != nil || rejected { t.Fatalf("replay: rejected=%v err=%v", rejected, err) } if events := kittest.Stored(t, s); len(events) != 0 { @@ -133,7 +133,7 @@ func TestSupabaseDropsRemovalsThatWerentDeprecated(t *testing.T) { s = openStore(t) p := supabasePlugin("") p.Keep = nil - if _, err := kittest.Replay(ctx, vercelEnv(s), s, p, "8aef4a08", "90b71e3e"); err != nil { + if _, err := kittest.Pair(ctx, vercelEnv(s), s, p, "8aef4a08", "90b71e3e"); err != nil { t.Fatal(err) } var removals int @@ -155,7 +155,7 @@ func TestSupabaseBranchParameterRenameIsNoChange(t *testing.T) { s := openStore(t) p := supabasePlugin("") p.Keep = nil // even unfiltered: the operations are paired, not removed - if _, err := kittest.Replay(ctx, vercelEnv(s), s, p, "de806266", "a5fc0527"); err != nil { + if _, err := kittest.Pair(ctx, vercelEnv(s), s, p, "de806266", "a5fc0527"); err != nil { t.Fatal(err) } for _, e := range kittest.Stored(t, s) { @@ -165,7 +165,7 @@ func TestSupabaseBranchParameterRenameIsNoChange(t *testing.T) { } s = openStore(t) p.Diff.PathTemplates = false - if _, err := kittest.Replay(ctx, vercelEnv(s), s, p, "de806266", "a5fc0527"); err != nil { + if _, err := kittest.Pair(ctx, vercelEnv(s), s, p, "de806266", "a5fc0527"); err != nil { t.Fatal(err) } var removed int diff --git a/plugins/openapi/testdata/golden/algolia-ingestion.json b/plugins/openapi/testdata/golden/algolia-ingestion.json index 5804ed9..388f55b 100644 --- a/plugins/openapi/testdata/golden/algolia-ingestion.json +++ b/plugins/openapi/testdata/golden/algolia-ingestion.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:1e7a1a853da5f0cb442587af95ab66fcc9a20308d4295dfb287805399c7c41e7", - "api": "algolia-ingestion", + "fingerprint": "sha256:eb14278aa4735854c8fd3f33ffe3e5eb43d6e81f720547c68cf55f91f2eb51b8", + "api": "algolia/ingestion-api", "version": "2025-01-22", "previous_version": "2025-01-07", "change_type": "deprecation", @@ -22,8 +22,8 @@ }, { "id": 2, - "fingerprint": "sha256:17ec64b06df87ecb1eecafcb16e9e382db116527edca15062f451c572745f3ae", - "api": "algolia-ingestion", + "fingerprint": "sha256:d6fbe2c5b1ed2baf0b7131551b5656fd7aed8b91490c6f4126fd4a42c9731478", + "api": "algolia/ingestion-api", "version": "2025-01-22", "previous_version": "2025-01-07", "change_type": "deprecation", @@ -43,8 +43,8 @@ }, { "id": 3, - "fingerprint": "sha256:4e9f82a0c9e7cabbc050af7fd66c4d4e71a90c18a695f1f8464d93cf7be864db", - "api": "algolia-ingestion", + "fingerprint": "sha256:8e673e76d54e5b20644e0787cbf23af273057f0bf044f7cd29081d546ec2c96c", + "api": "algolia/ingestion-api", "version": "2025-01-22", "previous_version": "2025-01-07", "change_type": "deprecation", @@ -64,8 +64,8 @@ }, { "id": 4, - "fingerprint": "sha256:df4563501aec2e6b427964f1ee51f9881e432fc2eed2c343953d78f43d79f317", - "api": "algolia-ingestion", + "fingerprint": "sha256:00482b2527330636337a1fa3e5f5319458f1ff185282d9d2d89b88fb71eea14d", + "api": "algolia/ingestion-api", "version": "2025-01-22", "previous_version": "2025-01-07", "change_type": "deprecation", @@ -85,8 +85,8 @@ }, { "id": 5, - "fingerprint": "sha256:f53f0abf4924f3abed31f2d0d50b71e30c77295dc2b2a4fcfc426aeb64b3cf4e", - "api": "algolia-ingestion", + "fingerprint": "sha256:9137e456a4e6480c5115bc5cabd4c07d3e8b90a4dc3bff54511c1cd20e93ead5", + "api": "algolia/ingestion-api", "version": "2025-01-22", "previous_version": "2025-01-07", "change_type": "deprecation", @@ -106,8 +106,8 @@ }, { "id": 6, - "fingerprint": "sha256:7dc53327e9239847c43e0d1fc140670139b4b755711875cc00b2d0126973cf69", - "api": "algolia-ingestion", + "fingerprint": "sha256:2d0c4fd84ef9e0c4956b0572939c915ab7be8075ab296fe585b307fa65a7dee0", + "api": "algolia/ingestion-api", "version": "2025-01-22", "previous_version": "2025-01-07", "change_type": "deprecation", @@ -127,8 +127,8 @@ }, { "id": 7, - "fingerprint": "sha256:fbb43f00dfdd75418da24e766a926b0e48b824e8b6a000340a3a82ed87ec654f", - "api": "algolia-ingestion", + "fingerprint": "sha256:b991f89f474625d83ef1733ba29bab9c9d63c6520a5e969610a1f7a06f3ae014", + "api": "algolia/ingestion-api", "version": "2025-01-22", "previous_version": "2025-01-07", "change_type": "deprecation", @@ -148,8 +148,8 @@ }, { "id": 8, - "fingerprint": "sha256:cefabf61328b95d67f3187e183dae0b8d54407d98b09b0d018e15f6b3d5f0d69", - "api": "algolia-ingestion", + "fingerprint": "sha256:dd4793d02c7b15e0a8469cd996a78d26e79a73684f2f620936a324c7da5761ca", + "api": "algolia/ingestion-api", "version": "2025-01-22", "previous_version": "2025-01-07", "change_type": "deprecation", diff --git a/plugins/openapi/testdata/golden/algolia-search.json b/plugins/openapi/testdata/golden/algolia-search.json index 584aed1..1457fb8 100644 --- a/plugins/openapi/testdata/golden/algolia-search.json +++ b/plugins/openapi/testdata/golden/algolia-search.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:98c98629cbe46426329ba9fb60630c8bcc4194b191545aa008011f07252b5f5b", - "api": "algolia-search", + "fingerprint": "sha256:185305649ae5f0070c023dbd84d3b8fa2fd69b0b9396e9bcf6ab865030bbff54", + "api": "algolia/search-api", "version": "2025-04-01", "previous_version": "2025-03-25", "change_type": "deprecation", @@ -22,8 +22,8 @@ }, { "id": 2, - "fingerprint": "sha256:300b57a1485499d6a5fe3ff47e73b3dae695e2354ce20af1984db2345eb85334", - "api": "algolia-search", + "fingerprint": "sha256:2abd5794c049ff2047ac323f87f07289957eaa94026f57230857e3da4e0b4d9c", + "api": "algolia/search-api", "version": "2025-04-01", "previous_version": "2025-03-25", "change_type": "deprecation", @@ -43,8 +43,8 @@ }, { "id": 3, - "fingerprint": "sha256:cef12aebf4a4a83fccea8645a0cf33c1d26468c547db8f103763278e78d38bca", - "api": "algolia-search", + "fingerprint": "sha256:10eb98743283aa78f98c179d431384a36df1f5e383cc427087c65ce25082532f", + "api": "algolia/search-api", "version": "2025-04-01", "previous_version": "2025-03-25", "change_type": "deprecation", @@ -64,8 +64,8 @@ }, { "id": 4, - "fingerprint": "sha256:3e264c501d2346c87750b601f3ec19cd16db54f253ebac636d2d4575f754cb76", - "api": "algolia-search", + "fingerprint": "sha256:aba31879e97ea5de446ccdecdd94cfe51c9d939574f169f67d0264debd2b0dd1", + "api": "algolia/search-api", "version": "2025-04-01", "previous_version": "2025-03-25", "change_type": "deprecation", @@ -85,8 +85,8 @@ }, { "id": 5, - "fingerprint": "sha256:3be2d780b21e3a2cac8cfc73c48a91171e7b77335c19d87f400d9c8618dd6e04", - "api": "algolia-search", + "fingerprint": "sha256:89631e91da5c783ab2b68d6c400a225118eaf31e4977caf323fd97633825092c", + "api": "algolia/search-api", "version": "2025-04-01", "previous_version": "2025-03-25", "change_type": "deprecation", @@ -106,8 +106,8 @@ }, { "id": 6, - "fingerprint": "sha256:9ef87419d739219194a79e3ba13a5c06c59d1ff0a6452a04c8a6200af27f87d5", - "api": "algolia-search", + "fingerprint": "sha256:65043d5a11f9527a38ff560bd15771a2417670c3dd2d7e8631c0f5bd4fab926e", + "api": "algolia/search-api", "version": "2025-04-01", "previous_version": "2025-03-25", "change_type": "deprecation", @@ -127,8 +127,8 @@ }, { "id": 7, - "fingerprint": "sha256:933c2581c2ee22647cfc56e69694b562523e91658f8f80d14845f1d201921fdb", - "api": "algolia-search", + "fingerprint": "sha256:beefe5487e2bae8dc4017249ce0580e1a0570a403466e9b700f98b10b594d184", + "api": "algolia/search-api", "version": "2025-04-01", "previous_version": "2025-03-25", "change_type": "deprecation", @@ -148,8 +148,8 @@ }, { "id": 8, - "fingerprint": "sha256:86c3bf5e28959fbc84b0258d5df3824066ef30c2f1f87fb50070cf4d1f29736f", - "api": "algolia-search", + "fingerprint": "sha256:2b249c86f444ddda89abd95f7f78fc38b42df4f605c7fb7f298f37fc49bf4dd5", + "api": "algolia/search-api", "version": "2025-04-01", "previous_version": "2025-03-25", "change_type": "deprecation", @@ -169,8 +169,8 @@ }, { "id": 9, - "fingerprint": "sha256:590237cb63bae5005e8bcbcf50ee7e4e15a1fd2ec1b324788bc960e493a87b8a", - "api": "algolia-search", + "fingerprint": "sha256:5b72de487e9077705f70e2ef2836ae72347896671c162b7f0e35812b71272850", + "api": "algolia/search-api", "version": "2025-04-01", "previous_version": "2025-03-25", "change_type": "deprecation", diff --git a/plugins/openapi/testdata/golden/appwrite.json b/plugins/openapi/testdata/golden/appwrite.json index 71b51fd..6c96c91 100644 --- a/plugins/openapi/testdata/golden/appwrite.json +++ b/plugins/openapi/testdata/golden/appwrite.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:d55bc2bc9326f99d1fb45d532acdaf3a9b3f607f00517726904566a275111aca", - "api": "appwrite", + "fingerprint": "sha256:ea7af6c4ce0ac5f78892593033526fd049b9dba84678559c95df62268c0bc143", + "api": "appwrite/api", "version": "2026-06-24", "previous_version": "2026-06-19", "change_type": "deprecation", @@ -22,8 +22,8 @@ }, { "id": 2, - "fingerprint": "sha256:54a92731e12a45f62ae7ca006da55acd8d0aeb850b717d0e91dcac6076805c97", - "api": "appwrite", + "fingerprint": "sha256:9aa750c05754b5e4d77e8532451916c43d59030fe5b1d4185e4298ec266c8d7a", + "api": "appwrite/api", "version": "2026-06-24", "previous_version": "2026-06-19", "change_type": "deprecation", @@ -43,8 +43,8 @@ }, { "id": 3, - "fingerprint": "sha256:1fa27c9a4c57ac607e966fab080b49ea80f21a8e7dce74c5befee3bb49170d1f", - "api": "appwrite", + "fingerprint": "sha256:ed8a5adc8dd491e36fe308d44039febe9e44f77c6d47a71ed7edd95566bbf803", + "api": "appwrite/api", "version": "2026-06-24", "previous_version": "2026-06-19", "change_type": "deprecation", @@ -64,8 +64,8 @@ }, { "id": 4, - "fingerprint": "sha256:6f4405889f51845aba9cd28d5a7178aecb016418b38da5f743acace34214a2ba", - "api": "appwrite", + "fingerprint": "sha256:b51c68833b56e4e1c8442fc7e966e85a861a363dc6a68569911d9561e7cc0608", + "api": "appwrite/api", "version": "2026-06-24", "previous_version": "2026-06-19", "change_type": "deprecation", @@ -85,8 +85,8 @@ }, { "id": 5, - "fingerprint": "sha256:1fb114ac9b3bf37942cc8a7bb25fb1f9b002fa8915cb9404358186f04ec70a0c", - "api": "appwrite", + "fingerprint": "sha256:45f6a512d1b968c8a1b7ddb488391ee2b7cbcd30455bfdb642393b3fa5a0cf96", + "api": "appwrite/api", "version": "2026-06-24", "previous_version": "2026-06-19", "change_type": "deprecation", @@ -106,8 +106,8 @@ }, { "id": 6, - "fingerprint": "sha256:c2e616df4c77d3282681a23974037061c1c4e7a80a3416d4c0111f1b411e69af", - "api": "appwrite", + "fingerprint": "sha256:3743d82a53dccfe87925bbd535a5912c06a0aeaf22671d8420d7eb3d91894166", + "api": "appwrite/api", "version": "2026-06-24", "previous_version": "2026-06-19", "change_type": "deprecation", @@ -127,8 +127,8 @@ }, { "id": 7, - "fingerprint": "sha256:e6990fcd55e828bece8dff3875ec79f1ef8a413c7571100ba7ed945fe9e1c539", - "api": "appwrite", + "fingerprint": "sha256:336e841ee77ca88bd25892dff4e73695b80040fef648dd950d67ba359220b1a1", + "api": "appwrite/api", "version": "2026-06-24", "previous_version": "2026-06-19", "change_type": "deprecation", @@ -148,8 +148,8 @@ }, { "id": 8, - "fingerprint": "sha256:8a80864146f1af2386381acaaef299815f7563119c5679a546a432ffb3907eda", - "api": "appwrite", + "fingerprint": "sha256:401e0496b4fedc6207569d1f157a590412f9d3007535d2fe2d4f091f4af727cf", + "api": "appwrite/api", "version": "2026-06-24", "previous_version": "2026-06-19", "change_type": "deprecation", @@ -169,8 +169,8 @@ }, { "id": 9, - "fingerprint": "sha256:4b28a490587c56b3f30f5b3844c446c6d60478ed97a50ce493008d6029fd227d", - "api": "appwrite", + "fingerprint": "sha256:10a2398eeb480ab3fd425040d9f435ba8bce60e3da7a770ed2ac338276eccab9", + "api": "appwrite/api", "version": "2026-06-24", "previous_version": "2026-06-19", "change_type": "deprecation", @@ -190,8 +190,8 @@ }, { "id": 10, - "fingerprint": "sha256:e9c2b62e2a2bccb4bd59086afa866d78677672411a2b6920f985dc4113114cfd", - "api": "appwrite", + "fingerprint": "sha256:a6cf84f00941198ec439e57f2a9c4a3344ab0eb343a683844ea51a726d663d26", + "api": "appwrite/api", "version": "2026-06-24", "previous_version": "2026-06-19", "change_type": "deprecation", @@ -211,8 +211,8 @@ }, { "id": 11, - "fingerprint": "sha256:e92c6dfc51cf7a10d88b4f5dc3896e3dd868de37aab652c41a314069efbb78a2", - "api": "appwrite", + "fingerprint": "sha256:924d1a10c8c836c00fd7a914f97a5452f25e44d1e62c3707ebefce3946ae325a", + "api": "appwrite/api", "version": "2026-06-24", "previous_version": "2026-06-19", "change_type": "deprecation", @@ -232,8 +232,8 @@ }, { "id": 12, - "fingerprint": "sha256:c6bba24ed542441ae24f495755a312c0580f8ba53decb9d6081b891ba111eaac", - "api": "appwrite", + "fingerprint": "sha256:e8b38a262b69d595c0ec9a0f557680d278e5831b8b85cd6270a21b401297a2cc", + "api": "appwrite/api", "version": "2026-06-24", "previous_version": "2026-06-19", "change_type": "deprecation", @@ -253,8 +253,8 @@ }, { "id": 13, - "fingerprint": "sha256:6f3460c2f466b54ae261e54c7cffecfc0528a63f5f735e15e95bdda6458fcc10", - "api": "appwrite", + "fingerprint": "sha256:3c9ef0414441ad96b68e3611ba21a866c848303105c6957377fa49dd3233774f", + "api": "appwrite/api", "version": "2026-06-24", "previous_version": "2026-06-19", "change_type": "deprecation", @@ -274,8 +274,8 @@ }, { "id": 14, - "fingerprint": "sha256:f930964ce5dc6078a8405d9b9d6472e739f13457be24e46b0f5b54e48e1b780d", - "api": "appwrite", + "fingerprint": "sha256:666d6159ed9b9d2464b84233bc13a470b3d5539f675a9a6d842b17c9906d9f9b", + "api": "appwrite/api", "version": "2026-06-24", "previous_version": "2026-06-19", "change_type": "deprecation", diff --git a/plugins/openapi/testdata/golden/convex.json b/plugins/openapi/testdata/golden/convex.json index e5aa4d8..fbb46cc 100644 --- a/plugins/openapi/testdata/golden/convex.json +++ b/plugins/openapi/testdata/golden/convex.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:3009cdf0f6116b14f13ec28bd6eca6aa3be6eabe66d34fb5db7454881671f770", - "api": "convex", + "fingerprint": "sha256:93a0aa0792cb89fc4d14ab40c6ef6dcfdfbdd333393c1f4721ab4b60603309e6", + "api": "convex/deployment-api", "version": "2026-11-05", "previous_version": "2026-10-30", "change_type": "deprecation", @@ -22,8 +22,8 @@ }, { "id": 2, - "fingerprint": "sha256:a42a45fdc091e8fe2b4e151c38e131c3195f846cd26148ddc5db8d9d02b6cbac", - "api": "convex", + "fingerprint": "sha256:175e34aab0307fe16078ddc521e19db2b1134e4e7fd666a6000b4aab02069eb9", + "api": "convex/deployment-api", "version": "2026-11-05", "previous_version": "2026-10-30", "change_type": "deprecation", @@ -43,8 +43,8 @@ }, { "id": 3, - "fingerprint": "sha256:930075f543a07bd23b16f582788fd8b8c079dc4bc2d3d6cd43c2acd583a995da", - "api": "convex", + "fingerprint": "sha256:190e855c8c48bbce6697171cd6e05be6ffe713c69e2ff89f469647a4c4e53abb", + "api": "convex/deployment-api", "version": "2026-11-05", "previous_version": "2026-10-30", "change_type": "deprecation", @@ -64,8 +64,8 @@ }, { "id": 4, - "fingerprint": "sha256:f5a5c1ee8bb1ce5a406d952df079517005f92e83a2c09729e782ebf7e892af71", - "api": "convex", + "fingerprint": "sha256:187282ee12aefa2a977e85b647db8b327e008be175b5ede9416badb4810972ea", + "api": "convex/deployment-api", "version": "2026-11-05", "previous_version": "2026-10-30", "change_type": "deprecation", @@ -85,8 +85,8 @@ }, { "id": 5, - "fingerprint": "sha256:be79bb14968226260e9856e3ec45a8e3ad5795f6ee67be1a380e59f1acc8ab92", - "api": "convex", + "fingerprint": "sha256:db13f14c31d4173ecb76578f5ce0a352d890a678b940333b5b548d516c14c357", + "api": "convex/deployment-api", "version": "2026-11-05", "previous_version": "2026-10-30", "change_type": "deprecation", @@ -106,8 +106,8 @@ }, { "id": 6, - "fingerprint": "sha256:942f605d4201eddbb6b6b98d66dd306b6154248fca40225b5586aba1da633610", - "api": "convex", + "fingerprint": "sha256:94eaf5379beef172438857103486580fbb6952b2df56268b2887a6735b285160", + "api": "convex/deployment-api", "version": "2026-11-05", "previous_version": "2026-10-30", "change_type": "deprecation", diff --git a/plugins/openapi/testdata/golden/elasticsearch.json b/plugins/openapi/testdata/golden/elasticsearch.json index 33941d9..e2c825a 100644 --- a/plugins/openapi/testdata/golden/elasticsearch.json +++ b/plugins/openapi/testdata/golden/elasticsearch.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:e6f9a24b6c0707867db8194dcf23dd20fe851e359236a9567c741e60daa220af", - "api": "elasticsearch", + "fingerprint": "sha256:9a7edf6e9f3b40c20d4e303d0ce42472b9c1c66e5125936f35e60b6f5255759f", + "api": "elastic/elasticsearch-api", "version": "9.0.0", "previous_version": "8.19.0", "change_type": "deprecation", @@ -22,8 +22,8 @@ }, { "id": 2, - "fingerprint": "sha256:914a686914eb233286a5ea281f284296892936c059d663d7786bf7972c3e6ae8", - "api": "elasticsearch", + "fingerprint": "sha256:89077715c1d3fdf2e229be46735a4d52bd3a9553d0531aa4ae56a073844c3770", + "api": "elastic/elasticsearch-api", "version": "9.0.0", "previous_version": "8.19.0", "change_type": "deprecation", @@ -43,8 +43,8 @@ }, { "id": 3, - "fingerprint": "sha256:ac4eb6548c39460a5ecce3f0c8c80aa59b458713afc81c081d126915c5ca116d", - "api": "elasticsearch", + "fingerprint": "sha256:72e6f44c763a9142fc69cf2328a5bff614ea2bb795a01b16f553b857230daecc", + "api": "elastic/elasticsearch-api", "version": "9.0.0", "previous_version": "8.19.0", "change_type": "deprecation", @@ -64,8 +64,8 @@ }, { "id": 4, - "fingerprint": "sha256:58610ad6c67e990ade54c586ad0cb021c4dcbb876454bb06a916f483b819e4bc", - "api": "elasticsearch", + "fingerprint": "sha256:6850c9d36ef120c4172c027d16743ced30b082c38a50f409adc5d41527aeba36", + "api": "elastic/elasticsearch-api", "version": "9.0.0", "previous_version": "8.19.0", "change_type": "deprecation", @@ -85,8 +85,8 @@ }, { "id": 5, - "fingerprint": "sha256:cf1e119d61e7a9acd402b6547a3854f956ca26b905ac6f6fe288d198f2894a6f", - "api": "elasticsearch", + "fingerprint": "sha256:6a472cf6cc4004690bee910738bc1717984e9689e71f6acd2a99a39e3fc6f502", + "api": "elastic/elasticsearch-api", "version": "9.0.0", "previous_version": "8.19.0", "change_type": "deprecation", @@ -106,8 +106,8 @@ }, { "id": 6, - "fingerprint": "sha256:245db5b4444fca5f4b864b5088d433ece32370538217d21dacc48d5cbb245eac", - "api": "elasticsearch", + "fingerprint": "sha256:dd5715bb59c4c9deb13f36a7bc80822410401c95aebddf6a9878755bd1b5d846", + "api": "elastic/elasticsearch-api", "version": "9.0.0", "previous_version": "8.19.0", "change_type": "breaking", @@ -127,8 +127,8 @@ }, { "id": 7, - "fingerprint": "sha256:e1850b21011cbdf095b88fbdbe1eaa522be2fab47912258bc06742f96bbbe44c", - "api": "elasticsearch", + "fingerprint": "sha256:351fc1a569c8a06f7b95de00e5f2b6cf521fa477ca0f16ac686d5bed1a0f0dac", + "api": "elastic/elasticsearch-api", "version": "9.0.0", "previous_version": "8.19.0", "change_type": "breaking", @@ -148,8 +148,8 @@ }, { "id": 8, - "fingerprint": "sha256:eaae479ba14d5d2779649052f53e9c9f2987b4cd01b284e94e7a5cf177f8514c", - "api": "elasticsearch", + "fingerprint": "sha256:bb11ba82db2c21bec5693520ed31045a19adfa7e36be55c2ab2f7f155df33d9c", + "api": "elastic/elasticsearch-api", "version": "9.0.0", "previous_version": "8.19.0", "change_type": "breaking", diff --git a/plugins/openapi/testdata/golden/flagsmith.json b/plugins/openapi/testdata/golden/flagsmith.json index 0eccaac..9dda769 100644 --- a/plugins/openapi/testdata/golden/flagsmith.json +++ b/plugins/openapi/testdata/golden/flagsmith.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:9d8954a4311788d780d04796043dc3382369ea6856663403d91e0622ee46440b", - "api": "flagsmith", + "fingerprint": "sha256:6ce1b7cd44dbaf3c520bfffef67a4c7dac7eb7f4c0417d22bcf08ec6ae607785", + "api": "flagsmith/api", "version": "2.287.0", "previous_version": "2.286.0", "change_type": "breaking", @@ -22,8 +22,8 @@ }, { "id": 2, - "fingerprint": "sha256:679f551f2accf69eb0af557218cc8c0ae617589fea24835cc12b9358e4b4b644", - "api": "flagsmith", + "fingerprint": "sha256:bd7cf93e078745edc76b9b1ef7a984132dc6a5216bb46e89ed8a2ffe8526f3ef", + "api": "flagsmith/api", "version": "2.287.0", "previous_version": "2.286.0", "change_type": "breaking", @@ -43,8 +43,8 @@ }, { "id": 3, - "fingerprint": "sha256:f787d4463ba4f53083c9ebf3e686f3668606c61d8501c4256ebc4ad87a444668", - "api": "flagsmith", + "fingerprint": "sha256:05c83c262388466286bbb1b75ce4e063962258b70aa30a67d67c67a727989323", + "api": "flagsmith/api", "version": "2.287.0", "previous_version": "2.286.0", "change_type": "breaking", diff --git a/plugins/openapi/testdata/golden/neon.json b/plugins/openapi/testdata/golden/neon.json index e37eeec..08a5c1e 100644 --- a/plugins/openapi/testdata/golden/neon.json +++ b/plugins/openapi/testdata/golden/neon.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:ddffac6cdf8e522e71a5059177f72c13d0f91fdcfcbaab724df5a0aa14666f9c", - "api": "neon", + "fingerprint": "sha256:50fac21d2215fb2ff00b13fe54d7d0bcbb21769dedc49d0db8ab8e2f25844828", + "api": "neon/api", "version": "2026-08-23", "previous_version": "2026-08-17", "change_type": "deprecation", diff --git a/plugins/openapi/testdata/golden/planetscale.json b/plugins/openapi/testdata/golden/planetscale.json index 0d6f791..7ca141b 100644 --- a/plugins/openapi/testdata/golden/planetscale.json +++ b/plugins/openapi/testdata/golden/planetscale.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:12edd932544ab7968b2ad2cd824f69cb0c14e258cbc923ac87feed5880eaaa78", - "api": "planetscale", + "fingerprint": "sha256:a4087965f42c9adeebfca1fce9db2fcc702fac2032be5becb97e084e058725a8", + "api": "planetscale/api", "version": "2026-11-09", "previous_version": "2026-10-23", "change_type": "deprecation", @@ -22,8 +22,8 @@ }, { "id": 2, - "fingerprint": "sha256:9d65c2b858a48c37c43fc2d4cdcf41b581ecab8ad3aa5f598ea4e85542d606b9", - "api": "planetscale", + "fingerprint": "sha256:a0e317945d1c458b22634689ab4613d532123c479b9b89cb5255c35fae24d635", + "api": "planetscale/api", "version": "2026-11-09", "previous_version": "2026-10-23", "change_type": "deprecation", @@ -43,8 +43,8 @@ }, { "id": 3, - "fingerprint": "sha256:51bee34c435105c87184ba87b0b57fae2195ff2212833d6630c41150b7d8d011", - "api": "planetscale", + "fingerprint": "sha256:c35e7b205fe4211446cbbf0900597be4f3930c66eb5436f42a4808aa9b024c65", + "api": "planetscale/api", "version": "2026-11-09", "previous_version": "2026-10-23", "change_type": "deprecation", @@ -64,8 +64,8 @@ }, { "id": 4, - "fingerprint": "sha256:414d4e35218966651f9ebb9baa9bef90d1a26dbb1722e53ec01b559ed6e1bd57", - "api": "planetscale", + "fingerprint": "sha256:e4a98b2e24ca8682268a2dd9bf628575f0437a8e562fe0a85f72335e09f8545a", + "api": "planetscale/api", "version": "2026-11-09", "previous_version": "2026-10-23", "change_type": "deprecation", @@ -85,8 +85,8 @@ }, { "id": 5, - "fingerprint": "sha256:542446b844dd8fc039e8148a9fbe9160f61e1b239e9889eb97227613d193f65c", - "api": "planetscale", + "fingerprint": "sha256:f63159b51e042b49e72a3209e0b5851ad836cfb5925e4380c23770b8f1b562fd", + "api": "planetscale/api", "version": "2026-11-09", "previous_version": "2026-10-23", "change_type": "deprecation", diff --git a/plugins/openapi/testdata/golden/sentry.json b/plugins/openapi/testdata/golden/sentry.json index e9c4f60..c755e62 100644 --- a/plugins/openapi/testdata/golden/sentry.json +++ b/plugins/openapi/testdata/golden/sentry.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:2efa45f20c4794cb83d70cc75a4a098f03002e8ca698ae69be2f0a032fba4d43", - "api": "sentry", + "fingerprint": "sha256:2c581bcf2a003ab8ce3564a8fa559f444388a64ed2a5dc0da2e7440400417047", + "api": "sentry/api", "version": "2024-07-31", "previous_version": "2024-07-31", "change_type": "deprecation", @@ -22,8 +22,8 @@ }, { "id": 2, - "fingerprint": "sha256:c9d7575990702109c5fe20bb8a1cf67654789f4e4a0977b4eb4d540093015e15", - "api": "sentry", + "fingerprint": "sha256:3cd6e034c9602e808d72897f85568aa4c6f3427840a9f55e3a819ec84f2c24e3", + "api": "sentry/api", "version": "2025-07-25", "previous_version": "2025-07-25", "change_type": "deprecation", @@ -43,8 +43,8 @@ }, { "id": 3, - "fingerprint": "sha256:6fc16106a310cfe991afc1001b20127813897fb5ae8a495c6b35f3877f844e73", - "api": "sentry", + "fingerprint": "sha256:b10b4122b9cf5bb7cf73b726128cfb8325227dd9e252b529595eb8419fcd3a17", + "api": "sentry/api", "version": "2026-01-22", "previous_version": "2026-01-21", "change_type": "deprecation", @@ -64,8 +64,8 @@ }, { "id": 4, - "fingerprint": "sha256:c2eb3298f4f871a01f9b5bf7b99e3731aa0328acc1f654b68308844bc8d9cdc7", - "api": "sentry", + "fingerprint": "sha256:9a1a370124284bb32f1ade8af8dc022ef9719a7adc5ade39a71f607848aea43b", + "api": "sentry/api", "version": "2026-01-22", "previous_version": "2026-01-21", "change_type": "deprecation", @@ -85,8 +85,8 @@ }, { "id": 5, - "fingerprint": "sha256:7c4f21e09fe00c30d1239b95e167e7739e81ad21e7ede0234ae837277f60b590", - "api": "sentry", + "fingerprint": "sha256:360f32fc9198150194657ac504e030a86f246677364104b5cdf65175934a1d5d", + "api": "sentry/api", "version": "2026-01-22", "previous_version": "2026-01-21", "change_type": "deprecation", @@ -106,8 +106,8 @@ }, { "id": 6, - "fingerprint": "sha256:5d93def1bfa9db7da29d9446fd4f5944df489f55033d585f951a2e4925afd4da", - "api": "sentry", + "fingerprint": "sha256:d585c8aff07f53c61f686e437d99447ce5d68254eef0f3527d38090d2103d1d8", + "api": "sentry/api", "version": "2026-01-22", "previous_version": "2026-01-21", "change_type": "deprecation", @@ -127,8 +127,8 @@ }, { "id": 7, - "fingerprint": "sha256:90402d61a2a48a93c0c095061b6dc457e189a52d4e5d84b68953d49b16c0c052", - "api": "sentry", + "fingerprint": "sha256:49151a031811fac3d401cc2ae9df3b29c92f25a1c768941f64b9db48fe933c38", + "api": "sentry/api", "version": "2026-01-22", "previous_version": "2026-01-21", "change_type": "deprecation", @@ -148,8 +148,8 @@ }, { "id": 8, - "fingerprint": "sha256:2f145e0f7dab69af5b768ce70659ca1bc83c0adcbc3d82e0d4c8282c70c4cded", - "api": "sentry", + "fingerprint": "sha256:1e0a6193b9d4ee311207fff20af8ee2a22ad6d55a066af49fa82876a7cb91d97", + "api": "sentry/api", "version": "2026-01-22", "previous_version": "2026-01-21", "change_type": "deprecation", @@ -169,8 +169,8 @@ }, { "id": 9, - "fingerprint": "sha256:9530af56a60f90dc66ad010d23cfbe27c1e4995ca7abaf025069e9a8a979c813", - "api": "sentry", + "fingerprint": "sha256:10b62873f4ac22a29ac7384ccc9bdb308c3bb070adc6cc3e4e21afe759ebade0", + "api": "sentry/api", "version": "2026-01-22", "previous_version": "2026-01-21", "change_type": "deprecation", @@ -190,8 +190,8 @@ }, { "id": 10, - "fingerprint": "sha256:c4b2385ae7d1452194f50e65e09c90b5a370c23741e45655c2aef541b65aa70c", - "api": "sentry", + "fingerprint": "sha256:229b405e49905a7c71fc58eaff80f860bdce47abbeb9bd766301879094c31e17", + "api": "sentry/api", "version": "2026-01-22", "previous_version": "2026-01-21", "change_type": "deprecation", @@ -211,8 +211,8 @@ }, { "id": 11, - "fingerprint": "sha256:67cdb8021716e9e3bdd7fbe696b87099b0301943cba1cf66b5a8973e4db45fbb", - "api": "sentry", + "fingerprint": "sha256:1e5db27221e10250eb64354e1c204c1120cd14dbef5bf7661f063d0aab0bbe71", + "api": "sentry/api", "version": "2026-01-22", "previous_version": "2026-01-21", "change_type": "deprecation", @@ -232,8 +232,8 @@ }, { "id": 12, - "fingerprint": "sha256:4857ec490742153cbb2fc9d7acfdfe63f5fc5c1cb45f4df2a8d9c6a8de9ca484", - "api": "sentry", + "fingerprint": "sha256:c2c1b2a44827fbc07afe0ddf1c6cbd7fae8c39d513508c68853ec8a7a8f6988d", + "api": "sentry/api", "version": "2026-01-22", "previous_version": "2026-01-21", "change_type": "deprecation", diff --git a/plugins/openapi/testdata/golden/supabase.json b/plugins/openapi/testdata/golden/supabase.json index dbe6909..2719393 100644 --- a/plugins/openapi/testdata/golden/supabase.json +++ b/plugins/openapi/testdata/golden/supabase.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:880606fe624faa3f49480e13588a19e93562091d5a8f40c2a097f36fb329a604", - "api": "supabase", + "fingerprint": "sha256:fd6a1208f9f1047d9eaeff41188fbfda52dd7a2d5a67c05a7989a0a17ac1eb6f", + "api": "supabase/management-api", "version": "2025-02-19", "previous_version": "2025-02-10", "change_type": "deprecation", @@ -22,8 +22,8 @@ }, { "id": 2, - "fingerprint": "sha256:9cdc7164ed43b50e19c232e8af7f43c3fbfe87aa18b96bf5e62d7e59ee47c7b0", - "api": "supabase", + "fingerprint": "sha256:06a8a5322e8f622bc5e0841866ddb7d9d2c195f8b5137c9a5c7e2f49d3f7f7b2", + "api": "supabase/management-api", "version": "2026-06-29", "previous_version": "2026-06-22", "change_type": "deprecation", diff --git a/plugins/openapi/testdata/golden/vercel.json b/plugins/openapi/testdata/golden/vercel.json index 9c1a600..9731195 100644 --- a/plugins/openapi/testdata/golden/vercel.json +++ b/plugins/openapi/testdata/golden/vercel.json @@ -1,8 +1,8 @@ [ { "id": 1, - "fingerprint": "sha256:3ed13a96aa00836818e55222cab3da2dfa8a26582d5498f1af05c31f5d6f4069", - "api": "vercel", + "fingerprint": "sha256:ff56553007ba92c7da01fd7b944f1989a2a08ddd78f67e4d61757f507b93ca91", + "api": "vercel/api", "version": "1.13.5", "previous_version": "1.13.4", "change_type": "deprecation", @@ -22,8 +22,8 @@ }, { "id": 2, - "fingerprint": "sha256:9063f28da001671b78c5c0095cc412ca28c892e2a0e87b8a26c15b954530cea4", - "api": "vercel", + "fingerprint": "sha256:bbc8995e4907e383935c8eb7eda04a71b49975160a4c2cfa67ca296011a5e48c", + "api": "vercel/api", "version": "1.13.5", "previous_version": "1.13.4", "change_type": "deprecation", @@ -43,8 +43,8 @@ }, { "id": 3, - "fingerprint": "sha256:13194122725cea31972cf361d8bf98a8f41aedb308e10a721fe800145f2afe51", - "api": "vercel", + "fingerprint": "sha256:350f494abf46acc4721581386836895b85a3fab5cb1b285405ba8094d7e9ddf8", + "api": "vercel/api", "version": "1.13.5", "previous_version": "1.13.4", "change_type": "deprecation", @@ -64,8 +64,8 @@ }, { "id": 4, - "fingerprint": "sha256:3230007e27b6de1ffbd000649cdd3e34ac9a31da35a9c650cdb573b5d8f939d6", - "api": "vercel", + "fingerprint": "sha256:e36c66e4c03dd109d47cfe6cc67a8f8809b46f23afa1ab9133b6270c0f7bf34d", + "api": "vercel/api", "version": "1.13.5", "previous_version": "1.13.4", "change_type": "deprecation", @@ -85,8 +85,8 @@ }, { "id": 5, - "fingerprint": "sha256:4f1bb30450488badb2c18e52b206ebdd7c5b1265e2e13508351e4bf99d945d05", - "api": "vercel", + "fingerprint": "sha256:3abdd335e32e5c60ebe66fcbc7fc418a6c58c76f5402907977f1ada184f96733", + "api": "vercel/api", "version": "1.18.7", "previous_version": "1.18.6", "change_type": "breaking", @@ -106,8 +106,8 @@ }, { "id": 6, - "fingerprint": "sha256:ab1fee5e9b4b891417f2c62350ae005c7e15241d877b242dfc437764201915ac", - "api": "vercel", + "fingerprint": "sha256:f982f8524edab06d1447ca7c478e0b4e153914e8f1d7a3781762e37338f3d895", + "api": "vercel/api", "version": "1.18.7", "previous_version": "1.18.6", "change_type": "breaking", diff --git a/plugins/openapi/vercel_test.go b/plugins/openapi/vercel_test.go index 2c1e357..9293627 100644 --- a/plugins/openapi/vercel_test.go +++ b/plugins/openapi/vercel_test.go @@ -21,7 +21,7 @@ import ( // real URL each one was copied from, the way adapter.Vercel.Fetch cites it. type fakeVercelAdapter struct{ latest string } -func (fakeVercelAdapter) API() string { return "vercel" } +func (fakeVercelAdapter) API() string { return "vercel/api" } func (f fakeVercelAdapter) LatestTag(context.Context) (string, error) { return f.latest, nil } @@ -73,7 +73,7 @@ func TestVercelGolden(t *testing.T) { } } // The removal, replayed. - if rejected, err := kittest.Replay(ctx, env, s, vercelPlugin(""), "v1.18.6", "v1.18.7"); err != nil || rejected { + if rejected, err := kittest.Pair(ctx, env, s, vercelPlugin(""), "v1.18.6", "v1.18.7"); err != nil || rejected { t.Fatalf("replay: rejected=%v err=%v", rejected, err) } @@ -117,7 +117,7 @@ func TestVercelGolden(t *testing.T) { kittest.Golden(t, "testdata/golden/vercel.json", events) // Replaying the same pair again must not duplicate the events. - if _, err := kittest.Replay(ctx, env, s, vercelPlugin(""), "v1.18.6", "v1.18.7"); err != nil { + if _, err := kittest.Pair(ctx, env, s, vercelPlugin(""), "v1.18.6", "v1.18.7"); err != nil { t.Fatalf("second replay: %v", err) } if again := kittest.Stored(t, s); len(again) != len(events) { @@ -129,7 +129,7 @@ func TestVercelGolden(t *testing.T) { func TestVercelSummaryDeprecationQuotesTheSummary(t *testing.T) { ctx := context.Background() s := openStore(t) - if _, err := kittest.Replay(ctx, vercelEnv(s), s, vercelPlugin(""), "v1.13.4", "v1.13.5"); err != nil { + if _, err := kittest.Pair(ctx, vercelEnv(s), s, vercelPlugin(""), "v1.13.4", "v1.13.5"); err != nil { t.Fatal(err) } for _, e := range kittest.Stored(t, s) { @@ -153,7 +153,7 @@ func TestVercelSummaryDeprecationQuotesTheSummary(t *testing.T) { func TestVercelDropsRemovalsThatWerentDeprecated(t *testing.T) { ctx := context.Background() s := openStore(t) - if rejected, err := kittest.Replay(ctx, vercelEnv(s), s, vercelPlugin(""), "v1.6.2", "v1.6.3"); err != nil || rejected { + if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, vercelPlugin(""), "v1.6.2", "v1.6.3"); err != nil || rejected { t.Fatalf("replay: rejected=%v err=%v", rejected, err) } if events := kittest.Stored(t, s); len(events) != 0 { @@ -168,7 +168,7 @@ func TestVercelDropsRemovalsThatWerentDeprecated(t *testing.T) { s = openStore(t) p := vercelPlugin("") p.Keep = nil - if _, err := kittest.Replay(ctx, vercelEnv(s), s, p, "v1.6.2", "v1.6.3"); err != nil { + if _, err := kittest.Pair(ctx, vercelEnv(s), s, p, "v1.6.2", "v1.6.3"); err != nil { t.Fatal(err) } var removals int @@ -188,7 +188,7 @@ func TestVercelDropsRemovalsThatWerentDeprecated(t *testing.T) { func TestVercelPathParameterRenameIsNoChange(t *testing.T) { ctx := context.Background() s := openStore(t) - if rejected, err := kittest.Replay(ctx, vercelEnv(s), s, vercelPlugin(""), "v1.28.64", "v1.28.65"); err != nil || rejected { + if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, vercelPlugin(""), "v1.28.64", "v1.28.65"); err != nil || rejected { t.Fatalf("replay: rejected=%v err=%v", rejected, err) } if events := kittest.Stored(t, s); len(events) != 0 { @@ -202,7 +202,7 @@ func TestVercelPathParameterRenameIsNoChange(t *testing.T) { s = openStore(t) p := vercelPlugin("") p.Diff.PathTemplates = false - if _, err := kittest.Replay(ctx, vercelEnv(s), s, p, "v1.28.64", "v1.28.65"); err != nil { + if _, err := kittest.Pair(ctx, vercelEnv(s), s, p, "v1.28.64", "v1.28.65"); err != nil { t.Fatal(err) } events := kittest.Stored(t, s) diff --git a/scripts/check_contract.py b/scripts/check_contract.py index 5bbc0fd..5477c14 100644 --- a/scripts/check_contract.py +++ b/scripts/check_contract.py @@ -2,8 +2,8 @@ """Check contract/fixtures/ against patch-it's fixtures/. patch-it (https://github.com/patch-it-dev/patch-it) owns the change-event -contract; this repo carries a copy of its change-event fixtures so core/event/ and -core/migrate/ test against the same events the patch-it client does. The copies +contract; this repo carries a copy of its change-event fixtures so core/event/ +tests against the same events the patch-it client does. The copies must hold the same JSON as patch-it's. Only the top-level "_comment" fields may differ: they describe where a fixture came from, and this repo words them for a public audience. From 04813a857c67a9c2120497583592b9218f2c0545 Mon Sep 17 00:00:00 2001 From: adssib <75389300+adssib@users.noreply.github.com> Date: Fri, 20 Nov 2026 18:40:31 -0500 Subject: [PATCH 4/7] docs: ids only, no forwarders, no v1, no replay Co-Authored-By: Claude Opus 5.5 Signed-off-by: adssib <75389300+adssib@users.noreply.github.com> --- .github/pull_request_template.md | 4 ++-- AGENTS.md | 8 ++++---- CONTRIBUTING.md | 4 ++-- docs/how-it-works.md | 4 ++-- docs/writing-a-plugin.md | 22 +++++++++++----------- plugins/notices/feed/testdata/README.md | 2 +- plugins/notices/testdata/README.md | 2 +- providers/README.md | 2 +- providers/_template.md | 4 ++-- providers/algolia.md | 2 +- providers/anthropic-models.md | 2 +- providers/anthropic.md | 2 +- providers/appwrite.md | 2 +- providers/cloudflare.md | 2 +- providers/convex.md | 2 +- providers/datadog.md | 2 +- providers/elasticsearch.md | 2 +- providers/flagsmith.md | 2 +- providers/github-actions.md | 2 +- providers/github.md | 2 +- providers/gitlab.md | 2 +- providers/mongodb-atlas.md | 2 +- providers/neon.md | 2 +- providers/newrelic.md | 2 +- providers/numpy.md | 2 +- providers/openai-models.md | 2 +- providers/openai-python-sdk.md | 2 +- providers/planetscale.md | 2 +- providers/posthog.md | 2 +- providers/redis.md | 2 +- providers/salesforce.md | 2 +- providers/sentry.md | 2 +- providers/stripe.md | 2 +- providers/supabase.md | 2 +- providers/textual.md | 2 +- providers/urllib3.md | 2 +- providers/vercel.md | 2 +- providers/vertex-ai-models.md | 2 +- 38 files changed, 55 insertions(+), 55 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 2517da6..dcf6f53 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,10 +6,10 @@ - [ ] **Metadata complete in the registration** (`plugin.RegisterProvider`: provider id, name, category, homepage; each source's id, kind, layer, what it watches, URLs, packages, page), and I read the words. There is no list to update. Not applicable: - [ ] Every commit is signed off (`git commit -s`, DCO) -- [ ] Golden test over a real saved copy of the source (`testdata/golden/.json`) +- [ ] Golden test over a real saved copy of the source (`testdata/golden/-.json`) - [ ] `testdata/README.md` lists each file: URL, date fetched, license, quote of the part the plugin reads - [ ] One pinned drop test: a realistic input that produces no event -- [ ] `providers/.md` written or updated from `providers/_template.md`, including **Why this source** +- [ ] `providers/-.md` written or updated from `providers/_template.md`, including **Why this source** - [ ] Fetches only through `env.Get` / `core/kit/` - [ ] `make check` passes locally (`make plugins` prints the source as you expect) - [ ] Nothing private: no credentials, internal hosts, private links, customer names diff --git a/AGENTS.md b/AGENTS.md index 74fbfbf..d23d094 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -25,10 +25,10 @@ Refer to the service that runs these plugins as "patch-it's hosted ingestion ser - **Start a new source with `make new-plugin ARGS='--provider --name --source --kind '`** (`go run ./cmd/new-plugin`; [which kind](docs/which-kind.md)), then fill in every `TODO(new-plugin)`; `make todos` (part of `make check` and CI_go) fails while one is left. - **Fetch only through the environment** (`env.Get` or `core/kit/`). No `net/http` outside the fetch layer, no filesystem outside `testdata/`, no database. -- **Golden test + dated source quote**: a saved copy of the real source in `testdata/`, a row in `testdata/README.md` (URL, date fetched, license, quote), and `testdata/golden/.json` with the exact events. +- **Golden test + dated source quote**: a saved copy of the real source in `testdata/`, a row in `testdata/README.md` (URL, date fetched, license, quote), and `testdata/golden/-.json` with the exact events. - **Precision over recall.** When unsure whether something is a change, don't emit an event. - **One pinned drop test** per plugin: a realistic input that must produce no event. -- **`providers/.md`** for every provider, copied from `providers/_template.md`, including **Why this source**: the link, the date it was checked, why it's the best source, the alternatives not used, and a short quote. +- **`providers/-.md`** for every provider, copied from `providers/_template.md`, including **Why this source**: the link, the date it was checked, why it's the best source, the alternatives not used, and a short quote. - **No source, no event**: every event carries the source URL and a quote. - Don't edit golden files to make a test pass without explaining in the PR why the new output is right. @@ -56,7 +56,7 @@ core/github/ the newest release / commit on GitHub, and a commit's SHA core/versions/ every version of a source: GitHub releases, tags and commits, PyPI, npm, Web Archive captures core/kit/ core/kit/kittest/ Unchanged, Cite, Wayback, Notices; the test kit (Mem, Pages, Ingest, Golden) core/extract/ what readers of prose share: RSS/Atom entries, HTML as text, dates, code spans -core/event/ core/migrate/ the change-event types from patch-it's contract (v1 + v2), v1 -> v2 +core/event/ the change event of patch-it's contract: types, fingerprint, validation core/diff/ core/normalize/ core/hint/ the OpenAPI diff engine and its helpers plugins// one package per kind, with its providers: openapi (+ adapter/, one spec adapter per provider), notices (+ retire/, feed/, eol/), migrationguide (+ sdkguide/, @@ -67,7 +67,7 @@ cmd/new-plugin/ scaffolds a provider's source on a kind (make new-plugin contract/fixtures/ a copy of patch-it's change-event fixtures (CI_contract checks it) Makefile make check (what CI_go runs, plus the leak guard), make plugins docs/ contributor docs, including writing-a-plugin.md -providers/.md one page per provider +providers/-.md one page per provider scripts/ leak_guard.py (hashed internal names), check_contract.py .github/ CODEOWNERS, PR template, release-notes categories, workflows (CI_go, CI_dco, CI_leak_guard, CI_contract, Release) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 10dfee1..f7ede16 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,10 +8,10 @@ Thanks for helping patch-it watch more APIs. This file is the rulebook; [docs/wr 1. **Give every provider and source complete metadata in its registration.** A source exists when its kind's package registers it with `plugin.RegisterProvider`: the provider's id, name, category and homepage, and the source's id, layer, what it watches, the URLs it reads and its page. That registration is the only list: `make plugins` prints it, each release carries it as `plugins.json`, and docs.patch-it.dev reads it from there. Nothing else to update. 2. **Fetch only through the environment.** Plugins get their sources from `env.Get` or the helpers in `core/kit/`, never from `net/http` directly, the filesystem or a database. That keeps tests offline and lets the hosted service cache, retry and rate-limit politely. -3. **Every plugin has a golden test** over a real saved copy of its source: `testdata/` in, `testdata/golden/.json` out. `testdata/README.md` lists each file with its URL, the date you fetched it, its license, and a short quote of the part your plugin reads. Keep openly licensed files whole; trim vendor documentation pages to what the test needs. +3. **Every plugin has a golden test** over a real saved copy of its source: `testdata/` in, `testdata/golden/-.json` out. `testdata/README.md` lists each file with its URL, the date you fetched it, its license, and a short quote of the part your plugin reads. Keep openly licensed files whole; trim vendor documentation pages to what the test needs. 4. **Precision over recall.** A missed change is a bug we can fix later. A wrong change becomes a wrong pull request in someone's repo. When in doubt, don't emit. 5. **One pinned drop test per plugin**: a realistic input your plugin must *not* turn into an event (an unrelated section, a renamed heading, a non-breaking addition). -6. **Document the provider** in `providers/.md`, copied from [`providers/_template.md`](providers/_template.md): what it watches, **why you chose that source** (and the alternatives you didn't), how the provider announces changes, what the plugin reads and ignores, and known gaps. +6. **Document the provider** in `providers/-.md`, copied from [`providers/_template.md`](providers/_template.md): what it watches, **why you chose that source** (and the alternatives you didn't), how the provider announces changes, what the plugin reads and ignores, and known gaps. 7. **Nothing private.** This repo is public. No credentials, tokens, internal hostnames or links to private repos or systems, in code, tests, commit messages or PR descriptions. CI scans every PR for secrets and for known internal names. ## Sign your commits (DCO) diff --git a/docs/how-it-works.md b/docs/how-it-works.md index ba0a6f3..139265d 100644 --- a/docs/how-it-works.md +++ b/docs/how-it-works.md @@ -1,6 +1,6 @@ # How it works -A **provider** (Stripe, OpenAI, GitHub…) has one category and one or more **sources**: each one place it announces changes (an OpenAPI spec repo, a changelog, a deprecations page, a feed), read by one **kind** of plugin (`plugins//`), at one **layer** of a customer's stack. A source's id is `provider/source` (`stripe/api`, `openai/models`); its old slug (`stripe`, `openai-models`) is what events carry in `api` until patch-it's change-event contract switches to source ids. Every provider and source is registered in code with its metadata (`plugin.RegisterProvider`): that registration is the only list. +A **provider** (Stripe, OpenAI, GitHub…) has one category and one or more **sources**: each one place it announces changes (an OpenAPI spec repo, a changelog, a deprecations page, a feed), read by one **kind** of plugin (`plugins//`), at one **layer** of a customer's stack. A source's id is `provider/source` (`stripe/api`, `openai/models`): what its events carry in `api`. Every provider and source is registered in code with its metadata (`plugin.RegisterProvider`): that registration is the only list. ## What a plugin does @@ -24,7 +24,7 @@ There's no list in this repo: `make plugins` prints every provider and source fr | [`plugins/`](../plugins/) | One package per kind, with its providers (openapi, changelog, notices, migrationguide, catalog, apisurface); `plugins/all` imports every one | | [`cmd/new-plugin/`](../cmd/new-plugin/), [`cmd/list-plugins/`](../cmd/list-plugins/) | The starter for a new provider; the list of providers and sources, printed from the registry | | [`core/kit/`](../core/kit/), [`core/kit/kittest/`](../core/kit/kittest/), [`core/github/`](../core/github/), [`core/extract/`](../core/extract/) | What plugins share (the unchanged-page check, Wayback citing, the newest release or commit on GitHub, RSS/Atom and HTML text helpers) and the test kit (in-memory store, saved pages, golden files) | -| [`core/event/`](../core/event/), [`core/migrate/`](../core/migrate/) | The change-event types of [patch-it's contract](https://github.com/patch-it-dev/patch-it/tree/main/docs/contract), and the v1 → v2 conversion | +| [`core/event/`](../core/event/) | The change event of [patch-it's contract](https://github.com/patch-it-dev/patch-it/tree/main/docs/contract): its types, fingerprint and validation | | [`core/diff/`](../core/diff/), [`core/normalize/`](../core/normalize/), [`core/hint/`](../core/hint/), [`plugins/openapi/adapter/`](../plugins/openapi/adapter/) | The OpenAPI diff engine: compare two specs, turn the changes into events, attach changelog hints; one adapter per spec provider | | [`plugins/notices/retire/`](../plugins/notices/retire/), [`plugins/notices/feed/`](../plugins/notices/feed/), [`plugins/notices/eol/`](../plugins/notices/eol/), [`plugins/migrationguide/sdkguide/`](../plugins/migrationguide/sdkguide/), [`plugins/migrationguide/members/`](../plugins/migrationguide/members/), [`core/fetch/`](../core/fetch/) | The notices readers (deprecations pages, feeds, end-of-life tables) and the migration-guide readers (removed parameters, removed members); the HTTP fetch and cache | | [`contract/fixtures/`](../contract/) | A copy of patch-it's change-event fixtures | diff --git a/docs/writing-a-plugin.md b/docs/writing-a-plugin.md index bc7f703..4a59766 100644 --- a/docs/writing-a-plugin.md +++ b/docs/writing-a-plugin.md @@ -15,7 +15,7 @@ make new-plugin ARGS='--provider acme --name Acme --category devtools --homepage # --kind: openapi, changelog, notices, migrationguide, catalog, apisurface # --reader, for a kind with several: changelog markdown|json, notices deprecations|feed, migrationguide sdk|members # optional: --layer api|sdk|package|runtime|ci|ai-models|infra (default: the kind's), --watches "...", -# --page acme (share an existing providers/ page), --api acme-api (the first name; default -) +# --page acme (share an existing providers/ page; default -) ``` Run in a terminal without the flags, it asks for them: the provider's id, then (for a new provider) its name, category and homepage, then the source's id, kind, reader, layer, URLs, packages and what it watches. A second source of a registered provider needs only `--provider`, `--source` and `--kind`: the name, category and homepage come from the registry. One run adds one source; run it again for the next. @@ -23,12 +23,12 @@ Run in a terminal without the flags, it asks for them: the provider's id, then ( It writes, and lists: - the source's definition in the package its kind reads it from (`plugins/openapi/adapter/`, `plugins/notices/retire/`, `plugins/notices/feed/`, `plugins/migrationguide/sdkguide/`, `plugins/migrationguide/members/` or `plugins//`), with the version wiring the kind needs from it: an OpenAPI adapter's `LatestTag`, `Fetch` and `Versions` to write; every other kind lists, reads and extracts versions itself; -- its `plugin.RegisterProvider` block (the provider and the source with every metadata field, packages included) in the kind's `init` (plus the `core/migrate/` map entry that the deprecations-page and SDK-guide readers need), and the kind's import in `plugins/all` if it's a new kind; -- `plugins//_test.go`: the registration test, a golden test and a pinned drop test, over placeholder sources in `testdata/`, with the golden file written from them; +- its `plugin.RegisterProvider` block (the provider and the source with every metadata field, packages included) in the kind's `init`, and the kind's import in `plugins/all` if it's a new kind; +- `plugins//__test.go`: the registration test, a golden test and a pinned drop test, over placeholder sources in `testdata/`, with the golden file written from them; - a row per saved file in that `testdata/README.md` (URL, date, license, quote to fill in); -- `providers/.md` from the template (or nothing, with `--page`, when the provider already has one); +- `providers/-.md` from the template (or nothing, with `--page`, when the provider already has one); -`go test ./...` passes right after; every place to fill in says `TODO(new-plugin)` (`grep -rn 'TODO(new-plugin)' .`), and `make check` (its `todos` step, also in CI_go) fails until none is left. It refuses a `provider/source` id or a first name that's taken, or a file it would write that exists, and then changes nothing. The old flags (`--api acme --provider Acme --format feed --source `) still work for one release. +`go test ./...` passes right after; every place to fill in says `TODO(new-plugin)` (`grep -rn 'TODO(new-plugin)' .`), and `make check` (its `todos` step, also in CI_go) fails until none is left. It refuses a `provider/source` id that's taken, or a file it would write that exists, and then changes nothing. ## 2. Pick the source @@ -95,7 +95,7 @@ A plugin implements `plugin.Plugin` (package [`core/plugin/`](../core/plugin/plu ```go type Plugin interface { - Name() string // the source's old slug: --api and every event's `api` + Name() string // the source's id, provider/source: every event's `api` Run(ctx context.Context, env Env) (Result, error) // the newest version against the baseline it saved last } @@ -107,7 +107,7 @@ type Env struct { type Result struct { Label string // what was read, for the run summary - Events []event.EventV2 // valid events + Events []event.Event // valid events Rejected []error // changes that failed to become valid events Baselines []Spec // what was read, saved after the events } @@ -129,6 +129,7 @@ Extract(ctx, env, from, to Snapshot) (Result, error) // the changes fro - **Read at** a version's `Ref` (a tag, a commit SHA, an archive URL) and return the exact URL read as the snapshot's `SourceURL`: it's the events' citation. - **Extract** sets `previous_version` to `from`'s version; `from` may be zero (nothing before). It returns no baselines. - `Run` is built from the same parts: the newest version, extracted against the last baseline. +- Test a version pair with `kittest.Pair(ctx, env, sink, plugin, from, to)`: both versions read, the change extracted, its events stored. A living page with no versions of its own (a deprecations page, a feed: a `notices` source) is read as it is now by `Run`, and each change to it is a dated version. Its history comes from the Web Archive: the `notices` kind lists every distinct capture (`WaybackCaptures`), reads each, and extracts what each one added, citing that capture, so a year of it can be backfilled by date with no stored copies. @@ -157,7 +158,7 @@ func init() { } ``` -`RegisterProvider` panics on missing metadata, a duplicate id, or a provider registered twice with a different name, category or homepage (a provider with sources in two kinds repeats the same ones). `plugin.Lookup` and `plugin.LookupSource` find a source by `provider/source` or by its old slug (its first name, which events carry in `api` and fingerprints hash). +`RegisterProvider` panics on missing metadata, a duplicate id, or a provider registered twice with a different name, category or homepage (a provider with sources in two kinds repeats the same ones). `plugin.Lookup` and `plugin.LookupSource` find a source by its id, `provider/source`. The plugin's `Name` is that id: what every event carries in `api`, and what the fingerprint hashes. `Packages` are the published packages the source covers, `:` (`pypi:stripe`, `npm:@vercel/sdk`): the package itself for a package or SDK source, the provider's official SDKs for an API source. `plugin.ForPackage` finds a package's sources, so a customer's lockfile maps to sources with no table kept anywhere else. List only names you checked; none is fine. @@ -166,13 +167,12 @@ func init() { - Fetch **only** with `env.Get`. It caches by `ETag` / `Last-Modified`, retries, and in tests serves saved files. `CI_go` fails a package outside `core/fetch/`, `core/kit/` and `plugins/openapi/adapter/` that imports `net/http`. - `kit.Unchanged(env, api, body)`: true when the page hashes to the last baseline. Return early: an unchanged source costs one GET and nothing else. - `kit.Cite(ctx, archiver, url, read, want)`: for a **live page**. Takes a Wayback Machine snapshot, reads it with your own reader and checks it says exactly what the live page said. Make the events from the snapshot and cite its URL. No snapshot, no events. -- `plugin.Baseline(api, version, tag, sourceURL, content, replay, now)`: the baseline `Run` returns. +- `plugin.Baseline(api, version, tag, sourceURL, content, now)`: the baseline `Run` returns. - `github.LatestRelease`, `github.LatestCommit`, `github.Commit`, `github.Head` ([`core/github`](../core/github/github.go)): the newest release or commit on GitHub, one place; don't decode GitHub's responses yourself. -- Older kinds build v1 `event.ChangeEvent`s and convert them with `migrate.Fresh`; new code builds `event.EventV2` directly. ### Events -The event format is [patch-it's change-event contract](https://github.com/patch-it-dev/patch-it/tree/main/docs/contract); `core/event/` is its Go binding. Every event has a typed `subject` (`api_operation`, `model`, `package_release`, `ci_runtime`), a `change_type` (`breaking`, `deprecation`, …), a `version`, a `fingerprint` (`event.FingerprintV2`), and **a `source_url` and `source_excerpt`: no source, no event**. Call `Validate()`; an invalid event goes in `Result.Rejected`, not `Events`. +The event format is [patch-it's change-event contract](https://github.com/patch-it-dev/patch-it/tree/main/docs/contract); `core/event/` is its Go binding. Every event has a typed `subject` (`api_operation`, `model`, `package_release`, `ci_runtime`), a `change_type` (`breaking`, `deprecation`, …), a `version`, a `fingerprint` (`event.Fingerprint`), and **a `source_url` and `source_excerpt`: no source, no event**. Call `Validate()`; an invalid event goes in `Result.Rejected`, not `Events`. ## 5. Save the source diff --git a/plugins/notices/feed/testdata/README.md b/plugins/notices/feed/testdata/README.md index d6115b7..47ec016 100644 --- a/plugins/notices/feed/testdata/README.md +++ b/plugins/notices/feed/testdata/README.md @@ -1,6 +1,6 @@ # Saved feeds -Real copies, saved once with `curl`. The golden files, `../../testdata/golden/.json`, +Real copies, saved once with `curl`. The golden files, `../../testdata/golden/-.json`, are what the notices kind stores from them (`go test ./plugins/notices -update`). | File | URL | Saved | License | Quote | diff --git a/plugins/notices/testdata/README.md b/plugins/notices/testdata/README.md index 9e9ae85..fb557f5 100644 --- a/plugins/notices/testdata/README.md +++ b/plugins/notices/testdata/README.md @@ -2,6 +2,6 @@ `golden/openai-models.json` and `golden/anthropic-models.json` are what the `openai-models` and `anthropic-models` plugins store from the saved deprecations pages. The pages themselves are shared with the `retire` package: see [`retire/testdata/README.md`](../retire/testdata/README.md) for their URLs, dates and licenses. -`golden/github-actions.json`, `golden/vertex-ai-models.json` and `golden/cloudflare.json` come from the saved feeds in [`feed/testdata/`](../feed/testdata/README.md); `golden/salesforce.json` from the saved page in [`eol/testdata/`](../eol/testdata/README.md). +`golden/github-actions.json`, `golden/google-vertex-ai-models.json` and `golden/cloudflare-api.json` come from the saved feeds in [`feed/testdata/`](../feed/testdata/README.md); `golden/salesforce.json` from the saved page in [`eol/testdata/`](../eol/testdata/README.md). Rewrite them after an intended change with `go test ./plugins/notices -update`, and say in the PR why the new output is right. diff --git a/providers/README.md b/providers/README.md index 550b4fa..56d8d6d 100644 --- a/providers/README.md +++ b/providers/README.md @@ -1,6 +1,6 @@ # Providers -One page per plugin id: `providers/.md`. Start from [`_template.md`](_template.md). Each page says: +One page per provider: `providers/-.md`, or the provider's own page shared by its sources. Start from [`_template.md`](_template.md). Each page says: - **What the plugin watches.** - **Why this source:** the link the plugin reads, when it was checked, why it's the most reliable place this provider announces breaking changes, which other sources were considered and why they weren't used, and one short quote from it. diff --git a/providers/_template.md b/providers/_template.md index 533dd71..b7eab39 100644 --- a/providers/_template.md +++ b/providers/_template.md @@ -1,6 +1,6 @@ -# (``) +# (`/`) -Copy this file to `providers/.md` and fill every section. Delete these instructions. +Copy this file to `providers/-.md` and fill every section. Delete these instructions. ## What it watches diff --git a/providers/algolia.md b/providers/algolia.md index 3b53b17..5fbd906 100644 --- a/providers/algolia.md +++ b/providers/algolia.md @@ -1,4 +1,4 @@ -# Algolia (`algolia-search`, `algolia-ingestion`, `algolia-recommend`) +# Algolia (`algolia/search-api`, `algolia/ingestion-api`, `algolia/recommend-api`) ## What it watches diff --git a/providers/anthropic-models.md b/providers/anthropic-models.md index d13782e..56ee9fc 100644 --- a/providers/anthropic-models.md +++ b/providers/anthropic-models.md @@ -1,4 +1,4 @@ -# Anthropic model retirements (`anthropic-models`) +# Anthropic model retirements (`anthropic/models`) ## What it watches diff --git a/providers/anthropic.md b/providers/anthropic.md index d67f50f..6b10823 100644 --- a/providers/anthropic.md +++ b/providers/anthropic.md @@ -1,4 +1,4 @@ -# Anthropic Python SDK (`anthropic`) +# Anthropic Python SDK (`anthropic/python-sdk`) ## What it watches diff --git a/providers/appwrite.md b/providers/appwrite.md index ea502e7..c03f918 100644 --- a/providers/appwrite.md +++ b/providers/appwrite.md @@ -1,4 +1,4 @@ -# Appwrite (`appwrite`) +# Appwrite (`appwrite/api`) ## What it watches diff --git a/providers/cloudflare.md b/providers/cloudflare.md index 9a91803..8937bd7 100644 --- a/providers/cloudflare.md +++ b/providers/cloudflare.md @@ -1,4 +1,4 @@ -# Cloudflare (`cloudflare`) +# Cloudflare (`cloudflare/api`) ## What it watches diff --git a/providers/convex.md b/providers/convex.md index fb9e7db..b6c0d34 100644 --- a/providers/convex.md +++ b/providers/convex.md @@ -1,4 +1,4 @@ -# Convex (`convex`) +# Convex (`convex/deployment-api`) ## What it watches diff --git a/providers/datadog.md b/providers/datadog.md index 3de454b..3e70326 100644 --- a/providers/datadog.md +++ b/providers/datadog.md @@ -1,4 +1,4 @@ -# Datadog (`datadog`) +# Datadog (`datadog/api`) ## What it watches diff --git a/providers/elasticsearch.md b/providers/elasticsearch.md index 36d6509..37147c7 100644 --- a/providers/elasticsearch.md +++ b/providers/elasticsearch.md @@ -1,4 +1,4 @@ -# Elasticsearch (`elasticsearch`) +# Elasticsearch (`elastic/elasticsearch-api`) ## What it watches diff --git a/providers/flagsmith.md b/providers/flagsmith.md index 89ad8d0..555cd71 100644 --- a/providers/flagsmith.md +++ b/providers/flagsmith.md @@ -1,4 +1,4 @@ -# Flagsmith (`flagsmith`) +# Flagsmith (`flagsmith/api`) ## What it watches diff --git a/providers/github-actions.md b/providers/github-actions.md index c9adb20..25076d6 100644 --- a/providers/github-actions.md +++ b/providers/github-actions.md @@ -1,4 +1,4 @@ -# GitHub Actions runner images (`github-actions`) +# GitHub Actions runner images (`github/actions`) ## What it watches diff --git a/providers/github.md b/providers/github.md index f47fd93..aad0118 100644 --- a/providers/github.md +++ b/providers/github.md @@ -1,4 +1,4 @@ -# GitHub REST API (`github`) +# GitHub REST API (`github/rest-api`) ## What it watches diff --git a/providers/gitlab.md b/providers/gitlab.md index 7556c13..354a9c6 100644 --- a/providers/gitlab.md +++ b/providers/gitlab.md @@ -1,4 +1,4 @@ -# GitLab REST API (`gitlab`) +# GitLab REST API (`gitlab/rest-api`) ## What it watches diff --git a/providers/mongodb-atlas.md b/providers/mongodb-atlas.md index c0a5143..d47dc78 100644 --- a/providers/mongodb-atlas.md +++ b/providers/mongodb-atlas.md @@ -1,4 +1,4 @@ -# MongoDB Atlas (`mongodb-atlas`) +# MongoDB Atlas (`mongodb/atlas-admin-api`) ## What it watches diff --git a/providers/neon.md b/providers/neon.md index 1724564..ce45f7e 100644 --- a/providers/neon.md +++ b/providers/neon.md @@ -1,4 +1,4 @@ -# Neon (`neon`) +# Neon (`neon/api`) ## What it watches diff --git a/providers/newrelic.md b/providers/newrelic.md index dcfdb82..9e87fc3 100644 --- a/providers/newrelic.md +++ b/providers/newrelic.md @@ -1,4 +1,4 @@ -# New Relic (`newrelic`) +# New Relic (`newrelic/python-agent`) ## What it watches diff --git a/providers/numpy.md b/providers/numpy.md index 2a0058b..32357a6 100644 --- a/providers/numpy.md +++ b/providers/numpy.md @@ -1,4 +1,4 @@ -# NumPy (`numpy`) +# NumPy (`numpy/numpy`) ## What it watches diff --git a/providers/openai-models.md b/providers/openai-models.md index 9ddceb7..a021144 100644 --- a/providers/openai-models.md +++ b/providers/openai-models.md @@ -1,4 +1,4 @@ -# OpenAI model retirements (`openai-models`) +# OpenAI model retirements (`openai/models`) ## What it watches diff --git a/providers/openai-python-sdk.md b/providers/openai-python-sdk.md index d99a51c..4d233f1 100644 --- a/providers/openai-python-sdk.md +++ b/providers/openai-python-sdk.md @@ -1,4 +1,4 @@ -# OpenAI Python SDK (`openai`) +# OpenAI Python SDK (`openai/python-sdk`) ## What it watches diff --git a/providers/planetscale.md b/providers/planetscale.md index c1e9658..40c2ae0 100644 --- a/providers/planetscale.md +++ b/providers/planetscale.md @@ -1,4 +1,4 @@ -# PlanetScale (`planetscale`) +# PlanetScale (`planetscale/api`) ## What it watches diff --git a/providers/posthog.md b/providers/posthog.md index c822b09..917620c 100644 --- a/providers/posthog.md +++ b/providers/posthog.md @@ -1,4 +1,4 @@ -# PostHog (`posthog`) +# PostHog (`posthog/python-sdk`) ## What it watches diff --git a/providers/redis.md b/providers/redis.md index b7b9a84..f118c89 100644 --- a/providers/redis.md +++ b/providers/redis.md @@ -1,4 +1,4 @@ -# Redis (`redis`) +# Redis (`redis/commands`) ## What it watches diff --git a/providers/salesforce.md b/providers/salesforce.md index 0d27ada..ddb6c19 100644 --- a/providers/salesforce.md +++ b/providers/salesforce.md @@ -1,4 +1,4 @@ -# Salesforce (`salesforce`) +# Salesforce (`salesforce/rest-api`) ## What it watches diff --git a/providers/sentry.md b/providers/sentry.md index d61f373..0d7a4af 100644 --- a/providers/sentry.md +++ b/providers/sentry.md @@ -1,4 +1,4 @@ -# Sentry (`sentry`) +# Sentry (`sentry/api`) ## What it watches diff --git a/providers/stripe.md b/providers/stripe.md index 46aee8f..9fde42b 100644 --- a/providers/stripe.md +++ b/providers/stripe.md @@ -1,4 +1,4 @@ -# Stripe (`stripe`) +# Stripe (`stripe/api`) ## What it watches diff --git a/providers/supabase.md b/providers/supabase.md index 86dae18..880226e 100644 --- a/providers/supabase.md +++ b/providers/supabase.md @@ -1,4 +1,4 @@ -# Supabase (`supabase`) +# Supabase (`supabase/management-api`) ## What it watches diff --git a/providers/textual.md b/providers/textual.md index ec6488b..602855e 100644 --- a/providers/textual.md +++ b/providers/textual.md @@ -1,4 +1,4 @@ -# Textual (`textual`) +# Textual (`textual/textual`) ## What it watches diff --git a/providers/urllib3.md b/providers/urllib3.md index d6c7e3d..7ba3bcc 100644 --- a/providers/urllib3.md +++ b/providers/urllib3.md @@ -1,4 +1,4 @@ -# urllib3 (`urllib3`) +# urllib3 (`urllib3/urllib3`) ## What it watches diff --git a/providers/vercel.md b/providers/vercel.md index 4aec983..2e16b65 100644 --- a/providers/vercel.md +++ b/providers/vercel.md @@ -1,4 +1,4 @@ -# Vercel (`vercel`) +# Vercel (`vercel/api`) ## What it watches diff --git a/providers/vertex-ai-models.md b/providers/vertex-ai-models.md index eb00d3c..b34e22c 100644 --- a/providers/vertex-ai-models.md +++ b/providers/vertex-ai-models.md @@ -1,4 +1,4 @@ -# Vertex AI generative models (`vertex-ai-models`) +# Vertex AI generative models (`google/vertex-ai-models`) ## What it watches From d33aac1719c1a7c51a2d30fbf222946c3569230a Mon Sep 17 00:00:00 2001 From: adssib <75389300+adssib@users.noreply.github.com> Date: Fri, 20 Nov 2026 19:12:47 -0500 Subject: [PATCH 5/7] no replay wording: tests, comments and provider pages say version pair Co-Authored-By: Claude Opus 5.5 Signed-off-by: adssib <75389300+adssib@users.noreply.github.com> --- core/kit/kittest/kittest.go | 2 +- core/plugin/plugin.go | 2 +- plugins/catalog/catalog_test.go | 12 ++++----- plugins/changelog/json_test.go | 2 +- plugins/openapi/algolia_test.go | 8 +++--- plugins/openapi/appwrite_test.go | 14 +++++----- plugins/openapi/convex_test.go | 4 +-- plugins/openapi/datadog_test.go | 18 ++++++------- plugins/openapi/elasticsearch_test.go | 8 +++--- plugins/openapi/flagsmith_test.go | 6 ++--- plugins/openapi/github_test.go | 18 ++++++------- plugins/openapi/gitlab_test.go | 24 ++++++++--------- plugins/openapi/neon_test.go | 8 +++--- plugins/openapi/openapi.go | 3 ++- plugins/openapi/openapi_test.go | 38 +++++++++++++-------------- plugins/openapi/planetscale_test.go | 10 +++---- plugins/openapi/sentry_test.go | 24 ++++++++--------- plugins/openapi/supabase_test.go | 6 ++--- plugins/openapi/vercel_test.go | 18 ++++++------- providers/appwrite.md | 2 +- providers/convex.md | 2 +- providers/datadog.md | 2 +- providers/elasticsearch.md | 2 +- providers/gitlab.md | 2 +- providers/neon.md | 2 +- providers/planetscale.md | 2 +- providers/redis.md | 4 +-- providers/sentry.md | 2 +- providers/stripe.md | 2 +- providers/supabase.md | 2 +- providers/vercel.md | 2 +- 31 files changed, 126 insertions(+), 125 deletions(-) diff --git a/core/kit/kittest/kittest.go b/core/kit/kittest/kittest.go index f17770c..8437690 100644 --- a/core/kit/kittest/kittest.go +++ b/core/kit/kittest/kittest.go @@ -109,7 +109,7 @@ func Stored(t testing.TB, s Sink) []event.Event { } // Golden compares events with the JSON file at path, or rewrites it with -// -update. Every event must also be valid v2, or the golden would pin a bug. +// -update. Every event must also be valid, or the golden would pin a bug. func Golden(t testing.TB, path string, events []event.Event) { t.Helper() golden(t, path, events, *update) diff --git a/core/plugin/plugin.go b/core/plugin/plugin.go index cc34ef6..f5a623b 100644 --- a/core/plugin/plugin.go +++ b/core/plugin/plugin.go @@ -66,7 +66,7 @@ type Spec struct { // Result is what one run found. type Result struct { Label string // what was read, for the summary: a tag, a snapshot, a URL - Events []event.Event // valid v2 events, to store + Events []event.Event // valid events, to store Rejected []error // changes that failed to become valid events Baselines []Spec // what the run read, saved after the events } diff --git a/plugins/catalog/catalog_test.go b/plugins/catalog/catalog_test.go index 7d24792..c827f76 100644 --- a/plugins/catalog/catalog_test.go +++ b/plugins/catalog/catalog_test.go @@ -33,20 +33,20 @@ func fixturePages() kittest.Pages { } } -// The golden test and the replay fixture in one: testdata/redis-doc-cc0427b.json +// The golden test and the pair fixture in one: testdata/redis-doc-cc0427b.json // and redis-doc-06f3598.json are real, trimmed excerpts of redis-doc's // commands.json at those two commits (checked 2026-11-18). Between them, // FUNCTION CREATE and FUNCTION INFO disappear, FUNCTION LOAD appears, and GET // (an unrelated, long-lived command) is unchanged. This is the pair the // plugin's Replay from oldRef to newRef recreates. -func TestReplayRecreatesTheRealFunctionCommandRemoval(t *testing.T) { +func TestPairRecreatesTheRealFunctionCommandRemoval(t *testing.T) { ctx := context.Background() s := kittest.NewMem() e := env(s, fixturePages(), t) rejected, err := kittest.Pair(ctx, e, s, Plugin{Catalog: Redis}, oldRef, newRef) if err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } events, err := s.All() @@ -90,12 +90,12 @@ func TestReplayRecreatesTheRealFunctionCommandRemoval(t *testing.T) { } } - // Replaying the same pair again must not duplicate the events. + // Reading the same pair again must not duplicate the events. if _, err := kittest.Pair(ctx, e, s, Plugin{Catalog: Redis}, oldRef, newRef); err != nil { - t.Fatalf("second replay: %v", err) + t.Fatalf("second read of the pair: %v", err) } if again, _ := s.All(); len(again) != len(events) { - t.Errorf("repeating the replay added events: %d -> %d", len(events), len(again)) + t.Errorf("reading the pair again added events: %d -> %d", len(events), len(again)) } } diff --git a/plugins/changelog/json_test.go b/plugins/changelog/json_test.go index e065056..c00d89a 100644 --- a/plugins/changelog/json_test.go +++ b/plugins/changelog/json_test.go @@ -149,7 +149,7 @@ func TestReactivationWithdrawsTheDeprecation(t *testing.T) { // Deprecated, reactivated, deprecated again: one deprecation, the second. // Deprecated, then removed: both. And "api path removed without deprecation" // isn't read (its one real entry was an endpoint that stayed). -func TestLifeCycleReplay(t *testing.T) { +func TestLifeCycleInOrder(t *testing.T) { ch := func(code string) string { return `{"change":"x","changeCode":"` + code + `","backwardCompatible":true}` } diff --git a/plugins/openapi/algolia_test.go b/plugins/openapi/algolia_test.go index 6fa3494..edc34ef 100644 --- a/plugins/openapi/algolia_test.go +++ b/plugins/openapi/algolia_test.go @@ -23,7 +23,7 @@ type fakeAlgoliaAdapter struct{ spec string } func (f fakeAlgoliaAdapter) API() string { return "algolia/" + f.spec + "-api" } func (fakeAlgoliaAdapter) LatestTag(context.Context) (string, error) { - return "", fmt.Errorf("replay only") + return "", fmt.Errorf("pairs only") } func (f fakeAlgoliaAdapter) Fetch(_ context.Context, tag string) (adapter.Spec, error) { @@ -77,7 +77,7 @@ func TestAlgoliaGolden(t *testing.T) { ctx := context.Background() s := openStore(t) if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, algoliaPlugin(c.spec), c.from, c.to); err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } events := kittest.Stored(t, s) if len(events) != c.ops { @@ -114,7 +114,7 @@ func TestAlgoliaDropsRemovalsThatWerentDeprecated(t *testing.T) { const from, to = "released-2024-09-18-cc190fae3", "released-2024-09-19-a62c27d3b" s := openStore(t) if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, algoliaPlugin("ingestion"), from, to); err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } if events := kittest.Stored(t, s); len(events) != 0 { t.Fatalf("%d events, want none", len(events)) @@ -166,7 +166,7 @@ func TestAlgoliaRecommendCustomRequestMoveIsNoEvent(t *testing.T) { const from, to = "released-2024-03-19-2eac6f410", "released-2024-03-25-30207fcd0" s := openStore(t) if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, algoliaPlugin("recommend"), from, to); err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } if events := kittest.Stored(t, s); len(events) != 0 { t.Fatalf("%d events, want none", len(events)) diff --git a/plugins/openapi/appwrite_test.go b/plugins/openapi/appwrite_test.go index 2a0ac82..047200d 100644 --- a/plugins/openapi/appwrite_test.go +++ b/plugins/openapi/appwrite_test.go @@ -98,11 +98,11 @@ func appwritePlugin(t *testing.T) (Plugin, string) { return Plugin{Adapter: a, Diff: appwriteDiff, Keep: appwriteKeep}, srv.URL + "/raw/appwrite/specs" } -func replayAppwrite(t *testing.T, p Plugin, from, to string) []event.Event { +func pairAppwrite(t *testing.T, p Plugin, from, to string) []event.Event { t.Helper() s := openStore(t) if rejected, err := kittest.Pair(context.Background(), vercelEnv(s), s, p, from, to); err != nil || rejected { - t.Fatalf("replay %s -> %s: rejected=%v err=%v", from, to, rejected, err) + t.Fatalf("pair %s -> %s: rejected=%v err=%v", from, to, rejected, err) } return kittest.Stored(t, s) } @@ -122,7 +122,7 @@ func TestAppwriteRegistersItself(t *testing.T) { // quotes x-appwrite.deprecated in the file as published. func TestAppwriteGolden(t *testing.T) { p, base := appwritePlugin(t) - events := replayAppwrite(t, p, appwrite19Old, appwrite19New) + events := pairAppwrite(t, p, appwrite19Old, appwrite19New) if len(events) != 14 { t.Fatalf("%d events, want 14", len(events)) } @@ -153,13 +153,13 @@ func TestAppwriteGolden(t *testing.T) { // day. As the adapter reads it, 13 removals; no event: removals never are. func TestAppwriteDropsRemovals(t *testing.T) { p, _ := appwritePlugin(t) - if events := replayAppwrite(t, p, appwrite24Old, appwrite24New); len(events) != 0 { + if events := pairAppwrite(t, p, appwrite24Old, appwrite24New); len(events) != 0 { t.Fatalf("%d events, want none: %s", len(events), events[0].Subject.Operation) } // Unfiltered, the same pair reports the 13 removals. p.Keep = nil var removed int - for _, e := range replayAppwrite(t, p, appwrite24Old, appwrite24New) { + for _, e := range pairAppwrite(t, p, appwrite24Old, appwrite24New) { if e.ChangeType == event.ChangeTypeBreaking && e.Subject.Kind == event.KindOperation { removed++ } @@ -180,11 +180,11 @@ func TestAppwriteDropsRemovals(t *testing.T) { // flag, 21. func TestAppwriteDropsSDKMethodRenames(t *testing.T) { p, _ := appwritePlugin(t) - if events := replayAppwrite(t, p, "1.7.x@"+appwrite18, appwrite18); len(events) != 0 { + if events := pairAppwrite(t, p, "1.7.x@"+appwrite18, appwrite18); len(events) != 0 { t.Fatalf("%d events, want none: %s", len(events), events[0].Subject.Operation) } p.Diff.FlagNotDeprecation = nil - events := replayAppwrite(t, p, "1.7.x@"+appwrite18, appwrite18) + events := pairAppwrite(t, p, "1.7.x@"+appwrite18, appwrite18) if len(events) != 21 { t.Fatalf("every flag read: %d events, want 21", len(events)) } diff --git a/plugins/openapi/convex_test.go b/plugins/openapi/convex_test.go index c548fbd..098d8ca 100644 --- a/plugins/openapi/convex_test.go +++ b/plugins/openapi/convex_test.go @@ -85,7 +85,7 @@ func TestConvexGolden(t *testing.T) { ctx := context.Background() s := openStore(t) if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, convexPlugin(""), "f35879bb", "5e5159cb"); err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } events := kittest.Stored(t, s) if len(events) != len(convexReplacements) { @@ -138,7 +138,7 @@ func TestConvexDropsPropertyChangesThatWerentDeprecations(t *testing.T) { ctx := context.Background() s := openStore(t) if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, convexPlugin(""), "3f6edf7a", "3ead9091"); err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } if events := kittest.Stored(t, s); len(events) != 0 { t.Fatalf("stored %d events, want none", len(events)) diff --git a/plugins/openapi/datadog_test.go b/plugins/openapi/datadog_test.go index e1b0c0c..fa486e5 100644 --- a/plugins/openapi/datadog_test.go +++ b/plugins/openapi/datadog_test.go @@ -38,20 +38,20 @@ func (fakeDatadogAdapter) Fetch(_ context.Context, tag string) (adapter.Spec, er return adapter.Spec{Content: content, Version: tag, SourceURL: sourceURL}, nil } -// The golden test and the replay fixture in one: testdata/datadog-2.60.0.yaml +// The golden test and the pair fixture in one: testdata/datadog-2.60.0.yaml // and datadog-2.61.0.yaml are real, trimmed excerpts of // datadog-api-client-python's bundled spec at those two tags (checked // 2026-11-13). Between them, PR #4045 removed queried_tags_window_seconds and // related_asset_tags from TagIndexingRuleDynamicTags — a real historical // breaking change, not an invented one. This is the pair -// the plugin's Replay from 2.60.0 to 2.61.0 recreates. -func TestDatadogReplayRecreatesTheRealPropertyRemoval(t *testing.T) { +// the pair 2.60.0 → 2.61.0 recreates. +func TestDatadogPairRecreatesTheRealPropertyRemoval(t *testing.T) { ctx := context.Background() s := openStore(t) - rejected, err := replayWith(ctx, s, Plugin{Adapter: fakeDatadogAdapter{}}, "2.60.0", "2.61.0") + rejected, err := pairWith(ctx, s, Plugin{Adapter: fakeDatadogAdapter{}}, "2.60.0", "2.61.0") if err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } events, err := s.All() @@ -87,11 +87,11 @@ func TestDatadogReplayRecreatesTheRealPropertyRemoval(t *testing.T) { } } - // Replaying the same pair again must not duplicate the events. - if _, err := replayWith(ctx, s, Plugin{Adapter: fakeDatadogAdapter{}}, "2.60.0", "2.61.0"); err != nil { - t.Fatalf("second replay: %v", err) + // Reading the same pair again must not duplicate the events. + if _, err := pairWith(ctx, s, Plugin{Adapter: fakeDatadogAdapter{}}, "2.60.0", "2.61.0"); err != nil { + t.Fatalf("second read of the pair: %v", err) } if again, _ := s.All(); len(again) != len(events) { - t.Errorf("repeating the replay added events: %d -> %d", len(events), len(again)) + t.Errorf("reading the pair again added events: %d -> %d", len(events), len(again)) } } diff --git a/plugins/openapi/elasticsearch_test.go b/plugins/openapi/elasticsearch_test.go index 9103f4e..10ec11a 100644 --- a/plugins/openapi/elasticsearch_test.go +++ b/plugins/openapi/elasticsearch_test.go @@ -26,7 +26,7 @@ type fakeESAdapter struct{} func (fakeESAdapter) API() string { return "elastic/elasticsearch-api" } -func (fakeESAdapter) LatestTag(context.Context) (string, error) { return "", fmt.Errorf("replay only") } +func (fakeESAdapter) LatestTag(context.Context) (string, error) { return "", fmt.Errorf("pairs only") } func (fakeESAdapter) Fetch(_ context.Context, branch string) (adapter.Spec, error) { if _, ok := esHeads[branch]; !ok { @@ -72,7 +72,7 @@ func TestElasticsearchNoRemovalWithinAMinor(t *testing.T) { p := esPlugin() p.Adapter = sameMinor{} if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, p, "8.19", "9.0"); err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } n := map[event.ChangeType]int{} for _, e := range kittest.Stored(t, s) { @@ -93,7 +93,7 @@ func TestElasticsearchGolden(t *testing.T) { ctx := context.Background() s := openStore(t) if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, esPlugin(), "8.19", "9.0"); err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } events := kittest.Stored(t, s) byType := map[event.ChangeType][]string{} @@ -143,7 +143,7 @@ func TestElasticsearchDropsUndeprecatedRemovals(t *testing.T) { ctx := context.Background() s := openStore(t) if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, esPlugin(), "9.1", "9.2"); err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } if events := kittest.Stored(t, s); len(events) != 0 { t.Fatalf("%d events, want none", len(events)) diff --git a/plugins/openapi/flagsmith_test.go b/plugins/openapi/flagsmith_test.go index 921b805..1b91b06 100644 --- a/plugins/openapi/flagsmith_test.go +++ b/plugins/openapi/flagsmith_test.go @@ -72,7 +72,7 @@ func (fakeFlagsmithAdapter) Fetch(_ context.Context, tag string) (adapter.Spec, }, nil } -// The golden test and the replay fixture: the real removal of the three +// The golden test and the pair fixture: the real removal of the three // experimental flag-update endpoints between v2.286.0 and v2.287.0. func TestFlagsmithGolden(t *testing.T) { ctx := context.Background() @@ -80,7 +80,7 @@ func TestFlagsmithGolden(t *testing.T) { sink := env.Baselines.(kittest.Sink) p := Plugin{Adapter: fakeFlagsmithAdapter{}, Keep: requestSide} if rejected, err := kittest.Pair(ctx, env, sink, p, "v2.286.0", "v2.287.0"); err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } kittest.Golden(t, "testdata/golden/flagsmith.json", kittest.Stored(t, sink)) } @@ -93,7 +93,7 @@ func TestFlagsmithDropsADescriptionOnlyChange(t *testing.T) { sink := env.Baselines.(kittest.Sink) p := Plugin{Adapter: fakeFlagsmithAdapter{}, Keep: requestSide} if rejected, err := kittest.Pair(ctx, env, sink, p, "c3ef832", "f504f16"); err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } if got := kittest.Stored(t, sink); len(got) != 0 { t.Errorf("%d events from a description-only change, want none", len(got)) diff --git a/plugins/openapi/github_test.go b/plugins/openapi/github_test.go index 00e7ea1..9239b88 100644 --- a/plugins/openapi/github_test.go +++ b/plugins/openapi/github_test.go @@ -28,21 +28,21 @@ func (fakeGitHubAdapter) Fetch(_ context.Context, tag string) (adapter.Spec, err return adapter.Spec{Content: body, Version: tag, SourceURL: sourceURL}, nil } -// The golden test and the replay fixture in one: testdata/github-2022-11-28.json +// The golden test and the pair fixture in one: testdata/github-2022-11-28.json // and github-2026-03-10.json are real, trimmed excerpts of github's own bundled // REST API description at those two dated API versions (checked 2026-11-14). // Between them, GitHub's documented breaking change for 2026-03-10 ("Remove // deprecated rate property from rate limit endpoint") dropped the required // `rate` property from the `rate-limit-overview` schema — a real historical // breaking change, not an invented one. This is the pair -// the plugin's Replay from 2022-11-28 to 2026-03-10 recreates. -func TestGitHubReplayRecreatesTheRealPropertyRemoval(t *testing.T) { +// the pair 2022-11-28 → 2026-03-10 recreates. +func TestGitHubPairRecreatesTheRealPropertyRemoval(t *testing.T) { ctx := context.Background() s := openStore(t) - rejected, err := replayWith(ctx, s, Plugin{Adapter: fakeGitHubAdapter{}}, "2022-11-28", "2026-03-10") + rejected, err := pairWith(ctx, s, Plugin{Adapter: fakeGitHubAdapter{}}, "2022-11-28", "2026-03-10") if err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } events, err := s.All() @@ -67,11 +67,11 @@ func TestGitHubReplayRecreatesTheRealPropertyRemoval(t *testing.T) { t.Errorf("event %s: missing provenance", e.Subject.Property) } - // Replaying the same pair again must not duplicate the event. - if _, err := replayWith(ctx, s, Plugin{Adapter: fakeGitHubAdapter{}}, "2022-11-28", "2026-03-10"); err != nil { - t.Fatalf("second replay: %v", err) + // Reading the same pair again must not duplicate the event. + if _, err := pairWith(ctx, s, Plugin{Adapter: fakeGitHubAdapter{}}, "2022-11-28", "2026-03-10"); err != nil { + t.Fatalf("second read of the pair: %v", err) } if again, _ := s.All(); len(again) != len(events) { - t.Errorf("repeating the replay added events: %d -> %d", len(events), len(again)) + t.Errorf("reading the pair again added events: %d -> %d", len(events), len(again)) } } diff --git a/plugins/openapi/gitlab_test.go b/plugins/openapi/gitlab_test.go index da2a8c6..cafdd13 100644 --- a/plugins/openapi/gitlab_test.go +++ b/plugins/openapi/gitlab_test.go @@ -24,7 +24,7 @@ func gitlabPlugin(t *testing.T) (Plugin, string) { return Plugin{Adapter: adapter.GitLab{SpecURLTemplate: tmpl}, Keep: requestSide}, tmpl } -// The golden test and the replay fixture in one: testdata/gitlab-v18.11.0-ee.yaml +// The golden test and the pair fixture in one: testdata/gitlab-v18.11.0-ee.yaml // and gitlab-v19.0.0-ee.yaml are trimmed, unedited excerpts of GitLab's // OpenAPI spec at those two tags (checked 2026-11-15). GitLab 19.0 removed app // passwords from the Bitbucket Cloud import API ("Using app passwords with @@ -32,19 +32,19 @@ func gitlabPlugin(t *testing.T) (Plugin, string) { // docs.gitlab.com/update/deprecations): bitbucket_username and // bitbucket_app_password are gone from POST /api/v4/import/bitbucket, and // bitbucket_email and bitbucket_api_token became required. This is the pair -// the plugin's Replay from v18.11.0-ee to v19.0.0-ee recreates. +// the pair v18.11.0-ee → v19.0.0-ee recreates. // // The excerpts also keep APIEntitiesBadge, whose id went from the generator's // default "string" to "integer" in the same release while the API kept // returning the same JSON: the response-side noise requestSide drops. -func TestGitLabReplayRecreatesTheBitbucketAppPasswordRemoval(t *testing.T) { +func TestGitLabPairRecreatesTheBitbucketAppPasswordRemoval(t *testing.T) { ctx := context.Background() s := openStore(t) p, tmpl := gitlabPlugin(t) - rejected, err := replayWith(ctx, s, p, "v18.11.0-ee", "v19.0.0-ee") + rejected, err := pairWith(ctx, s, p, "v18.11.0-ee", "v19.0.0-ee") if err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } events, err := s.All() if err != nil { @@ -110,12 +110,12 @@ func TestGitLabReplayRecreatesTheBitbucketAppPasswordRemoval(t *testing.T) { } } - // Replaying the same pair again must not duplicate the events. - if _, err := replayWith(ctx, s, p, "v18.11.0-ee", "v19.0.0-ee"); err != nil { - t.Fatalf("second replay: %v", err) + // Reading the same pair again must not duplicate the events. + if _, err := pairWith(ctx, s, p, "v18.11.0-ee", "v19.0.0-ee"); err != nil { + t.Fatalf("second read of the pair: %v", err) } if again, _ := s.All(); len(again) != len(events) { - t.Errorf("repeating the replay added events: %d -> %d", len(events), len(again)) + t.Errorf("reading the pair again added events: %d -> %d", len(events), len(again)) } } @@ -127,8 +127,8 @@ func TestGitLabResponseSideNoiseIsWhatTheFilterDrops(t *testing.T) { p, _ := gitlabPlugin(t) p.Keep = nil - if _, err := replayWith(ctx, s, p, "v18.11.0-ee", "v19.0.0-ee"); err != nil { - t.Fatalf("replay: %v", err) + if _, err := pairWith(ctx, s, p, "v18.11.0-ee", "v19.0.0-ee"); err != nil { + t.Fatalf("pair: %v", err) } events, _ := s.All() var badge bool @@ -138,7 +138,7 @@ func TestGitLabResponseSideNoiseIsWhatTheFilterDrops(t *testing.T) { } } if !badge { - t.Error("unfiltered replay has no APIEntitiesBadge.id event; the fixture no longer shows what requestSide is for") + t.Error("unfiltered pair has no APIEntitiesBadge.id event; the fixture no longer shows what requestSide is for") } } diff --git a/plugins/openapi/neon_test.go b/plugins/openapi/neon_test.go index aff90c4..09ed7e0 100644 --- a/plugins/openapi/neon_test.go +++ b/plugins/openapi/neon_test.go @@ -67,7 +67,7 @@ func neonPlugin(a adapter.Adapter) Plugin { return Plugin{Adapter: a, Diff: neonDiff, Keep: neonKeep} } -// The golden test, the replay fixture: the one operation Neon deprecated in +// The golden test, the pair fixture: the one operation Neon deprecated in // neon-pkgs's copy of the spec. On 2026-08-23 POST // /projects/{project_id}/branches/{branch_id}/auth/send_test_email (beta) // gained the flag, an x-sunset of 2027-02-28 and "Deprecated: to test a @@ -78,7 +78,7 @@ func TestNeonGolden(t *testing.T) { ctx := context.Background() s := openStore(t) if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, neonPlugin(fakeNeonAdapter{}), "5c57d009", "93b93dc9"); err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } events := kittest.Stored(t, s) if len(events) != 1 { @@ -118,7 +118,7 @@ func TestNeonDropsRemovalsThatWerentDeprecated(t *testing.T) { ctx := context.Background() s := openStore(t) if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, neonPlugin(fakeNeonAdapter{}), "4c6b3be4", "4497de89"); err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } if events := kittest.Stored(t, s); len(events) != 0 { t.Fatalf("stored %d events, want none", len(events)) @@ -179,7 +179,7 @@ func TestNeonKeepsTheRemovalOfADeprecatedOperation(t *testing.T) { ctx := context.Background() s := openStore(t) if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, neonPlugin(neonAPIClient{}), "2.7.2", "2.7.3"); err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } events := kittest.Stored(t, s) if len(events) != 1 { diff --git a/plugins/openapi/openapi.go b/plugins/openapi/openapi.go index a0e3ac7..cdae1f6 100644 --- a/plugins/openapi/openapi.go +++ b/plugins/openapi/openapi.go @@ -3,7 +3,8 @@ // Algolia, Elasticsearch, Sentry, Neon, Convex, PlanetScale, Appwrite): fetch // the newest spec, diff it against the last one seen, normalize the changes // into events, and attach migration hints from the API's changelog when it -// has one. It can also replay two given releases. +// has one. Every release is listed and each consecutive pair diffed +// (ListVersions, ReadAt, Extract). package openapi import ( diff --git a/plugins/openapi/openapi_test.go b/plugins/openapi/openapi_test.go index 0b041cd..ec60e9d 100644 --- a/plugins/openapi/openapi_test.go +++ b/plugins/openapi/openapi_test.go @@ -43,11 +43,11 @@ func ingest(ctx context.Context, s *kittest.Mem, a adapter.Adapter) (bool, error return kittest.Run(ctx, env(s), s, newPlugin(a, noChangelog)) } -func replay(ctx context.Context, s *kittest.Mem, a adapter.Adapter, from, to string) (bool, error) { - return replayWith(ctx, s, newPlugin(a, noChangelog), from, to) +func pair(ctx context.Context, s *kittest.Mem, a adapter.Adapter, from, to string) (bool, error) { + return pairWith(ctx, s, newPlugin(a, noChangelog), from, to) } -func replayWith(ctx context.Context, s *kittest.Mem, p Plugin, from, to string) (bool, error) { +func pairWith(ctx context.Context, s *kittest.Mem, p Plugin, from, to string) (bool, error) { return kittest.Pair(ctx, env(s), s, p, from, to) } @@ -145,29 +145,29 @@ func TestIngestStoresTheEventsItFinds(t *testing.T) { } } -// Replay (--from/--to) is how the demo change gets recreated: it must store the -// events, and it must never move the normal-run baseline. -func TestReplayStoresEventsWithoutMovingTheBaseline(t *testing.T) { +// A version pair (ReadAt both sides, Extract) stores its events and no +// baseline: a backfill never moves what the next run compares with. +func TestAPairStoresEventsAndNoBaseline(t *testing.T) { ctx := context.Background() s := openStore(t) - if _, err := replay(ctx, s, fakeAdapter{specs: specs}, "v1", "v2"); err != nil { - t.Fatalf("replay: %v", err) + if _, err := pair(ctx, s, fakeAdapter{specs: specs}, "v1", "v2"); err != nil { + t.Fatalf("pair: %v", err) } if got := storedEvents(t, s); len(got) != 2 { - t.Errorf("replay stored %d events, want 2: %v", len(got), got) + t.Errorf("the pair stored %d events, want 2: %v", len(got), got) } if last, _ := s.LastSpec("stripe/api"); last != nil { - t.Errorf("replay moved the baseline to %s; replays must never set it", last.Version) + t.Errorf("the pair set a baseline (%s); Extract returns none", last.Version) } - // Replaying the same pair again stores nothing new. + // Reading the same pair again stores nothing new. before := len(storedEvents(t, s)) - if _, err := replay(ctx, s, fakeAdapter{specs: specs}, "v1", "v2"); err != nil { - t.Fatalf("second replay: %v", err) + if _, err := pair(ctx, s, fakeAdapter{specs: specs}, "v1", "v2"); err != nil { + t.Fatalf("second read of the pair: %v", err) } if after := len(storedEvents(t, s)); after != before { - t.Errorf("repeating a replay added events: %d -> %d", before, after) + t.Errorf("reading the pair again added events: %d -> %d", before, after) } } @@ -176,8 +176,8 @@ func TestReplayStoresEventsWithoutMovingTheBaseline(t *testing.T) { func TestIngestStoresEventsWhenTheChangelogIsUnreachable(t *testing.T) { ctx := context.Background() s := openStore(t) - if _, err := replay(ctx, s, fakeAdapter{specs: specs}, "v1", "v2"); err != nil { - t.Fatalf("replay: %v", err) + if _, err := pair(ctx, s, fakeAdapter{specs: specs}, "v1", "v2"); err != nil { + t.Fatalf("pair: %v", err) } events, _ := s.All() if len(events) != 2 { @@ -186,7 +186,7 @@ func TestIngestStoresEventsWhenTheChangelogIsUnreachable(t *testing.T) { } // With a changelog, the entry's text and link become the event's migration hint. -func TestReplayAttachesMigrationHintsFromTheChangelog(t *testing.T) { +func TestAPairAttachesMigrationHintsFromTheChangelog(t *testing.T) { withHints := fakeHints{entries: []hint.Entry{{ Title: "Removes the charges attribute from the PaymentIntent object", URL: "https://docs.stripe.com/changelog/2022-11-15/removes-charges-attribute-paymentintent", @@ -196,8 +196,8 @@ func TestReplayAttachesMigrationHintsFromTheChangelog(t *testing.T) { ctx := context.Background() s := openStore(t) - if _, err := replayWith(ctx, s, newPlugin(fakeAdapter{specs: specs}, withHints), "v1", "v2"); err != nil { - t.Fatalf("replay: %v", err) + if _, err := pairWith(ctx, s, newPlugin(fakeAdapter{specs: specs}, withHints), "v1", "v2"); err != nil { + t.Fatalf("pair: %v", err) } events, _ := s.All() var removed *event.Event diff --git a/plugins/openapi/planetscale_test.go b/plugins/openapi/planetscale_test.go index 19318c3..0da3651 100644 --- a/plugins/openapi/planetscale_test.go +++ b/plugins/openapi/planetscale_test.go @@ -56,11 +56,11 @@ func planetscalePlugin(t *testing.T) (Plugin, string) { return Plugin{Adapter: a, Diff: planetscaleDiff, Keep: planetscaleKeep}, srv.URL + "/raw" + repo } -func replayPlanetScale(t *testing.T, p Plugin, from, to string) []event.Event { +func pairPlanetScale(t *testing.T, p Plugin, from, to string) []event.Event { t.Helper() s := openStore(t) if rejected, err := kittest.Pair(context.Background(), vercelEnv(s), s, p, from, to); err != nil || rejected { - t.Fatalf("replay %s -> %s: rejected=%v err=%v", from, to, rejected, err) + t.Fatalf("pair %s -> %s: rejected=%v err=%v", from, to, rejected, err) } return kittest.Stored(t, s) } @@ -74,7 +74,7 @@ func replayPlanetScale(t *testing.T, p Plugin, from, to string) []event.Event { func TestPlanetScaleGolden(t *testing.T) { p, base := planetscalePlugin(t) const from, to = "e631095aa649a6797578a1d51d861b91e0568aa1", "fc13e09d0c18b893aabd3e02d175d13957bba677" - events := replayPlanetScale(t, p, from, to) + events := pairPlanetScale(t, p, from, to) const branch = "/v1/organizations/{organization}/databases/{database}/branches/{branch}" want := map[string]bool{ "GET " + branch + "/bouncers/{bouncer}/resizes": true, @@ -127,12 +127,12 @@ func TestPlanetScaleGolden(t *testing.T) { func TestPlanetScaleDropsRemovalsThatWerentDeprecated(t *testing.T) { p, _ := planetscalePlugin(t) const from, to = "b49c354080667638b79781801f0517ae07bc55b8", "f6d6ad4d3929f6c1ef021eb13c1541ba31f72107" - if events := replayPlanetScale(t, p, from, to); len(events) != 0 { + if events := pairPlanetScale(t, p, from, to); len(events) != 0 { t.Fatalf("%d events, want none: %s", len(events), events[0].Description) } p.Keep = nil var removed []string - for _, e := range replayPlanetScale(t, p, from, to) { + for _, e := range pairPlanetScale(t, p, from, to) { if e.Breaking && e.Subject.Kind == event.KindOperation && strings.HasSuffix(e.Description, " removed.") { removed = append(removed, e.Subject.Operation) } diff --git a/plugins/openapi/sentry_test.go b/plugins/openapi/sentry_test.go index 6e02f4f..80b8b0c 100644 --- a/plugins/openapi/sentry_test.go +++ b/plugins/openapi/sentry_test.go @@ -80,12 +80,12 @@ func sentryPlugin(t *testing.T) (Plugin, string) { return Plugin{Adapter: a, Diff: sentryDiff, Keep: sentryKeep}, srv.URL + "/raw/getsentry/sentry-api-schema" } -func replaySentry(t *testing.T, p Plugin, pairs ...[2]string) []event.Event { +func pairSentry(t *testing.T, p Plugin, pairs ...[2]string) []event.Event { t.Helper() s := openStore(t) for _, pair := range pairs { if rejected, err := kittest.Pair(context.Background(), vercelEnv(s), s, p, pair[0], pair[1]); err != nil || rejected { - t.Fatalf("replay %s -> %s: rejected=%v err=%v", pair[0], pair[1], rejected, err) + t.Fatalf("pair %s -> %s: rejected=%v err=%v", pair[0], pair[1], rejected, err) } } return kittest.Stored(t, s) @@ -105,7 +105,7 @@ func replaySentry(t *testing.T, p Plugin, pairs ...[2]string) []event.Event { // Each event cites the description, in the commit's file. func TestSentryGolden(t *testing.T) { p, base := sentryPlugin(t) - events := replaySentry(t, p, + events := pairSentry(t, p, [2]string{"ead7f0cf9ccb8ac817105ac11bb94fe316fcb337", "4650a66a859e015cccef2c171b115633321768e9"}, [2]string{"d64149d65723484ca4d34c956ad017a66e1a4e07", "c2f638f601baadcb055aec4ca3c2ba9f2654c087"}, [2]string{"47231e6180b34f222ed462b1d0cb3cdb951cc4e7", "1da1f31fac696201b1a7d20046fc199c8b1324b6"}, @@ -152,11 +152,11 @@ func TestSentryGolden(t *testing.T) { // date both deprecations 2026-06-16. func TestSentryFlagAfterWordsIsNotNew(t *testing.T) { p, _ := sentryPlugin(t) - if events := replaySentry(t, p, [2]string{"0.223.0", "0.224.0"}); len(events) != 0 { + if events := pairSentry(t, p, [2]string{"0.223.0", "0.224.0"}); len(events) != 0 { t.Fatalf("%d events, want none", len(events)) } p.Diff.DeprecatedDescription = nil - events := replaySentry(t, p, [2]string{"0.223.0", "0.224.0"}) + events := pairSentry(t, p, [2]string{"0.223.0", "0.224.0"}) var ops []string for _, e := range events { if strings.HasSuffix(e.SourcePointer, "/description") || !strings.Contains(e.SourceExcerpt, `"deprecated":true`) { @@ -174,7 +174,7 @@ func TestSentryFlagAfterWordsIsNotNew(t *testing.T) { type rawSentry struct{} func (rawSentry) API() string { return "sentry/api" } -func (rawSentry) LatestTag(context.Context) (string, error) { return "", fmt.Errorf("replay only") } +func (rawSentry) LatestTag(context.Context) (string, error) { return "", fmt.Errorf("pairs only") } func (rawSentry) Fetch(_ context.Context, tag string) (adapter.Spec, error) { body, err := os.ReadFile(sentryFile(tag)) return adapter.Spec{Content: body, Version: sentryTags[tag][:10], SourceURL: "https://example.invalid/" + tag}, err @@ -187,14 +187,14 @@ func (rawSentry) Fetch(_ context.Context, tag string) (adapter.Spec, error) { // rule that kept removals of deprecated operations would report it shut down. func TestSentryBasePathMoveIsNoChange(t *testing.T) { p, base := sentryPlugin(t) - if events := replaySentry(t, p, [2]string{"2.0.1", "2.1.0"}); len(events) != 0 { + if events := pairSentry(t, p, [2]string{"2.0.1", "2.1.0"}); len(events) != 0 { t.Fatalf("%d events, want none", len(events)) } // Unfiltered, what the move leaves is a few property changes, and every // pointer names a node in the file as published, without /api/0. p.Keep = nil - for _, e := range replaySentry(t, p, [2]string{"2.0.1", "2.1.0"}) { + for _, e := range pairSentry(t, p, [2]string{"2.0.1", "2.1.0"}) { if e.ChangeType == event.ChangeTypeBreaking && e.Subject.Kind == event.KindOperation { t.Errorf("unfiltered: %s %s", e.ChangeType, e.Subject.Operation) } @@ -207,7 +207,7 @@ func TestSentryBasePathMoveIsNoChange(t *testing.T) { // As published: every operation of 2.0.1 removed. raw := Plugin{Adapter: rawSentry{}, Diff: sentryDiff} var removed []string - for _, e := range replaySentry(t, raw, [2]string{"2.0.1", "2.1.0"}) { + for _, e := range pairSentry(t, raw, [2]string{"2.0.1", "2.1.0"}) { if e.ChangeType == event.ChangeTypeBreaking && e.Subject.Kind == event.KindOperation { removed = append(removed, e.Subject.Operation) } @@ -216,7 +216,7 @@ func TestSentryBasePathMoveIsNoChange(t *testing.T) { t.Errorf("as published: removed %v, want the 5 operations of the saved 2.0.1", removed) } raw.Keep = deprecationsOnly(sentryDiff) - events := replaySentry(t, raw, [2]string{"2.0.1", "2.1.0"}) + events := pairSentry(t, raw, [2]string{"2.0.1", "2.1.0"}) if len(events) != 1 || events[0].Subject.Operation != "GET /api/0/projects/{organization_id_or_slug}/{project_id_or_slug}/issues/" || !events[0].Breaking { t.Errorf("as published, removals of deprecated operations: %d events, want GET .../issues/ removed", len(events)) } @@ -234,12 +234,12 @@ func TestSentryDeprecationWordsThatArentDeprecations(t *testing.T) { {"e8ec23b4c9601dea2d51205983ec1d7b89550b85", "1ef7f21a0501fae9490d69e3ae29f0d5acbfb61c"}, } p, _ := sentryPlugin(t) - if events := replaySentry(t, p, pairs...); len(events) != 0 { + if events := pairSentry(t, p, pairs...); len(events) != 0 { t.Fatalf("%d events, want none: %v", len(events), events[0].Subject.Operation) } loose := regexp.MustCompile(`(?i)deprecat`) p.Diff.DeprecatedDescription = loose.MatchString - if events := replaySentry(t, p, pairs...); len(events) != 2 { + if events := pairSentry(t, p, pairs...); len(events) != 2 { t.Errorf("matching %q: %d events, want the 2 wrong ones", loose, len(events)) } } diff --git a/plugins/openapi/supabase_test.go b/plugins/openapi/supabase_test.go index 52d0f27..d2497ad 100644 --- a/plugins/openapi/supabase_test.go +++ b/plugins/openapi/supabase_test.go @@ -62,7 +62,7 @@ func supabasePlugin(latest string) Plugin { // Management API spec's history. On 2025-02-19, POST // /v1/projects/{ref}/functions ("This endpoint is deprecated - use the deploy // endpoint."), here as a daily ingest. On 2026-06-29, GET -// /v1/projects/{ref}/analytics/endpoints/logs.all, the replay fixture: the +// /v1/projects/{ref}/analytics/endpoints/logs.all, the pair fixture: the // flag alone, no reason yet. (On 2026-09-30 its description became "This // endpoint has been removed and always responds with `410 Gone`", with the // operation still in the spec: a change of words, which no diff sees.) @@ -76,7 +76,7 @@ func TestSupabaseGolden(t *testing.T) { } } if rejected, err := kittest.Pair(ctx, env, s, supabasePlugin(""), "693bdc38", "eb21ae25"); err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } events := kittest.Stored(t, s) @@ -124,7 +124,7 @@ func TestSupabaseDropsRemovalsThatWerentDeprecated(t *testing.T) { ctx := context.Background() s := openStore(t) if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, supabasePlugin(""), "8aef4a08", "90b71e3e"); err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } if events := kittest.Stored(t, s); len(events) != 0 { t.Fatalf("stored %d events, want none", len(events)) diff --git a/plugins/openapi/vercel_test.go b/plugins/openapi/vercel_test.go index 9293627..9f76e86 100644 --- a/plugins/openapi/vercel_test.go +++ b/plugins/openapi/vercel_test.go @@ -58,7 +58,7 @@ func vercelEnv(s *kittest.Mem) plugin.Env { // Domains API is now deprecated. ... Sunset date: 2025-11-09." // (vercel.com/changelog/new-domains-registrar-api-for-domain-search-pricing-purchase-and-management). // v1.18.7 (2026-01-09) removed two of them; both now answer "This endpoint has -// been sunsetted on November 9, 2025." The second pair is the replay fixture: +// been sunsetted on November 9, 2025." The second pair is the pair fixture: // one real historical breaking change. The same release added the five // /v1/connect/networks operations, which the filter drops, saved here as one. func TestVercelGolden(t *testing.T) { @@ -72,9 +72,9 @@ func TestVercelGolden(t *testing.T) { t.Fatalf("run %s: rejected=%v err=%v", tag, rejected, err) } } - // The removal, replayed. + // The removal, as a pair. if rejected, err := kittest.Pair(ctx, env, s, vercelPlugin(""), "v1.18.6", "v1.18.7"); err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } events := kittest.Stored(t, s) @@ -116,12 +116,12 @@ func TestVercelGolden(t *testing.T) { kittest.Golden(t, "testdata/golden/vercel.json", events) - // Replaying the same pair again must not duplicate the events. + // Reading the same pair again must not duplicate the events. if _, err := kittest.Pair(ctx, env, s, vercelPlugin(""), "v1.18.6", "v1.18.7"); err != nil { - t.Fatalf("second replay: %v", err) + t.Fatalf("second read of the pair: %v", err) } if again := kittest.Stored(t, s); len(again) != len(events) { - t.Errorf("repeating the replay added events: %d -> %d", len(events), len(again)) + t.Errorf("reading the pair again added events: %d -> %d", len(events), len(again)) } } @@ -154,7 +154,7 @@ func TestVercelDropsRemovalsThatWerentDeprecated(t *testing.T) { ctx := context.Background() s := openStore(t) if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, vercelPlugin(""), "v1.6.2", "v1.6.3"); err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } if events := kittest.Stored(t, s); len(events) != 0 { for _, e := range events { @@ -178,7 +178,7 @@ func TestVercelDropsRemovalsThatWerentDeprecated(t *testing.T) { } } if removals == 0 { - t.Error("unfiltered replay removes no /v1/log-drains operation; the fixture no longer shows the noise") + t.Error("unfiltered pair removes no /v1/log-drains operation; the fixture no longer shows the noise") } } @@ -189,7 +189,7 @@ func TestVercelPathParameterRenameIsNoChange(t *testing.T) { ctx := context.Background() s := openStore(t) if rejected, err := kittest.Pair(ctx, vercelEnv(s), s, vercelPlugin(""), "v1.28.64", "v1.28.65"); err != nil || rejected { - t.Fatalf("replay: rejected=%v err=%v", rejected, err) + t.Fatalf("pair: rejected=%v err=%v", rejected, err) } if events := kittest.Stored(t, s); len(events) != 0 { for _, e := range events { diff --git a/providers/appwrite.md b/providers/appwrite.md index c03f918..0d5e8e2 100644 --- a/providers/appwrite.md +++ b/providers/appwrite.md @@ -38,7 +38,7 @@ Kind: `openapi` (`plugins/openapi`), with `adapter.Appwrite`. - **Removals, all of them,** even of deprecated operations. Read as the plugin reads it (139 commits on `main`), 78 operations left the server operations (from the spec, or from the `server` platform). Only one had been flagged first, and it was a path move: `PATCH .../attributes/{key}/relationship` became `.../attributes/relationship/{key}` on 2026-03-20. 13 are back now: on 2026-10-12, `06e6fafa` took `server` off 13 operations of 2.4.x's single document ("listed server and client methods no released SDK ships yet"), and 2.5.x had them on `server` again the next day. Nothing in the spec says when an operation stops answering. - **Request and response property changes, and new operations.** - Over the 139 commits this keeps 14 events, all on 2026-06-24 (`7d74bf9f`): the six `/v1/databases/transactions` operations and the `longtext`, `mediumtext`, `text` and `varchar` attribute operations, each replaced by a `tablesDB` method. None is a rename or has a live method, so the filter drops none of them. -- **Replays** a pair of commits (`Replay`, as the golden test does from `8c00ba35` to `7d74bf9f`). A tag can name an older minor's directory, `1.7.x@`, as the rename test does. The pinned drop test is the 2.4.x pair (13 removals, no event). A single document where no operation is on `server` (the platforms gone or renamed) fails the fetch, rather than read as nothing deprecated. +- **Reads** a pair of commits (a version pair, as the golden test does from `8c00ba35` to `7d74bf9f`). A tag can name an older minor's directory, `1.7.x@`, as the rename test does. The pinned drop test is the 2.4.x pair (13 removals, no event). A single document where no operation is on `server` (the platforms gone or renamed) fails the fetch, rather than read as nothing deprecated. ## Known gaps diff --git a/providers/convex.md b/providers/convex.md index b6c0d34..b8898c8 100644 --- a/providers/convex.md +++ b/providers/convex.md @@ -38,7 +38,7 @@ Kind: `openapi` (`plugins/openapi`), with `adapter.Convex`. - **Request and response property changes,** and new operations. Over the history the differ finds 18 property removals, 16 type changes, 10 schema removals and 3 properties no longer required, most of them in the data sync, usage-limit and S3 export APIs. The drop test is one of them: on 2026-07-14 (`3ead9091`, "Remove name from usage limits") the optional `name` left the usage-limit request and response; the commit says it "was never editable in the UI (always `None` on create, only echoed back)", and the request type at that commit doesn't reject unknown fields, so a caller still sending it isn't refused. - **Removals of operations that were never deprecated.** None in the history: no operation has left the spec. - Over the 68 commits this keeps 6 events, all deprecations on 2026-11-05: `GET /api/v1/list_log_streams`, `GET /api/v1/get_log_stream/{id}`, `POST /api/v1/create_log_stream`, `POST /api/v1/update_log_stream/{id}`, `POST /api/v1/delete_log_stream/{id}`, `POST /api/v1/rotate_webhook_secret/{id}`. -- **Replays** a historical pair (`Replay`, from `f35879bb` to `5e5159cb`) and recreates those six; the golden test also runs them as a daily ingest. The drop test replays `3f6edf7a` to `3ead9091`. +- **Reads** a historical pair (a version pair, `f35879bb` → `5e5159cb`) and recreates those six; the golden test also runs them as a daily ingest. The drop test replays `3f6edf7a` to `3ead9091`. ## Known gaps diff --git a/providers/datadog.md b/providers/datadog.md index 3e70326..56befde 100644 --- a/providers/datadog.md +++ b/providers/datadog.md @@ -24,7 +24,7 @@ Kind: `openapi` (`plugins/openapi`), with `adapter.Datadog`. - Reads: the v2 spec at the newest tag, diffed against the last one. - Ignores: changes to OpenAPI `tags` (they only rename generated SDK methods; the REST API is unchanged). The v1 spec isn't read yet. -- Replays a historical pair (`Replay`, from `2.60.0` to `2.61.0`) and recreates the removal of two properties from `TagIndexingRuleDynamicTags` (the golden test uses trimmed excerpts of both specs). +- Reads a historical pair (a version pair, `2.60.0` → `2.61.0`) and recreates the removal of two properties from `TagIndexingRuleDynamicTags` (the golden test uses trimmed excerpts of both specs). ## Known gaps diff --git a/providers/elasticsearch.md b/providers/elasticsearch.md index 37147c7..72667ba 100644 --- a/providers/elasticsearch.md +++ b/providers/elasticsearch.md @@ -42,7 +42,7 @@ Kind: `openapi` (`plugins/openapi`), with `adapter.Elasticsearch`. - **History:** over 8.14 to 9.6, this keeps 26 events. - **23 deprecations.** For example, the rollup and legacy `_template` endpoints (8.17), `/_application/analytics` (9.0), and `POST /_ml/anomaly_detectors/{job_id}/_flush` (9.1). - **3 removals, in 9.0:** GET and POST `/{index}/_knn_search`, and POST `/{index}/_unfreeze`. -- **Replays** 8.19 → 9.0 in the golden test. The drop test replays 9.1 → 9.2. +- **Reads** 8.19 → 9.0 in the golden test. The drop test replays 9.1 → 9.2. ## Known gaps diff --git a/providers/gitlab.md b/providers/gitlab.md index 354a9c6..e068267 100644 --- a/providers/gitlab.md +++ b/providers/gitlab.md @@ -24,7 +24,7 @@ Kind: `openapi` (`plugins/openapi`), with `adapter.GitLab` and a request-side fi - **Response-side changes are dropped.** Between 18.11 and 19.0 the generator retyped hundreds of response properties (default `string` to the real type) while GitLab returned the same JSON; reporting them would be wrong pull requests. Precision over recall: only request-side changes are kept. - Request bodies are named by a hash of their content (`RequestBody_`), so adding one field renames the schema. The adapter inlines those bodies back under their operations, and each event's pointer still names the node in the published file. - Release candidates are skipped; tags are sorted numerically. -- The OpenAPI 3 file exists from `v18.10.0-ee`; 19.0 is the first major release that can be replayed (`Replay` from `v18.11.0-ee` to `v19.0.0-ee`). +- The OpenAPI 3 file exists from `v18.10.0-ee`; 19.0 is the first major release that can be replayed (the pair `v18.11.0-ee` → `v19.0.0-ee`). ## Known gaps diff --git a/providers/neon.md b/providers/neon.md index ce45f7e..91ffd93 100644 --- a/providers/neon.md +++ b/providers/neon.md @@ -40,7 +40,7 @@ Kind: `openapi` (`plugins/openapi`), with `adapter.Neon`. - **`x-sunset` dates and "Removal scheduled" words:** quoted in the deprecation's excerpt, but not events of their own, since the operations outlive them. - **Request and response property changes, and new operations.** - **History:** over the 23 commits this keeps 1 event: the deprecation of `POST /projects/{project_id}/branches/{branch_id}/auth/send_test_email` (beta) on 2026-08-23. The other 15 deprecated operations were already flagged in the first commit. -- **Replays** a historical pair (`Replay`, from `5c57d009` to `93b93dc9`) and recreates that deprecation (the golden test). The drop test replays `4c6b3be4` to `4497de89`, the `recover` removal. +- **Reads** a historical pair (a version pair, `5c57d009` → `93b93dc9`) and recreates that deprecation (the golden test). The drop test replays `4c6b3be4` to `4497de89`, the `recover` removal. - **A kept removal:** none happened in neon-pkgs's history, so a test replays the same spec from `@neondatabase/api-client` 2.7.2 to 2.7.3 (a different source, used only for this test): `GET /consumption_history/account`, deprecated and then removed, the removal Neon's changelog announced. That's one breaking event. ## Known gaps diff --git a/providers/planetscale.md b/providers/planetscale.md index 40c2ae0..9a54a6f 100644 --- a/providers/planetscale.md +++ b/providers/planetscale.md @@ -40,7 +40,7 @@ Kind: `openapi` (`plugins/openapi`), with `adapter.PlanetScale`. - **Removals of operations that were never deprecated.** 41 in the history: 1 on 2026-06-01, 7 on 2026-10-03, 17 on 2026-10-14, 7 on 2026-10-23, 9 on 2026-11-09. On 2026-10-03, 6 of them were the read-only replica operations, renamed to dedicated read replicas, and on 2026-11-19 planetscale-go's `main` still sends `.../read-only-replicas` ("the deprecated read-only-replicas path", in its own words). Leaving the spec isn't the same as stopping working. - **Request and response property changes, and new operations.** The history has 216 new operations, and the property side is noisy: 226 type changes on 2025-12-06 alone, when whole numbers became `integer`. - Over the 31 consecutive pairs this keeps 5 events, all deprecations on 2026-11-09 (`fc13e09d`): `GET` and `DELETE .../bouncers/{bouncer}/resizes`, `GET .../neki-changes`, `GET` and `DELETE .../neki-changes/{id}`. A pattern matching "deprecat" anywhere in the description finds the same 5. -- **Replays** a historical pair (`Replay`, from `e631095a` to `fc13e09d`) and recreates those 5. The drop test replays `b49c3540` to `f6d6ad4d` (the replica rename): no event, where the same pair unfiltered reports the 7 removals. +- **Reads** a historical pair (a version pair, `e631095a` → `fc13e09d`) and recreates those 5. The drop test replays `b49c3540` to `f6d6ad4d` (the replica rename): no event, where the same pair unfiltered reports the 7 removals. ## Known gaps diff --git a/providers/redis.md b/providers/redis.md index f118c89..fb28c52 100644 --- a/providers/redis.md +++ b/providers/redis.md @@ -25,10 +25,10 @@ Kind: `catalog` (`plugins/catalog`), new in this change — no existing format p ## What the plugin reads and ignores -- Reads: `commands.json` at the newest commit, diffed against the last one stored (or two given commits, to replay). A name present before and missing after becomes a `breaking` `package_release` event (`change: removed_symbol`); the excerpt quotes the entry's own JSON from the snapshot where it still existed. +- Reads: `commands.json` at the newest commit, compared with the commit read before it. A name present before and missing after becomes a `breaking` `package_release` event (`change: removed_symbol`); the excerpt quotes the entry's own JSON from the snapshot where it still existed. - Ignores: everything else about a command (arguments, flags, complexity, ACL categories) — only presence is diffed. A name that's only *added* is not an event. A rename is read as one removal, since nothing in the catalog says a disappearance and an appearance are the same command; guessing that would trade precision for recall. - The live `deprecated_since` / `replaced_by` fields on still-present commands aren't read yet (see "Known gaps"): they're deprecations, not removals, and every one of them already works forever regardless. -- Replays a historical pair (`Replay`, from commit `cc0427b` to `06f3598`) and recreates the real removal of `FUNCTION CREATE` and `FUNCTION INFO` (the golden test uses trimmed excerpts of both commits' `commands.json`, alongside `GET`, unchanged, as the drop-test fixture). +- Reads a historical pair (a version pair, commit `cc0427b` → `06f3598`) and recreates the real removal of `FUNCTION CREATE` and `FUNCTION INFO` (the golden test uses trimmed excerpts of both commits' `commands.json`, alongside `GET`, unchanged, as the drop-test fixture). ## Known gaps diff --git a/providers/sentry.md b/providers/sentry.md index 0d7a4af..06914d5 100644 --- a/providers/sentry.md +++ b/providers/sentry.md @@ -47,7 +47,7 @@ Kind: `openapi` (`plugins/openapi`), with `adapter.Sentry`. - Compared as published, 446 operations left the spec: the 289 more are the 2026-11-13 move of `/api/0`, `GET .../issues/` and `POST .../user-feedback/` among them, both flagged deprecated. A rule keeping removals of deprecated operations would report those two shut down. - **Property changes, and new operations.** - **History:** 13 events over the whole history, all deprecations: the 13 above, none withdrawn. By the flag alone it would be 3, two of them dated 2026-06-16 instead of 2024 and 2025. -- **Replays** the three description deprecations in the golden test (sentry-api-schema commits `ead7f0cf` → `4650a66a`, `d64149d6` → `c2f638f6`, `47231e61` → `1da1f31f`). The drop test replays `2.0.1` → `2.1.0`, the `/api/0` move. Other tests replay `0.223.0` → `0.224.0` (the flag after the words) and the two commits that added the "deprecation" wording that isn't a deprecation. +- **Reads** the three description deprecations in the golden test (sentry-api-schema commits `ead7f0cf` → `4650a66a`, `d64149d6` → `c2f638f6`, `47231e61` → `1da1f31f`). The drop test replays `2.0.1` → `2.1.0`, the `/api/0` move. Other tests replay `0.223.0` → `0.224.0` (the flag after the words) and the two commits that added the "deprecation" wording that isn't a deprecation. ## Known gaps diff --git a/providers/stripe.md b/providers/stripe.md index 9fde42b..2f385a7 100644 --- a/providers/stripe.md +++ b/providers/stripe.md @@ -24,7 +24,7 @@ Kind: `openapi` (`plugins/openapi`), with `adapter.Stripe` and the changelog hin - Reads: the whole spec at the newest tag, diffed against the last one it saw (`core/diff/`, `core/normalize/`). `$ref`s are never followed: a change inside a shared schema is reported once, on that schema, not once per endpoint that uses it. - Hints: for each breaking event, the changelog entry for that version whose "REST API" table names the same parameter and operation; the entry's "What's new" text and link become `migration_hint`. An entry describing an addition never explains a removal, and the reverse. -- Replays a historical pair (`Replay`, from `v207` to `v208`) and recreates the 2022-11-15 change (38 events, 36 breaking). +- Reads a historical pair (a version pair, `v207` → `v208`) and recreates the 2022-11-15 change (38 events, 36 breaking). - `latest/openapi.spec3.json` can lag a version bump by several tags; the plugin follows the file, not the release notes. ## Known gaps diff --git a/providers/supabase.md b/providers/supabase.md index 880226e..8d096bd 100644 --- a/providers/supabase.md +++ b/providers/supabase.md @@ -35,7 +35,7 @@ Kind: `openapi` (`plugins/openapi`), with `adapter.Supabase`. - **Removals of operations that were never deprecated.** 22 operations left the spec in its history, none deprecated first: 14 analytics warehouse operations on 2024-07-15, 7 path-parameter renames, and one that came back 12 days later. Without credentials every route answers `401`, made-up ones included, so whether a removed one still works can't be checked from outside. - **Request and response property changes, and new operations.** - Over the 90 commits this keeps 2 events, both deprecations: `POST /v1/projects/{ref}/functions` (2025-02-19) and `GET /v1/projects/{ref}/analytics/endpoints/logs.all` (2026-06-29). -- **Replays** a historical pair (`Replay`, from `693bdc38` to `eb21ae25`) and recreates the `logs.all` deprecation. The golden test also runs the `functions` deprecation as a daily ingest. The drop tests replay the warehouse removal and the branch path-parameter rename. +- **Reads** a historical pair (a version pair, `693bdc38` → `eb21ae25`) and recreates the `logs.all` deprecation. The golden test also runs the `functions` deprecation as a daily ingest. The drop tests replay the warehouse removal and the branch path-parameter rename. ## Known gaps diff --git a/providers/vercel.md b/providers/vercel.md index 2e16b65..1b01fc9 100644 --- a/providers/vercel.md +++ b/providers/vercel.md @@ -36,7 +36,7 @@ Kind: `openapi` (`plugins/openapi`), with `adapter.Vercel`. - **Request properties.** 478 breaking request-property changes, most of them union members compared by position as their order moved. Outside unions there were 142, and 27 of those reverted later. - **New operations.** Nobody has to fix code for a new endpoint. - Over the 207 releases, this keeps 26 events: 22 deprecations, and the removal of the four Legacy Domains operations, all four of which Vercel shut down. -- **Replays** a historical pair (`Replay`, from `v1.18.6` to `v1.18.7`) and recreates the removal of `GET /v4/domains/price` and `GET /v4/domains/status`. The golden test also runs the deprecation of all four operations (`v1.13.4` to `v1.13.5`). The drop tests replay an unmarked removal (`v1.6.2` to `v1.6.3`) and the path-parameter rename (`v1.28.64` to `v1.28.65`). +- **Reads** a historical pair (a version pair, `v1.18.6` → `v1.18.7`) and recreates the removal of `GET /v4/domains/price` and `GET /v4/domains/status`. The golden test also runs the deprecation of all four operations (`v1.13.4` to `v1.13.5`). The drop tests replay an unmarked removal (`v1.6.2` to `v1.6.3`) and the path-parameter rename (`v1.28.64` to `v1.28.65`). ## Known gaps From ad2ecef706ade3aa0d329f2adee7f77bf9325fdc Mon Sep 17 00:00:00 2001 From: adssib <75389300+adssib@users.noreply.github.com> Date: Fri, 20 Nov 2026 19:14:19 -0500 Subject: [PATCH 6/7] the last two replay comments Co-Authored-By: Claude Opus 5.5 Signed-off-by: adssib <75389300+adssib@users.noreply.github.com> --- plugins/catalog/catalog_test.go | 2 +- plugins/openapi/adapter/gitlab.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/catalog/catalog_test.go b/plugins/catalog/catalog_test.go index c827f76..c700cce 100644 --- a/plugins/catalog/catalog_test.go +++ b/plugins/catalog/catalog_test.go @@ -38,7 +38,7 @@ func fixturePages() kittest.Pages { // commands.json at those two commits (checked 2026-11-18). Between them, // FUNCTION CREATE and FUNCTION INFO disappear, FUNCTION LOAD appears, and GET // (an unrelated, long-lived command) is unchanged. This is the pair the -// plugin's Replay from oldRef to newRef recreates. +// version pair oldRef → newRef (ReadAt both, Extract) recreates. func TestPairRecreatesTheRealFunctionCommandRemoval(t *testing.T) { ctx := context.Background() s := kittest.NewMem() diff --git a/plugins/openapi/adapter/gitlab.go b/plugins/openapi/adapter/gitlab.go index 95b6191..461ddf1 100644 --- a/plugins/openapi/adapter/gitlab.go +++ b/plugins/openapi/adapter/gitlab.go @@ -101,7 +101,7 @@ func (g GitLab) LatestTag(ctx context.Context) (string, error) { // (checked v18.11.0-ee and v19.0.0-ee, 2026-11-15), which can't tell two // releases apart. The bare version is also what a self-managed instance // reports and what patch-it's package gate can read; it refuses "v19.0.0-ee". -// A tag that isn't a release (a branch, for a replay) is its own version. +// A tag that isn't a release (a branch, read as a version) is its own version. func (g GitLab) Fetch(ctx context.Context, tag string) (Spec, error) { url := fmt.Sprintf(cmp.Or(g.SpecURLTemplate, gitlabSpecURLTemplate), tag) body, err := fetch.Get(ctx, url, nil) From ed940de837dcfacc582be59a6eda3fe85610cc47 Mon Sep 17 00:00:00 2001 From: adssib <75389300+adssib@users.noreply.github.com> Date: Fri, 20 Nov 2026 19:14:27 -0500 Subject: [PATCH 7/7] catalog test comment reads as a sentence Co-Authored-By: Claude Opus 5.5 Signed-off-by: adssib <75389300+adssib@users.noreply.github.com> --- plugins/catalog/catalog_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/catalog/catalog_test.go b/plugins/catalog/catalog_test.go index c700cce..e904e23 100644 --- a/plugins/catalog/catalog_test.go +++ b/plugins/catalog/catalog_test.go @@ -37,8 +37,8 @@ func fixturePages() kittest.Pages { // and redis-doc-06f3598.json are real, trimmed excerpts of redis-doc's // commands.json at those two commits (checked 2026-11-18). Between them, // FUNCTION CREATE and FUNCTION INFO disappear, FUNCTION LOAD appears, and GET -// (an unrelated, long-lived command) is unchanged. This is the pair the -// version pair oldRef → newRef (ReadAt both, Extract) recreates. +// (an unrelated, long-lived command) is unchanged: the version pair +// oldRef → newRef, read with ReadAt and Extract. func TestPairRecreatesTheRealFunctionCommandRemoval(t *testing.T) { ctx := context.Background() s := kittest.NewMem()