Skip to content

fix protobuf Checkstyle - #1881

Merged
coderzc merged 10 commits into
apache:masterfrom
seagle-yuan:checkstyle-protobuf
Jun 8, 2022
Merged

fix protobuf Checkstyle #1881
coderzc merged 10 commits into
apache:masterfrom
seagle-yuan:checkstyle-protobuf

Conversation

@seagle-yuan

Copy link
Copy Markdown
Contributor

move Generated java file from src/main/java to src/protobuf/java
add proto maven plugin
add proto dependency

@codecov

codecov Bot commented May 15, 2022

Copy link
Copy Markdown

Codecov Report

Merging #1881 (86c341b) into master (2af01bc) will decrease coverage by 0.59%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master    #1881      +/-   ##
============================================
- Coverage     71.11%   70.52%   -0.60%     
+ Complexity      963      961       -2     
============================================
  Files           452      452              
  Lines         38405    38656     +251     
  Branches       5418     5526     +108     
============================================
- Hits          27312    27261      -51     
- Misses         8436     8724     +288     
- Partials       2657     2671      +14     
Impacted Files Coverage Δ
...hugegraph/backend/store/raft/rpc/RaftRequests.java 20.53% <ø> (ø)
.../java/com/baidu/hugegraph/task/HugeServerInfo.java 73.91% <0.00%> (-0.73%) ⬇️
...ugegraph/backend/store/raft/StoreStateMachine.java 65.76% <0.00%> (+0.90%) ⬆️
...va/com/baidu/hugegraph/task/ServerInfoManager.java 78.48% <0.00%> (+1.16%) ⬆️
...va/com/baidu/hugegraph/util/collection/IntSet.java 75.00% <0.00%> (+1.27%) ⬆️
...hugegraph/backend/store/raft/rpc/RpcForwarder.java 71.18% <0.00%> (+1.69%) ⬆️
.../hugegraph/backend/store/rocksdb/RocksDBTable.java 68.49% <0.00%> (+2.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2af01bc...86c341b. Read the comment docs.

@javeme javeme left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

there are some conflicts, please rebase the latest code

javeme
javeme previously approved these changes May 17, 2022

@imbajin imbajin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, and could u explain why the files that generated by protobuf has changed a lot? (version update? or just check style inconsistent?)

if we generate a new proto java file, how to keep the code style? (rely on the maven plugin?)

Comment thread hugegraph-core/pom.xml Outdated
Comment on lines +196 to +211
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do we include it in commons-rpc module?

@seagle-yuan seagle-yuan Jun 4, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

1、I compiled protobuf with different version. and found that old file compliled with likely 2.6.1 version. this version released in Apr, 2015.
https://mvnrepository.com/artifact/com.google.protobuf/protoc

2、if we add protobuf plugin. and generate file to src/protobuf/java path. this path will be ignored to check

3、Through the dependency check, found these dependencies already exist.

[INFO] com.baidu.hugegraph:hugegraph-rpc:jar:2.0.1:compile
[INFO] +- com.lmax:disruptor:jar:3.3.7:compile
[INFO] \- com.alipay.sofa:sofa-rpc-all:jar:5.7.6:compile
[INFO]    +- com.alipay.sofa:tracer-core:jar:3.0.8:compile
[INFO]    |  +- io.opentracing:opentracing-api:jar:0.22.0:compile
[INFO]    |  +- io.opentracing:opentracing-noop:jar:0.22.0:compile
[INFO]    |  +- io.opentracing:opentracing-mock:jar:0.22.0:compile
[INFO]    |  \- io.opentracing:opentracing-util:jar:0.22.0:compile
[INFO]    +- com.alipay.sofa.lookout:lookout-api:jar:1.4.1:compile
[INFO]    +- io.swagger:swagger-core:jar:1.5.18:compile
[INFO]    |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.9.3:compile
[INFO]    |  +- io.swagger:swagger-models:jar:1.5.18:compile
[INFO]    |  |  \- io.swagger:swagger-annotations:jar:1.5.18:compile
[INFO]    |  \- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO]    +- io.grpc:grpc-netty-shaded:jar:1.28.0:compile
[INFO]    |  \- io.grpc:grpc-core:jar:1.28.0:compile (version selected from constraint [1.28.0,1.28.0])
[INFO]    |     +- io.grpc:grpc-api:jar:1.28.0:compile (version selected from constraint [1.28.0,1.28.0])
[INFO]    |     |  \- io.grpc:grpc-context:jar:1.28.0:compile
[INFO]    |     +- com.google.code.gson:gson:jar:2.8.6:compile
[INFO]    |     +- com.google.android:annotations:jar:4.1.1.4:compile
[INFO]    |     \- io.perfmark:perfmark-api:jar:0.19.0:compile
[INFO]    +- io.grpc:grpc-protobuf:jar:1.6.1:provided
[INFO]    |  +- com.google.protobuf:protobuf-java-util:jar:3.3.1:provided
[INFO]    |  +- com.google.api.grpc:proto-google-common-protos:jar:0.1.9:provided
[INFO]    |  \- io.grpc:grpc-protobuf-lite:jar:1.6.1:provided
[INFO]    \- io.grpc:grpc-stub:jar:1.6.1:provided

Comment thread pom.xml
Comment on lines +111 to +112
<hugegraph-rpc.version>2.0.1</hugegraph-rpc.version>
<hugegraph-common.version>2.1.2</hugegraph-common.version>

@imbajin imbajin Jun 6, 2022

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

TODO: we need use a unify version for rpc & common (or just include commons package maybe)

@coderzc
coderzc marked this pull request as draft June 8, 2022 08:12
@coderzc
coderzc marked this pull request as ready for review June 8, 2022 08:12
@coderzc
coderzc merged commit 98dc91e into apache:master Jun 8, 2022
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.

4 participants