Skip to content

chore(codegen): daily schema refresh (2026-06-07)#29

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

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

Conversation

@timgl

@timgl timgl commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Daily OpenAPI schema refresh

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

Spec diff size

  • src/generated/api.d.ts: +1384 / −49 lines (only file changed)
  • openapi-filter.yaml: unchanged

The drift is additive field/component changes on operations we already manage —
no breaking removals. New component schemas pulled in by managed operations:

  • ExperimentParameters gained ExperimentMetricOutlierHandling
    (numerator/denominator outlier handling) and related exposure fields
    → managed via experiments_*
  • TeamCustomerAnalyticsConfig, TeamWorkflowsConfig +
    capture_workflows_engagement_events → managed via
    environments_retrieve / environments_partial_update (project settings)
  • CalendarHeatmapFilter, AccountsQuery/AccountsQueryResponse,
    DataWarehouseSyncWarning → referenced by insight/query schemas

New operationIds added to the filter

None. Every operationId in the live spec that is absent from
openapi-filter.yaml was reviewed; none warranted adding:

  • PUT _update variants of resources we manage via PATCH — cohorts_update,
    experiments_update, experiment_holdouts_update,
    experiment_saved_metrics_update, event_definitions_update,
    event_schemas_update / event_schemas_partial_update,
    schema_property_groups_update. The clients update exclusively via
    api.PATCH (*_partial_update), so the PUT variants would be unused dead
    weight. Excluding them is consistent with the existing curation.
  • Environment lifecycleenvironments_list / _create / _update /
    _destroy. Project settings is managed as a singleton via
    environments_retrieve + environments_partial_update; IaC does not
    create/delete environments, so these stay out of scope.
  • All remaining unfiltered operationIds are auxiliary sub-resources
    (sharing, activity, collaborators, bulk-tagging, suggestions, …),
    environment-scoped duplicates of project-scoped resources, or brand-new
    resource families that docs/resources.md already marks as
    not-yet-supported (surveys, notebooks, error_tracking, warehouse, llm_*,
    conversations, vision, etc.). None are core CRUD for a currently-managed
    family.

Resources touched

None beyond the regenerated types — no client.ts Zod schemas or pipeline.ts
projections needed patching. pnpm typecheck passes; all 290 schema/pipeline
tests pass.

Removed operationIds (flagged, not deleted)

None — every operationId currently in openapi-filter.yaml is still present in
the live spec.

Unresolved drift / notes

  • One pre-existing flaky test, src/pull/run.test.ts > runPull orchestrator > writes files and calls tagOnServer on a non-dry run, intermittently exceeds
    its 500ms testTimeout under full-suite parallel load (~504–554ms). Verified
    it fails identically on the base main api.d.ts, so it is unrelated to
    this refresh and left untouched. It passes in isolation. Worth a small
    timeout bump in a separate change.

TaskRun: b6c211a9-cd6d-47b1-9576-70d5773a87cf

🤖 Generated with Claude Code

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

Additive field/component drift on already-managed operations only; no filter
changes and no Zod schema patches required (typecheck + schema tests pass).

Generated-By: PostHog Code
Task-Id: b6c211a9-cd6d-47b1-9576-70d5773a87cf
@timgl timgl requested a review from pl June 7, 2026 08:15
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