Repository navigation
feat(activation): report structured failure for activation and deactivation - #3030
madhavilosetty-intel wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Active moderate and critical findings remain in the activation and deactivation reporting paths, including stale error state, lost child failure details, and unsanitized failure data published over MQTT.
6 open issues
Sanitize failure details before publishing MQTT events · New Sanitize failure details before publishing MQTT events · New Clear stale error status after successful activation or reconfiguration · New Forward structured TLS child failures to the parent report · New Forward structured time-sync failures to the parent report · New Clear stale error status after successful deactivation · New
What changed in this PR
Adds structured failure reporting for activation and deactivation flows while preserving existing status text and response fields. Failures now include stable codes, components, state-machine steps, and optional AMT/WSMAN diagnostics for RPC, logging, and MQTT consumers.
Changes:
- Captures and propagates structured failures across activation and deactivation state transitions.
- Reports failure details in final status messages, logs, and MQTT events.
- Extends activation and deactivation tests for structured failure propagation and response reporting.
| File | Description |
|---|---|
| src/stateMachines/deactivation.ts | Records and reports structured deactivation failures, including cleanup-related failure context. |
| src/stateMachines/deactivation.test.ts | Tests structured failure capture and propagation for deactivation cleanup errors. |
| src/stateMachines/activation.ts | Records, propagates, and reports structured activation failures, including cleanup and child-flow handling. |
| src/stateMachines/activation.test.ts | Tests activation failure codes, steps, return values, deactivation preservation, and final response reporting. |
Review effort: Lite
7b3a8a4 to
f69dbe8
Compare
26f951b to
310e2bb
Compare
66a7f64 to
a7805a4
Compare
310e2bb to
ebc5f26
Compare
2b1458c to
8953175
Compare
82f8be8 to
d375fb6
Compare
78ad95a to
e9ce9f4
Compare
d375fb6 to
5e4b87a
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The timeout fallback can discard the original WSMAN timeout and failed AdminSetup details, causing activation failures to be reported without the relevant error context.
1 open issue
6 resolved since last review
Sanitize failure details before publishing MQTT events Sanitize failure details before publishing MQTT events Clear stale error status after successful deactivation Forward structured time-sync failures to the parent report Forward structured TLS child failures to the parent report Clear stale error status after successful activation or reconfiguration
Review effort: Lite
0d35045 to
adfbf8d
Compare
5e4b87a to
4c64e01
Compare
|
Ran the stack on an AMT 18 against RPS and the output matches main for ccm/acm with tls, cira and the maintenance commands, so no breaking changes that I can see. Small one, the CCM failure gets recorded as CHECK_CLIENT_SETUP but the state is CHECK_SETUP, and the deactivate path sending the Error block could use a test. |
…vation A failed activation or deactivation now sends an additive Status.Error block with a catalog code, the component and step that failed, the WSMAN call AMT was answering, a readable reason and the AMT return value or HTTP status when there is one. The same block goes to one RPS log line and an MQTT event. Legacy status text is unchanged. Related to #2999
adfbf8d to
6aaee07
Compare
|
Thanks for running the stack on hardware. The CCM check now records |


PR Checklist
What are you changing?
Third of five stacked PRs for #2999. This is the first one that changes what rpc-go receives.
A failed activation or deactivation now sends an optional
Errorobject inside the final status message:CodeRPS_ACTIVATION_FAILED,WSMAN_TIMEOUT,RPS_CERT_INVALIDComponentActivationorDeactivationStepADMIN_SETUPReasonAmtReturnValueHttpStatusWsmanCallIPS_HostBasedSetupService.AdminSetupDetailThe same block goes to one RPS log line and one MQTT
failevent.Anything the reviewer should know when reviewing this PR?
Statustext and existing fields are unchanged, and older rpc-go releases ignore the new key.Detailis dropped forRPS_*codes before the message is sent, because that text can name internal hosts; it stays in the RPS log line.AmtReturnValuewith theWsmanCall.mainas the earlier PRs merge.Stack, in merge order:
Errorblock (this PR)ErrorblockIf the there are associated PRs in other repositories, please link them here (i.e. device-management-toolkit/repo#365 )