Repository navigation
feat(state-machine): record failure code and step on component results - #3031
madhavilosetty-intel wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Two moderate data-propagation issues cause structured failures from the feature-configuration and unconfiguration child machines to be discarded before reaching the activation response.
2 open issues
What changed in this PR
Extends provisioning state machines with structured failure diagnostics, including catalog codes, failed steps, and AMT/CIM return values, while preserving existing status text and progress messages.
Changes:
- Adds structured failure handling across wired, wireless, proxy, CIRA, TLS, network, feature, and unconfiguration flows.
- Maps service-specific AMT, Wi-Fi, and CIM return values to catalog codes.
- Expands unit tests for timeout, database, secret-provider, transport, and component-result behavior.
| File | Description |
|---|---|
| src/stateMachines/wiredNetworkConfiguration.ts | Records structured wired-network failure details and component results. |
| src/stateMachines/wiredNetworkConfiguration.test.ts | Tests wired timeout and database failure metadata. |
| src/stateMachines/wifiNetworkConfiguration.ts | Maps Wi-Fi return values and records structured wireless failures. |
| src/stateMachines/wifiNetworkConfiguration.test.ts | Tests Wi-Fi catalog mappings, return values, and failure metadata. |
| src/stateMachines/unconfiguration.ts | Adds structured failure details to unconfiguration paths. |
| src/stateMachines/unconfiguration.test.ts | Tests HTTP failure classification during unconfiguration. |
| src/stateMachines/tls.ts | Adds structured TLS failure details and component-result reporting. |
| src/stateMachines/tls.test.ts | Tests TLS timeout and component-result metadata. |
| src/stateMachines/proxyConfiguration.ts | Maps proxy return values and records structured proxy failures. |
| src/stateMachines/proxyConfiguration.test.ts | Tests proxy return-value, database, transport, and thrown-error failures. |
| src/stateMachines/networkConfiguration.ts | Records failures from general network configuration steps. |
| src/stateMachines/networkConfiguration.test.ts | Updates network state-machine mocks for structured failure helpers. |
| src/stateMachines/featuresConfiguration.ts | Adds structured failure construction to feature configuration steps. |
| src/stateMachines/featuresConfiguration.test.ts | Tests feature configuration timeout failure metadata. |
| src/stateMachines/ciraConfiguration.ts | Adds structured CIRA failure reporting and CIM return-value handling. |
| src/stateMachines/ciraConfiguration.test.ts | Tests CIRA method, MPS, timeout, and secret-provider failures. |
Review effort: Lite
7b3a8a4 to
f69dbe8
Compare
468d150 to
6eea6d8
Compare
f69dbe8 to
66a7f64
Compare
6eea6d8 to
3ebf33a
Compare
66a7f64 to
a7805a4
Compare
3ebf33a to
b5766c4
Compare
2b1458c to
8953175
Compare
9bd615a to
8d6fcb0
Compare
78ad95a to
e9ce9f4
Compare
8d6fcb0 to
127f403
Compare
e9ce9f4 to
0d35045
Compare
12e1849 to
a3c7402
Compare
0d35045 to
adfbf8d
Compare
a3c7402 to
443d648
Compare
|
The ONFAILURE to ONFAILED change in unconfiguration is a real fix since it used to just hang, worth calling out in the description or splitting out. Component failures now publish fail events even when activation succeeds, which could confuse anything treating fail as the activation failed. Also GenerateKeyPair and the CSR signing steps get tagged RPS_CERT_GENERATION_FAILED even when it's AMT rejecting them. |
adfbf8d to
6aaee07
Compare
443d648 to
0abf048
Compare
Network, CIRA, proxy, TLS, features and unconfiguration failures now carry the catalog code, the step that failed and the AMT return value on their component result, alongside the existing details text. Related to #2999
0abf048 to
da432e9
Compare
|
The |

PR Checklist
What are you changing?
Fourth of five stacked PRs for #2999.
Network (wired, wireless), CIRA, proxy, TLS, features and unconfiguration failures now record the catalog code, the step that failed and the AMT return value on their component result, next to the existing
Detailstext.A non-zero method ReturnValue is not decoded: for example ReturnValue 1 on
AddWiFiSettingsreportsAMT_METHOD_FAILEDwithAmtReturnValue: 1.Bug fix included:
unconfigurationlistened for anONFAILUREevent that the error machine never sends (it sendsONFAILED, like every other machine expects). When the error machine gave up, the unconfiguration machine sat inERRORforever. It now transitions toFAILUREand records the failed step.Anything the reviewer should know when reviewing this PR?
successmessage with noErrorblock. rpc-go turns them into an exit code in feat(rps): render structured provisioning error and map exit code rpc-go#1716.GenerateKeyPairandGeneratePKCS10RequestExare AMT calls, so their failures carry no RPS step code: an AMT rejection resolves to theWSMAN_*code withHttpStatus, a timeout toWSMAN_TIMEOUT.RPS_CERT_GENERATION_FAILEDis used only where RPS or rpc-go generates the certificate.mainas the earlier PRs merge.Stack, in merge order:
ErrorblockErrorblockIf the there are associated PRs in other repositories, please link them here (i.e. device-management-toolkit/repo#365 )