clients/dotnet: SDK methods for AcknowledgeAlarm + QueryActiveAlarms (PR E.2) #106

Merged
dohertj2 merged 1 commits from track-e2-dotnet-alarm-sdk into main 2026-04-30 16:39:36 -04:00
Owner

Summary

Seventh PR of the alarms-over-gateway epic (docs/plans/alarms-over-gateway.md). Depends on PR A.1 (#104, merged) and E.1 (#105, merged).

Hand-written .NET SDK methods on top of the regenerated proto types:

  • MxGatewayClient.AcknowledgeAlarmAsync — routes through the existing safe-unary retry pipeline (Acks are idempotent at MxAccess), maps Unauthenticated/PermissionDenied RpcExceptions to typed MxGatewayAuthenticationException / MxGatewayAuthorizationException via GrpcMxGatewayClientTransport.MapRpcException.
  • MxGatewayClient.QueryActiveAlarmsAsync — server-streaming IAsyncEnumerable<ActiveAlarmSnapshot> mirroring the StreamEvents pattern.
  • IMxGatewayClientTransport extended; GrpcMxGatewayClientTransport implements both methods using the regenerated grpc client.
  • FakeGatewayTransport extended with capture lists, exception queue, and reply / snapshot enqueue helpers.

CLI version-string assertions updated for the GatewayProtocolVersion 2 → 3 bump from A.1.

The CLI alarms verb (subscribe / acknowledge / query-active) is deferred to a follow-up — keeping this PR focused on the SDK surface that lmxopcua's GalaxyDriver consumes in PR B.2. The other-language SDKs (E.3-E.6) layer the same shape on the regen.

Test plan

  • 6 new MxGatewayClientAlarmsTests — request shape, cancellation honor (linked-token via retry pipeline), Unauthenticated mapping, streaming snapshot enumeration, filter prefix passthrough, cancellation during enumeration
  • Pre-existing CLI version assertions updated for 2 → 3 bump
  • Full client test suite: 57 passed (was 51; 6 new)
## Summary Seventh PR of the **alarms-over-gateway** epic (docs/plans/alarms-over-gateway.md). Depends on PR A.1 (#104, merged) and E.1 (#105, merged). Hand-written .NET SDK methods on top of the regenerated proto types: - `MxGatewayClient.AcknowledgeAlarmAsync` — routes through the existing safe-unary retry pipeline (Acks are idempotent at MxAccess), maps Unauthenticated/PermissionDenied RpcExceptions to typed `MxGatewayAuthenticationException` / `MxGatewayAuthorizationException` via `GrpcMxGatewayClientTransport.MapRpcException`. - `MxGatewayClient.QueryActiveAlarmsAsync` — server-streaming `IAsyncEnumerable<ActiveAlarmSnapshot>` mirroring the `StreamEvents` pattern. - `IMxGatewayClientTransport` extended; `GrpcMxGatewayClientTransport` implements both methods using the regenerated grpc client. - `FakeGatewayTransport` extended with capture lists, exception queue, and reply / snapshot enqueue helpers. CLI version-string assertions updated for the `GatewayProtocolVersion` 2 → 3 bump from A.1. The CLI alarms verb (subscribe / acknowledge / query-active) is deferred to a follow-up — keeping this PR focused on the SDK surface that lmxopcua's GalaxyDriver consumes in PR B.2. The other-language SDKs (E.3-E.6) layer the same shape on the regen. ## Test plan - [x] 6 new `MxGatewayClientAlarmsTests` — request shape, cancellation honor (linked-token via retry pipeline), Unauthenticated mapping, streaming snapshot enumeration, filter prefix passthrough, cancellation during enumeration - [x] Pre-existing CLI version assertions updated for 2 → 3 bump - [x] Full client test suite: 57 passed (was 51; 6 new)
dohertj2 added 1 commit 2026-04-30 16:39:34 -04:00
Seventh PR of the alarms-over-gateway epic
(docs/plans/alarms-over-gateway.md). Depends on PR A.1 (proto, merged)
and E.1 (regen, merged).

Hand-written .NET SDK methods on top of the regenerated proto types:

- MxGatewayClient.AcknowledgeAlarmAsync — routes through the existing
  safe-unary retry pipeline (Acks are idempotent at MxAccess), maps
  Unauthenticated/PermissionDenied RpcExceptions to typed
  MxGatewayAuthenticationException / MxGatewayAuthorizationException
  via GrpcMxGatewayClientTransport.MapRpcException.
- MxGatewayClient.QueryActiveAlarmsAsync — server-streaming
  IAsyncEnumerable<ActiveAlarmSnapshot> mirroring the StreamEvents
  pattern.
- IMxGatewayClientTransport extended; GrpcMxGatewayClientTransport
  implements both methods using the regenerated grpc client.
- FakeGatewayTransport extended with capture lists, exception queue,
  and reply / snapshot enqueue helpers.

CLI version-string assertions updated for the GatewayProtocolVersion
2 → 3 bump from A.1.

The CLI alarms verb (subscribe / acknowledge / query-active) is
deferred to a follow-up — keeping this PR focused on the SDK surface
that lmxopcua's GalaxyDriver consumes in PR B.2. The other-language
SDKs (E.3-E.6) layer the same shape on the regen.

Tests:
- 6 new MxGatewayClientAlarmsTests — request shape, cancellation
  honor (linked-token via retry pipeline), Unauthenticated mapping,
  streaming snapshot enumeration, filter prefix passthrough,
  cancellation during enumeration.
- Full client test suite: 57 passed (was 51; 6 new).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dohertj2 merged commit a7edc8f8bf into main 2026-04-30 16:39:36 -04:00
dohertj2 deleted branch track-e2-dotnet-alarm-sdk 2026-04-30 16:39:36 -04:00
Sign in to join this conversation.