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

refactor(cloud): update to support buf lint and generation automation #413

Merged
merged 2 commits into from
Dec 15, 2023

Conversation

sandersms
Copy link
Contributor

Transition cloud to the buf lint and buf generate operation to allow for automation of the protobuf file generation.

Support for cpp and java are being removed at this time. Generation supports go and python. Support for other languages can be added as needed by the buf.gen.yaml file.

Be aware that the .proto files are moved up from the v1alpha1 directory to support the buf operation and to keep the version of the generated files in a separate (v1, v1alpha1, etc.) directory structure. This will allow for the future ability to autogenerate the files and place them in a separate repo location.

@sandersms sandersms marked this pull request as ready for review December 6, 2023 23:21
@sandersms sandersms requested a review from a team as a code owner December 6, 2023 23:21
@@ -2,22 +2,23 @@
# Copyright (C) 2022 Intel Corporation
# Copyright (c) 2022 Dell Inc, or its subsidiaries.

all:
all: buflint doc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my comments to
#411

@@ -879,10 +889,15 @@ message DeleteVnicRequest {

// Update vnic request
message UpdateVnicRequest {
// Name of Vnic requested
string name = 1 [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, these Update* changes look strange...
The resource (vnic) already contains name and adding it one more time is suspicious. I assume we can resolve it on the annotation level. Can you try to annotate UpdateVnic the following way

rpc UpdateVnic (UpdateVnicRequest) returns (Vnic) {
        option (google.api.http) = {
            patch: "/v1/{vnic.name=vnics/*}"
            body: "vnic"
        };
        option (google.api.method_signature) = "vnic, update_mask";
    }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, much cleaner solution using the different annotate.

@@ -1604,7 +1604,6 @@ message DeleteSubnetRequest {

// Update subnet request
message UpdateSubnetRequest {
// updated subnet info
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should not delete the comment here.
That's a pity that we cannot enable COMMENTS linter rules, since many comments are missing in these proto files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should not delete the comment here. That's a pity that we cannot enable COMMENTS linter rules, since many comments are missing in these proto files.

I will get that comment back in there is was deleted inadvertently. I will look at the "buf" setting to see if there is a "Comments" linter rule that can be enabled separately.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enabled buf COMMENTS linting rule in latest update with two comment checks disabled currently to be worked in later updates.

@@ -354,7 +354,7 @@ message BGPNLRIPrefixStatus {
int32 flap_starttime = 19;
// If bgpNlriPrefixBest is 'true', then this field is set to 'routeIsBest'.
// Otherwise, it reports the stage in the decision process when the route was determined to be non-best.
BGPRsnNotBest reason_not_best = 20;
BGPRouteReason reason_not_best = 20;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could consider renaming the member as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could consider renaming the member as well

We could change it to route_reason = 20; as an option. The intent is to report the reason for not having the best route which really is the reason for the particular route selection where one of the reason's is "Route is best". I will let @jainvipin respond on the changing since the elements are from his contribution and his input on the enum and parameter should be considered on this one.

Copy link
Contributor

@artek-koltun artek-koltun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sandersms sandersms linked an issue Dec 11, 2023 that may be closed by this pull request
Copy link
Contributor

@jainvipin jainvipin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sandersms - all good; few minor comments inline... will approve after those fixes.

@@ -106,7 +106,7 @@ message BGPPeerSpec {
// send extended community attributes to neighbor
bool send_ext_comm = 6;
// peer is a route reflector client
BGPPeerRRClient rr_client = 7;
BGPPeerRR rr_client = 7;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usualally RR Client is different than RR; not sure about the reason behind this name change, and if this was linting related or something done for improving brevity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add the Client back to the enum and the parameter. It was the linting checking on the enum definitions that resulted in the change.

@@ -354,7 +354,7 @@ message BGPNLRIPrefixStatus {
int32 flap_starttime = 19;
// If bgpNlriPrefixBest is 'true', then this field is set to 'routeIsBest'.
// Otherwise, it reports the stage in the decision process when the route was determined to be non-best.
BGPRsnNotBest reason_not_best = 20;
BGPRouteReason reason_not_best = 20;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree with @artek-koltun - we should change the field/member name as well to reflect its intent; thanks for fixing this.

Signed-off-by: Mark Sanders <marksanders194@gmail.com>
Signed-off-by: Mark Sanders <marksanders194@gmail.com>
@sandersms sandersms merged commit 55bee9e into opiproject:main Dec 15, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[storage]: enable BUF linter and compiler
3 participants