Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
edfa24b
plugin: a version can say which version of another source it pins
adssib Nov 21, 2026
22c5511
list every major's removed-members guide from PyPI, no pinned release
adssib Nov 21, 2026
0ca1e7c
redis: read the commands at each release tag of redis/redis
adssib Nov 21, 2026
955c5bb
openapi: add openai/api, cloudflare/api-spec and mongodb/atlas-admin-…
adssib Nov 21, 2026
c0b0bfb
notices: a living page that can't be read fails the run; salesforce f…
adssib Nov 21, 2026
f3131ab
convex: read from the convex org, not the get-convex redirect
adssib Nov 21, 2026
7f09c1c
changelog: read SDK changelogs, release notes and tag-listed releases
adssib Nov 21, 2026
bc122d6
add the stripe sdk changelog sources
adssib Nov 21, 2026
bd302f5
add the sentry sdk changelog sources
adssib Nov 21, 2026
abc91ca
add the cloudflare sdk and terraform changelog sources
adssib Nov 21, 2026
1b60a10
add the octokit, ioredis and posthog-go changelog sources
adssib Nov 21, 2026
1c95caf
add google/gemini-models: the Gemini API's model shutdown table
adssib Nov 21, 2026
d6f3b35
add google/vertex-model-retirements: Vertex AI's model retirement tables
adssib Nov 21, 2026
f82d040
add github/graphql: announced GraphQL removals, commit by commit
adssib Nov 21, 2026
894fdd2
changelog: follow renames to their end; names alone only under removed
adssib Nov 21, 2026
3533785
github/graphql: the golden is three consecutive pairs
adssib Nov 21, 2026
1e985f4
Merge branch 'pl4-changelog-reader' into pl4-changelog-stripe
adssib Nov 21, 2026
387bedd
Merge branch 'pl4-changelog-stripe' into pl4-changelog-sentry
adssib Nov 21, 2026
04e889b
Merge branch 'pl4-changelog-sentry' into pl4-changelog-cloudflare
adssib Nov 21, 2026
ebd7fbf
cloudflare/typescript: pin 7.1.0, whose rename is plain
adssib Nov 21, 2026
f8c9064
Merge branch 'pl4-changelog-cloudflare' into pl4-changelog-more
adssib Nov 21, 2026
417a120
octokit: renames followed to their end; octokit-net pins 0.5.2
adssib Nov 21, 2026
0801380
changelog: a deprecation's replacement isn't followed as a rename
adssib Nov 21, 2026
f1b7cd1
Merge branch 'pl4-changelog-reader' into pl4-changelog-stripe
adssib Nov 21, 2026
5d69c5a
Merge branch 'pl4-changelog-stripe' into pl4-changelog-sentry
adssib Nov 21, 2026
90c5d49
Merge branch 'pl4-changelog-sentry' into pl4-changelog-cloudflare
adssib Nov 21, 2026
c452153
Merge branch 'pl4-changelog-cloudflare' into pl4-changelog-more
adssib Nov 21, 2026
587a34d
github/graphql: version is the removal date, so a restored entry isn'…
adssib Nov 21, 2026
0459a27
github/graphql: check the test's reads; say what the version pair means
adssib Nov 21, 2026
d6f0e7d
apisurface: read 14 more PyPI packages, and read fewer false removals
adssib Nov 21, 2026
8630bc7
apisurface: read npm packages from their typescript declarations
adssib Nov 21, 2026
8ee0861
apisurface: convex-js lives in the convex org
adssib Nov 21, 2026
b456318
apisurface: urllib3's golden fingerprints for its python-surface id
adssib Nov 21, 2026
a6a11f9
apisurface: a required parameter in an optional one's place is a note
adssib Nov 21, 2026
3bac535
Merge remote-tracking branch 'origin/pl4-changelog-all' into pl-all-s…
adssib Nov 21, 2026
6c9744d
Merge remote-tracking branch 'origin/pl5-all' into pl-all-sources
adssib Nov 21, 2026
54e521f
Merge remote-tracking branch 'origin/pl4-sources' into pl-all-sources
adssib Nov 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ core/event/ the change event of patch-it's contract: types, fingerpri
core/diff/ core/normalize/ core/hint/ the OpenAPI diff engine and its helpers
plugins/<kind>/ one package per kind, with its providers: openapi (+ adapter/, one spec adapter
per provider), notices (+ retire/, feed/, eol/), migrationguide (+ sdkguide/,
members/), changelog (Markdown, RST or JSON), catalog, apisurface (+ pysurface/);
members/), changelog (Markdown, RST, GitHub release notes or JSON), catalog, apisurface (+ pysurface/, dtsurface/);
plugins/all imports every one
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)
Expand Down
173 changes: 131 additions & 42 deletions cmd/new-plugin/formats.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var defaultReaders = map[string]string{
"notices": "deprecations",
"migrationguide": "sdk",
"changelog": "markdown",
"apisurface": "pypi", // npm when a --package is npm:
}

var formats = map[string]formatSpec{
Expand Down Expand Up @@ -159,16 +160,15 @@ func {{.Lower}}Ingest(t *testing.T, file string) []event.Event {
defDir: "plugins/migrationguide/sdkguide",
def: `package sdkguide

// {{.Ident}} is {{.Provider}}'s SDK guide to a major release (MIGRATION.md at
// the release tag).
// {{.Ident}} is {{.Provider}}'s SDK guide to each major release (MIGRATION.md
// at the major's first tag), its releases listed from PyPI.
//
// ` + todo + `: the PyPI name, the repo, the major release and the calls the
// guide's table names. Say what you checked, with the date.
// ` + todo + `: the PyPI name, the repo and the calls the guide's table
// names. Say what you checked, with the date.
var {{.Ident}} = Guide{
API: "{{.ID}}",
Package: "{{.PyPI}}",
Repo: "TODO-owner/TODO-repo",
Major: 1,
Methods: "` + "`TODO.create()`" + `",
Symbols: []string{"TODO.create"},
}
Expand Down Expand Up @@ -216,9 +216,10 @@ const {{.Lower}}Previous = "0.0.0"

// {{.Lower}}Ingest is the version pair {{.Lower}}Previous -> the guide's
// major over a saved copy of the guide.
// ` + todo + `: the major the saved guide is for.
func {{.Lower}}Ingest(t *testing.T, file string) []event.Event {
t.Helper()
g := sdkguide.{{.Ident}}
g := sdkguide.{{.Ident}}.At(1)
env := kittest.Env(t, kittest.Pages{g.URL(): file})
return kittest.Versions(t, env, Plugin{Guide: g},
plugin.Version{ID: {{.Lower}}Previous, Ref: "v" + {{.Lower}}Previous}, plugin.Version{ID: g.Version(), Ref: "v" + g.Version()})
Expand All @@ -233,19 +234,19 @@ func {{.Lower}}Ingest(t *testing.T, file string) []event.Event {
defDir: "plugins/migrationguide/members",
def: `package members

// {{.Ident}} is {{.Provider}}'s migration guide to a release, with its table
// of removed members.
// {{.Ident}} is {{.Provider}}'s migration guide to each major, with its table
// of removed members, read at the major's first tag.
//
// ` + todo + `: the package, how the guide writes the module, the release,
// the repo, the guide's path at the release tag and the heading the table is
// under. Say what you checked, with the date.
// ` + todo + `: the package, how the guide writes the module, the repo, the
// guide's path at a major's tag ({major} for its number, {prev} for the one
// before) and the heading the table is under. Say what you checked, with the
// date.
var {{.Ident}} = Guide{
API: "{{.ID}}",
Package: "{{.PyPI}}",
Module: "{{.Module}}",
Release: "1.0.0",
Repo: "TODO-owner/TODO-repo",
Path: "TODO/migration_guide.rst",
Path: "TODO/migration_guide_{major}.rst",
Section: "Removed members",
}
`,
Expand Down Expand Up @@ -300,13 +301,17 @@ func Test{{.Ident}}DropsANonChange(t *testing.T) {
// ` + todo + `: the real release before it.
const {{.Lower}}Previous = "0.0.0"

// {{.Lower}}Ingest is the version pair {{.Lower}}Previous -> the guide's
// release over a saved copy of the guide.
// {{.Lower}}Release is the major's first release the saved guide is for.
// ` + todo + `: the real release.
const {{.Lower}}Release = "1.0.0"

// {{.Lower}}Ingest is the version pair {{.Lower}}Previous ->
// {{.Lower}}Release over a saved copy of the guide.
func {{.Lower}}Ingest(t *testing.T, file string) []event.Event {
t.Helper()
g := members.{{.Ident}}
env := kittest.Env(t, kittest.Pages{g.URL(): file})
return kittest.Versions(t, env, Plugin{Guide: g}, plugin.Version{ID: {{.Lower}}Previous}, plugin.Version{ID: g.Release})
env := kittest.Env(t, kittest.Pages{g.RawURL("v"+{{.Lower}}Release, 1): file})
return kittest.Versions(t, env, Plugin{Guide: g}, plugin.Version{ID: {{.Lower}}Previous}, plugin.Version{ID: {{.Lower}}Release})
}
`,
imports: []string{"slices", "github.com/patch-it-dev/patch-it-plugins/core/event", "github.com/patch-it-dev/patch-it-plugins/core/plugin", "github.com/patch-it-dev/patch-it-plugins/plugins/migrationguide/members"},
Expand All @@ -328,9 +333,6 @@ var {{.Ident}} = File{
API: "{{.ID}}", Package: "{{.PyPI}}", Ecosystem: "pypi", Module: "{{.Module}}",
Repo: "TODO-owner/TODO-repo", TagPrefix: "v", Path: "CHANGELOG.md",
}

// {{.Ident}}Golden is the release the golden test pins.
var {{.Ident}}Golden = {{.Ident}}.At("1.0.0")
`,
register: `plugin.Register(Plugin{File: {{.Ident}}})`,
pluginOf: `Plugin{File: {{.Ident}}}`,
Expand All @@ -345,7 +347,12 @@ var {{.Ident}}Golden = {{.Ident}}.At("1.0.0")
- A placeholder entry.
`},
source: "{{.File}}-CHANGELOG.md",
ingest: `// {{.Lower}}Previous is the release before {{.Ident}}Golden's on the
ingest: `// {{.Ident}}Golden is the release the golden test pins: only a test names
// one.
// ` + todo + `: the real release.
var {{.Ident}}Golden = {{.Ident}}.At("1.0.0")

// {{.Lower}}Previous is the release before {{.Ident}}Golden's on the
// registry: the pair's older side.
// ` + todo + `: the real release before it.
const {{.Lower}}Previous = "0.0.0"
Expand Down Expand Up @@ -421,40 +428,46 @@ func {{.Lower}}Ingest(t *testing.T, file string) []event.Event {
defDir: "plugins/catalog",
def: `package catalog

// {{.Ident}} is {{.Provider}}'s catalog: one JSON object, one key per command
// or endpoint, at a git ref.
import "regexp"

// {{.Ident}} is {{.Provider}}'s command catalog: one JSON file per command in a
// directory of its repo, read at each release tag, as Redis's is (redis.go).
//
// ` + todo + `: the ecosystem and package for the events' subject, the repo,
// 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{
// the directory and the release tags' shape. Say what you checked, with the
// date, as redis.go does for Redis.
var {{.Ident}} = Commands{
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",
Repo: "TODO-owner/TODO-repo", Dir: "TODO/commands",
Release: regexp.MustCompile(` + "`" + `^v?(\d+\.\d+\.\d+)$` + "`" + `),
}
`,
register: `plugin.Register(Plugin{Catalog: {{.Ident}}})`,
pluginOf: `Plugin{Catalog: {{.Ident}}}`,
register: `plugin.Register({{.Ident}})`,
pluginOf: `{{.Ident}}`,
fixtures: map[string]string{
"{{.File}}-old.json": "{\"PLACEHOLDER\": {}}\n",
"{{.File}}-new.json": "{\"PLACEHOLDER\": {}}\n",
"{{.File}}-old.json": "[{\"name\": \"placeholder.json\", \"type\": \"file\"}, {\"name\": \"kept.json\", \"type\": \"file\"}]\n",
"{{.File}}-new.json": "[{\"name\": \"kept.json\", \"type\": \"file\"}]\n",
"{{.File}}-placeholder.json": "{\"PLACEHOLDER\": {\"summary\": \"a placeholder\"}}\n",
},
source: "{{.File}}-new.json",
ingest: `// The two refs the saved snapshots are at.
// ` + todo + `: the real commits, oldest first.
dropFile: "[{\"name\": \"placeholder.json\", \"type\": \"file\"}, {\"name\": \"kept.json\", \"type\": \"file\"}, {\"name\": \"added.json\", \"type\": \"file\"}]\n",
source: "{{.File}}-new.json",
ingest: `// The two releases the saved listings are at.
// ` + todo + `: the real tags, oldest first.
const (
{{.Lower}}OldRef = "0000000000000000000000000000000000000000"
{{.Lower}}NewRef = "1111111111111111111111111111111111111111"
{{.Lower}}OldRef = "v1.0.0"
{{.Lower}}NewRef = "v2.0.0"
)

// {{.Lower}}Ingest extracts the change from the saved old snapshot to file.
// {{.Lower}}Ingest is the version pair from the saved old listing to file,
// the newer release's listing; a file gone from it is read at the old tag.
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",
{{.Ident}}.URL({{.Lower}}NewRef): file,
{{.Ident}}.listingURL({{.Lower}}OldRef): "testdata/{{.File}}-old.json",
{{.Ident}}.listingURL({{.Lower}}NewRef): file,
{{.Ident}}.FileURL({{.Lower}}OldRef, "placeholder.json"): "testdata/{{.File}}-placeholder.json",
})
return kittest.Versions(t, env, Plugin{Catalog: {{.Ident}}},
return kittest.Versions(t, env, {{.Ident}},
plugin.Version{ID: {{.Lower}}OldRef, Ref: {{.Lower}}OldRef}, plugin.Version{ID: {{.Lower}}NewRef, Ref: {{.Lower}}NewRef})
}
`,
Expand Down Expand Up @@ -541,7 +554,7 @@ func {{.Lower}}Ingest(t *testing.T, file string) []event.Event {
imports: []string{"context", "fmt", "os", "github.com/patch-it-dev/patch-it-plugins/plugins/openapi/adapter", "github.com/patch-it-dev/patch-it-plugins/core/event", "github.com/patch-it-dev/patch-it-plugins/core/plugin"},
next: "Write LatestTag, Fetch and Versions in plugins/openapi/adapter/{{.File}}.go (fetch.Get only); add Diff/Keep to the Register line if the spec needs them (see vercel.go).",
},
"apisurface": {
"apisurface/pypi": {
kind: "apisurface",
layer: "sdk",
defDir: "plugins/apisurface",
Expand Down Expand Up @@ -611,6 +624,82 @@ func {{.Lower}}Ingest(t *testing.T, file string) []event.Event {
imports: []string{"archive/zip", "bytes", "context", "fmt", "github.com/patch-it-dev/patch-it-plugins/core/event"},
next: "Save two real wheels of the package and serve them in {{.Lower}}Ingest; the kind reads their .py files, never runs them.",
},
"apisurface/npm": {
kind: "apisurface",
layer: "sdk",
defDir: "plugins/apisurface",
def: `package apisurface

// {{.Ident}} is {{.Provider}}'s package on npm, its public API read from each
// release's TypeScript declarations.
//
// ` + todo + `: check the name on npm, and that its tarball has .d.ts
// files (package.json's "types" or "exports"). Say what you checked, with
// the date.
var {{.Ident}} = npmPackage("{{.ID}}", "{{.NPM}}")
`,
register: `plugin.Register(Plugin{Package: {{.Ident}}})`,
pluginOf: `Plugin{Package: {{.Ident}}}`,
fixtures: map[string]string{
"{{.File}}-old.d.ts": "// ` + todo + `: a placeholder for the older release's declarations. Save the real release's tarball instead (see npm_test.go).\nexport declare function placeholder(a: string, b?: number): void;\n",
"{{.File}}-new.d.ts": "// ` + todo + `: a placeholder for the newer release's declarations: b is no longer optional, one event.\nexport declare function placeholder(a: string, b: number): void;\n",
},
// The drop test's newer release: the older one again, a name added.
dropFile: "// ` + todo + `: a placeholder: a release that only adds.\nexport declare function placeholder(a: string, b?: number): void;\nexport declare function added(): void;\n",
source: "{{.File}}-new.d.ts",
ingest: `// {{.Lower}}Ingest compares two releases: 1.0.0, a tarball holding
// testdata/{{.File}}-old.d.ts as index.d.ts, and 1.1.0, one holding file.
// The tarballs are built here so the placeholders are text.
// ` + todo + `: save the two real tarballs (trimmed if they're large, as
// npm_test.go's are) and serve them instead.
func {{.Lower}}Ingest(t *testing.T, file string) []event.Event {
t.Helper()
tarball := func(src string) []byte {
var buf bytes.Buffer
gz := gzip.NewWriter(&buf)
tw := tar.NewWriter(gz)
for name, body := range map[string][]byte{
"package/package.json": []byte(` + "`" + `{"name": "{{.NPM}}", "types": "index.d.ts"}` + "`" + `),
"package/index.d.ts": kittest.Read(t, src),
} {
if err := tw.WriteHeader(&tar.Header{Name: name, Mode: 0o644, Size: int64(len(body)), Typeflag: tar.TypeReg}); err != nil {
t.Fatal(err)
}
tw.Write(body)
}
if err := tw.Close(); err != nil {
t.Fatal(err)
}
gz.Close()
return buf.Bytes()
}
reg := "https://registry.npmjs.org/" + strings.ReplaceAll("{{.NPM}}", "/", "%2F")
files := map[string][]byte{
reg: []byte(` + "`" + `{"versions": {"1.0.0": {}, "1.1.0": {}}, "time": {"1.0.0": "2026-01-01T00:00:00Z", "1.1.0": "2026-02-01T00:00:00Z"}}` + "`" + `),
reg + "/1.0.0": []byte(` + "`" + `{"dist": {"tarball": "https://example.com/{{.File}}-1.0.0.tgz"}}` + "`" + `),
reg + "/1.1.0": []byte(` + "`" + `{"dist": {"tarball": "https://example.com/{{.File}}-1.1.0.tgz"}}` + "`" + `),
"https://example.com/{{.File}}-1.0.0.tgz": tarball("testdata/{{.File}}-old.d.ts"),
"https://example.com/{{.File}}-1.1.0.tgz": tarball(file),
}
env := kittest.Env(t, nil)
env.Get = func(_ context.Context, url string) ([]byte, error) {
if b, ok := files[url]; ok {
return b, nil
}
t.Errorf("fetched %s, which the test didn't save", url)
return nil, fmt.Errorf("no saved copy of %s", url)
}
ctx, p := context.Background(), Plugin{Package: {{.Ident}}}
vs, err := p.ListVersions(ctx, env)
if err != nil || len(vs) != 2 {
t.Fatalf("versions %v: %v", vs, err)
}
return kittest.Versions(t, env, p, vs[0], vs[1])
}
`,
imports: []string{"archive/tar", "bytes", "compress/gzip", "context", "fmt", "strings", "github.com/patch-it-dev/patch-it-plugins/core/event"},
next: "Save two real tarballs of the package and serve them in {{.Lower}}Ingest; the kind reads their .d.ts files, never runs them.",
},
}

// testFile is the generated test, the same for every format.
Expand Down
20 changes: 15 additions & 5 deletions cmd/new-plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ func (o Options) template() (string, error) {
return o.Kind, nil
}
r := cmp(o.Reader, defaultReaders[o.Kind])
if o.Kind == "apisurface" && o.Reader == "" && slices.ContainsFunc(o.Packages, func(p string) bool { return strings.HasPrefix(p, "npm:") }) {
r = "npm" // the package's ecosystem picks the reader
}
if _, ok := formats[o.Kind+"/"+r]; !ok {
return "", fmt.Errorf("--reader %q: kind %s's readers are %s", o.Reader, o.Kind, readerHelp())
}
Expand All @@ -192,10 +195,10 @@ var (

// data is what the templates fill in.
type data struct {
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
ID, Name, Ident, Lower, ProviderID, Provider, Source, File, Format, Kind, Module, PyPI, NPM 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.
Expand Down Expand Up @@ -233,7 +236,7 @@ func Run(o Options, out io.Writer) error {
}
}
if len(o.Packages) == 0 && f.kind == "apisurface" {
o.Packages = []string{"pypi:" + o.ProviderID}
o.Packages = []string{strings.TrimPrefix(o.tmpl, "apisurface/") + ":" + o.ProviderID}
}
for _, p := range o.Packages {
eco, name, ok := strings.Cut(p, ":")
Expand Down Expand Up @@ -268,6 +271,13 @@ func Run(o Options, out io.Writer) error {
break
}
}
d.NPM = o.ProviderID
for _, p := range o.Packages {
if name, ok := strings.CutPrefix(p, "npm:"); ok {
d.NPM = name
break
}
}
d.Module = strings.ReplaceAll(strings.ToLower(d.PyPI), "-", "_")
d.Ident = ident(o.name)
d.Lower = string(unicode.ToLower(rune(d.Ident[0]))) + d.Ident[1:]
Expand Down
2 changes: 1 addition & 1 deletion cmd/new-plugin/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func hash(b []byte) string {
// name, category and homepage not asked again.
func TestAsksWhatIsMissing(t *testing.T) {
o := Options{ProviderID: "stripe"}
in := bufio.NewReader(strings.NewReader("python-sdk\napisurface\nsdk\nhttps://pypi.org/project/stripe/\npypi:stripe\nRemoved names\n"))
in := bufio.NewReader(strings.NewReader("python-sdk\napisurface\npypi\nsdk\nhttps://pypi.org/project/stripe/\npypi:stripe\nRemoved names\n"))
var out bytes.Buffer
if err := ask(&o, in, &out); err != nil {
t.Fatal(err)
Expand Down
6 changes: 4 additions & 2 deletions core/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"time"

"github.com/patch-it-dev/patch-it-plugins/core/fetch"
"github.com/patch-it-dev/patch-it-plugins/core/plugin"
)

// API is GitHub's REST API.
Expand Down Expand Up @@ -63,7 +64,8 @@ func LatestRelease(ctx context.Context, get Getter, url string) (string, error)
}

// LatestCommit reads a commit list (url: commits?path=<file>&per_page=1, newest
// first) and returns the newest commit's SHA, or an error when it lists none.
// first) and returns the newest commit's SHA, or an error when it lists none
// (plugin.ErrNothingToRead: no commit ever changed the path).
func LatestCommit(ctx context.Context, get Getter, url string) (string, error) {
body, err := get(ctx, url)
if err != nil {
Expand All @@ -76,7 +78,7 @@ func LatestCommit(ctx context.Context, get Getter, url string) (string, error) {
return "", fmt.Errorf("parsing github commits response: %w", err)
}
if len(commits) == 0 || commits[0].SHA == "" {
return "", fmt.Errorf("github lists no commit")
return "", fmt.Errorf("github lists no commit: %w", plugin.ErrNothingToRead)
}
return commits[0].SHA, nil
}
Expand Down
9 changes: 9 additions & 0 deletions core/plugin/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,12 @@ func TestTwoSourcesCantShareAnID(t *testing.T) {
}()
register(t, "test-dup")
}

func TestAVersionPinsNothingUntilSet(t *testing.T) {
if !(Version{ID: "12.0.0"}).MapsTo.IsZero() {
t.Error("a version with no MapsTo pins something")
}
if (Pin{API: "example/api", Version: "2026-03-31"}).IsZero() {
t.Error("a set pin is zero")
}
}
Loading
Loading