Skip to content

register providers with sources and their metadata in code - #184

Open
adssib wants to merge 2 commits into
pl-r1-layoutfrom
pl-r2-providers
Open

adssib wants to merge 2 commits into
pl-r1-layoutfrom
pl-r2-providers

Conversation

@adssib

@adssib adssib commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #183. Refs #173 (I19.2), part of #171.

What this changes

Every plugin is now registered as a source of a provider, with its metadata, in code:

plugin.RegisterProvider(plugin.Provider{
	ID: "algolia", Name: "Algolia", Category: plugin.CategorySearch, Homepage: "https://www.algolia.com",
	Sources: []plugin.Source{{
		ID: "search-api", Layer: plugin.LayerAPI, Page: "providers/algolia.md",
		Watches: "Search API operations deprecated, …",
		URLs:    []string{"https://github.com/algolia/api-clients-automation", …},
		Plugin:  Plugin{Adapter: adapter.Algolia{Spec: "search"}, …},
	}, …},
})
  • Source ids are provider/source; the old slug is the source's Plugin.Name() and stays an alias. plugin.Lookup and the new plugin.LookupSource resolve both (algolia/search-api and algolia-search). plugin.Names() still lists the old slugs (what --api all runs), so patch-it's hosted ingestion service behaves exactly as before.
  • Events keep emitting the old api value (algolia-search, openai-models…) until patch-it's change-event contract switches to source ids; that switch is a contract PR in patch-it first.
  • Kind is filled in from the package the plugin is defined in (plugins/openapi → openapi), so it can't drift.
  • The three Algolia plugins are one provider with three sources (algolia/search-api, algolia/ingestion-api, algolia/recommend-api).
  • Every provider has a category (plugin.Categories(): ai, payments, infrastructure, databases, monitoring, analytics, auth, messaging, hosting, search, devtools, crm, packages) and every source a layer (plugin.Layers(): api, sdk, package, runtime, ci, ai-models, infra).
  • RegisterProvider refuses incomplete metadata (no category, name, homepage, watches, URLs, page, a wrong layer or kind). A provider registered from two kinds (Anthropic, GitHub) must say the same name, category and homepage. plugins/all's test fails if a registered plugin isn't a source or its page is missing.
  • Until print the plugin list from the registry, commit none #208 removes docs/plugins.md, internal/pluginlist checks every row says what its registration says (provider, layer, what it watches, page): the move is word for word, and docs/plugins.json is unchanged.
  • cmd/new-plugin writes a RegisterProvider block (placeholders marked TODO(new-plugin) for a new provider's category and homepage; an existing provider's metadata reused).
Old slug (api on events) Source id Category
stripe stripe/api payments
datadog datadog/api monitoring
github / github-actions github/rest-api / github/actions devtools
gitlab gitlab/rest-api devtools
vercel vercel/api hosting
supabase supabase/management-api databases
algolia-search / -ingestion / -recommend algolia/search-api / ingestion-api / recommend-api search
elasticsearch elastic/elasticsearch-api search
sentry sentry/api monitoring
neon neon/api databases
convex convex/deployment-api databases
planetscale planetscale/api databases
appwrite appwrite/api hosting
flagsmith flagsmith/api devtools
mongodb-atlas mongodb/atlas-admin-api databases
openai-models openai/models ai
anthropic-models / anthropic anthropic/models / anthropic/python-sdk ai
vertex-ai-models google/vertex-ai-models ai
numpy, textual, urllib3 numpy/numpy, textual/textual, urllib3/urllib3 packages
posthog posthog/python-sdk analytics
newrelic newrelic/python-agent monitoring
redis redis/commands databases
cloudflare cloudflare/api infrastructure
salesforce salesforce/rest-api crm

(This table is for review only; it isn't committed anywhere.)

Checklist

  • docs/plugins.md: unchanged; a test now checks each row against its registration (removed in the next PR)
  • Every commit is signed off (DCO)
  • Golden tests: every golden byte-identical (36 files, sha256 compared with main)
  • testdata/README.md: not applicable, no new source
  • Drop tests: unchanged
  • providers/<api>.md: unchanged; each source's Page points at its existing page
  • Fetches only through env.Get / core/kit/
  • make check passes locally
  • Nothing private

Notes for the reviewer

  • Built a copy of the hosted ingestion service's code against this branch: go build ./... && go vet ./... pass (it uses Register/Lookup/Names, all unchanged in behavior).
  • I compared every Watches, provider name, layer and page with its docs/plugins.md row: the new pluginlist check enforces it.

Calls I made (please check)

  • Categories added beyond the agreed list where nothing fit: search (Algolia, Elastic), analytics (PostHog), crm (Salesforce). Choices to check: Google → ai (only Vertex AI models today), Appwrite → hosting, Supabase/Neon/Convex/PlanetScale/MongoDB/Redis → databases, Cloudflare → infrastructure, GitHub/GitLab/Flagsmith → devtools.
  • Source ids: api for a provider's single REST API, rest-api where the provider has other sources or several APIs (GitHub, GitLab, Salesforce), the package name for packages (numpy/numpy), python-sdk / python-agent for SDKs. Elasticsearch's provider is elastic.
  • No Status field: a registered source is live by definition; a pause belongs in the hosted service's settings, not in code.
  • Homepages are the providers' public sites, typed by hand.

Related PRs

🤖 Generated with Claude Code

A plugin is now registered as a source of its provider:
plugin.RegisterProvider(Provider{ID, Name, Category, Homepage, Sources:
[]Source{ID, Kind, Layer, Watches, URLs, Page, Plugin}}). Source ids are
provider/source (stripe/api, algolia/search-api, openai/models); the old
slugs stay as aliases, so Lookup and LookupSource resolve both, Names() still
lists the old slugs, and events keep the old api value until patch-it's
change-event contract switches to source ids.

The three Algolia plugins are one provider with three sources. Every provider
has a category. RegisterProvider refuses incomplete metadata; a test checks
every registered plugin is a source whose page exists, and the docs table
must match the registrations word for word until it goes.

new-plugin writes a RegisterProvider block, reusing an existing provider's
metadata.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: adssib <[email protected]>
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