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

fix: format method types and table in Client Overview #2361

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

alicejli
Copy link
Contributor

@alicejli alicejli commented Jan 12, 2024

Fixes #2366 ☕️

Confirmed with java-logging that running mvn javadoc:aggregate successfully builds.

@alicejli alicejli requested a review from a team as a code owner January 12, 2024 23:26
@product-auto-label product-auto-label bot added the size: xl Pull request size is extra large. label Jan 12, 2024
Copy link

sonarcloud bot commented Jan 12, 2024

Quality Gate Passed Quality Gate passed for 'gapic-generator-java-root'

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Jan 12, 2024

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

for (MethodAndVariants method : methodAndVariantsList) {
tableBuilder
.append(" <tr>\n")
.append(" <td>")
.append(method.method)
.append(CommentFormatter.formatAsJavaDocComment(method.method, null))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's see if we can refactor CommentFormatter so that it can be used for the whole table, otherwise this issue may happen again in the future. That being said, if it turns out to be more complicated that it supposed to, we can merge this for now and create another issue to track the refactoring effort.

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 investigated this a bit and I think it would be a little tricky to refactor CommentFormatter to be able to be applied to a whole table as I think it would need to have changes (or additions) to JavadocComment to only escape certain characters if they're not part of an html tag.

I could rewrite the table in general to use JavadocComment instead of StringBuilder so at least it would be explicitly clear when we are not applying standard formatting (e.g. escaping HTML characters). Let me know if you think that's worth doing or if I should create an issue for the larger refactoring effort.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tracking issue for refactor: #2385

Copy link
Member

@suztomo suztomo left a comment

Choose a reason for hiding this comment

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

About the prevention of future problems, would you implement a test to verify the generated javadoc are good with regard to the Maven command in Java 17?

@alicejli
Copy link
Contributor Author

About the prevention of future problems, would you implement a test to verify the generated javadoc are good with regard to the Maven command in Java 17?

Are you thinking something like the downstream tests we configured in java-shared-config: https://github.com/googleapis/java-shared-config/pull/662/files and applied to sdk-platform-java?

@suztomo
Copy link
Member

suztomo commented Jan 18, 2024

I didn't think of the downstream testing specifically. Yes, a check similar to the downstream check will address my ask. There are various ways to solve that. I'm asking "Next time when somebody breaks the javadoc generation logic, please block the pull request."

@alicejli
Copy link
Contributor Author

I didn't think of the downstream testing specifically. Yes, a check similar to the downstream check will address my ask. There are various ways to solve that. I'm asking "Next time when somebody breaks the javadoc generation logic, please block the pull request."

Cool. I created an issue #2380 to track that work as separate from this PR.

@alicejli alicejli merged commit 7436995 into main Jan 18, 2024
25 checks passed
@alicejli alicejli deleted the fixClientOverview branch January 18, 2024 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: xl Pull request size is extra large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Client Overview generation javadoc generation
3 participants