chore(codegen): daily schema refresh (2026-05-22)#14
Open
timgl wants to merge 1 commit into
Open
Conversation
Regenerate src/generated/api.d.ts from the live PostHog OpenAPI schema. Changes are purely additive — new field descriptions, a few new optional fields on existing schemas (resultCustomizations, query on ExperimentSavedMetric, test_account_filters on Team, usedLazyPrecompute on QueryResponse, TeamCustomerAnalyticsConfig fields, expanded TrendsFilter docs). No managed paths removed. Generated-By: PostHog Code Task-Id: 5f08433d-8a90-4204-86ba-1ea67ef0074a
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
Daily regeneration of
src/generated/api.d.tsfrom the live PostHog OpenAPIschema (
https://us.posthog.com/api/schema/?format=json), filtered byopenapi-filter.yaml.Spec diff size
src/generated/api.d.ts: +113 / −11 lines (one file changed).openapi-filter.yaml: unchanged.Changes are purely additive:
TrendsFilter(aggregationAxisFormat,aggregationAxisPostfix, aggregationAxisPrefix) and on
ExperimentSavedMetric/PatchedExperimentSavedMetric(name, description, query).
resultCustomizationson a chart filter component.queryonExperimentSavedMetricandPatchedExperimentSavedMetric(already covered by the resource's Zod schema as
record(string, unknown)).test_account_filtersonTeamand the patched team payload.usedLazyPrecomputeon the query-response schema.TeamCustomerAnalyticsConfigexpanded fromRecord<string, never>to a concrete shape (
activity_event,signup_*,subscription_event,payment_event,account_group_type_index).kinddiscriminators on union members were re-describedby openapi-typescript (
ActionsNode,EventsNode,ExperimentDataWarehouseNode); no semantic change.New operationIds added to the filter
None. The drift is entirely within existing schemas — no new
endpoints needed to be allowlisted to keep the managed resources
(insights, dashboards, feature_flags, environments_endpoints,
event_definitions, schema_property_groups, event_schemas,
experiment_holdouts, experiment_saved_metrics, experiments,
environments, cohorts, actions) compiling and behaving correctly.
The live spec contains many operationIds outside the filter
(
annotations_*,alerts_*,surveys_*,subscriptions_*,comments_*,tasks_*, plus a large surface of admin / debug /auxiliary endpoints on already-managed families like
*_activity_retrieve,*_bulk_update_tags_create,*_sharing_*,dashboards_collaborators_*, etc.). These haveintentionally never been in the allowlist — the filter only
exposes operations the resource clients in
src/resources/*actually call. Adopting any of them is a deliberate, human
decision (new resource family via the
add-resourceskill) andout of scope for an automated refresh.
PUT (
_update) variants exist for several PATCH-only managedfamilies (
cohorts_update,event_definitions_update,experiments_update,experiment_holdouts_update,experiment_saved_metrics_update,schema_property_groups_update,event_schemas_update,event_schemas_partial_update). Theexisting clients only use
partial_update(PATCH); adding thePUT variants would expand the generated surface without any
caller, so they remain unfiltered.
Resources touched
None. All managed resources continue to typecheck and behave
identically against the new schema.
Unresolved drift
None. No previously-filtered operationIds disappeared from the
live spec.
Verification
pnpm install --frozen-lockfile✅pnpm codegen✅ — onlysrc/generated/api.d.tsregenerated.pnpm typecheck✅pnpm test— all 290 schema/codegen/pipeline tests pass. Onepre-existing flake in
src/pull/run.test.ts("writes files andcalls tagOnServer on a non-dry run") times out under full-suite
CPU contention at 500 ms; passes when run in isolation. Verified
to flake on
mainwithout this PR's changes, so unrelated toschema drift.
TaskRun
Task
5f08433d-8a90-4204-86ba-1ea67ef0074a.Test plan
src/generated/api.d.tsfor anything thatshould have triggered a resource client update.