Skip to content

Commit aec72a2

Browse files
authored
[nexus-external-api] reorganize per RFD 619 (#9568)
This is an extremely large PR, but a generally quite mechanical one. I had Claude Code both write most of the PR and review it for conformance with the RFD -- all tests appear to pass, and I also manually spot-checked the versions crate to ensure it generally made sense.
1 parent b25d94e commit aec72a2

446 files changed

Lines changed: 19661 additions & 17399 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 37 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ members = [
111111
"nexus/test-utils-macros",
112112
"nexus/test-utils",
113113
"nexus/types",
114+
"nexus/types/versions",
114115
"ntp-admin",
115116
"ntp-admin/api",
116117
"ntp-admin/types",
@@ -287,6 +288,7 @@ default-members = [
287288
"nexus/test-utils-macros",
288289
"nexus/test-utils",
289290
"nexus/types",
291+
"nexus/types/versions",
290292
"ntp-admin",
291293
"ntp-admin/api",
292294
"ntp-admin/types",
@@ -613,6 +615,7 @@ nexus-test-interface = { path = "nexus/test-interface" }
613615
nexus-test-utils-macros = { path = "nexus/test-utils-macros" }
614616
nexus-test-utils = { path = "nexus/test-utils" }
615617
nexus-types = { path = "nexus/types" }
618+
nexus-types-versions = { path = "nexus/types/versions" }
616619
nix = { version = "0.30", features = ["fs", "net"] }
617620
nom = "7.1.3"
618621
nonempty = "0.12.0"

clients/nexus-client/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ impl TryFrom<types::ProducerEndpoint>
266266
}
267267
}
268268

269-
impl From<nexus_types::external_api::shared::Baseboard> for types::Baseboard {
270-
fn from(value: nexus_types::external_api::shared::Baseboard) -> Self {
269+
impl From<nexus_types::external_api::hardware::Baseboard> for types::Baseboard {
270+
fn from(value: nexus_types::external_api::hardware::Baseboard) -> Self {
271271
types::Baseboard {
272272
part: value.part,
273273
revision: value.revision,

dev-tools/omdb/src/bin/omdb/db.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,11 @@ use nexus_types::deployment::BlueprintZoneDisposition;
137137
use nexus_types::deployment::BlueprintZoneType;
138138
use nexus_types::deployment::DiskFilter;
139139
use nexus_types::deployment::SledFilter;
140-
use nexus_types::external_api::params;
141-
use nexus_types::external_api::views::PhysicalDiskPolicy;
142-
use nexus_types::external_api::views::PhysicalDiskState;
143-
use nexus_types::external_api::views::SledPolicy;
144-
use nexus_types::external_api::views::SledState;
140+
use nexus_types::external_api::disk::BlockSize;
141+
use nexus_types::external_api::physical_disk::{
142+
PhysicalDiskPolicy, PhysicalDiskState,
143+
};
144+
use nexus_types::external_api::sled::{SledPolicy, SledState};
145145
use nexus_types::identity::Resource;
146146
use nexus_types::internal_api::params::DnsRecord;
147147
use nexus_types::internal_api::params::Srv;
@@ -4086,7 +4086,7 @@ async fn cmd_db_dry_run_region_allocation(
40864086
};
40874087

40884088
let size: external::ByteCount = args.size.try_into()?;
4089-
let block_size: params::BlockSize = args.block_size.try_into()?;
4089+
let block_size: BlockSize = args.block_size.try_into()?;
40904090

40914091
let (blocks_per_extent, extent_count) = DataStore::get_crucible_allocation(
40924092
&block_size.try_into().unwrap(),

dev-tools/omdb/src/bin/omdb/nexus.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3009,7 +3009,7 @@ fn print_task_alert_dispatcher(details: &serde_json::Value) {
30093009
}
30103010
}
30113011
fn print_task_webhook_deliverator(details: &serde_json::Value) {
3012-
use nexus_types::external_api::views::WebhookDeliveryAttemptResult;
3012+
use nexus_types::external_api::alert::WebhookDeliveryAttemptResult;
30133013
use nexus_types::internal_api::background::WebhookDeliveratorStatus;
30143014
use nexus_types::internal_api::background::WebhookDeliveryFailure;
30153015
use nexus_types::internal_api::background::WebhookRxDeliveryStatus;

dev-tools/reconfigurator-cli/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ use nexus_types::deployment::{
4949
};
5050
use nexus_types::deployment::{OmicronZoneNic, TargetReleaseDescription};
5151
use nexus_types::deployment::{PendingMgsUpdateSpDetails, PlanningInput};
52-
use nexus_types::external_api::views::SledPolicy;
53-
use nexus_types::external_api::views::SledProvisionPolicy;
52+
use nexus_types::external_api::sled::{SledPolicy, SledProvisionPolicy};
5453
use nexus_types::inventory::CollectionDisplayCliFilter;
5554
use omicron_common::address::REPO_DEPOT_PORT;
5655
use omicron_common::api::external::Generation;

dev-tools/reconfigurator-cli/src/test_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use nexus_types::deployment::Blueprint;
2424
use nexus_types::deployment::BlueprintSource;
2525
use nexus_types::deployment::ClickhousePolicy;
2626
use nexus_types::deployment::PlanningInput;
27-
use nexus_types::external_api::views::SledPolicy;
27+
use nexus_types::external_api::sled::SledPolicy;
2828
use nexus_types::inventory::Collection;
2929
use omicron_uuid_kinds::SledUuid;
3030
use slog::Logger;

live-tests/tests/common/reconfigurator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use nexus_lockstep_client::types::{
1313
use nexus_reconfigurator_planning::blueprint_builder::BlueprintBuilder;
1414
use nexus_reconfigurator_planning::planner::PlannerRng;
1515
use nexus_types::deployment::{Blueprint, BlueprintSource};
16-
use nexus_types::external_api::views::SledState;
16+
use nexus_types::external_api::sled::SledState;
1717
use nexus_types::inventory::Collection;
1818
use omicron_test_utils::dev::poll::{CondCheckError, wait_for_condition};
1919
use omicron_uuid_kinds::GenericUuid;

nexus/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ nexus-reconfigurator-planning.workspace = true
141141
nexus-reconfigurator-preparation.workspace = true
142142
nexus-reconfigurator-rendezvous.workspace = true
143143
nexus-types.workspace = true
144+
nexus-types-versions.workspace = true
144145
omicron-common.workspace = true
145146
omicron-passwords.workspace = true
146147
oxide-tokio-rt.workspace = true

nexus/auth/src/authn/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ pub use nexus_db_fixed_data::user_builtin::USER_SERVICE_BALANCER;
4040
use crate::authz;
4141
use chrono::{DateTime, Utc};
4242
use nexus_db_fixed_data::silo::DEFAULT_SILO;
43-
use nexus_types::external_api::shared::FleetRole;
44-
use nexus_types::external_api::shared::SiloRole;
43+
use nexus_types::external_api::policy::FleetRole;
44+
use nexus_types::external_api::policy::SiloRole;
4545
use nexus_types::identity::Asset;
4646
use omicron_common::api::external::LookupType;
4747
use omicron_uuid_kinds::BuiltInUserUuid;

0 commit comments

Comments
 (0)