oxidecomputer / omicron

Omicron: Oxide control plane
Mozilla Public License 2.0
244 stars 38 forks source link

want xtask for updating internal APIs when shared data structures change #5648

Closed rcgoodfellow closed 1 month ago

rcgoodfellow commented 5 months ago

Currently when a data structure is changed that is shared among internal APIs, it requires the developer to manually iterate through compiling individual omicron components, generating their API specifications, recompiling dependent internal crates, if the types are re-exported from those dependent crates compiling them, regenerating their API specifications, finding any dependencies for those crates and continuing to iterate, sometimes circularly with a need for stubbing things out with todo!() directives to break loops.

It seems like there should be something like an xtask for automating this. The xtask would likely not be able to deal with loops, but perhaps that would force us into avoiding loops in the first place.

sunshowers commented 5 months ago

Definitely a huge pain point today. I'm wondering if the approach shown in https://github.com/oxidecomputer/omicron/pull/5653 -- splitting up the API into a trait that sits in its own crate (from which the OpenAPI document can be generated), and the impl in a separate crate -- would improve matters here.

sunshowers commented 4 months ago

As demoed today -- it absolutely does!

rcgoodfellow commented 1 month ago

I think we can close this one now @sunshowers?

sunshowers commented 1 month ago

Since this is focused on the internal API, and all of those have now been converted, this is done, yeah.