Skip to content

Conversation

@gsmet
Copy link
Member

@gsmet gsmet commented May 26, 2023

@radcortez I experimented with the new feature you implemented for default map entries on top of #33228 .

Probably a good idea to drive #33228 before focusing on this new one but I promised you some feedback :).

I confirm that it would be better to have a separate annotation as I had to adjust the config reference doc generation: the semantic is really different, let's have a separate annotation.

And apart from that, I got things to compile but I have a weird issue with the Agroal testing.

When running the tests for Agroal (with ./mvnw -f extensions/agroal/ clean install -Dtest-containers -Dstart-containers) I end up with:

Caused by: io.smallrye.config.ConfigValidationException: Configuration validation failed:
	java.util.NoSuchElementException: SRCFG00014: The config property quarkus.datasource.*.health.enabled is required but it could not be found in any config source
	at io.smallrye.config.ConfigMappingProvider.mapConfigurationInternal(ConfigMappingProvider.java:1001)
	at io.smallrye.config.ConfigMappingProvider.lambda$mapConfiguration$3(ConfigMappingProvider.java:957)
	at io.smallrye.config.SecretKeys.doUnlocked(SecretKeys.java:28)
	at io.smallrye.config.ConfigMappingProvider.mapConfiguration(ConfigMappingProvider.java:957)
	at io.smallrye.config.ConfigMappings.mapConfiguration(ConfigMappings.java:91)
	at io.smallrye.config.SmallRyeConfigBuilder.build(SmallRyeConfigBuilder.java:624)
	at io.quarkus.deployment.ExtensionLoader.loadStepsFrom(ExtensionLoader.java:184)
	at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:107)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:331)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:252)
	at io.quarkus.test.QuarkusUnitTest.beforeAll(QuarkusUnitTest.java:650)

which is a bit confusing as quarkus.datasource.health.enabled is not in a Map, it's at the root of DataSourcesBuildTimeConfig so there's something odd going on. The error message seems to reference a map entry as it has a * in it: quarkus.datasource.*.health.enabled. Moreover it has a default value.

@radcortez
Copy link
Member

Thanks! Let me have a look.

@radcortez
Copy link
Member

Seems to be a bug between @WithName in the root property and @WithParentName in the Map property. Let me try to fix it.

@radcortez
Copy link
Member

I've fixed the issue and added @WithDefaults instead.

@gsmet
Copy link
Member Author

gsmet commented Jun 15, 2023

Closing this one as we will make progress here: #33228 .

@gsmet gsmet closed this Jun 15, 2023
@quarkus-bot quarkus-bot bot added the triage/invalid This doesn't seem right label Jun 15, 2023
@github-actions
Copy link

🙈 The PR is closed and the preview is expired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants