chore(codegen): daily schema refresh (2026-05-27)#19
Open
timgl wants to merge 1 commit into
Open
Conversation
Regenerate src/generated/api.d.ts from the live PostHog OpenAPI spec. Schema changes (additive, backward-compatible): - New schemas: CalendarHeatmapFilter, ParserMode enum, Response7 - ExperimentSavedMetric / PatchedExperimentSavedMetric now expose `query` and per-field docs - TeamCustomerAnalyticsConfig is now a typed object (was Record<string, never>) - Endpoint / PatchedEndpoint / EndpointResponse / EndpointVersionResponse gain `tags` - TeamPublic and TeamSerializerForPublic gain `test_account_filters` - TrendsFilter gains `xAxisLabel`, `yAxisLabel`, expanded docs on aggregation axis fields - TrendsQuery gains `calendarHeatmapFilter` - HogQLQueryModifiers gains `parserMode` - RetentionFilter gains `cohortLabelStartIndex` - Multiple web analytics queries gain `useWebAnalyticsPrecompute` - Multiple Response* shapes gain `usedLazyPrecompute` - ChartSettings gains `resultCustomizations` - AggregationPropertyType1 renamed to AggregationPropertyType - event_definitions_list gains `exclude_hidden`, `exclude_stale` query params - experiments_list gains `prompt_name` query param Filter changes: none. All "missing" operationIds in the drift report are auxiliary endpoints (bulk, activity, sharing, collaborators, etc.) or belong to resource families not managed by posthog-definitions. The managed families (insights, dashboards, feature flags, endpoints, event definitions, schema property groups, event schemas, experiments, experiment holdouts, experiment saved metrics, environments, cohorts, actions) already have the CRUD operations they need. Validation: pnpm typecheck and pnpm test (291 tests) pass cleanly. Drift report: no removed operationIds, no breaking changes to Zod schemas or pipeline projections. Generated-By: PostHog Code Task-Id: 41f61832-f47e-4591-b860-fa0cbdd8c332
Contributor
Author
|
The single failing CI check (Semgrep) flagged two findings, both in I'm not modifying the release workflow here for two reasons:
A human should pick up the Semgrep findings against — posthog-code, automated daily schema refresh |
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 PostHog's live OpenAPI spec(filtered by
openapi-filter.yaml).Spec diff size: 313 lines (+298 / −15) in
src/generated/api.d.ts.No change to
openapi-filter.yaml.New operationIds added to the filter
None. The drift report flagged ~1100 operationIds present in the live spec but
not in the filter; none are core CRUD for resource families managed by
posthog-definitions. They fall into:
actions_bulk_update_tags_create,cohorts_activity_retrieve,feature_flags_bulk_delete_create,insights_my_last_viewed_retrieve,dashboards_collaborators_*,experiments_duplicate_create) — not needed by the apply/pull pipelines, whichonly use list/create/retrieve/PATCH/destroy.
environments_*mirror endpoints — environment-scoped duplicates of theproject-scoped endpoints we already consume.
warehouse_, error_tracking_, surveys, notebooks, integrations, etc.) — adding
these would be a deliberate human decision to extend posthog-definitions scope,
not an automated daily refresh.
Resources touched
None. No
src/resources/*/client.tsZod schema orpipeline.tsprojectionrequired updating. All schema changes are additive (new optional fields, new
schemas) and the existing
.loose()Zod parsers tolerate the extra fields.Notable schema changes in
api.d.tsCalendarHeatmapFilter,ParserModeenum,Response7ExperimentSavedMetric/PatchedExperimentSavedMetricnow exposequery: unknownand per-field descriptionsTeamCustomerAnalyticsConfigis now a typed object (wasRecord<string, never>)Endpoint*schemas gaintagsTeamPublic/TeamSerializerForPublicgaintest_account_filtersTrendsFiltergainsxAxisLabel,yAxisLabel, expanded axis-format docsTrendsQuerygainscalendarHeatmapFilterHogQLQueryModifiersgainsparserModeRetentionFiltergainscohortLabelStartIndexuseWebAnalyticsPrecompute; multipleResponse*shapes gainusedLazyPrecomputeChartSettingsgainsresultCustomizationsAggregationPropertyType1renamed toAggregationPropertyTypeevent_definitions_listquery gainsexclude_hidden,exclude_staleexperiments_listquery gainsprompt_nameUnresolved drift
None. No operationIds were removed from the live spec (nothing for a human to
clean up).
Validation
pnpm typecheck✅pnpm test✅ (291 tests, 35 files)Test plan
ExperimentSavedMetricstill parses realsaved-metric responses (now that the spec types
queryexplicitly)🤖 Generated by the daily schema-refresh agent.