fix(parametermanager): fix invalid bean definition named 'clientFactory'#4127
Conversation
a42c421 to
f83f800
Compare
f83f800 to
5f23214
Compare
| @Bean | ||
| @ConditionalOnMissingBean | ||
| public SecretManagerServiceClientFactory clientFactory() { | ||
| public SecretManagerServiceClientFactory secretManagerClientFactory() { |
There was a problem hiding this comment.
This change is backwards incompatible, right?
If anyone is using the auto-configured bean ("clientFactory") then after this change that will result in error.
There was a problem hiding this comment.
Yes, this change is backward-incompatible. However, the impact should be minimal, as the auto-configured clientFactory bean was mainly introduced to support global with multi-regional functionality and is not expected to be directly used by most users.
There was a problem hiding this comment.
@jinseopkim0 What do you think about the bean name changes?
| void testParameterManagerDependencyWithoutConfigImportShouldNotCrash() { | ||
| contextRunner | ||
| .withConfiguration(AutoConfigurations.of(GcpSecretManagerAutoConfiguration.class)) | ||
| .run(ctx -> assertThat(ctx).hasSingleBean(ParameterManagerClientFactory.class)); |
There was a problem hiding this comment.
Let's assert that ctx has a bean for SecretManagerClientFactory.class as well - given that we are autoconfiguring SM beans as well.
There was a problem hiding this comment.
Added test case for this.
🤖 I have created a release *beep* *boop* --- ## [7.3.1](v7.3.0...v7.3.1) (2025-09-15) ### Bug Fixes * **deps:** update dependency com.google.cloud:libraries-bom to v26.68.0 ([#4136](#4136)) ([2335f17](2335f17)) * **deps:** update gapic-generator-java-bom.version to v2.62.1 ([#4135](#4135)) ([7010534](7010534)) * **parametermanager:** fix invalid bean definition named 'clientFactory' ([#4127](#4127)) ([1c98540](1c98540)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
…ry' (#4127) Issue: [#4117](#4117) Changes: - Make Parameter Manager as `optional dependency` in AutoConfigure module. - Changed the `clientFactory` bean name for both Secret Manager and Parameter Manager. - Added logic to resolve the registered bean in `spring.factories` only if the class is present in the classpath for Parameter Manager. - Added parameter manager module and starter module in `spring-cloud-gcp-dependencies`. Testing: - [x] Created project which uses secretManager - [x] Created project which uses parameterManager - [x] Created project which uses secretManager and parameterManager
…ry' (#4127) Issue: [#4117](#4117) Changes: - Make Parameter Manager as `optional dependency` in AutoConfigure module. - Changed the `clientFactory` bean name for both Secret Manager and Parameter Manager. - Added logic to resolve the registered bean in `spring.factories` only if the class is present in the classpath for Parameter Manager. - Added parameter manager module and starter module in `spring-cloud-gcp-dependencies`. Testing: - [x] Created project which uses secretManager - [x] Created project which uses parameterManager - [x] Created project which uses secretManager and parameterManager
…ry' (#4127) Issue: [#4117](#4117) Changes: - Make Parameter Manager as `optional dependency` in AutoConfigure module. - Changed the `clientFactory` bean name for both Secret Manager and Parameter Manager. - Added logic to resolve the registered bean in `spring.factories` only if the class is present in the classpath for Parameter Manager. - Added parameter manager module and starter module in `spring-cloud-gcp-dependencies`. Testing: - [x] Created project which uses secretManager - [x] Created project which uses parameterManager - [x] Created project which uses secretManager and parameterManager
…ry' (#4127) Issue: [#4117](#4117) Changes: - Make Parameter Manager as `optional dependency` in AutoConfigure module. - Changed the `clientFactory` bean name for both Secret Manager and Parameter Manager. - Added logic to resolve the registered bean in `spring.factories` only if the class is present in the classpath for Parameter Manager. - Added parameter manager module and starter module in `spring-cloud-gcp-dependencies`. Testing: - [x] Created project which uses secretManager - [x] Created project which uses parameterManager - [x] Created project which uses secretManager and parameterManager
…ry' (#4127) Issue: [#4117](#4117) Changes: - Make Parameter Manager as `optional dependency` in AutoConfigure module. - Changed the `clientFactory` bean name for both Secret Manager and Parameter Manager. - Added logic to resolve the registered bean in `spring.factories` only if the class is present in the classpath for Parameter Manager. - Added parameter manager module and starter module in `spring-cloud-gcp-dependencies`. Testing: - [x] Created project which uses secretManager - [x] Created project which uses parameterManager - [x] Created project which uses secretManager and parameterManager
…ry' (#4127) Issue: [#4117](#4117) Changes: - Make Parameter Manager as `optional dependency` in AutoConfigure module. - Changed the `clientFactory` bean name for both Secret Manager and Parameter Manager. - Added logic to resolve the registered bean in `spring.factories` only if the class is present in the classpath for Parameter Manager. - Added parameter manager module and starter module in `spring-cloud-gcp-dependencies`. Testing: - [x] Created project which uses secretManager - [x] Created project which uses parameterManager - [x] Created project which uses secretManager and parameterManager
…ry' (#4127) Issue: [#4117](#4117) Changes: - Make Parameter Manager as `optional dependency` in AutoConfigure module. - Changed the `clientFactory` bean name for both Secret Manager and Parameter Manager. - Added logic to resolve the registered bean in `spring.factories` only if the class is present in the classpath for Parameter Manager. - Added parameter manager module and starter module in `spring-cloud-gcp-dependencies`. Testing: - [x] Created project which uses secretManager - [x] Created project which uses parameterManager - [x] Created project which uses secretManager and parameterManager
…ry' (#4127) Issue: [#4117](#4117) Changes: - Make Parameter Manager as `optional dependency` in AutoConfigure module. - Changed the `clientFactory` bean name for both Secret Manager and Parameter Manager. - Added logic to resolve the registered bean in `spring.factories` only if the class is present in the classpath for Parameter Manager. - Added parameter manager module and starter module in `spring-cloud-gcp-dependencies`. Testing: - [x] Created project which uses secretManager - [x] Created project which uses parameterManager - [x] Created project which uses secretManager and parameterManager
…ry' (#4127) Issue: [#4117](#4117) Changes: - Make Parameter Manager as `optional dependency` in AutoConfigure module. - Changed the `clientFactory` bean name for both Secret Manager and Parameter Manager. - Added logic to resolve the registered bean in `spring.factories` only if the class is present in the classpath for Parameter Manager. - Added parameter manager module and starter module in `spring-cloud-gcp-dependencies`. Testing: - [x] Created project which uses secretManager - [x] Created project which uses parameterManager - [x] Created project which uses secretManager and parameterManager
…ry' (#4127) Issue: [#4117](#4117) Changes: - Make Parameter Manager as `optional dependency` in AutoConfigure module. - Changed the `clientFactory` bean name for both Secret Manager and Parameter Manager. - Added logic to resolve the registered bean in `spring.factories` only if the class is present in the classpath for Parameter Manager. - Added parameter manager module and starter module in `spring-cloud-gcp-dependencies`. Testing: - [x] Created project which uses secretManager - [x] Created project which uses parameterManager - [x] Created project which uses secretManager and parameterManager
Backports the following PRs to 6.x: #3699, #3684, #4127 --------- Co-authored-by: suvidha-malaviya <[email protected]>
Issue: #4117
Changes:
optional dependencyin AutoConfigure module.clientFactorybean name for both Secret Manager and Parameter Manager.spring.factoriesonly if the class is present in the classpath for Parameter Manager.spring-cloud-gcp-dependencies.Testing: