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

feat(resnames)!: Do not generate unused resname classes [ggj] #785

Merged

Conversation

miraleung
Copy link
Contributor

Prevents resource name helper classes from being generated for definition-only resource names and references. Previously, classes for any such definitions or references were generated in the monolith, resulting in unused code in the GAPIC client libraries. With the pending major version update for Java client libraries, we can stop generating these classes.

This branch will not be merged into main until all stakeholders are ready for the major version update.

Relevant PRs that added the backwards-compatibility logic:

cc @chingor13

@miraleung miraleung requested a review from Neenu1995 June 29, 2021 22:05
@miraleung miraleung requested a review from a team as a code owner June 29, 2021 22:05
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jun 29, 2021
@miraleung miraleung changed the base branch from master to main/java_major_version_bump June 29, 2021 22:06
@codecov
Copy link

codecov bot commented Jun 29, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main/java_major_version_bump@91dce65). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@                       Coverage Diff                       @@
##             main/java_major_version_bump     #785   +/-   ##
===============================================================
  Coverage                                ?   91.39%           
===============================================================
  Files                                   ?      140           
  Lines                                   ?    14928           
  Branches                                ?     1073           
===============================================================
  Hits                                    ?    13644           
  Misses                                  ?      991           
  Partials                                ?      293           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 91dce65...67fd32f. Read the comment docs.

…gapic-generator-java into java_major_version_bump/extra_resnames
@miraleung miraleung merged commit 3c9b2f4 into main/java_major_version_bump Jul 2, 2021
@miraleung miraleung deleted the java_major_version_bump/extra_resnames branch July 2, 2021 17:59
@miraleung miraleung changed the title fix(resnames)!: Do not generate unused resname classes [ggj] feat(resnames)!: Do not generate unused resname classes [ggj] Aug 3, 2021
miraleung added a commit that referenced this pull request Aug 3, 2021
…n bump (#814)

* fix!: remove extraneous thrown exception for Java major version bump (#784)

* fix(resnames)!: Do not generate unused resname classes (#785)

* fix: update goldens
@miraleung
Copy link
Contributor Author

For posterity - "usage" in this case pertains to "usage in the generated GAPIC library." That is, if there is no field used in a method_signature that has a resource_reference, then it is not considered "used." A message definition with a resource_reference on a field not used in a method_signature annotation will never be called within the client library, so the corresponding resource name helper class may likely be unused. Hence, we will generate helper classes only for the former case.

CC @BenWhitehead

suztomo pushed a commit that referenced this pull request Mar 21, 2023
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.api:gax-grpc](https://togithub.com/googleapis/gax-java) | `2.18.7` -> `2.19.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.api:gax-grpc/2.19.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.api:gax-grpc/2.19.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.api:gax-grpc/2.19.0/compatibility-slim/2.18.7)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.api:gax-grpc/2.19.0/confidence-slim/2.18.7)](https://docs.renovatebot.com/merge-confidence/) |
| [com.google.api:gax-bom](https://togithub.com/googleapis/gax-java) | `2.18.7` -> `2.19.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.api:gax-bom/2.19.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.api:gax-bom/2.19.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.api:gax-bom/2.19.0/compatibility-slim/2.18.7)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.api:gax-bom/2.19.0/confidence-slim/2.18.7)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/gax-java</summary>

### [`v2.19.0`](https://togithub.com/googleapis/gax-java/blob/HEAD/CHANGELOG.md#&#8203;2190-httpsgithubcomgoogleapisgax-javacomparev2187v2190-2022-08-22)

[Compare Source](https://togithub.com/googleapis/gax-java/compare/v2.18.7...v2.19.0)

##### Features

-   Add numeric enum support. ([#&#8203;1743](https://togithub.com/googleapis/gax-java/issues/1743)) ([3f7628e](https://togithub.com/googleapis/gax-java/commit/3f7628e27495806675ec8c8521e9c33725908936))

##### Bug Fixes

-   **deps:** update dependency com.google.auth:google-auth-library-credentials to v1.10.0 ([#&#8203;1768](https://togithub.com/googleapis/gax-java/issues/1768)) ([3f2188d](https://togithub.com/googleapis/gax-java/commit/3f2188d83751272de1a4c3db85e95d79b690e3fc))
-   **deps:** update dependency com.google.auth:google-auth-library-credentials to v1.9.0 ([#&#8203;1765](https://togithub.com/googleapis/gax-java/issues/1765)) ([103db3c](https://togithub.com/googleapis/gax-java/commit/103db3cc06cfaafeda1a043b6e19e668083ed782))
-   **deps:** update dependency com.google.auth:google-auth-library-oauth2-http to v1.10.0 ([#&#8203;1769](https://togithub.com/googleapis/gax-java/issues/1769)) ([0b1eb92](https://togithub.com/googleapis/gax-java/commit/0b1eb924aefc79b6fc4757d253d4c8a93a094c84))
-   **deps:** update dependency com.google.auth:google-auth-library-oauth2-http to v1.9.0 ([#&#8203;1766](https://togithub.com/googleapis/gax-java/issues/1766)) ([2677f07](https://togithub.com/googleapis/gax-java/commit/2677f07a8e20c82403f60c6aa1f9d46c1274b37f))
-   **deps:** update dependency com.google.code.gson:gson to v2.9.1 ([#&#8203;1757](https://togithub.com/googleapis/gax-java/issues/1757)) ([ea2a075](https://togithub.com/googleapis/gax-java/commit/ea2a07504899703e4fcd428f31d615fb208a50aa))
-   **deps:** update dependency com.google.protobuf:protobuf-bom to v3.21.5 ([#&#8203;1772](https://togithub.com/googleapis/gax-java/issues/1772)) ([d7a48d1](https://togithub.com/googleapis/gax-java/commit/d7a48d1886a3f39acb26580d1d35a288102af436))
-   **deps:** update dependency io.grpc:grpc-bom to v1.48.1 ([#&#8203;1763](https://togithub.com/googleapis/gax-java/issues/1763)) ([e5e4232](https://togithub.com/googleapis/gax-java/commit/e5e423200260c210071ce626612d7e54af0695e4))
-   **deps:** update dependency org.graalvm.sdk:graal-sdk to v22.2.0 ([#&#8203;1740](https://togithub.com/googleapis/gax-java/issues/1740)) ([ded44a6](https://togithub.com/googleapis/gax-java/commit/ded44a66d3de8a2678fa4c5efe8b3ded4484de2b))
-   **deps:** update dependency org.mockito:mockito-core to v4.7.0 ([#&#8203;1774](https://togithub.com/googleapis/gax-java/issues/1774)) ([29678c8](https://togithub.com/googleapis/gax-java/commit/29678c805855c97b4c26f0156923a41820411a10))
-   **deps:** update dependency org.threeten:threetenbp to v1.6.1 ([#&#8203;1773](https://togithub.com/googleapis/gax-java/issues/1773)) ([d2c84e6](https://togithub.com/googleapis/gax-java/commit/d2c84e6fb22a2752b68fecc9b6c9e480f398b87c))
-   **test:** testThrottlingBlocking flakyness fix ([#&#8203;1775](https://togithub.com/googleapis/gax-java/issues/1775)) ([e69393c](https://togithub.com/googleapis/gax-java/commit/e69393c32ffe32306acc8f495b1f41198d86f507))

##### Documentation

-   explaining UNIX environment is required ([#&#8203;1760](https://togithub.com/googleapis/gax-java/issues/1760)) ([1d31e90](https://togithub.com/googleapis/gax-java/commit/1d31e90e70867cb4b896d7a393f9271788b6371f))

</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 these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

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-shared-dependencies).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xNzMuMCIsInVwZGF0ZWRJblZlciI6IjMyLjE3My4wIn0=-->
suztomo pushed a commit that referenced this pull request Mar 21, 2023
🤖 I have created a release *beep* *boop*
---


## [3.0.2](googleapis/java-shared-dependencies@v3.0.1...v3.0.2) (2022-09-08)


### Dependencies

* Update dependency com.fasterxml.jackson:jackson-bom to v2.13.4 ([#789](googleapis/java-shared-dependencies#789)) ([d0b6888](googleapis/java-shared-dependencies@d0b6888))
* Update dependency com.google.auth:google-auth-library-bom to v1.10.0 ([#781](googleapis/java-shared-dependencies#781)) ([450a3fe](googleapis/java-shared-dependencies@450a3fe))
* Update dependency com.google.auth:google-auth-library-bom to v1.11.0 ([#790](googleapis/java-shared-dependencies#790)) ([fdbab60](googleapis/java-shared-dependencies@fdbab60))
* Update dependency com.google.auth:google-auth-library-bom to v1.9.0 ([#773](googleapis/java-shared-dependencies#773)) ([f59be02](googleapis/java-shared-dependencies@f59be02))
* Update dependency com.google.errorprone:error_prone_annotations to v2.15.0 ([#776](googleapis/java-shared-dependencies#776)) ([8eddf23](googleapis/java-shared-dependencies@8eddf23))
* Update dependency com.google.protobuf:protobuf-bom to v3.21.5 ([#780](googleapis/java-shared-dependencies#780)) ([80c783f](googleapis/java-shared-dependencies@80c783f))
* Update dependency io.grpc:grpc-bom to v1.48.1 ([#768](googleapis/java-shared-dependencies#768)) ([c1e6978](googleapis/java-shared-dependencies@c1e6978))
* Update dependency io.grpc:grpc-bom to v1.49.0 ([#786](googleapis/java-shared-dependencies#786)) ([c5c4a0b](googleapis/java-shared-dependencies@c5c4a0b))
* Update dependency org.checkerframework:checker-qual to v3.24.0 ([#775](googleapis/java-shared-dependencies#775)) ([4bb5bee](googleapis/java-shared-dependencies@4bb5bee))
* Update dependency org.checkerframework:checker-qual to v3.25.0 ([#788](googleapis/java-shared-dependencies#788)) ([ad9e4f1](googleapis/java-shared-dependencies@ad9e4f1))
* Update dependency org.threeten:threetenbp to v1.6.1 ([#782](googleapis/java-shared-dependencies#782)) ([30717c3](googleapis/java-shared-dependencies@30717c3))
* Update gax.version to v2.19.0 ([#785](googleapis/java-shared-dependencies#785)) ([b5a674e](googleapis/java-shared-dependencies@b5a674e))
* Update google.core.version to v2.8.10 ([#787](googleapis/java-shared-dependencies#787)) ([754e622](googleapis/java-shared-dependencies@754e622))
* Update google.core.version to v2.8.7 ([#774](googleapis/java-shared-dependencies#774)) ([0c8e010](googleapis/java-shared-dependencies@0c8e010))
* Update google.core.version to v2.8.8 ([#777](googleapis/java-shared-dependencies#777)) ([e354fe1](googleapis/java-shared-dependencies@e354fe1))
* Update google.core.version to v2.8.9 ([#784](googleapis/java-shared-dependencies#784)) ([a9847d7](googleapis/java-shared-dependencies@a9847d7))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
suztomo pushed a commit that referenced this pull request Mar 21, 2023
🤖 I have created a release *beep* *boop*
---


## [2.6.0](googleapis/java-core@v2.5.11...v2.6.0) (2022-04-14)


### Features

* **java:** remove GoogleJsonClentFeature and OpenCensusFeature after relocation ([#793](googleapis/java-core#793)) ([cafd489](googleapis/java-core@cafd489))
* **java:** remove Netty Native Image configuration after relocation to gax ([#771](googleapis/java-core#771)) ([9cc7dba](googleapis/java-core@9cc7dba))
* **java:** remove protobuf Native Image configuration ([#784](googleapis/java-core#784)) ([7a8df66](googleapis/java-core@7a8df66))
* remove native-image.properties settings  after relocation ([#794](googleapis/java-core#794)) ([219a519](googleapis/java-core@219a519))
* remove resource-config after relocation ([#795](googleapis/java-core#795)) ([8ed3110](googleapis/java-core@8ed3110))
* remove substitutions after relocation to gax ([#789](googleapis/java-core#789)) ([85280b1](googleapis/java-core@85280b1))


### Bug Fixes

* **java:** register test class for reflection to fix native image test ([#766](googleapis/java-core#766)) ([fa07125](googleapis/java-core@fa07125))


### Dependencies

* revert protobuf to 3.19 and common-protos 2.8.3 ([#798](googleapis/java-core#798)) ([27ca70c](googleapis/java-core@27ca70c))
* update dependency com.google.api-client:google-api-client-bom to v1.34.0 ([#800](googleapis/java-core#800)) ([3abc47d](googleapis/java-core@3abc47d))
* update dependency com.google.api:gax-bom to v2.16.0 ([#785](googleapis/java-core#785)) ([bd33a76](googleapis/java-core@bd33a76))
* update dependency com.google.api.grpc:proto-google-common-protos to v2.8.1 ([#792](googleapis/java-core#792)) ([3f85e62](googleapis/java-core@3f85e62))
* update dependency com.google.api.grpc:proto-google-common-protos to v2.8.2 ([#796](googleapis/java-core#796)) ([d6ea18e](googleapis/java-core@d6ea18e))
* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.3.0 ([#783](googleapis/java-core#783)) ([48594f3](googleapis/java-core@48594f3))
* update dependency com.google.api.grpc:proto-google-iam-v1 to v1.3.1 ([#799](googleapis/java-core#799)) ([9fe7d35](googleapis/java-core@9fe7d35))
* update dependency com.google.errorprone:error_prone_annotations to v2.12.1 ([#788](googleapis/java-core#788)) ([cfdabb4](googleapis/java-core@cfdabb4))
* update dependency com.google.http-client:google-http-client-bom to v1.41.6 ([#791](googleapis/java-core#791)) ([d9ff405](googleapis/java-core@d9ff405))
* update dependency com.google.http-client:google-http-client-bom to v1.41.7 ([#797](googleapis/java-core#797)) ([dfc3c57](googleapis/java-core@dfc3c57))
* update dependency com.google.protobuf:protobuf-bom to v3.20.0 ([#787](googleapis/java-core#787)) ([51f59fc](googleapis/java-core@51f59fc))
* update dependency io.grpc:grpc-bom to v1.45.1 ([#780](googleapis/java-core#780)) ([cd8a078](googleapis/java-core@cd8a078))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants