Skip to content

chore(codegen): daily schema refresh (2026-06-04)#26

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

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

Conversation

@timgl
Copy link
Copy Markdown
Contributor

@timgl timgl commented Jun 4, 2026

Daily OpenAPI schema refresh — 2026-06-04

Regenerated src/generated/api.d.ts from the live PostHog OpenAPI spec
(https://us.posthog.com/api/schema/?format=json, filtered by openapi-filter.yaml)
via pnpm codegen. Generated file only — no hand edits.

Spec diff size

  • src/generated/api.d.ts: +1050 / −44 lines (17,571 → ~18,500).
  • openapi-filter.yaml: unchanged.

The drift is confined to shared component schemas referenced by the existing
managed operations' query/filter union types — new schemas
(AccountsQuery/AccountsQueryResponse, CalendarHeatmapFilter,
ExperimentMetricOutlierHandling, TeamCustomerAnalyticsConfig,
AggregationPropertyType, DataWarehouseSyncWarning, ParserMode), a couple of
new optional fields (test_account_filters, tags, revenue-analytics event
fields), and renumbered anonymous Response* aliases. No managed operation was
added or removed.

New operationIds added to the filter

None.

The drift detector reports the entire un-allowlisted API surface as "new" (this is
the allowlist's complement, not genuinely newly-shipped endpoints). Triaged against
the 13 managed resource families:

  • CRUD siblings of existing families — all the candidates are auxiliary, non-declarative
    endpoints (*_activity_retrieve, *_bulk_update_tags_create, *_sharing_*,
    *_references_list, actions_references_list, cohorts_persons_retrieve,
    experiments_duplicate_create/_reset_create/_ship_variant_create, etc.). They are not
    part of the declarative create/update/delete model, so none were added.
  • Brand-new resource families (annotations_*, surveys_*, alerts_*, comments_*,
    roles_*, subscriptions_*, notebooks_*, …) — adopting one of these is a deliberate
    add-resource decision (new client schema, pipeline projection, registration, tests, and
    the tag-based safety invariant). That is out of scope for an unattended daily refresh and is
    left for a human to prioritise rather than auto-adopting dozens of families.

Resources touched

None. Only the generated schema changed. No src/resources/*/client.ts Zod schemas or
pipeline.ts projections required patching.

Verification

  • pnpm typecheckpass.
  • pnpm test → 290/291 pass. The one failure (src/pull/run.test.ts > writes files and calls tagOnServer on a non-dry run) is a pre-existing environmental flake: a 500 ms test
    timeout that trips only under full-suite parallel transform load (collect ~35 s). It passes
    in isolation (298 ms) and fails identically on the baseline api.d.ts, so it is unrelated
    to this refresh. Left untouched per "do not touch unrelated files."

Unresolved drift / removed operations

  • No managed operationId disappeared from the live spec — all 68 allowlisted operations are
    still present in the regenerated output.
  • No operations flagged for human deletion this run.

TaskRun: https://us.posthog.com/project/423401/tasks/40726497-80c3-4a98-a535-ebc90cb498f9

🤖 Generated with Claude Code

Regenerate src/generated/api.d.ts from the live PostHog OpenAPI spec via
`pnpm codegen`. openapi-filter.yaml is unchanged — drift is confined to shared
component schemas referenced by the existing managed operations.

Generated file only; no hand edits.

Generated-By: PostHog Code
Task-Id: 40726497-80c3-4a98-a535-ebc90cb498f9
@timgl timgl requested a review from pl June 4, 2026 08:31
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