Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support explicitly setting field tags #339

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Commits on Dec 20, 2019

  1. Support explicitly setting field tags

    The YANG to Protobuf specification mentions using extensions to explicitly set
    the field tag of generated Protobuf fields. Add support for annotating field
    tags.
    
    * Support setting the field number with occodegenext:field-number.
    
    * Support offsetting the field number with occodegenext:field-number-offset.
    
    * Reject field number annotations that result in a value in the Protobuf
    reserved range.
    jasonewang committed Dec 20, 2019
    Configuration menu
    Copy the full SHA
    24d823d View commit details
    Browse the repository at this point in the history
  2. Fix gofmt issues

    jasonewang committed Dec 20, 2019
    Configuration menu
    Copy the full SHA
    a332dd6 View commit details
    Browse the repository at this point in the history

Commits on Jan 3, 2020

  1. Configuration menu
    Copy the full SHA
    ed76346 View commit details
    Browse the repository at this point in the history

Commits on Jan 13, 2020

  1. Configuration menu
    Copy the full SHA
    ed1ea13 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5ff177f View commit details
    Browse the repository at this point in the history
  3. Merge branch 'support-field-number-gen' of github.com:jasonewang/ygot…

    … into support-field-number-gen
    jasonewang committed Jan 13, 2020
    Configuration menu
    Copy the full SHA
    c683aa4 View commit details
    Browse the repository at this point in the history

Commits on Jan 17, 2020

  1. Configuration menu
    Copy the full SHA
    74a15f7 View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2020

  1. Configuration menu
    Copy the full SHA
    d3f59ee View commit details
    Browse the repository at this point in the history

Commits on Feb 26, 2020

  1. Configuration menu
    Copy the full SHA
    068aec9 View commit details
    Browse the repository at this point in the history

Commits on May 27, 2021

  1. Configuration menu
    Copy the full SHA
    d65fbb0 View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2021

  1. Configuration menu
    Copy the full SHA
    9afadc5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4795ccf View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2021

  1. Configuration menu
    Copy the full SHA
    a87ee45 View commit details
    Browse the repository at this point in the history

Commits on Jun 25, 2021

  1. Support explicitly setting proto field tags.

    Credits to @jasonewang for posting the first implementation at openconfig#339. I've
    modified this a bit to read the extension values from the new
    openconfig-codegen-extensions.yang model that's now in
    openconfig/public, and also to address some of the corner cases that
    were discussed in the PR.
    
    Spec:
    https://github.com/openconfig/ygot/blob/master/docs/yang-to-protobuf-transformations-spec.md#field-numbering
    
    Corner cases not mentioned in the spec:
    1. multiple `field-number` extensions.
      - Error out.
    1. multiple `field-number-offset` extensions.
      - Add them up.
    1. `field-number` or `field-number-offset` extensions on non-leaves.
      - Silently ignore.
    1. `field-number-offset` on non-uses statements, including leafs.
      - Allow.
    1. Conflicts.
      - Allow. The proto compilation will of course fail. Automated checking can be added here if we'd prefer.
    
    I made some simple choices for the above items. Erroring out for 3 and 4 would
    likely require changing `goyang` to specifically support checking these cases,
    which I'm not sure is worth it here.
    wenovus committed Jun 25, 2021
    Configuration menu
    Copy the full SHA
    179dfb6 View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2021

  1. Configuration menu
    Copy the full SHA
    4664808 View commit details
    Browse the repository at this point in the history