Skip to content

add the algolia plugins - #113

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

brandonphelps1212 merged 2 commits into
mainfrom
algolia-plugin

Conversation

@brandonphelps1212

Copy link
Copy Markdown
Contributor

What this changes

Adds algolia-search, algolia-ingestion and algolia-recommend on the openapi format plugin, one per Algolia REST API spec. Part of #72 (I11.4 · Watch Algolia), under #14.

  • Source: specs/bundled/<api>.yml in algolia/api-clients-automation, the specs Algolia generates every API client from, pinned to its released-* tags (186 since 2023-08-22).
    • The newest tag comes from the GitHub refs API.
    • Several releases can land on one day (three on 2024-09-19), and the commit in the tag says nothing about their order, so same-day releases are ordered by their commit's date.
    • An event's version is the release's date (2025-04-01). The API has nothing beyond /1/, and each client has its own versions.
  • Reports: the same rule as vercel and supabase, with the whole operation quoted (QuoteDeprecatedOperation) and path templates matched.
    • operation deprecations (the deprecated flag);
    • removals (breaking) of operations marked deprecated first.
  • Skips entries that describe only an API client:
    • helpers marked x-helper: true (/saveObjects, /waitForTask, …);
    • the custom-request methods (customGet/Post/Put/Delete on /{path}).
  • History (every release, 2023-08-22 to 2026-11-17): 18 events, all deprecations.
    • Search: the 9 /1/clusters multi-cluster operations (2025-04-01).
    • Ingestion: 8 v1 /1/tasks operations (2025-01-22: "please use getTasks instead") and PUT /1/tasks/{taskID}/disable (2024-07-26).
    • Recommend: none.

Checklist

  • Added to docs/plugins.md: three rows, status paused like the other new plugins. I compared the registered plugins with the table.
  • Every commit is signed off (git commit -s, DCO)
  • Golden tests over real saved copies: golden/algolia-search.json (the 2025-04-01 deprecation) and golden/algolia-ingestion.json (2025-01-22).
  • testdata/README.md lists each file: URL, date fetched, license, quote. The copies are trimmed by lines (openapi, info, the paths involved), with every line unchanged.
  • Pinned drop tests:
    • Ingestion: GET and POST /1/transformations/models, removed without being deprecated (2024-09-18-cc190fae3 → 2024-09-19-a62c27d3b).
    • Recommend: the custom-request methods moving from /1{path} to /{path} (2024-03-25).
    • A unit test checks that client-only entries make no event even when deprecated or removed.
  • providers/algolia.md written from providers/_template.md, including Why this source. One page for the three plugin ids.
  • Fetches only through env.Get / kit/: the adapter uses the shared fetch layer under adapter/, like the other openapi 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

  • Removals: 17 in the history, none deprecated first, so none are events. 13 were client-only entries (the custom-request methods in all three specs, and /saveObjects), and 4 were Ingestion operations.
  • The client-only filter is defensive. No helper or custom-request entry was ever deprecated, so over the real history it changes nothing, and only the unit test exercises it. It's there because a helper's deprecation would be an API-client change, not an API one.
  • An independent review replayed all 186 releases of the three specs (558 files) through the registered plugins. It found no wrong events and no missed deprecations. All 558 files convert from YAML cleanly, and the trimmed copies give byte-identical goldens to the full specs. It also corrected two removal counts and asked for the Recommend drop test; both are included.
  • The live check ran the real adapter against GitHub. It found the latest tag (released-2026-11-17-31c309fe2a), the three plugins ran, and the full-size Search replay gave the 9 events.
  • Client side: like cloudflare and supabase, these events are versioned by date.

🤖 Generated with Claude Code

algolia-search, algolia-ingestion and algolia-recommend watch Algolia's
REST API specs in algolia/api-clients-automation at its released-* tags,
same-day releases ordered by commit date; an event's version is the
release's date. They use vercel's and supabase's rule (operation
deprecations, and removals of operations marked deprecated first) and
skip entries that describe only an API client: x-helper helpers and the
custom-request methods.

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

claude Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

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


✅ Ready to merge. The three Algolia plugins follow every rule in AGENTS.md, all the checks pass locally, and I found no bugs.

Rules

Rule Status Evidence
Plugin list (Rule 1) ✅ 3 plugins registered (plugins/openapi/openapi.go:39-43) and 3 matching rows in docs/plugins.md inside the markers. Each row has absolute links and status paused, like the other unreleased plugins.
Provider page ✅ providers/algolia.md has every section of _template.md. Why this source has the link, the date checked (2026-11-19), the reasons, 4 alternatives and a quote. It's also listed in providers/README.md.
Golden test + dated source quote ✅ golden/algolia-search.json and golden/algolia-ingestion.json, built from real MIT-licensed copies. Each file pair has a row in testdata/README.md with its URL, date, license and quote. Every event has a pinned released-* source_url and quotes the whole operation.
Pinned drop test ✅ Ingestion: /1/transformations/models, removed without being deprecated. Recommend: the custom-request methods moving from /1{path} to /{path}.
Fetch only via env / kit / fetch layer ✅ adapter/algolia.go uses only fetch.Get. No net/http, no filesystem access, no database.
Nothing private (Rule 2) ✅ Only public GitHub and Algolia URLs. leak_guard.py --all is clean. The sign-off email in the commit is the usual DCO line.
Contract fixtures untouched ✅ Nothing changed under contract/fixtures/.

Bugs

None found. I checked these:

  • Client-only filter. algoliaKeep reads c.Node. For a removal that's the old operation (diff.go:289). Because QuoteDeprecatedOperation is set, a deprecation also gets the new operation (diff.go:294), so the helper and custom-request filter works on both paths.
  • Rest of the rule. It reuses deprecationsOnly, so a removal makes an event only if the operation was deprecated first, the same as Vercel and Supabase.
  • LatestTag. It handles both tag formats (released-2023-08-22 and released-YYYY-MM-DD-<sha>). It picks the latest day by string order and breaks same-day ties by commit date. It looks up commit dates only when a day has more than one tag.

Verified

  • go build ./...: ok
  • go vet ./...: ok
  • gofmt -l .: printed nothing
  • go test -race ./...: all 20 packages pass, including adapter and plugins/openapi
  • python3 scripts/leak_guard.py --all: "no banned terms (8 hashed terms checked)"

I didn't re-run the 186-release replay or the live GitHub check from the PR description. The numbers in the description come from the author.

Non-blocking

  • plugins/openapi/algolia.go:27 (inline comment): the client-only filter quietly depends on algoliaDiff setting QuoteDeprecatedOperation. Without it, Node for a deprecation would be the bare true. The unit test builds the diff.Change by hand, so it wouldn't catch that. A short comment, or running that case through diff.Changes, would guard it.

Thanks for a careful, well-documented PR.

// history was deprecated first; 13 were the client-only entries above (the
// custom-request methods in all three specs on 2024-03-25, and /saveObjects).
func algoliaKeep(c diff.Change) bool {
op, _ := c.Node.(map[string]any)

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. This works only because algoliaDiff sets QuoteDeprecatedOperation. With that option set, diff.go:294 passes the whole operation as Node for an OperationDeprecated. Without it, Node is just the true from deprecated (diff.go:296), so op is nil and clientOnly would quietly let a deprecated helper through.

TestAlgoliaClientOnlyEntriesMakeNoEvent builds the diff.Change by hand, so it wouldn't notice that. You could run that case through diff.Changes(old, new) with algoliaDiff instead, or add a comment here saying this depends on the option.

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 40s —— View job


✅ Ready to merge. The new commit (babbf8e) resolves the one non-blocking point from the last review. The three Algolia plugins meet every rule in AGENTS.md, and I found no blocking bugs.

Rules

Rule Status Evidence
1. docs/plugins.md ✅ There are 3 registrations (plugins/openapi/openapi.go:42, looping over search/ingestion/recommend) and 3 rows at docs/plugins.md:18-20, inside the markers. All links are absolute, and the status is paused like the other unreleased plugins.
2. Provider page ✅ providers/algolia.md follows _template.md. Why this source gives the link, the date checked (2026-11-19), the reasons, 4 alternatives and the getTasks quote. The page is also listed in providers/README.md:19.
3. Golden + dated quote ✅ golden/algolia-search.json has 9 events and golden/algolia-ingestion.json has 8. Each event has a source_url pinned to a released-* tag and an excerpt of the whole operation. testdata/README.md:18-21 has a row for each saved pair, with URL, date, MIT license and quote. The test checks every excerpt against the saved YAML node (algolia_test.go:99).
3. Pinned drop test ✅ Ingestion: /1/transformations/models was removed without being deprecated (algolia_test.go:112). Recommend: the custom-request methods moved from /1{path} to /{path} (:164). Both tests also confirm that the same input with no filter does produce the removals, so each one tests the filter and not an empty diff.
3. Golden edits explained ✅ Both goldens are new files, so there are no edits to explain.
4. Fetch only via env / kit / fetch layer ✅ adapter/algolia.go fetches only through fetch.Get. It doesn't use net/http, the filesystem or a database. The test adapter reads only testdata/.
5. Precision over recall ✅ algoliaKeep reuses deprecationsOnly, so a removal produces an event only if the operation was deprecated first. It also drops x-helper and custom* entries, which belong to the API clients, not the REST API.
6. Nothing private ✅ The PR links only to public GitHub and Algolia pages. It has no credentials, internal names, ticket links or session links. The commit has the usual DCO sign-off and co-author trailer.

Blocking bugs

None.

Notes on the new commit

  • TestAlgoliaClientOnlyFilterThroughTheDiffer (algolia_test.go:196) runs a deprecated helper, a deprecated customGet and a deprecated REST operation through the real diff.ChangesWith with algoliaDiff. It expects only GET /1/clusters to be kept. If someone drops QuoteDeprecatedOperation, Node becomes the bare true (diff/diff.go:296) and this test fails, so the dependency is now covered.
  • The comment at plugins/openapi/algolia.go:27-29 explains the dependency and names the test. That resolves the earlier inline suggestion.

Non-blocking suggestions (optional)

  • Matching custom* by operationId alone (algolia.go:44-46). This is fine for the specs as they are today. If Algolia ever names a real REST operation customGet or similar, the filter would quietly hide it. If you'd like it stricter, you could also require the path to be /{path} or /1{path}. That would cost recall, not precision, so I'm not blocking on it.
  • Version check in the golden test (algolia_test.go:90). c.to[9:19] works, but strings.TrimPrefix(c.to, "released-")[:10] would match how the fake adapter builds Version (:42) and be a little easier to read.

Tests

I can't run the tests in this review. CI_go covers go build, go vet, gofmt and go test -race, and CI_leak_guard covers the internal-names check. I haven't re-run the 186-release replay or the live GitHub check described in the PR. Those numbers come from the author, and they match the code comments and the provider page.

Thanks for picking up the earlier suggestion so quickly. This is a clean, well-documented addition.

@brandonphelps1212
brandonphelps1212 merged commit c39fd3a into main Nov 19, 2026
4 checks passed
@brandonphelps1212
brandonphelps1212 deleted the algolia-plugin branch November 19, 2026 20:00
@brandonphelps1212 brandonphelps1212 mentioned this pull request Nov 19, 2026
15 tasks
@claude claude Bot mentioned this pull request Nov 19, 2026
9 tasks done
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