Skip to content

[cleanup] switch to byte-wrapper#9978

Open
sunshowers wants to merge 1 commit intomainfrom
sunshowers/spr/cleanup-switch-to-byte-wrapper
Open

[cleanup] switch to byte-wrapper#9978
sunshowers wants to merge 1 commit intomainfrom
sunshowers/spr/cleanup-switch-to-byte-wrapper

Conversation

@sunshowers
Copy link
Contributor

@sunshowers sunshowers commented Mar 5, 2026

I wrote serde_human_bytes a long time ago and it's ended up in use in Omicron in several spots. I've released it as byte-wrapper on crates.io (repository), with a few changes:

  • supporting newtypes
  • continuing with the existing serde(with) support
  • adding schemars support.

The schemas specified by byte-wrapper are equivalent, but represented differently/more programmatically than our existing schemas. If we used byte-wrapper's schemas, drift would detect incompatible changes to old Sled Agent API versions. In the interest of not trying to introduce a new version of the Sled Agent API unnecessarily, I've opted to preserve the old schema instead, and left a note that if and when the type changes, the new schema should be used.

This is a ticking time bomb -- tufaceous depends on serde_human_bytes main, and the omicron-common job generates a fresh lockfile. A breaking change to serde_human_bytes main (a reasonable thing to do) caused the omicron-common job to fail. I've put serde_human_bytes back to an old revision until we fix tufaceous (which we can do along with/after tufaceous v2).

Created using spr 1.3.6-beta.1
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