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(evpn-gw): updates to support buf lint and generation #411

Merged
merged 4 commits into from
Dec 12, 2023

Conversation

sandersms
Copy link
Contributor

@sandersms sandersms commented Dec 5, 2023

Transition evpn-gw 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.

Signed-off-by: Mark Sanders <marksanders194@gmail.com>
@sandersms sandersms marked this pull request as ready for review December 6, 2023 17:35
@sandersms sandersms requested a review from a team as a code owner December 6, 2023 17:35
rm -rf ./google
rm -rf ./v1alpha1/{autogen.md,gen,google}
mkdir -p ./v1alpha1/gen/{go,cpp,python,java}
rm -rf ./v1alpha1/{autogen.md}
Copy link
Contributor

Choose a reason for hiding this comment

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

{} are not needed since we have only one option autogen.md
Also, since it is a single file, we can just use rm -f

@@ -3,22 +3,22 @@
# Copyright (c) 2022 Dell Inc, or its subsidiaries.
# Copyright (C) 2023 Nordix Foundation.

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.

do we intentionally not run bufgen target? Without bufgen, the CI job does not actually check that we provided all generated artifacts

- name: Build protobufs
run: make
working-directory: network
- name: Check uncomitted auto generated protobufs
run: git diff --exit-code
working-directory: network

I missed that point on the review of opinetcommon 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.

Yes, I will add that into the steps currently. Eventually the generated files will be placed into a separate repository and autogenerated; but, for now adding the bufgen in the make should take care of the operation.

Copy link
Contributor

@mardim91 mardim91 left a comment

Choose a reason for hiding this comment

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

@sandersms I guess you are doing the transition to the buf lint but you still need to generate the go/python files by yourself. Right ? When we move the apis to their own repo then the generation of the go/python files will happen automatically. So this is a prepatory step. Right ?

@@ -337,9 +337,9 @@ enum BPOperStatus {
// BridgePortType reflects the different types of a Bridge Port
enum BridgePortType {
// "unknown" bridge port type
UNKNOWN = 0;
BRIDGE_PORT_TYPE_UNSPECIFIED = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason that we have changed the ENUM here ? Does this follows the googles AIPs for ENUMs ?

Copy link
Contributor Author

@sandersms sandersms Dec 7, 2023

Choose a reason for hiding this comment

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

Yes - this follows the AIPs for ENUMs as part of the checking. It also requires the addition of the "BRIDGE_PORT_TYPE_" for all of the ENUMs to be unique as a check.

@sandersms
Copy link
Contributor Author

@sandersms I guess you are doing the transition to the buf lint but you still need to generate the go/python files by yourself. Right ? When we move the apis to their own repo then the generation of the go/python files will happen automatically. So this is a prepatory step. Right ?

@mardim91 Yes, this is the preparatory step to get to the generation of the apis and I will be adding the buf gen to the full make to have the go/python files generated as part of this PR as noted in one of the earlier comments. We will be moving the apis that are generated to their own repo once we get all of the capabilities in place.

Signed-off-by: Mark Sanders <marksanders194@gmail.com>
artek-koltun
artek-koltun previously approved these changes Dec 8, 2023
@@ -3,3 +3,11 @@ name: buf.build/opiproject/evpn-gw
deps:
- buf.build/googleapis/googleapis
- buf.build/grpc-ecosystem/grpc-gateway
- buf.build/opiproject/opinetcommon
lint:
Copy link
Contributor

Choose a reason for hiding this comment

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

let's also include COMMENTS linter rules here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added to latest addition.

@artek-koltun artek-koltun dismissed their stale review December 8, 2023 07:33

let's also include COMMENTS linter rules here

Copy link
Contributor

@mardim91 mardim91 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

@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

@artek-koltun artek-koltun merged commit 25c68ab into opiproject:main Dec 12, 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