Skip to content

Conversation

@ayaegashi
Copy link
Contributor

@ayaegashi ayaegashi commented Dec 4, 2025

🔍 Description

Implement select_servicing_type() for extensions, osconfig and networks subsystems, enabling runtime updates. Moves the check of whether the OS image has been updated out of storage subsystem so that it is performed before any subsystems' select_servicing_type() functions are called, since if the OS image has been updated no further checks are needed.

Testing can be seen inside Runtime Update and Rollback Testing block.

ndubchak
ndubchak previously approved these changes Dec 4, 2025
@ayaegashi ayaegashi marked this pull request as draft December 4, 2025 19:36
@ayaegashi ayaegashi force-pushed the user/ayaegashi/select-servicing-type branch from eccd9c3 to d364a73 Compare December 5, 2025 00:25
@ayaegashi ayaegashi force-pushed the user/ayaegashi/select-servicing-type branch from d364a73 to 3f6e7d8 Compare December 5, 2025 18:21
@ayaegashi ayaegashi changed the base branch from user/ayaegashi/runtime to main December 5, 2025 18:22
@ayaegashi ayaegashi dismissed ndubchak’s stale review December 5, 2025 18:22

The base branch was changed.

@ayaegashi
Copy link
Contributor Author

/AzurePipelines run [GITHUB]-trident-pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Comment on lines -155 to -159
// Any changes to the storage section of the Host Configuration require
// a Clean Install.
if ctx.spec_old.storage != ctx.spec.storage {
return Ok(ServicingType::CleanInstall);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is performed already inside validate_host_config() for the storage subsystem

@ayaegashi
Copy link
Contributor Author

/AzurePipelines run [GITHUB]-trident-pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ayaegashi
Copy link
Contributor Author

/AzurePipelines run [GITHUB]-trident-pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ayaegashi
Copy link
Contributor Author

/AzurePipelines run [GITHUB]-trident-pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ayaegashi ayaegashi marked this pull request as ready for review December 8, 2025 19:33
Copilot AI review requested due to automatic review settings December 8, 2025 19:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements select_servicing_type() for multiple subsystems (extensions, osconfig, network, and hooks) to enable runtime updates, and centralizes the servicing type selection logic by moving the OS image check out of the storage subsystem.

  • Centralizes servicing type selection in engine/mod.rs, checking for clean install and AB update requirements before delegating to subsystems
  • Moves ab_update_required() from subsystems/storage/image.rs to engine/context/image.rs as a method on EngineContext
  • Implements subsystem-specific select_servicing_type() methods that compare old vs new configurations to determine if runtime updates or AB updates are needed

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/trident/src/subsystems/storage/mod.rs Removes select_servicing_type() implementation and image module import from storage subsystem
crates/trident/src/subsystems/osconfig/mod.rs Adds select_servicing_type() to determine if OS config changes can use runtime update or require AB update
crates/trident/src/subsystems/network.rs Adds select_servicing_type() to enable runtime updates for netplan configuration changes
crates/trident/src/subsystems/hooks.rs Adds select_servicing_type() for scripts changes requiring AB updates
crates/trident/src/subsystems/extensions/mod.rs Adds select_servicing_type() to enable runtime updates for sysext/confext changes
crates/trident/src/engine/update.rs Refactors to call centralized select_servicing_type() function
crates/trident/src/engine/runtime_update.rs Removes redundant comment and hardcodes servicing type in tracing
crates/trident/src/engine/mod.rs Adds centralized select_servicing_type() function, changes default trait implementation, and updates log levels from debug to trace for skip messages
crates/trident/src/engine/context/mod.rs Makes image submodule public within crate
crates/trident/src/engine/context/image.rs Refactors ab_update_required() as a method on EngineContext and updates test calls
.pipelines/templates/stages/testing_rollback/vm-testing.yml Enables runtime update testing for all image flavors
.pipelines/templates/stages/testing_rollback/testing-template.yml Changes default for skipRuntimeUpdateTesting from true to false and fixes whitespace

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


fn select_servicing_type(&self, ctx: &EngineContext) -> Result<ServicingType, TridentError> {
if ctx.spec.os != ctx.spec_old.os {
if runtime_update_sufficient(ctx) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Could this be a method of EngineContext like ab_update_required()? They seem somewhat equivalent

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a preference to keep the logic here so that subsystems that own parts of the HC can individually determine which servicing type is required

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't mean moving this func; I suggested defining it as a method of EngineContext by using the impl EngineContext key words, just like we're doing with ab_update_required(). I think that is idiomatic Rust

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, sorry, based on the GitHub formatting I thought you were suggesting making select_servicing_type() a method of EngineContext, not runtime_update_sufficient.
I think in this case runtime_update_sufficient and the other functions defined lines 34-75 are better as free functions instead of methods since their scope is limited to just this subsystem and file.

@ayaegashi ayaegashi merged commit b6ba8d2 into main Dec 8, 2025
16 checks passed
@ayaegashi ayaegashi deleted the user/ayaegashi/select-servicing-type branch December 8, 2025 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants