chore(codegen): daily schema refresh (2026-08-03) - #111
Draft
timgl wants to merge 1 commit into
Draft
Conversation
Regenerate src/generated/api.d.ts from the live PostHog OpenAPI spec and
realign managed resource clients with renamed component schemas.
- Endpoints API renamed environments_endpoints_* -> endpoints_* (path moved
from /api/environments/{environment_id}/endpoints/ to
/api/projects/{project_id}/endpoints/); updated openapi-filter.yaml and the
endpoint client accordingly.
- Dashboard PATCH body schema PatchedDashboard -> PatchedPatchedDashboardOpenApi.
- Experiment write schemas Experiment/PatchedExperiment/PaginatedExperimentList
-> ExperimentWrite/PatchedExperimentWrite/PaginatedExperimentBasicList.
pnpm typecheck and pnpm test pass (291 tests).
Generated-By: PostHog Code
Task-Id: b291a215-b762-4dd2-8443-0da70472b635
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. PostHog's live API spec drifted from the
committed types, so
src/generated/api.d.tsneeded regenerating and a fewmanaged-resource clients needed realigning with renamed schemas/paths.
Spec diff size
src/generated/api.d.ts: +3958 / −1621 lines (regenerated viapnpm codegen, never hand-edited).New operationIds added to the filter
The endpoints API was renamed upstream —
environments_endpoints_*disappeared and reappeared as
endpoints_*at a new project-scoped path(
/api/projects/{project_id}/endpoints/{name}/). Swapped the six operationIdsin
openapi-filter.yaml:Resources touched
/api/projects/{project_id}/endpoints/route andproject_idpath param.PatchedDashboard→PatchedPatchedDashboardOpenApi.Experiment/PatchedExperiment/PaginatedExperimentList→ExperimentWrite/PatchedExperimentWrite/PaginatedExperimentBasicList.Edits are minimal type-alias/path updates — no refactors.
pnpm typecheckandpnpm test(291 tests) pass.Unresolved / not actioned drift
environments_endpoints_*removed upstream — resolved here via the rename above (no orphaned filter entries remain). Flagging per policy: no managed operationIds were deleted, only renamed.~1719 live operationIds are outside the filter and were intentionally left out. They fall into three buckets, none in scope for this IaC tool:
_updateverbs on managed families (e.g.cohorts_update,event_definitions_update,experiments_update) — these resources are deliberately driven via PATCH/partial_update; unchanged long-standing design choice, not new drift.dashboards_collaborators_*,insights_sharing_*,feature_flags_activity_*,*_bulk_update_tags_create) — not core CRUD.No brand-new resource family met the bar for adding via
add-resource.TaskRun
PostHog Code TaskRun
b291a215-b762-4dd2-8443-0da70472b635— https://us.posthog.com/project/423401/tasksCreated with PostHog Code