Skip to content

Conversation

@emmileaf
Copy link
Contributor

@emmileaf emmileaf commented Oct 12, 2022

In this PR:

  • Add SpringPackageInfoComposer.java to generate package-info.java, similar to ClientLibraryPackageInfoComposer.java but customized for spring.
  • In SpringWriter.java, remove generation of gapic_metadata.json for spring libraries.

Todos:

@emmileaf emmileaf added the spring pr that's related to spring code gen, intend to merge into autoconfig-gen-draft2 branch. label Oct 12, 2022
Copy link
Contributor

@zhumin8 zhumin8 left a comment

Choose a reason for hiding this comment

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

A few comments below, and just a thought (this could totally be a separate pr if we want it):
You probably started out from ClientLibraryPackageInfoComposer.java for SpringPackageInfoComposer.java and cleaned out irrelevant contents.
What if we keep the descriptions for each service like in here, remove the samples, and at the bottom, add a sample to use along the lines of:
"You can inject auto-configured service bean to your Spring Boot application with annotation based configuration @Autowired [serviceBean] or Constructor Injection "

@emmileaf
Copy link
Contributor Author

A few comments below, and just a thought (this could totally be a separate pr if we want it): You probably started out from ClientLibraryPackageInfoComposer.java for SpringPackageInfoComposer.java and cleaned out irrelevant contents. What if we keep the descriptions for each service like in here, remove the samples, and at the bottom, add a sample to use along the lines of: "You can inject auto-configured service bean to your Spring Boot application with annotation based configuration @Autowired [serviceBean] or Constructor Injection "

@zhumin8 Ah I think that would be helpful! One concern here might be that ClientLibraryPackageInfoComposer has logic for formatting service descriptions that is not currently exposed, so copying it could run us into inconsistency if that part of gapic generator code gets updated in the future (though those lines haven’t been modified for a while).

A couple of possible approaches here come to mind, in order of estimated effort. Let me know if you have any preferences or suggestions?

  1. We could skip the service description and just list each service client name, followed by the Spring-specific snippet
  2. We could copy over service description logic from ClientPackageInfoComposer, and keep SpringPackageInfoComposer updated if this ever changes (any discrepancy would also only impact generated javadoc and not code)
  3. We could possibly refactor ClientPackageInfoComposer to expose service description logic for reuse? (This option would definitely warrant a separate PR)

@zhumin8
Copy link
Contributor

zhumin8 commented Oct 20, 2022

I am inclined to option 3.
But either way, you are right, it could be done in a separate PR. Let's get this merged in and talk about it separately.

@emmileaf
Copy link
Contributor Author

I am inclined to option 3. But either way, you are right, it could be done in a separate PR. Let's get this merged in and talk about it separately.

Sounds good!

@emmileaf emmileaf marked this pull request as ready for review October 20, 2022 19:14
@emmileaf emmileaf requested a review from a team October 20, 2022 19:14
@emmileaf emmileaf requested a review from a team as a code owner October 20, 2022 19:14
Copy link
Contributor

@zhumin8 zhumin8 left a comment

Choose a reason for hiding this comment

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

LGTM

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

82.1% 82.1% Coverage
0.7% 0.7% Duplication

@emmileaf emmileaf merged commit c45ec23 into autoconfig-gen-draft2 Oct 24, 2022
@emmileaf emmileaf deleted the autoconfig-package-info branch October 24, 2022 14:08
suztomo pushed a commit that referenced this pull request Mar 21, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

spring pr that's related to spring code gen, intend to merge into autoconfig-gen-draft2 branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants