Repository navigation
console: bump kysely to 0.29 and fix yarn gen:types - #40550
Merged
Merged
Conversation
kysely 0.28's Postgres introspector, which kysely-codegen uses for its table query, calls pg_get_serial_sequence. Materialize lacks it, so `yarn gen:types` has failed since the bump from kysely 0.27 (MaterializeInc#35669). The query also lists only relkinds 'r', 'v' and 'p', which skips the catalog's builtin materialized views ('m'). Run kysely-codegen from bin/kysely-codegen.ts with an introspector that overrides the table query, keeping kysely-codegen's enum handling and serializer. The script writes the copyright header, which the codegen output lacks and the copyright lint requires. bin/generate-types now exits on errors, pulls the requested image, and stops the container on exit. Before, each run left a container bound to port 6875, and the next run generated types from that old container.
Generated with the fixed `yarn gen:types`. Adds mz_builtin_columns and mz_builtin_index_columns. Builtin columns lose their Generated<> wrappers, since MaterializeInc#40316 reports no default for them in pg_attribute. Keeps the two hand-added TODO markers for mz >= 26.34.
MaterializeInc#39992 typed mz_cluster_auto_scaling_strategies and mz_cluster_reconfigurations by hand while gen:types was broken. The generator now emits both, and AUTO_SCALING_MIN_VERSION gates them at runtime, so the file is exactly the generator output.
jdonelson
approved these changes
Nov 6, 2026
jdonelson
left a comment
Contributor
There was a problem hiding this comment.
Nice fix. The cleanup trap closes a nasty trap where a stale container silently served old types. LGTM.
kysely 0.28.17 -> 0.29.8 and kysely-codegen 0.17 -> 0.20.0. Supersedes MaterializeInc#39686. 0.29 rejects limit(sql.raw(...)), so rawLimit and the lag history limit call query.limit(sql.lit(n)). rawLimit used modifyEnd before, and 0.29 sorts end modifiers with Array.prototype.toSorted, which Chrome 109 lacks. Neither rawLimit caller has an OFFSET or another end modifier, so the compiled SQL is unchanged. kysely-codegen 0.20 renames generate's schemas option to defaultSchemas, lists materialized views itself, and writes to a default file in node_modules unless outFile is null. kysely 0.29's TableMetadata adds isForeign. The generated types are identical to 0.17's.
leedqin
enabled auto-merge (squash)
November 6, 2026 22:38
This was referenced Nov 10, 2026
leedqin
added a commit
that referenced
this pull request
Nov 11, 2026
### Motivation Renovate opens a batch of dependency PRs every week. CI catches most breaks, but last month's Console upgrades hit several it can't see: - renamed config that the new version silently ignores (msw 3's `onUnhandledRequest`); - dev scripts CI never runs (`yarn gen:types` was broken from #35669 until #40550); - APIs and syntax old browsers lack (kysely 0.29's `toSorted`, string-width 8's `v`-flag regexes); - Node floors above `engines.node`; - layout jsdom can't measure (visx 4's `ParentSize`); - version holds a later bump undid (react-virtualized-auto-sizer in #40521). ### Description Adds the `mz-renovate-triage` skill. - `SKILL.md` sorts open Renovate PRs by risk, checks what CI can't, and posts one verdict comment per PR for the approver (Ready to approve, Needs changes, Needs a decision, Waiting on CI, Superseded). It edits that comment in place on later runs and skips PRs whose head hasn't changed. It never approves, merges, closes, labels or pushes. - `lessons.md` records what the Console upgrades of October and November needed, as rules and as a table by package, each with the PR that taught it. - A row in `.agents/skills/README.md`. A scheduled routine runs the skill twice a week. It can also be run by hand, where it shows the comments and asks before posting. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
leedqin
added a commit
that referenced
this pull request
Nov 11, 2026
### Motivation `console/package.json` declares `"node": ">=20.12.2"`, but the installed dependency tree no longer runs there. Checking every installed package's `engines.node` against candidate versions: | Node | Packages whose `engines.node` rejects it | |---|---| | 20.12.2 | 60 (jsdom's CSS packages, …) | | 20.19.0 | 18 (`@mswjs/interceptors` 0.45, `@rolldown/plugin-babel`, `@testing-library/jest-dom` 7, `eslint-plugin-unicorn` 79, …) | | 22.12.0 | 25 (`@eslint/*` needs 22.13, …) | | 22.18.0 | 7 (`node-gyp` 13, `which` 7, `abbrev` 5, `nopt` 10, `lint-staged` 17, `undici` 8.12, …) | | 24.11.0 | 5 (`node-gyp` 13 and its helpers) | | 22.22.2, 24.15.0, 26.0.0 | none | msw 3 (#39684) and kysely 0.29 (#40550) both deferred this change to #39683, which is still open. ### Description `engines.node` becomes `^22.22.2 || ^24.15.0 || >=26.0.0`, the intersection of every installed package's range. Volta (26.10.0), `console/Dockerfile` and CI already run Node 26. It is the same range as #39683, so that PR merges cleanly on this line. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
yarn gen:typesfails withfunction "pg_get_serial_sequence" does not exist. kysely-codegen runs kysely's Postgres introspector for its table query. Since the bump to kysely 0.28 (#35669), that query callspg_get_serial_sequence, which Materialize lacks. kysely 0.29 still does. The query also lists only relkindsr,vandp, so the catalog's builtin materialized views (m) never reached the types under kysely-codegen 0.17. #40044's types were generated with both patched by hand innode_modules.This also bumps kysely to 0.29 and kysely-codegen to 0.20, superseding #39686.
Description
bin/kysely-codegen.tsruns kysely-codegen programmatically with an introspector that overrides only the table query. kysely-codegen's materialized view query, enum handling and serializer still apply.types/materialize.d.ts. The codegen output lacks it, and the copyright lint fails without it.bin/generate-typesexits on errors, pulls the requested image (a cachedlatestwent stale), and stops the container on exit. Before, each run left a container bound to port 6875, and the next run generated types from that old container.limit(sql.raw(...)).rawLimitand the lag history limit now callquery.limit(sql.lit(n)), which still inlines the limit as a literal, as Materialize requires.rawLimitused to append its limit withmodifyEnd. In 0.29, compiling end modifiers callsArray.prototype.toSorted, which Chrome 109 lacks. No console query uses end modifiers now. NeitherrawLimitcaller has an OFFSET or another end modifier, so the compiled SQL is unchanged.requires it, soyarn gen:typesneeds Node 22.12 or later. CI and the Volta pin run Node 26, and console: bump vite-plugin-svgr to 5 and jsdom to 30 #39683 updatesengines.node.types/materialize.d.tsis regenerated against v26.49.1. kysely-codegen 0.17 and 0.20 produce identical output.mz_builtin_columnsandmz_builtin_index_columns.Generated<>wrappers, because sql-839: Report SQL string 'NULL' for table column defaults in mz_columns again #40316 changedpg_attribute.atthasdefto report no default for them. The console only selects from these relations, whereGenerated<T>andTread the same.TODOmarkers from console: configure a cluster from a drawer on the redesigned cluster page #39992. The generator now emitsmz_cluster_auto_scaling_strategiesandmz_cluster_reconfigurations, andAUTO_SCALING_MIN_VERSIONstill gates them at runtime. The file is now exactly the generator output.Worth checking on the preview, since these run the changed limits:
🤖 Generated with Claude Code