Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions .github/buildomat/jobs/tuf-repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
46 changes: 40 additions & 6 deletions gateway-types/src/component_details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -149,17 +150,40 @@ pub enum PhyType {
Vsc8562,
}

impl From<gateway_messages::ComponentDetails> 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<UnsupportedComponentDetails> for HttpError {
fn from(value: UnsupportedComponentDetails) -> Self {
HttpError::for_bad_request(
None,
format!(
"requested component details are not yet supported: {value}"
),
)
}
}

impl TryFrom<gateway_messages::ComponentDetails> for SpComponentDetails {
type Error = UnsupportedComponentDetails;

fn try_from(
details: gateway_messages::ComponentDetails,
) -> Result<Self, Self::Error> {
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(),
Expand All @@ -170,7 +194,17 @@ impl From<gateway_messages::ComponentDetails> 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:?}"),
})
}
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion gateway/src/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Result<Vec<_>, _>>()?,
))
};

Expand Down
4 changes: 2 additions & 2 deletions package-manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions workspace-hack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down Expand Up @@ -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"] }
Expand Down
Loading