chore(codegen): daily schema refresh (2026-08-12) - #119
Draft
timgl wants to merge 1 commit into
Draft
Conversation
Regenerate src/generated/api.d.ts from the live PostHog OpenAPI spec and
reconcile managed-resource drift.
- Endpoints resource moved from /api/environments/{environment_id}/endpoints/
to /api/projects/{project_id}/endpoints/ (operationIds environments_endpoints_*
→ endpoints_*). Update openapi-filter.yaml and endpoint/client.ts paths/params.
- Experiment schemas renamed: Experiment→ExperimentWrite (create body),
PatchedExperiment→PatchedExperimentWrite, PaginatedExperimentList→
PaginatedExperimentBasicList. Update experiment/client.ts type aliases.
- Dashboard PATCH schema renamed PatchedDashboard→PatchedPatchedDashboardOpenApi.
Update dashboard/client.ts type alias.
typecheck + test (291 tests) green.
Generated-By: PostHog Desktop
Task-Id: 9c5d8153-96c4-4656-8830-f942a48ad501
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
Automated daily refresh of
src/generated/api.d.tsfrom the live PostHog OpenAPIspec (
https://us.posthog.com/api/schema/?format=json, filtered byopenapi-filter.yaml), plus the minimal client fixes needed to reconcile driftin the managed resource families.
Why: the scheduled drift check flagged that
api.d.tschanged and thatmanaged operations had moved/renamed upstream; regenerating keeps the typed
client in sync with the live API.
Spec diff size
src/generated/api.d.ts: 17,571 → 21,295 lines (+5,803 / −2,079).New operationIds added to the filter
The endpoints resource moved namespaces upstream — the old operationIds no longer
exist, so their replacements were added to
openapi-filter.yaml:environments_endpoints_list→endpoints_listenvironments_endpoints_create→endpoints_createenvironments_endpoints_retrieve→endpoints_retrieveenvironments_endpoints_update→endpoints_updateenvironments_endpoints_partial_update→endpoints_partial_updateenvironments_endpoints_destroy→endpoints_destroyThe path also moved from
/api/environments/{environment_id}/endpoints/to/api/projects/{project_id}/endpoints/.Resources touched
src/resources/endpoint/client.ts): repointed all 5 calls to thenew
/api/projects/{project_id}/endpoints/path andproject_idparam.src/resources/experiment/client.ts): schema aliases renamed —Experiment→ExperimentWrite(create body),PatchedExperiment→PatchedExperimentWrite,PaginatedExperimentList→PaginatedExperimentBasicList.src/resources/dashboard/client.ts): PATCH schema alias renamedPatchedDashboard→PatchedPatchedDashboardOpenApi.No hand-edits to
src/generated/api.d.ts— regenerated viapnpm codegen.Verification
pnpm typecheck✅pnpm test✅ (291 tests)avoid touching unrelated files; the heavily-edited
endpoint/client.tsisprettier-clean.
Unresolved drift / notes for reviewers
every live operationId against the allowlist, so that list is dominated by
intentionally-unmanaged API surface (accounts, alerts, annotations, warehouse,
etc.). None of those are in scope for this IaC client, so they were left out of
the filter by design. Only the endpoints rename was actionable.
PaginatedExperimentBasicList(results areExperimentBasic, a narrower shape than the fullExperiment).ExperimentBasicstill carries
description,feature_flag_key,name,status, etc., so themanaged-filter and pull paths are unaffected, but flagging in case a reviewer
wants the list to hydrate full experiments.
resolve in the live spec after the endpoints remap.
TaskRun: https://us.posthog.com/project/423401/tasks/9c5d8153-96c4-4656-8830-f942a48ad501
Created with PostHog Desktop