-
Notifications
You must be signed in to change notification settings - Fork 69
fix(Spring CodeGen): Update and move naming-related logic into utils #1061
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
|
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use -- conventional-commit-lint bot |
1 similar comment
|
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use -- conventional-commit-lint bot |
|
Two questions for perhaps an initial review related to the code changes here:
In parsing version, for example, perhaps we could also align with SampleGen’s approach:https://github.com/googleapis/gapic-generator-java/blob/d222af10cd6345e0a3660353d7d667e917be67ec/src/main/java/com/google/api/generator/gapic/composer/Composer.java#L194-L205 |
|
zhumin8
left a comment
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.
Just minor comments.
| Utils.springPropertyPrefix(libName, service.name()), | ||
| libName + "/" + service.name()))); | ||
| Utils.getSpringPropertyPrefix(packageName, service.name()), | ||
| Utils.getLibName(context)))); |
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.
I think we still want service.name() some where in the description, as this block is generated per service. So for client lib with multiple services like vision, description for enabling each service is different.
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.
Oops - thanks for catching this!
| JarEntry jarEntry = | ||
| new JarEntry(String.format("%s/additional-spring-configuration-metadata.json", path)); | ||
| String libName = Utils.getLibName(context); | ||
| String packageName = context.services().get(0).pakkage(); |
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.
nit: Do you mind also extract this to Utils? It's only one line, but just in case of future changes.
|
SonarCloud Quality Gate failed. |
This is a draft to generate pom.xml for Spring Starters modules. The placeholders in this generated file will be replaced in spring-cloud-gcp when triggering the generation (e.g. via script) Update: updated to use utils added in #1061 We'll likely need to make more changes to pom generation depending on the project structure on spring-cloud-gcp side. But I'd like to merge this in first, and iterate as needed together with spring-cloud-gcp side.
… to v2.17.0 (#1061) [](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.errorprone:error_prone_annotations](https://errorprone.info) ([source](https://togithub.com/google/error-prone)) | `2.16` -> `2.17.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>google/error-prone</summary> ### [`v2.17.0`](https://togithub.com/google/error-prone/releases/tag/v2.17.0): Error Prone 2.17.0 [Compare Source](https://togithub.com/google/error-prone/compare/v2.16...v2.17.0) New Checkers: - [`AvoidObjectArrays`](https://errorprone.info/bugpattern/AvoidObjectArrays) - [`Finalize`](https://errorprone.info/bugpattern/Finalize) - [`IgnoredPureGetter`](https://errorprone.info/bugpattern/IgnoredPureGetter) - [`ImpossibleNullComparison`](https://errorprone.info/bugpattern/ProtoFieldNullComparison) - [`MathAbsoluteNegative`](https://errorprone.info/bugpattern/MathAbsoluteNegative) - [`NewFileSystem`](https://errorprone.info/bugpattern/NewFileSystem) - [`StatementSwitchToExpressionSwitch`](https://errorprone.info/bugpattern/StatementSwitchToExpressionSwitch) - [`UnqualifiedYield`](https://errorprone.info/bugpattern/UnqualifiedYield) Fixed issues: [#​2321](https://togithub.com/google/error-prone/issues/2321), [#​3144](https://togithub.com/google/error-prone/issues/3144), [#​3297](https://togithub.com/google/error-prone/issues/3297), [#​3428](https://togithub.com/google/error-prone/issues/3428), [#​3437](https://togithub.com/google/error-prone/issues/3437), [#​3462](https://togithub.com/google/error-prone/issues/3462), [#​3482](https://togithub.com/google/error-prone/issues/3482), [#​3494](https://togithub.com/google/error-prone/issues/3494) **Full Changelog**: https://togithub.com/google/error-prone/compare/v2.16...v2.17.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-core). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMCJ9-->








This PR updates and moves three pieces of naming-related logic in spring codegen into util methods:
getSpringPropertyPrefix (e.g.
com.google.cloud.vision.v1.spring.auto.image-annotator)getLibName (e.g.
vision)getSpringPackageName (e.g.
com.google.cloud.vision.v1.spring)Dependencies: