Skip to content

add the vercel plugin - #107

Merged
brandonphelps1212 merged 2 commits into
mainfrom
vercel-plugin
Nov 19, 2026
Merged

brandonphelps1212 merged 2 commits into
mainfrom
vercel-plugin

Conversation

@brandonphelps1212

Copy link
Copy Markdown
Contributor

What this changes

Adds the vercel plugin on the openapi format plugin. Part of #66 (I10.3 · Watch Vercel), under #13.

  • Source: vercel-spec.json in vercel/sdk, pinned to each release tag. This is the spec @vercel/sdk is generated from, tagged on nearly every release. The newest tag comes from the GitHub Releases API. Each event's version is the SDK release (1.18.7), because the spec's info.version is a fixed 0.0.1.
  • Reports:
    • Operation deprecations: the deprecated flag, or a summary starting "Deprecated:" or ending "(deprecated)". 16 of Vercel's 22 deprecations said it only in words.
    • Removals (breaking) of operations the previous spec had marked deprecated.
  • Replay fixture: v1.18.6 → v1.18.7 removes GET /v4/domains/price and GET /v4/domains/status. Vercel deprecated the Legacy Domains API in v1.13.5 and sunset it on 2025-11-09; both endpoints now answer "This endpoint has been sunsetted".
  • diff/: new Options (PathTemplates, DeprecatedSummary) and ChangesWith. The zero value keeps Changes' behavior, so the other four openapi plugins are unaffected.

Checklist

  • Added to / updated in docs/plugins.md: new vercel row. I compared the registered plugins with the table. Status is paused (see notes).
  • Every commit is signed off (git commit -s, DCO)
  • Golden test over a real saved copy of the source (plugins/openapi/testdata/golden/vercel.json): the deprecation (v1.13.4 → v1.13.5, run as a daily ingest), then the replayed removal.
  • testdata/README.md lists each file: URL, date fetched, license, quote. The saved copies are trimmed excerpts of the real specs, and every line matches the original.
  • One pinned drop test: v1.6.2 → v1.6.3, where /v1/log-drains and two /v1/integrations endpoints left the spec without being deprecated and later came back. A second drop test covers the {name} → {nameOrId} path-parameter rename in v1.28.65.
  • providers/vercel.md written from providers/_template.md, including Why this source
  • Fetches only through env.Get / kit/: the adapter uses the shared fetch layer under adapter/, like the Stripe, Datadog, GitHub and GitLab adapters.
  • go build ./... && go vet ./... && gofmt -l . && go test -race ./... pass locally, and so does scripts/leak_guard.py --all.
  • Nothing private: no credentials, internal hosts, private links, customer names

Notes for the reviewer

  • Field-level changes are deliberately not reported. I measured them over all 207 releases (2024-11 to 2026-11):

    • Response side: 67,048 removed properties, about a thousand a release, from the generated schemas reshuffling.
    • Request side: 478 breaking changes, most of them union members compared by position. Outside unions 142 remain, and 27 of those reverted later.
    • Operation removals: 108 operations left the spec, and only 5 had been marked deprecated first. Of the other 103, 16 came back later.

    With the filter, the history gives 26 events: 22 deprecations and the 4 Legacy Domains removals. Real field-level changes are missed; they're listed under Known gaps on the provider page.

  • Status paused, not live. The hosted ingestion service runs a plugin only once it's in a tagged release and the service is bumped to that release. Until then, live would claim coverage that doesn't exist. After the tag and bump, the row needs flipping to live.

  • Small change to the other openapi plugins: detected_at now comes from env.Now().UTC() instead of time.Now().UTC() inside normalize. In production it's the same clock; it makes the golden file deterministic.

  • PathTemplates trade-off, documented in diff/diff.go: a URL that keeps its shape but changes meaning (/teams/{teamId} → /teams/{slug}) reads as no change. That never happened in Vercel's history.

  • Client side (patch-it, not this repo):

    • The events are api_operation, so the existing handler takes them, with no new fix kind.
    • Its version gate has no entry for Vercel (@vercel/sdk is on npm).
    • A sunset breaks every caller of the endpoint, whatever their SDK version.
  • Follow-ups not in this PR:

    • Runtime deprecations (Node.js versions), which would be ci_runtime events from Vercel's changelog: a separate plugin.

🤖 Generated with Claude Code

Watches Vercel's REST API through the OpenAPI spec committed in
vercel/sdk at each release tag. Emits operation deprecations (by the
deprecated flag, or a summary starting "Deprecated:" or ending
"(deprecated)") and removals of operations the previous spec had marked
deprecated. Everything else is dropped: in the spec's history most
removals and property changes weren't changes to the API.

diff gains Options (PathTemplates, DeprecatedSummary) and ChangesWith;
the zero value keeps Changes' behavior for the other openapi plugins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: brandonphelps1212 <bphelps1212@gmail.com>
@brandonphelps1212

Copy link
Copy Markdown
Contributor Author

@claude review

@claude

claude Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Claude finished @brandonphelps1212's task in 1m 3s —— View job


✅ Ready to merge

Thanks @brandonphelps1212, this is a careful PR. The measured history in the notes (207 releases, 26 surviving events) makes the precision choices easy to check, and the two drop tests use real fixtures. I didn't find anything blocking.

  • Gather the diff and context
  • Check against AGENTS.md rules
  • Review diff/ changes for regressions in the other openapi plugins
  • Post review
Rule Status Evidence
1. docs/plugins.md row ✅ New vercel row sits between the markers with absolute links only. paused plus a reason matches the Status legend (docs/plugins.md:36). TestRegistersItself now includes adapter.Vercel{}, and providers/README.md has its row too.
2. providers/vercel.md with Why this source ✅ It's built from the template's sections and has the source link, the date checked (2026-11-18), why it's the best source, the alternatives considered (openapi.vercel.sh, the changelog/Atom feed, the 404 deprecations page, SDK commit notes, vercel-py) and a quote.
3. Golden + README row + drop test + source on every event ✅ TestVercelGolden covers the v1.13.4→v1.13.5 ingest and the v1.18.6→v1.18.7 replay, and it checks every event's source_url and that its excerpt matches the node in the saved copy. testdata/README.md has 4 rows (URL, date, Apache-2.0, quote). Pinned drop test: v1.6.2→v1.6.3, plus the v1.28.64→v1.28.65 rename. No existing golden files were edited.
4. Fetch only through env.Get / kit/ ✅ adapter/vercel.go uses fetch.Get only. net/http appears only in adapter/vercel_test.go (httptest), and adapter/ is allowed. os.ReadFile in plugins/openapi/vercel_test.go reads only testdata/.
5. Precision over recall ✅ vercelKeep keeps only deprecations and removals of operations the old spec had marked deprecated. The summary regex is anchored (^deprecated: / \(deprecated\)\s*$), and TestVercelDeprecatedSummary pins the false cases ("Deprecated runtimes…", "deprecated fields are ignored").
6. Nothing private ✅ Only public Vercel and GitHub URLs, and it uses "patch-it's hosted ingestion service" wording. The commit has a DCO sign-off.
Tests ℹ️ I can't run the tests from here; CI_go covers build, vet, gofmt and go test -race.

Regression check on diff/: operations() now goes through keys in method path order instead of path by path. That doesn't change the output, because ChangesWith still sorts by pointer, kind and detail (diff/diff.go:139). With the zero Options, renames are nil and the template key is the exact path, so Stripe, Datadog, GitHub and GitLab behave as before. Moving DetectedAt to env.Now().UTC() only fills a field that normalize already defaulted to time.Now() (normalize/normalize.go:44-46).

Blocking bugs

None.

Non-blocking suggestions

  1. Doc wording doesn't match the regex. providers/vercel.md (the "What the plugin reads" bullet) says a summary that starts "Deprecated", but vercelDeprecatedWords needs the colon, Deprecated:. Your own code comment explains why the bare form is excluded ("Deprecated runtimes for a project"). Suggest changing the doc to "starts "Deprecated:"" so readers don't expect the looser match.
  2. "Removed" means removed from the spec, which isn't always a shutdown. For Vercel the 4 historical cases were real sunsets, so precision holds today. Still, a deprecated operation could also leave the spec when it moves to a new path version (/v4/... → /v5/...) while the old URL keeps working for a while. Consider wording the Known gaps entry (or the event description, if normalize allows it) as "removed from the spec" rather than implying the endpoint stopped answering. This is just wording; I'm not suggesting any code change.
  3. PathTemplates fallback. When one spec has two paths with the same template, operations() falls back to exact-path pairing (diff/diff.go, the len(oldList) <= 1 && len(newList) <= 1 branch). A rename in that situation would show up as a removal of a deprecated operation. It's documented and never happened in Vercel's history. A small case in diff/options_test.go pinning that fallback would protect it if someone later tunes the pairing.
  4. Follow-up reminder: the row needs flipping from paused to live after the release tag and the bump of the hosted ingestion service. A tracking issue for that would make sure it doesn't get missed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: brandonphelps1212 <bphelps1212@gmail.com>
@brandonphelps1212
brandonphelps1212 merged commit 1cb2628 into main Nov 19, 2026
4 checks passed
@brandonphelps1212
brandonphelps1212 deleted the vercel-plugin branch November 19, 2026 15:44
@brandonphelps1212 brandonphelps1212 mentioned this pull request Nov 19, 2026
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant