-
Notifications
You must be signed in to change notification settings - Fork 18
Zod v4 again #2882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zod v4 again #2882
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| // out not to match the real API, which ignores primary: false. | ||
| // https://github.com/oxidecomputer/omicron/blob/61ad056c/nexus/db-queries/src/db/datastore/network_interface.rs?plain=1#L804-L808 | ||
|
|
||
| if (typeof body.primary === 'boolean' && body.primary && !nic.primary) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests were failing:
e2ec instance-networking -g 'NIC table' && e2ec instance-networking -g 'Transit IPs'https://zod.dev/v4/changelog?id=defaults-applied-within-optional-fields
The above change means that primary: SafeBoolean.default(false) is putting primary: false on the body, where in v3 it was just left out. That was tripping the "I refuse to unset the primary" logic below. The default comes from here in omicron and has been there for three years.
| }, | ||
| { | ||
| id: '7fc6ca11-452e-d3e4-9e1c-752ff615abea', | ||
| id: '75832119-7d9b-4e91-a7c6-76b996b69aaa', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out this was an invalid UUID, correctly rejected by Zod because of the d in d3e4, which is supposed to be a 4 for UUID v4. Solved this on the last attempt, see #2828 (comment).
oxidecomputer/console@777a959...8cc5b25 * [8cc5b253](oxidecomputer/console@8cc5b253) oxidecomputer/console#2891 * [33b2b55c](oxidecomputer/console@33b2b55c) oxidecomputer/console#2890 * [41ed7e3a](oxidecomputer/console@41ed7e3a) oxidecomputer/console#2882 * [887a2cab](oxidecomputer/console@887a2cab) oxidecomputer/console#2870 * [76ca8cff](oxidecomputer/console@76ca8cff) oxidecomputer/console#2879
oxidecomputer/console@777a959...8cc5b25 * [8cc5b253](oxidecomputer/console@8cc5b253) oxidecomputer/console#2891 * [33b2b55c](oxidecomputer/console@33b2b55c) oxidecomputer/console#2890 * [41ed7e3a](oxidecomputer/console@41ed7e3a) oxidecomputer/console#2882 * [887a2cab](oxidecomputer/console@887a2cab) oxidecomputer/console#2870 * [76ca8cff](oxidecomputer/console@76ca8cff) oxidecomputer/console#2879
Doing it properly this time.
oxidecomputer/oxide.ts#300