You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
client: re-export instance spec types for use in sled-agent (#899)
Using generated instance spec types in sled-agent's API has some
substantial downsides:
1. Some component types (e.g. storage backends) have fields that we'd
like to redact when logging their contents using their `Debug` impls.
The native versions of these types manually impl `Debug` for these
types, but their generated counterparts always derive Debug (and
AFAIK there's no way to ask Progenitor not to add this derive).
2. The Dropshot-generated OpenAPI doc for sled-agent's API winds up
having very gnarly type descriptions that include fully-escaped
versions of the Progenitor-generated doc comments from
propolis-client.
To get around these problems:
- Add a propolis-client submodule that re-exports all instance
spec-related types from `propolis_api_types`.
- Add `replace` directives to the generated client that replace the
generated versions of `InstanceSpecV0`, `VersionedInstanceSpec`, and
`ReplacementComponent` with their re-exported equivalents.
This way, sled-agent can use the re-exported spec types internally and
in its API. This reuses their manual `impl`s when they exist (solving
problem 1) and avoids presenting generated JSON schema documentation
when generating the sled-agent API document (solving problem 2).
Remove the `JsonSchema` implementations for generated spec types, since
they're no longer needed.
0 commit comments