[nexus] switch nexus internal API to a trait, add scaffolding to manage it#5844
Conversation
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1 [skip ci]
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
| // License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| // file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
|
||
| use std::{io::Write, process::ExitCode}; |
There was a problem hiding this comment.
A lot of this code is quite generic, and I think can live separately so it can be used by other projects. What do you think about moving this out to the dropshot repo or its own repo?
There was a problem hiding this comment.
In a meeting yesterday we decided to wait and see -- leave it in omicron for now but be open to the possibility of putting this code in a central location later.
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1 [skip ci]
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
| "last_port" | ||
| ] | ||
| }, | ||
| "ProbeExternalIpKind": { |
There was a problem hiding this comment.
Yeah -- there's already an ExternalIp type at
omicron/nexus/types/src/external_api/views.rs
Line 428 in 468e699
ExternalIp that are mostly but not entirely isomorphic (e.g. some of them carry around database UUIDs). We should probably revisit this at some point.
| bstr-6f8ce4dd05d13bba = { package = "bstr", version = "0.2.17" } | ||
| bstr-dff4ba8e3ae991db = { package = "bstr", version = "1.9.1" } |
There was a problem hiding this comment.
is this intentional or do we want a single bstr?
There was a problem hiding this comment.
hah good question -- this happened because I pulled in the similar library to do diffs, which depends on bstr 0.2. I filed mitsuhiko/similar#66 about this.
|
Will fix the test failures and rebase the PR onto main once #6056 lands. |
Created using spr 1.3.6-beta.1
Part of the work on RFD 479 Dropshot API traits.
As a first, impactful example, this PR switches over the Nexus internal API to being defined by a trait. Some minor refactoring was required but overall it took me around half an hour to do this.
Included also is a tool,
cargo xtask openapi, which is used to manage this and future documents, as well as instructions that folks can hopefully follow.