Skip to content

openapi: openai/api, cloudflare/api-spec, mongodb/atlas-admin-spec; one version per day - #241

Merged
1 commit merged into
mainfrom
pl4-openapi
Nov 21, 2026
Merged

1 commit merged into
mainfrom
pl4-openapi

Conversation

@adssib

@adssib adssib commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Three new openapi sources, each read day by day from the spec's commits (every version, not only the newest), keeping operation deprecations and the removal of operations the previous day's spec had marked deprecated:

source spec packages golden pair drop test
openai/api https://github.com/openai/openai-openapi/blob/main/openapi.yaml (MIT) pypi:openai, npm:openai 2026-10-27 → 2026-10-28: POST /v1/audio/translations deprecated (shutdown Feb 26, 2027 quoted) 2026-11-17 → 2026-11-18: session spending-limit schemas added and pulled the next day: 3 schema removals, no event
cloudflare/api-spec https://github.com/cloudflare/api-schemas/blob/main/openapi.json (BSD-3-Clause, 30 MB) pypi:cloudflare, npm:cloudflare 2026-10-29 → 2026-10-30: the three deprecated Registrar domains operations removed (their EOL message quoted) same pair: POST /accounts/move and GET /tenants/{tenant_id} gone unmarked: no event
mongodb/atlas-admin-spec https://github.com/mongodb/openapi/blob/main/openapi/v2.json none 2025-02-18 → 2025-02-20: user-management operations deprecated (3 of the 14 saved) 2024-07-25 → 2024-08-07: GET /rest/unauth/version gone unmarked: no event

Also: a spec read from its commits is now one version per day (adapter.Daily, the day's last commit), for every commit-listed adapter (Supabase, Neon, Convex, PlanetScale, Appwrite too). Version IDs are dates, and several commits on one day listed the same ID more than once (Appwrite's saved listing: 40 commits on 16 days). Provider pages for those four say so now. The package doc of plugins/openapi no longer lists providers by hand.

Part of #185 (I21.13 MongoDB, I21.18 Cloudflare) and #35 (I6.1 OpenAI); not closing them: their other sources are other kinds.

Checklist

  • Metadata complete in the registration, and I read the words (make plugins).
  • Every commit is signed off (git commit -s, DCO)
  • Golden test over a real saved copy of the source (testdata/golden/openai-api.json, cloudflare-api-spec.json, mongodb-atlas-admin-spec.json)
  • testdata/README.md lists each file: URL, date fetched, license, quote
  • One pinned drop test per source
  • providers/openai-api.md, providers/cloudflare-api-spec.md, providers/mongodb-atlas-admin-spec.md with Why this source
  • Fetches only through core/fetch / core/github (the adapter layer, as every openapi adapter)
  • make check passes locally
  • Nothing private

Calls I made (please check)

  • cloudflare/api-spec, not cloudflare/api: cloudflare/api is already the deprecations feed (kind notices).
  • Deprecations-only filter (deprecationsOnly) for all three, as for Vercel/Supabase/Neon: these specs are regenerated several times a day and most removals and property changes aren't API changes. Precision over recall.
  • Cloudflare word-only deprecations: summaries starting Deprecated: or ending (deprecated) (11 operations) count, same rule as Vercel's.
  • History limit: the GitHub commits API lists at most 1,000 commits (versions.MaxPages), about five months of Cloudflare's spec; noted on its page, not changed in core/versions.
  • Atlas spec license is CC BY-NC-SA 3.0 US: only small excerpts saved, noted in the README row and page.
  • Not built (audit medium candidates): posthog/api and planetscale/api-live (live URLs only, no versions to list; the openapi kind is versioned), google/gemini-api (Discovery format: needs a Discovery→OpenAPI adapter), github/graphql-schema (GraphQL SDL: a new kind). anthropic/api: no public spec.
  • Golden fixtures: the existing adapters' tests are unchanged except Appwrite's listing count (40 commits → 16 days), which is the intended effect of Daily.

Related PRs

🤖 Generated with Claude Code

…spec

Three specs committed several times a day, versioned by the day: a spec
read from its commits is now one version per day, at the day's last
commit (Daily), for every commit-listed adapter, so no version ID is
listed twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: adssib <75389300+adssib@users.noreply.github.com>
@claude

claude Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Claude finished @adssib's task in 1m 37s —— View job


✅ Ready to merge: the three new sources have complete metadata, real golden and drop tests, and full provider pages; the Daily change does what the description says, and all checks pass locally.

Rules

rule status evidence
Metadata in the registration (Rule 1) ✅ openai/api, cloudflare/api-spec and mongodb/atlas-admin-spec are registered in plugins/openapi/openapi.go:189-225 with ID, layer, Watches, URLs, page and packages (none for Atlas). The provider metadata (name, category, homepage) matches the existing openai, cloudflare and mongodb registrations in notices, apisurface and changelog exactly, so the registry merges them without panicking. No hand-kept list added back. I read the Watches text and it matches the code.
Provider pages ✅ providers/openai-api.md, cloudflare-api-spec.md and mongodb-atlas-admin-spec.md follow the template, and each Why this source has the link, "Checked on 2026-11-21", the reasons, the alternatives not used and a quote. The four existing pages affected by Daily (Supabase, Neon, Convex, PlanetScale) and appwrite.md are updated.
Golden test + dated quote ✅ testdata/golden/{openai-api,cloudflare-api-spec,mongodb-atlas-admin-spec}.json. Each testdata/README.md row has the URL pinned to a SHA, the fetch date, the license and a quote. Events cite the source URL and pointer: deprecations cite the new spec, removals the old one.
Drop test ✅ OpenAI: the work-in-progress schemas that were pulled back give 0 events (3 unfiltered). Cloudflare: operations removed without a deprecation mark give no event. Atlas: /rest/unauth/version removed without a mark gives no event.
Golden edits explained ✅ The only change to an existing test is Appwrite's listing count (40 → 16), which the description explains as the intended effect of Daily. No existing golden JSON changed.
Fetch only via the fetch layer ✅ The adapters use core/fetch and core/github only, inside plugins/openapi/adapter/ (allowed). No net/http, filesystem or database access elsewhere. Tests read only testdata/.
Precision over recall ✅ deprecationsOnly keeps only OperationDeprecated, plus OperationRemoved when the old operation was marked deprecated. Cloudflare's summary rule is anchored (^deprecated: / \(deprecated\)\s*$), so a summary that only mentions a deprecated parameter doesn't match.
Nothing private (Rule 2) ✅ Leak guard is clean. No internal names, tokens or private links in the code, docs or commit.
contract/fixtures/ untouched ✅

Bugs

None found.

Things I checked that could have been bugs:

  • YAML→JSON: yaml.v3 builds map[any]any when a key isn't a string, and json.Marshal fails on that. OpenAI's spec quotes its status codes ("200":), so the conversion works. If a later commit ever writes them unquoted, Fetch fails loudly rather than producing wrong events.
  • YAML timestamps: yaml.v3 keeps timestamp-looking values as strings when decoding into any, so they survive the conversion unchanged.
  • Atlas golden pair: GET /api/atlas/v2/users/byName/{userName} exists in the 2025-02-18 file and gains deprecated: true on 2025-02-20. So it really is a deprecation, not an operation added already deprecated.

Verified

  • go build ./...: ok
  • go vet ./...: no output
  • gofmt -l .: no output
  • go test -race ./...: all packages ok, including plugins/openapi and plugins/openapi/adapter
  • python3 scripts/leak_guard.py --all: "no banned terms (8 hashed terms checked)"
  • Searched for TODO(new-plugin): it appears only in the docs, Makefile and CI that describe the check, not in plugin code. I couldn't run make todos because it needed an approval this run didn't have.

Non-blocking

  • Rolling out Daily (inline comment on versions.go:282): for sources already running, an ID stored from an earlier commit on a day may now point at that day's last commit. That can miss events once per source, never produce wrong ones; worth a line in the description for whoever deploys this.
  • Atlas license (CC BY-NC-SA 3.0 US): the saved excerpts are small and the README row says so. Event excerpts in patch-it's hosted ingestion service will also quote this spec, so a maintainer may want to confirm that's fine under NC.
  • PR description: "Stacked by #PYPI and #NPM; all three combined in #COMBINED" are placeholders; please replace them with the real PR numbers or remove the line.
  • Nits: var _ Lister = OpenAI{} is in adapter/versions.go:294, while Cloudflare's and Atlas's are in their own files. TestOpenAIRegistersItself repeats what registered_test.go now covers.

Thanks, this is a careful PR: each filtering decision has a real example from the spec history behind it.

// Daily keeps one version per day of vs (oldest first, IDs dates, as
// versions.GitHubCommits lists them): the day's last commit, so a spec
// committed several times a day has one version per day, each ID once.
func Daily(vs []plugin.Version) []plugin.Version {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: Daily looks right to me. GitHubCommits and github.Commit both use the committer date in UTC, so the listed ID and Fetch's Version agree, and the duplicate IDs are always next to each other because the list is sorted.

One thing to check when this rolls out: Supabase, Neon, Convex, PlanetScale and Appwrite are already running. If patch-it's hosted ingestion service last stored a day with two commits by its ID, that ID now points at the day's last commit. If the stored ID came from an earlier commit that day, the commits after it on that day may never be diffed. This happens at most once per source and can only miss events, never produce wrong ones, so it fits "precision over recall". A sentence about it in the PR description would help whoever deploys this.

Small inconsistency: var _ Lister = OpenAI{} (line 294) sits here, while the Cloudflare and MongoDB assertions are in their own files. It could move to openai.go.

@adssib adssib closed this pull request by merging all changes into main in b1abc9c Nov 21, 2026
@adssib
adssib deleted the pl4-openapi branch November 21, 2026 03:21
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