SpineEventEngine / validation

Apache License 2.0
3 stars 0 forks source link

Filter out gRPC generated code when adding `implements ValidatingBuilder` #129

Closed alexander-yevsyukov closed 3 months ago

alexander-yevsyukov commented 3 months ago

This PR fixes filtering source sets that are output of gRPC compiler. ImplementValidatingBuilder action does not apply to these sources and fail with an exception when a Java file could not be found.

Previously, the code of ImplementValidatingBuilder action relied on the call to SourceFileSet.hasJavaFiles, which checks for the presence of a Java file in the set. gRPC Protobuf compiler does produce Java files, but the output placed under the grpc directory does not contain message files participating in gRPC calls. They are placed under java directory. Because of this it is not possible to find a source code file matching a message in the source file set with the grpc output directory.

Now, we call SourceFileSet.hasJavaOutput, which checks the target directory and that solves the filtering issue.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 37.83%. Comparing base (6eae621) to head (3ead41b).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #129 +/- ## ============================================ + Coverage 37.82% 37.83% +0.01% Complexity 353 353 ============================================ Files 127 127 Lines 2369 2368 -1 Branches 200 199 -1 ============================================ Hits 896 896 + Misses 1411 1410 -1 Partials 62 62 ```
alexander-yevsyukov commented 3 months ago

@alexander-yevsyukov LGTM, but please see my comment.

Also, I don't understand how this PR addresses filtering out the gRPC-generated sources. I am sure it works :) But let's discuss how :)

It's indeed not obvious. I've. updated the description of the PR.