[meta] Add check for enum const values#1256
[meta] Add check for enum const values#1256kcudnik merged 1 commit intoopencomputeproject:masterfrom
Conversation
This check will make sure that enum values are constant from this point on all future commits.
|
@lguohan there will be problem with SAI_ACL_TABLE_ATTR_FIELD_END, since if new FIELD will be added to TABLE, SAI_ACL_TABLE_ATTR_ENTRY_LIST will be shifted, look here: https://github.com/opencomputeproject/SAI/blob/master/inc/saiacl.h#L1391 Solution here: #1266 |
|
Thanks Kamil. Few questions:
Thanks, |
merge them before this merge happens
yea, explicit numbers may be provided, but currently this is not required as i made it shis way its doesnt mind
we have to sacrifice something, either metadata of readability, there is no win-win situation here, and from my perspective i dont want to weaken metadata from already make sanity checks. Put item at the end of list and forget about ut would be the choice |
Does that refer to moving the enum fields inserted "in between" SAI spec 1.6.5 to 1.8.1 to the end. |
you need to discuss this on weekly SAI meeting, this seems like a lot of shuffling |
|
@lguohan - please help review |
|
#1259 should be merged in before this one. |
|
@lguohan @shri-khare
there can be any other number of other commits in between ABCD Here is the problem: from backward compatibility each separate branch B C D is compatible with branch A, but branch B is not compatible with branch D, since in branch C we removed an enum. Solution would be to not allow to remove any existing enums and just deprecate them, but SAI repo history shows that enums many times was removed completely or renamed or changed attr type many times. We can't compare every branch permutation since it's not possible in let say 100 commits, and banning remove enums also don't seem like solution, this happed to segment route: https://github.com/opencomputeproject/SAI/pull/1231/files, entire api disappeared and was renamed to different one. In that case should we keep segment route for eternity? seems also not best way. I came up with this scenario 2:
there can be any other number of other commits in between ABCD. Branch BCD are backward compatible with branch A, but B and D is not compatible. At first i though that we can compare every new commit to previous branch and then to base branch A, but this is not good enough ether since if above example there will be additional commit between branch B and D then this detection will not work. So we would need check current commit with every commit down to base commit A, which would be insane. Again solution to this would be to ban removing enums, but same problem arises with like with segment route that shows entire enums can disappear. |
|
@lguohan @shri-khare
now, 1st PR is merged. Then second PR is merged since all checks passed, but this is invalid, since 2nd PR the lass attribute should have explicit value assigned, since 1st PR last attribute was explicitly assigned in the middle. So after merging 2nd PR current SAI status in PORT is invalid, wrong values. Then we we merge 3rd PR, and this also causes invalid enum values and possibly repetitions. So there will be a inconsistent enum values for some time, until 4th PR will be created and it will then show all errors, and 4th person will need to fix all those previous enum values. And this will be constant problem, since once checks passed, they are valid all the time until next PR comes and causes to run validation check. Currently there is no solution for this, workaround for that would be to manually run az pipeline to run validator before merge each PR. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This check will make sure that enum values are constant from this point on all future commits. [meta] Add enum ancestry check on SAI includes (opencomputeproject#1297) Will make sure that from BEGIN_COMMIT we will be always backward compatible for SAI enums Class-Based Forwarding (opencomputeproject#1193) This PR defines class-based forwarding. It contains two aspects: Assignment of a Forwarding Class to a packet, via QOS map or ACL New next-hop group type: SAI_NEXT_HOP_GROUP_TYPE_CLASS_BASED Where member selection is based on the forwarding-class of the packet. Signed-off-by: Jason Bos <[email protected]> [tests] Add missing lib -lzmq to saithrift (opencomputeproject#1298) [meta] Make sure SAI version components are unsigned integers (opencomputeproject#1300) [meta] Add lower case notification names (opencomputeproject#1301)
This check will make sure that enum values are constant from this point
on all future commits.