chore(codegen): daily schema refresh (2026-08-07) - #115
Draft
timgl wants to merge 1 commit into
Draft
Conversation
Regenerate src/generated/api.d.ts from the live PostHog OpenAPI schema and
realign managed resources with upstream renames.
- endpoints resource relocated: /api/environments/{environment_id}/endpoints/
→ /api/projects/{project_id}/endpoints/ (operationIds environments_endpoints_*
→ endpoints_*). Updated openapi-filter.yaml and endpoint/client.ts paths + params.
- schema renames: PatchedDashboard → PatchedPatchedDashboardOpenApi,
PatchedExperiment → PatchedExperimentWrite,
PaginatedExperimentList → PaginatedExperimentBasicList.
typecheck + test (291 tests) green.
Generated-By: PostHog Code
Task-Id: 7d925c8f-da3d-47e2-b34b-3a034aeb54f0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Daily automated OpenAPI schema refresh for
2026-08-07. Regeneratessrc/generated/api.d.tsfrom the live PostHog spec (filtered byopenapi-filter.yaml) and realigns the managed resources with upstream renames.Why: The generated client must track PostHog's live API. Drift was detected
today — the
endpointsresource was relocated on the server and several sharedresponse schemas were renamed — so the checked-in types and resource clients
needed to be regenerated and patched to keep
typecheck/testgreen.Spec diff size
src/generated/api.d.ts: +5066 / −1891 lines (one file). Most of this isroutine upstream drift in shared component schemas (new query kinds, additional
enum values) pulled in by the retained operations.
New operationIds added to the filter
The
endpointsresource moved on the server, so its six CRUD operationIds wererenamed in
openapi-filter.yaml(same resource, new location — not a newfamily):
environments_endpoints_listendpoints_listenvironments_endpoints_createendpoints_createenvironments_endpoints_retrieveendpoints_retrieveenvironments_endpoints_updateendpoints_updateenvironments_endpoints_partial_updateendpoints_partial_updateenvironments_endpoints_destroyendpoints_destroyPath moved
/api/environments/{environment_id}/endpoints/→/api/projects/{project_id}/endpoints/.No brand-new resource families were added. The daily drift report lists ~2000
live operationIds absent from the filter, but the filter is a deliberate
allowlist: this tool manages CRUD (plus a few experiment lifecycle actions) for a
fixed set of resource families. The remaining unlisted operationIds are product,
admin, analytics, and internal/debug endpoints outside the IaC surface and were
intentionally left unmanaged.
Resources touched
src/resources/endpoint/client.ts) — updated all five requestpaths and their path params (
environment_id→project_id) to the relocatedroute.
src/resources/dashboard/client.ts) — PATCH body typePatchedDashboard→PatchedPatchedDashboardOpenApi(schema rename upstream).src/resources/experiment/client.ts) —PatchedExperiment→PatchedExperimentWrite; list typePaginatedExperimentList→PaginatedExperimentBasicList(schema renames upstream).All edits are type-reference/path-only; no logic or behavior changed.
pnpm typecheckandpnpm test(291 tests) pass.Unresolved drift / for a human to review
environments_endpoints_*family no longerexists in the live spec. Handled here as a rename (same resource, new route)
rather than a deletion, since the
endpointresource is actively managed.pnpm lintandpnpm format:checkfailacross ~68 files unrelated to this change (verified present on
main). Nopre-commit hook is configured. Left untouched to avoid churning unrelated
files; a repo-wide Prettier/ESLint pass should be a separate PR.
TaskRun
Generated by the daily schema-refresh agent — TaskRun
7d925c8f-da3d-47e2-b34b-3a034aeb54f0.Created with PostHog Code