chore(codegen): daily schema refresh (2026-08-06) - #114
Draft
timgl wants to merge 1 commit into
Draft
Conversation
Regenerate src/generated/api.d.ts from the live PostHog OpenAPI schema.
- Endpoints API moved from /api/environments/{environment_id}/endpoints/ to
/api/projects/{project_id}/endpoints/ (operationIds renamed
environments_endpoints_* -> endpoints_*). Added the new ids to
openapi-filter.yaml and repointed the endpoint client paths/params.
- Schema component renames: PatchedDashboard -> PatchedPatchedDashboardOpenApi,
PatchedExperiment -> PatchedExperimentWrite,
PaginatedExperimentList -> PaginatedExperimentBasicList.
typecheck + test (291 tests) green.
Generated-By: PostHog Code
Task-Id: 25f358ad-c88c-46af-b921-3ad338d45d7e
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
committed types, so
src/generated/api.d.tswas regenerated and the managedresource clients were realigned with the new schema/paths.
Spec diff size
src/generated/api.d.ts: +4427 / −1619 lines (17,571 → 20,379).openapi-filter.yaml: +12 lines (6 new operationIds + a note).New operationIds added to the filter
The endpoints API was restructured — it moved from
/api/environments/{environment_id}/endpoints/to/api/projects/{project_id}/endpoints/, and its operationIds were renamedenvironments_endpoints_*→endpoints_*. Added the CRUD set for the existingendpointresource family:endpoints_listendpoints_createendpoints_retrieveendpoints_updateendpoints_partial_updateendpoints_destroyEvery other new operationId reported by the drift detector was left out by
design.
openapi-filter.yamlis an allowlist: the vast majority of thePostHog API is intentionally excluded. The remaining new ids fall into:
(e.g.
insights_activity_retrieve,dashboards_collaborators_*,feature_flags_status_retrieve) — not resource lifecycle, not IaC-relevant.*_update) variants of resources we deliberately manage via PATCH(
event_definitions_update,experiments_update,cohorts_update,schema_property_groups_update,experiment_holdouts_update,experiment_saved_metrics_update,event_schemas_update/partial_update).These families intentionally expose
partial_updateonly.analytics, error tracking, etc.) — none met the bar for an autonomous
add-resource run in a daily refresh; a human should decide if any are worth
managing.
Resources touched
openapi-filter.yamlendpoints_*CRUD operationIdssrc/resources/endpoint/client.ts…/environments/{environment_id}/endpoints/…→…/projects/{project_id}/endpoints/…andenvironment_id→project_idparamsrc/resources/dashboard/client.tsPatchedDashboard→PatchedPatchedDashboardOpenApisrc/resources/experiment/client.tsPatchedExperiment→PatchedExperimentWrite;PaginatedExperimentList→PaginatedExperimentBasicListpnpm typecheckandpnpm test(291 tests) pass. Pre-existing repo-widelint/format warnings are unrelated and untouched (
src/generatedis in.prettierignore).Unresolved drift (needs a human)
The 6 stale
environments_endpoints_*operationIds inopenapi-filter.yamlnolonger match anything in the live spec (renamed to
endpoints_*, added above).Per policy this refresh does not delete disappeared operationIds — please
remove the stale
environments_endpoints_*block. No other managedoperationIds disappeared.
TaskRun
Task-Id:
25f358ad-c88c-46af-b921-3ad338d45d7eCreated with PostHog Code