ygot icon indicating copy to clipboard operation
ygot copied to clipboard

F0319 10:36:12.648995 23753 protogenerator.go:135] unimplemented type: bits

Open dliu2223 opened this issue 9 months ago • 4 comments

Running latest github.com/openconfig/ygot/proto_generator/protogenerator.go on YANG modules with type bits{...} and received unimplemented type error, per https://github.com/openconfig/ygot/blob/master/docs/yang-to-protobuf-transformations-spec.md, the bits should be supported and translated to enum.

dliu2223 avatar Mar 19 '25 17:03 dliu2223

Generally, our support for bits isn't great across ygot, since it's not a type that is used in OpenConfig (why not just use enum :-))?

I'm happy to review PRs to add this functionality to ygot.

robshakir avatar May 31 '25 02:05 robshakir

The type bits is used by vendor, in this case https://github.com/nokia/7x50_YangModels/tree/master/latest_sros_23.10, in their native model, which has features that are not supported by the standard OC models.

In our network schema, both OC and native models are supported and compiled using ygot/gogen to create GoStruct for in memory cache. So far, the gogen actually worked well with native model in YANG1.1, with some minor deviation, e.g., type bits and leaf name validate (already reported).

The real benefits are we can start to move vendor by vendor to an uniform schema and using gNMI on both native and OC models, vs, waiting for the industry to be fully OC compliant. So, I know it is not used by the OC YANG, but it would be very helpful in adapting gNMI for both OC and non-OC models.

In summary, the support of both validate leaf and bits are more urgent for ygot/gogen, protogen is less critical, since most vendors support json_ietf encoding.

Thanks

David

dliu2223 avatar May 31 '25 03:05 dliu2223

ACK -- I am not arguing against having this support, just suggesting that code contributions on this would be welcome given that it is not within the current contributors' primary use cases.

r.

robshakir avatar Jun 02 '25 15:06 robshakir

Got it, I will look into it and get back to you. Thanks

On Mon, Jun 2, 2025 at 8:24 AM Rob Shakir @.***> wrote:

robshakir left a comment (openconfig/ygot#1024) https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openconfig_ygot_issues_1024-23issuecomment-2D2931245522&d=DwMCaQ&c=udBTRvFvXC5Dhqg7UHpJlPps3mZ3LRxpb6__0PomBTQ&r=muzbAtqPojeg0y31fUcbZA_FaWC9exft3yCCrqM_26s&m=CF0C1GE7HCMirx3Xn3EEBYkXsb-2FoxLSd3aCA1JButaZA2UadV310A2Vdp2uDGr&s=FYGr5zKEbiktZIqtBxpRJ8C24q_oZpYCyKbsDfw5Ng4&e=

ACK -- I am not arguing against having this support, just suggesting that code contributions on this would be welcome given that it is not within the current contributors' primary use cases.

r.

— Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openconfig_ygot_issues_1024-23issuecomment-2D2931245522&d=DwMCaQ&c=udBTRvFvXC5Dhqg7UHpJlPps3mZ3LRxpb6__0PomBTQ&r=muzbAtqPojeg0y31fUcbZA_FaWC9exft3yCCrqM_26s&m=CF0C1GE7HCMirx3Xn3EEBYkXsb-2FoxLSd3aCA1JButaZA2UadV310A2Vdp2uDGr&s=FYGr5zKEbiktZIqtBxpRJ8C24q_oZpYCyKbsDfw5Ng4&e=, or unsubscribe https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AEN56CNPYVQ2HBQRAMKC6GT3BRUB5AVCNFSM6AAAAABZLQBMNWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSMZRGI2DKNJSGI&d=DwMCaQ&c=udBTRvFvXC5Dhqg7UHpJlPps3mZ3LRxpb6__0PomBTQ&r=muzbAtqPojeg0y31fUcbZA_FaWC9exft3yCCrqM_26s&m=CF0C1GE7HCMirx3Xn3EEBYkXsb-2FoxLSd3aCA1JButaZA2UadV310A2Vdp2uDGr&s=aLBGlmXtr8rXrjfWx0lL09zMXN8MZ7wzPeqo_afzOx0&e= . You are receiving this because you authored the thread.Message ID: @.***>

-- David Liu

dliu2223 avatar Jun 02 '25 17:06 dliu2223