Skip to content
Open
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
2 changes: 1 addition & 1 deletion clients/wicketd-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ progenitor::generate_api!(
BootstrapSledDescription = wicket_common::rack_setup::BootstrapSledDescription,
CertificateUploadResponse = wicketd_commission_types_versions::latest::rack_setup::CertificateUploadResponse,
ClearUpdateStateOptions = wicket_common::rack_update::ClearUpdateStateOptions,
ClearUpdateStateResponse = wicket_common::rack_update::ClearUpdateStateResponse,
ClearUpdateStateResponse = wicketd_commission_types_versions::latest::update::ClearUpdateStateResponse,
CurrentRssUserConfigInsensitive = wicket_common::rack_setup::CurrentRssUserConfigInsensitive,
Duration = std::time::Duration,
EventReportForUplinkPreflightCheckSpec = wicket_common::preflight_check::EventReport,
Expand Down
1 change: 1 addition & 0 deletions openapi/wicketd.json
Original file line number Diff line number Diff line change
Expand Up @@ -1483,6 +1483,7 @@
]
},
"ClearUpdateStateResponse": {
"description": "Response to an instruction to clear update data.",
"type": "object",
"properties": {
"cleared": {
Expand Down
13 changes: 1 addition & 12 deletions wicket-common/src/rack_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +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 std::{collections::BTreeSet, time::Duration};
use std::time::Duration;

use semver::Version;

Expand Down Expand Up @@ -80,17 +80,6 @@ pub struct AbortUpdateOptions {
pub test_error: Option<UpdateTestError>,
}

#[derive(
Clone, Debug, Default, PartialEq, Eq, JsonSchema, Serialize, Deserialize,
)]
pub struct ClearUpdateStateResponse {
/// The SPs for which update data was cleared.
pub cleared: BTreeSet<SpIdentifier>,

/// The SPs that had no update state to clear.
pub no_update_data: BTreeSet<SpIdentifier>,
}

#[derive(
Copy, Clone, Debug, JsonSchema, Deserialize, Serialize, PartialEq, Eq,
)]
Expand Down
8 changes: 5 additions & 3 deletions wicket/src/cli/rack_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,18 @@ use tokio::{sync::watch, task::JoinHandle};
use wicket_common::{
WICKETD_TIMEOUT,
rack_update::{
ClearUpdateStateResponse, ComponentUpdateStatus, ExitMessage,
RackUpdateStatus, UpdateState, UpdateStateCounts, rollup_update_state,
ComponentUpdateStatus, ExitMessage, RackUpdateStatus, UpdateState,
UpdateStateCounts, rollup_update_state,
},
update_events::{EventReport, WicketdEngineSpec},
};
use wicketd_client::types::{
ClearUpdateStateParams, GetArtifactsAndEventReportsResponse,
StartUpdateParams,
};
use wicketd_commission_types::update::UpdateTargets;
use wicketd_commission_types::update::{
ClearUpdateStateResponse, UpdateTargets,
};

use super::command::CommandOutput;

Expand Down
2 changes: 1 addition & 1 deletion wicketd-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ use wicket_common::rack_setup::CurrentRssUserConfigInsensitive;
use wicket_common::rack_setup::GetBgpAuthKeyInfoResponse;
use wicket_common::rack_update::AbortUpdateOptions;
use wicket_common::rack_update::ClearUpdateStateOptions;
use wicket_common::rack_update::ClearUpdateStateResponse;
use wicket_common::rack_update::StartUpdateOptions;
use wicket_common::update_events::EventReport;
use wicketd_commission_types::rack_setup::BgpAuthKeyId;
use wicketd_commission_types::rack_setup::CertificateUploadResponse;
use wicketd_commission_types::rack_setup::PutRssUserConfigInsensitive;
use wicketd_commission_types::update::ClearUpdateStateResponse;
use wicketd_commission_types::update::UpdateTargets;

/// Full release repositories are currently (Dec 2024) 1.8 GiB and are likely to
Expand Down
12 changes: 12 additions & 0 deletions wicketd-commission-types/versions/src/initial/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ impl JsonSchema for UpdateTargets {
}
}

/// Response to an instruction to clear update data.
#[derive(
Clone, Debug, Default, PartialEq, Eq, JsonSchema, Serialize, Deserialize,
)]
pub struct ClearUpdateStateResponse {
/// The SPs for which update data was cleared.
pub cleared: BTreeSet<SpIdentifier>,

/// The SPs that had no update state to clear.
pub no_update_data: BTreeSet<SpIdentifier>,
}

/// Error returned when UpdateTargets is constructed from an empty set.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct EmptyUpdateTargets;
Expand Down
1 change: 1 addition & 0 deletions wicketd-commission-types/versions/src/latest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pub mod rack_setup {
}

pub mod update {
pub use crate::v1::update::ClearUpdateStateResponse;
pub use crate::v1::update::EmptyUpdateTargets;
pub use crate::v1::update::UpdateTargets;
}
2 changes: 1 addition & 1 deletion wicketd/src/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ use wicket_common::multirack_setup::CurrentMultirackJoinUserConfig;
use wicket_common::multirack_setup::MultirackJoinConfigBaseUserInput;
use wicket_common::rack_setup::GetBgpAuthKeyInfoResponse;
use wicket_common::rack_update::AbortUpdateOptions;
use wicket_common::rack_update::ClearUpdateStateResponse;
use wicket_common::update_events::EventReport;
use wicketd_api::*;
use wicketd_commission_types::rack_setup::CertificateUploadResponse;
use wicketd_commission_types::rack_setup::PutRssUserConfigInsensitive;
use wicketd_commission_types::update::ClearUpdateStateResponse;

use crate::ServerContext;

Expand Down
2 changes: 1 addition & 1 deletion wicketd/src/update_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ use uuid::Uuid;
use wicket_common::inventory::SpComponentCaboose;
use wicket_common::inventory::SpIdentifier;
use wicket_common::inventory::SpType;
use wicket_common::rack_update::ClearUpdateStateResponse;
use wicket_common::rack_update::StartUpdateOptions;
use wicket_common::rack_update::UpdateSimulatedResult;
use wicket_common::update_events::ComponentRegistrar;
Expand All @@ -98,6 +97,7 @@ use wicket_common::update_events::UpdateEngine;
use wicket_common::update_events::UpdateStepId;
use wicket_common::update_events::UpdateTerminalError;
use wicketd_api::GetArtifactsAndEventReportsResponse;
use wicketd_commission_types::update::ClearUpdateStateResponse;
use wicketd_commission_types::update::UpdateTargets;

#[derive(Debug)]
Expand Down
7 changes: 4 additions & 3 deletions wicketd/tests/integration_tests/updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,17 @@ use wicket::OutputKind;
use wicket_common::{
inventory::{SpIdentifier, SpType},
rack_update::{
ClearUpdateStateResponse, ExitMessage, RackUpdateStatus,
StartUpdateOptions, UpdateState,
ExitMessage, RackUpdateStatus, StartUpdateOptions, UpdateState,
},
update_events::{StepEventKind, UpdateComponent},
};
use wicketd::{RunningUpdateState, StartUpdateError};
use wicketd_client::types::{
GetInventoryParams, GetInventoryResponse, StartUpdateParams,
};
use wicketd_commission_types::update::UpdateTargets;
use wicketd_commission_types::update::{
ClearUpdateStateResponse, UpdateTargets,
};

/// The list of zone file names defined in fake-non-semver.toml.
static FAKE_NON_SEMVER_ZONE_FILE_NAMES: &[&str] = &[
Expand Down
Loading