SY-4299: Strongly-Typed OPC UA Task Types - #2668
Conversation
Author the OPC Oracle schema and rewire the Console task types and the Driver channel structs onto the generated clients in all four languages.
| if (this->synnax_key == 0) | ||
| parser.field_err("channel", "channel must be specified"); |
There was a problem hiding this comment.
Disabled channels fail parsing
When a disabled input channel retains the generated default channel value of 0, InputChan rejects it before ReadTaskConfig filters disabled channels, causing the entire read task to fail configuration even when all enabled channels are valid.
| if (this->synnax_key == 0) | |
| parser.field_err("channel", "channel must be specified"); | |
| if (this->enabled && this->synnax_key == 0) | |
| parser.field_err("channel", "channel must be specified"); |
Knowledge Base Used:
…9-opc-generated-types
…9-opc-generated-types
…pes-part-3' into sy-4299-opc-generated-types
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (68.75%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## sy-4299-strongly-type-ni-task-types-part-3 #2668 +/- ##
=============================================================================
Coverage ? 76.19%
=============================================================================
Files ? 2875
Lines ? 144619
Branches ? 10218
=============================================================================
Hits ? 110198
Misses ? 28478
Partials ? 5943
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…pes-part-3' into sy-4299-opc-generated-types
…pes-part-3' into sy-4299-opc-generated-types
…9-opc-generated-types
…pes-part-3' into sy-4299-opc-generated-types
…pes-part-3' into sy-4299-opc-generated-types
…pes-part-3' into sy-4299-opc-generated-types
Issue Pull Request
Linear Issue
SY-4299
Description
Moves the OPC UA integration onto Oracle-generated task config types, following the
NI pattern from Parts 1-3.
schemas/synnax/opc.oracledefinesBaseChannel,InputChannel(
channel,useAsIndex),OutputChannel(cmdChannel),ReadConfig(extends
task.BaseReadConfig, addsdevice,arrayMode,arraySize), andWriteConfig(extendstask.BaseWriteConfig). Generated clients land in Go, TS,Python, and C++ (
client/*/opc,core/pkg/service/opc).feature/opc/task/types.tsparses only the generated schemas.Cross-field validation Oracle does not generate stays on the hand-composed deploy
schemas: node-ID uniqueness, single index channel, array-mode size/rate coupling,
stream-rate bounds, and command-channel uniqueness. Channel enablement follows the
RFC 0043 polarity (
disabled), threaded through the shared task components via theexisting
polarityprop.InputChan/OutputChanhold the parsed generated structs(
::synnax::opc::InputChannel/OutputChannel) and keep only runtime state(resolved NodeId, fetched Synnax channel) as hand-written code.
enabledpolarity orthe v0 write-channel
channelkey migrate once at Core boot (the storage cutover PRlater in this chain).
the boot migration from the storage cutover PR. The chain ships as one release.
Basic Readiness
Greptile Summary
This PR moves OPC UA task configuration onto Oracle-generated cross-language types and adopts disabled-polarity fields in the Console and driver.
Confidence Score: 4/5
The read-task parser should be fixed before merging because a schema-valid disabled channel with no Synnax binding prevents the entire task from configuring.
Generated input channels permit the default key 0, but the driver validates that key while constructing disabled channels and only filters those channels afterward.
Files Needing Attention: driver/opc/read_task.h
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR Schema["schemas/synnax/opc.oracle"] --> Oracle["Oracle code generation"] Oracle --> TS["TypeScript OPC schemas"] Oracle --> PY["Python OPC models"] Oracle --> CPP["C++ OPC models/parsers"] Oracle --> GO["Go OPC models"] TS --> Console["Console task form and deploy validation"] Console --> Config["Stored OPC task config"] Config --> Driver["OPC driver"] CPP --> Driver Driver --> OPCUA["OPC UA server"]Reviews (1): Last reviewed commit: "Move the OPC UA integration onto the gen..." | Re-trigger Greptile
Context used (4)