Skip to content

feat(activation): structured per-component provisioning result#2744

Draft
madhavilosetty-intel wants to merge 2 commits into
mainfrom
feat/2665-structured-provisioning-result
Draft

feat(activation): structured per-component provisioning result#2744
madhavilosetty-intel wants to merge 2 commits into
mainfrom
feat/2665-structured-provisioning-result

Conversation

@madhavilosetty-intel
Copy link
Copy Markdown
Contributor

Break the activation outcome into structured per-component results (Activation, WiredNetwork, WirelessNetwork, TLS, CIRAProxy, CIRAConnection) so operators get granular visibility into what succeeded or failed during the multi-minute provisioning window.

Each child state machine now records a {Result, Mode, Details, ErrorCode} entry into a new additive Status.Components object via a shared recordComponentResult helper, alongside the existing flat status strings. The result rides in the same WebSocket message field, so older RPC clients that don't understand Components simply ignore it. Recording never alters control flow: a component failure is captured for visibility but does not change the activation outcome.

802.1x reporting is intentionally deferred to a follow-up.

Refs #2665

PR Checklist

  • Unit Tests have been added for new changes
  • API tests have been updated if applicable
  • All commented code has been removed
  • If you've added a dependency, you've ensured license is compatible with Apache 2.0 and clearly outlined the added dependency.

What are you changing?

Anything the reviewer should know when reviewing this PR?

If the there are associated PRs in other repositories, please link them here (i.e. device-management-toolkit/repo#365 )

@madhavilosetty-intel madhavilosetty-intel marked this pull request as draft June 3, 2026 02:19
Break the activation outcome into structured per-component results
(Activation, WiredNetwork, WirelessNetwork, TLS, CIRAProxy,
CIRAConnection) so operators get granular visibility into what
succeeded or failed during the multi-minute provisioning window.

Each child state machine now records a {Result, Mode, Details,
ErrorCode} entry into a new additive Status.Components object via a
shared recordComponentResult helper, alongside the existing flat
status strings. The result rides in the same WebSocket message field,
so older RPC clients that don't understand Components simply ignore
it. Recording never alters control flow: a component failure is
captured for visibility but does not change the activation outcome.

802.1x reporting is intentionally deferred to a follow-up.

Refs #2665
Copy link
Copy Markdown

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

Adds a structured, per-component activation/provisioning outcome (status.Components) to improve operator visibility during/after provisioning, while keeping the existing flat status strings for backwards compatibility.

Changes:

  • Introduces Status.Components plus supporting ComponentResult / ComponentResults types for granular activation outcomes.
  • Adds a shared recordComponentResult() helper and wires it into activation + key provisioning child state machines (wired, Wi-Fi, TLS, CIRA proxy, CIRA connection).
  • Updates/extends unit tests to accommodate the new helper (including new unit tests for recordComponentResult itself).

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/models/RCS.Config.ts Adds typed ComponentResult / ComponentResults and the additive Status.Components field.
src/stateMachines/common.ts Introduces recordComponentResult() helper to record structured component outcomes onto device status.
src/stateMachines/common.test.ts Adds unit tests validating recordComponentResult() behavior.
src/stateMachines/activation.ts Records Activation component success/failure into status.Components.
src/stateMachines/activation.test.ts Updates common module mock to include recordComponentResult.
src/stateMachines/wiredNetworkConfiguration.ts Records WiredNetwork component result when updating network status.
src/stateMachines/wiredNetworkConfiguration.test.ts Updates common module mock to include recordComponentResult.
src/stateMachines/wifiNetworkConfiguration.ts Records WirelessNetwork component result when updating network status.
src/stateMachines/wifiNetworkConfiguration.test.ts Updates common module mock to include recordComponentResult.
src/stateMachines/tls.ts Records TLS component success/failure alongside legacy TLSConfiguration status.
src/stateMachines/tls.test.ts Updates common module mock to include recordComponentResult.
src/stateMachines/proxyConfiguration.ts Records CIRAProxy component result alongside legacy network status string.
src/stateMachines/ciraConfiguration.ts Records CIRAConnection component result derived from final statusMessage.
src/stateMachines/ciraConfiguration.test.ts Updates common module mock to include recordComponentResult.

Comment thread src/stateMachines/activation.ts
Comment thread src/stateMachines/wifiNetworkConfiguration.ts
Comment thread src/stateMachines/wiredNetworkConfiguration.ts
Comment thread src/stateMachines/tls.ts
Comment thread src/stateMachines/proxyConfiguration.ts
Comment thread src/stateMachines/ciraConfiguration.ts
@madhavilosetty-intel madhavilosetty-intel force-pushed the feat/2665-structured-provisioning-result branch from 1973fee to d839922 Compare June 3, 2026 03:54
Each child state machine test now drives both success and failure
outcomes and asserts the recorded component result (Activation,
WiredNetwork, WirelessNetwork, TLS, CIRAProxy, CIRAConnection)
has the expected Result/Details.

Refs #2665
@madhavilosetty-intel madhavilosetty-intel force-pushed the feat/2665-structured-provisioning-result branch from d839922 to b113cc9 Compare June 4, 2026 22:25
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