Skip to content

chore(codegen): daily schema refresh (2026-05-28)#20

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

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

Conversation

@timgl
Copy link
Copy Markdown
Contributor

@timgl timgl commented May 28, 2026

Summary

Daily OpenAPI schema refresh from https://us.posthog.com/api/schema/?format=json, filtered by openapi-filter.yaml.

  • Spec diff size: ~430 lines in src/generated/api.d.ts; schema-only (component additions, field additions, one rename). No path or operationId additions/removals affecting managed resources.
  • openapi-filter.yaml: unchanged.

New operationIds added to filter

None. The drift detector flagged ~1000 operationIds in the live spec that are not in the filter, but none belong to a managed resource family in a way that would extend declarative management:

  • The unmanaged operations are auxiliary endpoints — activity logs, sharing, bulk-tag updates, collaborators, suggestions, thresholds, snapshotting, exposure-cohort creation, etc. — orthogonal to the create / read / update / destroy lifecycle this package manages.
  • Putting them through the filter would inflate api.d.ts (already ~13k LOC trimmed) without enabling new IaC capabilities.
  • Possible candidates if scope expands later: event_schemas_partial_update / event_schemas_update (event_schemas resource currently has list/create/destroy only), experiments_update, experiment_holdouts_update, experiment_saved_metrics_update, cohorts_update, event_definitions_update (PUT variants alongside the existing PATCH partial_update — none are needed today).

Resources touched

None. typecheck and vitest are clean against the regenerated types. Only src/generated/api.d.ts changed.

Notable schema-level additions consumed transitively by existing clients:

  • Endpoint* schemas gained a tags field (writable on create/update, read-only on responses).
  • ExperimentApiEventSource gained math, math_property, math_hogql, math_group_type_index.
  • ExperimentMetric gained denominator_outlier_handling, ignore_zeros, and winsorization controls.
  • New components: CalendarHeatmapFilter, DataWarehouseSyncWarning, ExperimentMetricOutlierHandling, ParserMode, Response7.
  • Rename: AggregationPropertyType1AggregationPropertyType (no consumer in this repo).

Unresolved drift

None.

  • No managed operationIds disappeared from the live spec (verified — all 71 still present).
  • No type breaks in src/resources/*/client.ts or pipeline.ts.
  • One flaky timeout in src/pull/run.test.ts passes on retry; unrelated to schema.

Test plan

  • pnpm install --frozen-lockfile
  • pnpm codegen
  • pnpm typecheck
  • pnpm test (re-ran a flaky timeout in pull/run.test.ts — passes in isolation, not schema-related)

TaskRun: 7ee22061-99f6-46b7-b5e3-a4c44c9e8f4b

Regenerate src/generated/api.d.ts from us.posthog.com/api/schema/.

Schema-only drift: new fields (tags on Endpoint*, math/* on
ExperimentMetricSource, resultCustomizations on Chart settings,
denominator_outlier_handling/ignore_zeros on ExperimentMetric),
new component schemas (CalendarHeatmapFilter, DataWarehouseSyncWarning,
ExperimentMetricOutlierHandling, Response7, ParserMode), one rename
(AggregationPropertyType1 → AggregationPropertyType). No path/operationId
additions or removals affecting managed resources.

Generated-By: PostHog Code
Task-Id: 7ee22061-99f6-46b7-b5e3-a4c44c9e8f4b
@timgl timgl requested a review from pl May 28, 2026 08:24
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