-
Notifications
You must be signed in to change notification settings - Fork 68
refactor: extract and move comment formatting logic to util # 8000 1089
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - nice cleanup!
src/main/java/com/google/api/generator/gapic/composer/utils/CommentFormatter.java
Show resolved
Hide resolved
src/main/java/com/google/api/generator/gapic/composer/utils/CommentFormatter.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/api/generator/gapic/composer/utils/CommentFormatter.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please resolve the comments
Regarding the code coverage: The use of this logic/util method in the two composers is covered by the integration tests (e.g. redis golden file). Sonar is unhappy with coverage because the existing composer unit tests (e.g. through Todo: will need to look more into how |
Kudos, SonarCloud Quality Gate passed! |
Some additional test-related changes from addressing code coverage:
|
* Extracts common logic to an util class, and exposes it for reuse * Adds description for echo service explicitly in TestProtoLoader since it is not parsed from source code location as an end-to-end call would (this allows the existing ServiceClientClassTest to cover class header comments that are also formatted with the util’s logic) * Adds ClientLibraryPackageInfoComposerTest as a golden-updating test
* Extracts common logic to an util class, and exposes it for reuse * Adds description for echo service explicitly in TestProtoLoader since it is not parsed from source code location as an end-to-end call would (this allows the existing ServiceClientClassTest to cover class header comments that are also formatted with the util’s logic) * Adds ClientLibraryPackageInfoComposerTest as a golden-updating test
🤖 I have created a release *beep* *boop* --- ### Updating meta-information for bleeding-edge SNAPSHOT release. --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
Both
ClientLibraryPackageInfoComposer
andServiceClientCommentComposer
currently have additional parsing logic to convert protobuf comments to a Javadoc-compatible format. For example, this handles bulleted list items with asterisks in secret manager service proto.This PR extracts common logic to an util class, and exposes it for reuse by Spring Codegen.
[Update] Additional test-related changes from addressing code coverage:
TestProtoLoader
since it is not parsed from source code location as an end-to-end call wouldServiceClientClassTest
to cover class header comments that are also formatted with the util’s logicClientLibraryPackageInfoComposerTest
as a golden-updating test