chore(codegen): daily schema refresh (2026-08-01) - #109
Draft
timgl wants to merge 1 commit into
Draft
Conversation
Regenerate src/generated/api.d.ts from the live PostHog OpenAPI schema and
patch the managed resource clients for upstream schema drift.
Filter changes:
- Endpoints API relocated from /api/environments/{environment_id}/endpoints/
(environments_endpoints_*) to /api/projects/{project_id}/endpoints/
(endpoints_*). Updated openapi-filter.yaml operationIds accordingly.
Client fixes for renamed component schemas:
- endpoint: switch to the /api/projects/{project_id}/endpoints/ paths.
- dashboard: PatchedDashboard -> PatchedPatchedDashboardOpenApi.
- experiment: PatchedExperiment -> PatchedExperimentWrite,
PaginatedExperimentList -> PaginatedExperimentBasicList.
pnpm typecheck and pnpm test both pass.
Generated-By: PostHog Code
Task-Id: 9a9aa815-8b9e-40e4-8fb7-d72dd5f361cc
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.
Why
Automated daily OpenAPI schema refresh. Keeps
src/generated/api.d.tsin sync with the live PostHog spec and patches the managed resource clients when upstream renames schemas or moves paths, so the typed client keeps compiling.Spec diff size
src/generated/api.d.ts: +3,958 / −1,621 lines (17,571 → 19,463). Regenerated viapnpm codegenonly — not hand-edited.Filter changes (new operationIds added)
The Endpoints API was relocated upstream, so its allowlisted operationIds changed:
environments_endpoints_list/create/retrieve/update/partial_update/destroyendpoints_list/create/retrieve/update/partial_update/destroyPath moved from
/api/environments/{environment_id}/endpoints/→/api/projects/{project_id}/endpoints/.No brand-new resource families were added.
openapi-filter.yamlis an allowlist; the drift report's ~1,000 "new operationIds" are the entire un-managed PostHog API surface (accounts, alerts, logs, warehouse, tasks, vision, …), intentionally out of scope for this repo's curated resource set (insights, dashboards, feature flags, endpoints, event definitions, experiments, cohorts, actions, holdouts, saved metrics, project settings, property groups). Adding any of them is a deliberate feature-work decision, not part of an automated refresh.Resources touched (schema-drift patches)
Upstream renamed several component schemas referenced by existing clients:
src/resources/endpoint/client.ts): repointed to the new/api/projects/{project_id}/endpoints/paths (environment_id→project_id).EndpointResponse/PaginatedEndpointResponseListschema names unchanged.src/resources/dashboard/client.ts):PatchedDashboard→PatchedPatchedDashboardOpenApi.src/resources/experiment/client.ts):PatchedExperiment→PatchedExperimentWrite,PaginatedExperimentList→PaginatedExperimentBasicList.pnpm typecheck✅ andpnpm test✅ (291 tests) both pass.Unresolved drift
TaskRun
Generated by the daily schema-refresh agent — Task-Id
9a9aa815-8b9e-40e4-8fb7-d72dd5f361cc.Created with PostHog Code