Skip to content

chore(codegen): daily schema refresh (2026-05-24)#16

Open
timgl wants to merge 1 commit into
mainfrom
posthog-code/schema-refresh-2026-05-24
Open

chore(codegen): daily schema refresh (2026-05-24)#16
timgl wants to merge 1 commit into
mainfrom
posthog-code/schema-refresh-2026-05-24

Conversation

@timgl
Copy link
Copy Markdown
Contributor

@timgl timgl commented May 24, 2026

Summary

Daily refresh of src/generated/api.d.ts from the live PostHog OpenAPI spec via pnpm codegen.

Drift size: 140 lines (+129 / −11) — schema enrichment only. No paths or operationIds added or removed in the filtered output, so openapi-filter.yaml is unchanged.

Notable additions in the regenerated schema:

  • TeamCustomerAnalyticsConfig filled out (previously Record<string, never>) with activity_event, signup_event, payment_event, account_group_type_index, …
  • New top-level ParserMode enum referenced from HogQL HogQLQueryModifiers.parserMode
  • New optional fields on query types: resultCustomizations (per-breakdown color customization), cohortLabelStartIndex (retention), useWebAnalyticsPrecompute, usedLazyPrecompute
  • ExperimentSavedMetric / PatchedExperimentSavedMetric gained typed query plus property-level descriptions
  • PatchedTeam / TeamSerializerSkinny gained test_account_filters (typed as unknown)
  • New optional prompt_name query param on experiments_list
  • Enriched descriptions on trend axis-format fields (aggregationAxisFormat, prefix/postfix, decimalPlaces)

Resources touched

None. Existing Zod schemas in src/resources/*/client.ts either use .loose() or model the affected fields as z.unknown(), so the new optional properties are accepted without any code changes.

New operationIds in live spec, not in filter

No action taken. The full list (~1000 operationIds across the live spec) is dominated by auxiliary endpoints for resources we do not currently manage as IaC (annotations, alerts, surveys, error tracking, conversations, warehouse, integrations, …) plus auxiliary operations on managed resources that the IaC tool does not need (e.g. actions_bulk_update_tags_create, cohorts_activity_retrieve, feature_flags_my_flags_retrieve, experiments_duplicate_create, …). These have always existed; they are excluded by design.

A handful of full-PUT variants exist for resources where we deliberately use PATCH: actions_update, cohorts_update, event_definitions_update, experiment_holdouts_update, experiment_saved_metrics_update, experiments_update, schema_property_groups_update, event_schemas_update, event_schemas_partial_update. Skipped — the resource clients use *_partial_update (PATCH) only.

Unresolved drift

None. All operationIds currently in openapi-filter.yaml are still present in the live spec — no removals to flag for human review.

Test plan

  • pnpm install --frozen-lockfile
  • pnpm codegen
  • pnpm typecheck
  • pnpm test — 291/291 pass (one flaky 500 ms timeout in src/pull/run.test.ts cleared on rerun; pre-existing, unrelated to this diff)

TaskRun: 61496ec2-ab3b-4580-a649-1e3dfba8b127

Regenerated `src/generated/api.d.ts` from the live PostHog OpenAPI spec
via `pnpm codegen`. Pure schema enrichment — no path additions/removals
and no `openapi-filter.yaml` changes.

Notable schema additions:
- `TeamCustomerAnalyticsConfig` filled in (previously `Record<string, never>`)
- New top-level `ParserMode` enum referenced from HogQL query settings
- New optional fields on existing query types: `resultCustomizations`,
  `cohortLabelStartIndex`, `useWebAnalyticsPrecompute`, `usedLazyPrecompute`
- `ExperimentSavedMetric` / `PatchedExperimentSavedMetric` gained a typed
  `query` property and descriptions
- `PatchedTeam` / `TeamSerializerSkinny` gained `test_account_filters`
- New optional `prompt_name` query param on experiments_list

No resource modules touched — existing Zod schemas already use `.loose()`
or `z.unknown()` for the affected fields, so the new properties are
already accepted.

Generated-By: PostHog Code
Task-Id: 61496ec2-ab3b-4580-a649-1e3dfba8b127
@timgl timgl requested a review from pl May 24, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant