Skip to content

feat: add api extractor, semantic diff, and sync workflow - #117

Merged
haydenhoang merged 123 commits into
typesense:masterfrom
tharropoulos:extractor
Nov 12, 2026
Merged

haydenhoang merged 123 commits into
typesense:masterfrom
tharropoulos:extractor

Conversation

@tharropoulos

Copy link
Copy Markdown
Contributor

Change Summary

  • add a typed C++ extractor that discovers routes, resolves parameters, and builds the API spec
    • split extraction into smaller runtime modules for config, source loading, traversal, resolution, and spec output
    • add a semantic-diff command to compare extracted specs and generate JSON/Markdown change reports
    • wire in GitHub Actions to run extraction, publish artifacts, and open follow-up issues when API shape changes

PR Checklist

@tharropoulos
tharropoulos force-pushed the extractor branch 2 times, most recently from 6fe47fd to 94e4716 Compare April 17, 2026 14:13
@tharropoulos

Copy link
Copy Markdown
Contributor Author

@haydenhoang went through your commits and pushed 33 small ones on top. I didn't touch yours. Each is one fix and passes the suite on its own, so they read fine one by one.

This is a big step up. On the routes openapi.yml documents, missed params dropped from 235 to 5, and those 5 are right to be missing.

Most of what I pushed doesn't change the v30.2 output. The four exceptions are type fixes. The big one is the comma-separated search params (query_by, facet_by, include_fields and friends), which came out as arrays even though the server only takes strings there. The rest of the extractor commits fix std methods resolving to Typesense ones, a few scoping edge cases, and dropping the "refused" key rule, which could hide real params. There's also a perf fix that gets extraction back to about 1.8s from 2.9s, plus a cap on concurrent GitHub fetches. And there's a handful of CI fixes so the bot PR doesn't close itself early or turn master red once merged.

A couple of things I left for you. Should latest-release pick the highest stable version instead of GitHub's "latest" flag, which a backport can take? And I think we could pick the receiver class from declared types and drop most of the name matching. Someone also needs to turn on "Allow GitHub Actions to create and approve pull requests" before the first nightly.

GitHub flags the last release published as latest, so a backport such as
v29.1, published 17 seconds before v30.2, could take it and make the
nightly report every v30 parameter as removed. List the releases and pick
the highest version tag that is neither a draft nor a prerelease.
`SynonymIndexManager& manager` says the class, but `manager` names none,
so the call fell back to the first method of that name in any class. Read
the declared type first, unwrapping const, references, pointers and smart
pointers. A receiver declared `auto` still falls back to its name, as in
`auto collection = collectionManager.get_collection(...)`.
@haydenhoang

Copy link
Copy Markdown
Collaborator

Thanks! On your two questions, I pushed:

  • latest-release now resolves to the highest-versioned release that isn't a draft or prerelease.
  • Receiver class: A declared type now wins over the name. I kept name matching as the fallback, though because the handlers sometimes use auto type e.g. auto collection = collectionManager.get_collection(...) in core_api.cpp. Output at v30.2 is unchanged.

That "Allow GitHub Actions to create and approve pull requests" setting may already be on by default. I will ask Jason to check if the first run fails. Mind a quick look at the last two commits before we merge?

@tharropoulos

Copy link
Copy Markdown
Contributor Author

:shipit: @haydenhoang

@haydenhoang
haydenhoang merged commit f08552d into typesense:master Nov 12, 2026
2 checks passed
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.

2 participants