Skip to content

chore(codegen): daily schema refresh (2026-06-02)#24

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

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

Conversation

@timgl
Copy link
Copy Markdown
Contributor

@timgl timgl commented Jun 2, 2026

Daily OpenAPI schema refresh — 2026-06-02

Automated regeneration of src/generated/api.d.ts from the live PostHog OpenAPI
spec (https://us.posthog.com/api/schema/?format=json, filtered by
openapi-filter.yaml).

Spec diff size

  • src/generated/api.d.ts: +990 / −24 (1 file changed; 17,571 → 18,537 lines)
  • openapi-filter.yaml: unchanged

The drift is purely additive — transitive schemas pulled in by operations we
already manage:

  • New AccountsQuery / AccountsQueryResponse added to the insight/dashboard
    source query union.
  • New experiment metric fields: ExperimentMetricOutlierHandling,
    denominator_outlier_handling, numerator_outlier_handling, ignore_zeros,
    percentile bounds.
  • New DataWarehouseSyncWarning component referenced by many query responses.
  • New ParserMode enum; assorted generated type-alias renames
    (AggregationPropertyType1AggregationPropertyType, Response* union
    renumbering).

pnpm typecheck and pnpm test (291 tests) both pass with no changes to
any Zod schema or pipeline.ts projection — no managed-resource shape broke.

New operationIds added to the filter

None. 1,940 operationIds exist in the live spec but not in the filter — this
is essentially the entire unmanaged API surface, not a day-over-day delta. Triaged
against the managed families:

  • Redundant PUT-twins of updates we already do via PATCH (partial_update) —
    not needed: endpoints_update, event_definitions_update,
    schema_property_groups_update, event_schemas_update,
    experiment_holdouts_update, experiment_saved_metrics_update,
    experiments_update, cohorts_update.
  • Auxiliary, non-CRUD actions on managed resources — outside the IaC
    create/read/update/delete lifecycle, so deliberately excluded: sharing/passwords,
    activity logs, bulk_update_tags, collaborators, tile/widget ops,
    run/versions/materialization, stats/timeseries, duplicate,
    copy_to_project, etc.
  • event_schemas_partial_update / event_schemas_update — event schemas are
    managed as immutable today (filter exposes only list/create/destroy); adding
    update is a client+pipeline change, not a filter refresh, so out of scope here.

Brand-new resource families (not added)

The remaining new operationIds belong to families not managed by
posthog-definitions (accounts, alerts, annotations, surveys, comments, roles,
persons, batch-exports, error-tracking, llm-analytics, warehouse, …). Onboarding
a family is an explicit, dev-project-verified, multi-file process (the
add-resource skill) and is not appropriate to fan out unattended in a daily
refresh. Left out; flagged here for human prioritization if any are wanted.

Resources touched

  • Generated types only (src/generated/api.d.ts). No src/resources/** changes.

Unresolved drift

  • None. No managed operationId disappeared from the live spec (all 71 still
    present — nothing to flag for human deletion). No failing typecheck/test.
  • Pre-existing lint errors in src/client/typed-posthog.ts,
    src/resources/types.ts, and dashboard/pipeline.acceptance.test.ts are
    unrelated to this refresh and left untouched.

TaskRun

Generated by PostHog Code — Task 152bb044-8140-419f-94af-4990d430557e
https://us.posthog.com/project/423401/tasks/152bb044-8140-419f-94af-4990d430557e

Regenerate src/generated/api.d.ts from the live PostHog OpenAPI spec
(https://us.posthog.com/api/schema/?format=json) filtered by openapi-filter.yaml.

Drift is purely additive transitive schema changes referenced by managed
resources (insight/dashboard query union, experiment metric outlier-handling
fields, DataWarehouseSyncWarning) plus harmless generated type-alias renames.
typecheck and the full test suite pass with no Zod/pipeline changes.

No openapi-filter.yaml change: every new operationId is either an unmanaged
resource family (out of scope) or a redundant PUT-twin / auxiliary action on an
already-managed family.

Generated-By: PostHog Code
Task-Id: 152bb044-8140-419f-94af-4990d430557e
@timgl timgl requested a review from pl June 2, 2026 08:36
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