diff --git a/.github/buildomat/jobs/tuf-repo.sh b/.github/buildomat/jobs/tuf-repo.sh index 8c4414019c3..9e7c7326bcb 100755 --- a/.github/buildomat/jobs/tuf-repo.sh +++ b/.github/buildomat/jobs/tuf-repo.sh @@ -14,20 +14,10 @@ #: "%/work/*.log", #: ] #: access_repos = [ -#: "oxidecomputer/amd-apcb", -#: "oxidecomputer/amd-efs", #: "oxidecomputer/amd-firmware", -#: "oxidecomputer/amd-flash", -#: "oxidecomputer/amd-host-image-builder", -#: "oxidecomputer/boot-image-tools", #: "oxidecomputer/chelsio-t6-roms", -#: "oxidecomputer/compliance-pilot", -#: "oxidecomputer/facade", -#: "oxidecomputer/helios", -#: "oxidecomputer/helios-omicron-brand", -#: "oxidecomputer/helios-omnios-build", -#: "oxidecomputer/helios-omnios-extra", -#: "oxidecomputer/nanobl-rs", +#: "oxidecomputer/dmar-report", +#: "oxidecomputer/pilot", #: ] #: #: [[publish]] diff --git a/Cargo.lock b/Cargo.lock index f921eaf2fb5..5ad442791a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3881,7 +3881,7 @@ dependencies = [ [[package]] name = "gateway-ereport-messages" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/management-gateway-service?rev=6bd2660d651332f38949cdfd3d23d751ca54b120#6bd2660d651332f38949cdfd3d23d751ca54b120" +source = "git+https://github.com/oxidecomputer/management-gateway-service?rev=669fe557b66f44aed3c622bd17bc092f08797e0c#669fe557b66f44aed3c622bd17bc092f08797e0c" dependencies = [ "serde", "zerocopy 0.8.27", @@ -3890,7 +3890,7 @@ dependencies = [ [[package]] name = "gateway-messages" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/management-gateway-service?rev=6bd2660d651332f38949cdfd3d23d751ca54b120#6bd2660d651332f38949cdfd3d23d751ca54b120" +source = "git+https://github.com/oxidecomputer/management-gateway-service?rev=669fe557b66f44aed3c622bd17bc092f08797e0c#669fe557b66f44aed3c622bd17bc092f08797e0c" dependencies = [ "bitflags 2.9.4", "hubpack", @@ -3908,7 +3908,7 @@ dependencies = [ [[package]] name = "gateway-sp-comms" version = "0.1.1" -source = "git+https://github.com/oxidecomputer/management-gateway-service?rev=6bd2660d651332f38949cdfd3d23d751ca54b120#6bd2660d651332f38949cdfd3d23d751ca54b120" +source = "git+https://github.com/oxidecomputer/management-gateway-service?rev=669fe557b66f44aed3c622bd17bc092f08797e0c#669fe557b66f44aed3c622bd17bc092f08797e0c" dependencies = [ "async-trait", "backoff", diff --git a/Cargo.toml b/Cargo.toml index 407c548a042..0aa02a2e81c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -466,9 +466,9 @@ gateway-client = { path = "clients/gateway-client" } # compatibility, but will mean that faux-mgs might be missing new # functionality.) # -gateway-ereport-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "6bd2660d651332f38949cdfd3d23d751ca54b120", default-features = false, features = ["debug-impls"] } -gateway-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "6bd2660d651332f38949cdfd3d23d751ca54b120", default-features = false, features = ["std"] } -gateway-sp-comms = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "6bd2660d651332f38949cdfd3d23d751ca54b120" } +gateway-ereport-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "669fe557b66f44aed3c622bd17bc092f08797e0c", default-features = false, features = ["debug-impls"] } +gateway-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "669fe557b66f44aed3c622bd17bc092f08797e0c", default-features = false, features = ["std"] } +gateway-sp-comms = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "669fe557b66f44aed3c622bd17bc092f08797e0c" } gateway-test-utils = { path = "gateway-test-utils" } gateway-types = { path = "gateway-types" } gethostname = "0.5.0" diff --git a/gateway-types/src/component_details.rs b/gateway-types/src/component_details.rs index 2c0dad8c95d..bd55c236fda 100644 --- a/gateway-types/src/component_details.rs +++ b/gateway-types/src/component_details.rs @@ -2,6 +2,7 @@ // 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 dropshot::HttpError; use schemars::JsonSchema; use serde::Deserialize; use serde::Serialize; @@ -149,17 +150,40 @@ pub enum PhyType { Vsc8562, } -impl From for SpComponentDetails { - fn from(details: gateway_messages::ComponentDetails) -> Self { +/// Error type for `gateway_messages::ComponentDetails` that are not supported +/// by MGS proper and are only available via `faux-mgs`. +#[derive(Debug, thiserror::Error)] +#[error("unsupported component details: {description}")] +pub struct UnsupportedComponentDetails { + pub description: String, +} + +impl From for HttpError { + fn from(value: UnsupportedComponentDetails) -> Self { + HttpError::for_bad_request( + None, + format!( + "requested component details are not yet supported: {value}" + ), + ) + } +} + +impl TryFrom for SpComponentDetails { + type Error = UnsupportedComponentDetails; + + fn try_from( + details: gateway_messages::ComponentDetails, + ) -> Result { use gateway_messages::ComponentDetails; match details { ComponentDetails::PortStatus(Ok(status)) => { - Self::PortStatus(status.into()) + Ok(Self::PortStatus(status.into())) } ComponentDetails::PortStatus(Err(err)) => { - Self::PortStatusError(err.into()) + Ok(Self::PortStatusError(err.into())) } - ComponentDetails::Measurement(m) => match m.value { + ComponentDetails::Measurement(m) => Ok(match m.value { Ok(value) => Self::Measurement(Measurement { name: m.name, kind: m.kind.into(), @@ -170,7 +194,17 @@ impl From for SpComponentDetails { kind: m.kind.into(), error: err.into(), }), - }, + }), + ComponentDetails::LastPostCode(inner) => { + Err(UnsupportedComponentDetails { + description: format!("last post code: {inner:?}"), + }) + } + ComponentDetails::GpioToggleCount(inner) => { + Err(UnsupportedComponentDetails { + description: format!("GPIO toggle count: {inner:?}"), + }) + } } } } diff --git a/gateway/src/http_entrypoints.rs b/gateway/src/http_entrypoints.rs index e05b89c58f4..3fe8861d009 100644 --- a/gateway/src/http_entrypoints.rs +++ b/gateway/src/http_entrypoints.rs @@ -201,7 +201,11 @@ impl GatewayApi for GatewayImpl { })?; Ok(HttpResponseOk( - details.entries.into_iter().map(Into::into).collect(), + details + .entries + .into_iter() + .map(SpComponentDetails::try_from) + .collect::, _>>()?, )) }; diff --git a/package-manifest.toml b/package-manifest.toml index d5b535aa33b..90f8bc1df80 100644 --- a/package-manifest.toml +++ b/package-manifest.toml @@ -576,8 +576,8 @@ source.type = "prebuilt" source.repo = "management-gateway-service" # In general, this commit should match the pinned revision of `gateway-sp-comms` # in `Cargo.toml`. -source.commit = "6bd2660d651332f38949cdfd3d23d751ca54b120" -source.sha256 = "bf38d83d61ea7b2923fc7bd3aa563627e1f270b4bf18b1fc7bc744ddedc3b8bc" +source.commit = "669fe557b66f44aed3c622bd17bc092f08797e0c" +source.sha256 = "a32b40a0581bab2d90f6f691ef17fcfb1c5925798afb7f8ab86e6ece168e637d" output.type = "zone" output.intermediate_only = true diff --git a/workspace-hack/Cargo.toml b/workspace-hack/Cargo.toml index 01bddf0b1be..5f6201a0199 100644 --- a/workspace-hack/Cargo.toml +++ b/workspace-hack/Cargo.toml @@ -60,8 +60,8 @@ futures-io = { version = "0.3.31" } futures-sink = { version = "0.3.31" } futures-task = { version = "0.3.31", default-features = false, features = ["std"] } futures-util = { version = "0.3.31", features = ["channel", "io", "sink"] } -gateway-ereport-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "6bd2660d651332f38949cdfd3d23d751ca54b120", default-features = false, features = ["debug-impls", "serde"] } -gateway-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "6bd2660d651332f38949cdfd3d23d751ca54b120", features = ["std"] } +gateway-ereport-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "669fe557b66f44aed3c622bd17bc092f08797e0c", default-features = false, features = ["debug-impls", "serde"] } +gateway-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "669fe557b66f44aed3c622bd17bc092f08797e0c", features = ["std"] } generic-array = { version = "0.14.7", default-features = false, features = ["more_lengths", "zeroize"] } getrandom-6f8ce4dd05d13bba = { package = "getrandom", version = "0.2.15", default-features = false, features = ["js", "rdrand", "std"] } group = { version = "0.13.0", default-features = false, features = ["alloc"] } @@ -201,8 +201,8 @@ futures-io = { version = "0.3.31" } futures-sink = { version = "0.3.31" } futures-task = { version = "0.3.31", default-features = false, features = ["std"] } futures-util = { version = "0.3.31", features = ["channel", "io", "sink"] } -gateway-ereport-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "6bd2660d651332f38949cdfd3d23d751ca54b120", default-features = false, features = ["debug-impls", "serde"] } -gateway-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "6bd2660d651332f38949cdfd3d23d751ca54b120", features = ["std"] } +gateway-ereport-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "669fe557b66f44aed3c622bd17bc092f08797e0c", default-features = false, features = ["debug-impls", "serde"] } +gateway-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "669fe557b66f44aed3c622bd17bc092f08797e0c", features = ["std"] } generic-array = { version = "0.14.7", default-features = false, features = ["more_lengths", "zeroize"] } getrandom-6f8ce4dd05d13bba = { package = "getrandom", version = "0.2.15", default-features = false, features = ["js", "rdrand", "std"] } group = { version = "0.13.0", default-features = false, features = ["alloc"] }