chore(codegen): daily schema refresh (2026-08-10) - #118
Draft
timgl wants to merge 1 commit into
Draft
Conversation
Regenerate src/generated/api.d.ts from the live PostHog OpenAPI schema and
migrate the managed clients to follow upstream renames.
- Endpoints resource moved from /api/environments/{environment_id}/endpoints/
(environments_endpoints_*) to /api/projects/{project_id}/endpoints/
(endpoints_*). Updated openapi-filter.yaml and endpoint/client.ts paths +
path params accordingly.
- Renamed upstream schemas: PatchedDashboard -> PatchedPatchedDashboardOpenApi;
Experiment(write)/PatchedExperiment/PaginatedExperimentList ->
ExperimentWrite/PatchedExperimentWrite/PaginatedExperimentBasicList.
typecheck + test (291 tests) green.
Generated-By: PostHog Code
Task-Id: 0440c8ea-11da-4df8-9ea2-dc22a99b7864
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. The live PostHog spec drifted from the
checked-in generated types, so the typed client needed regenerating and the
managed resource clients needed to follow two upstream renames.
Spec diff size
src/generated/api.d.ts: +5103 / −1914 lines (17,571 → 20,760). Regeneratedvia
pnpm codegen— not hand-edited.New operationIds added to the filter
The Endpoints resource was renamed/moved upstream, so its allowlisted
operationIds changed (net: still 6 operations, same family):
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.
openapi-filter.yamlis anallowlist — the drift detector's long "new operationIds" list is essentially
the entire unmanaged PostHog API surface (thousands of ops that have always
been intentionally excluded), not genuinely new endpoints worth managing.
Resources touched
src/resources/endpoint/client.ts) — updated the 5 requestpaths and the path param (
environment_id→project_id) to match the movedroute.
retrievenow returnsEndpointVersionResponse(a superset ofEndpointResponse), so the projection is unaffected.src/resources/dashboard/client.ts) — patched-body type aliasPatchedDashboard→PatchedPatchedDashboardOpenApi(schema rename).src/resources/experiment/client.ts) — type aliasesExperiment→ExperimentWrite,PatchedExperiment→PatchedExperimentWrite,PaginatedExperimentList→PaginatedExperimentBasicList(schema renames).All edits are minimal type/path adjustments — no refactors.
Verification
pnpm typecheck✅pnpm test✅ (291 tests, 35 files)Pre-existing repo-wide
eslint/prettierwarnings are untouched and not in anyfile changed here (
src/generatedis in.prettierignore).Unresolved drift
None. The only managed operations that disappeared from the live spec were the
environments_endpoints_*set, which was a rename (migrated above) rather than aremoval — no operationIds were dropped without a replacement, so nothing needs a
human deletion this run.
TaskRun
Task-Id:
0440c8ea-11da-4df8-9ea2-dc22a99b7864Created with PostHog Code