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

Disable external configuration sources parsing in native-mode #42103

Closed

Conversation

zakkak
Copy link
Contributor

@zakkak zakkak commented Jul 24, 2024

SmallryeConfigBuilder tries to access properties files from various
sources, despite them not being available at run-time nor supported in
native-mode, see #41994

This patch also avoids getting a MissingRegistrationError when using
-H:+ThrowMissingRegistrationErrors or --exact-reachability-metadata.

Related to #41994 and
#41995

`SmallryeConfigBuilder` tries to access properties files from various
sources, despite them not being available at run-time nor supported in
native-mode, see quarkusio#41994

This patch also avoids getting a `MissingRegistrationError` when using
`-H:+ThrowMissingRegistrationErrors` or `--exact-reachability-metadata`.

Related to quarkusio#41994 and
quarkusio#41995
@zakkak zakkak requested a review from radcortez July 24, 2024 12:04
@BuildStep(onlyIf = NativeOrNativeSourcesBuild.class)
void nativeNoSources(BuildProducer<StaticInitConfigBuilderBuildItem> staticInitConfigBuilder,
BuildProducer<RunTimeConfigBuilderBuildItem> runTimeConfigBuilder) {
runTimeConfigBuilder.produce(new RunTimeConfigBuilderBuildItem(SystemOnlySourcesConfigBuilder.class.getName()));
Copy link
Member

Choose a reason for hiding this comment

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

I believe this is going to fail in the native build tests because this will disable the discovery of the external config folder:

https://github.com/smallrye/smallrye-config/blob/d61a0d7430adbd919121437f34b93b05d2a56f85/implementation/src/main/java/io/smallrye/config/SmallRyeConfigBuilder.java#L197-L220

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, that's not gonna work. Closing this and I will prepare another PR registering the necessary files as resources.

Copy link
Member

Choose a reason for hiding this comment

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

io.smallrye.config.PropertiesConfigSourceLoader#inFileSystem is public, so you can probably add a specific builder just for the native image with the inFileSystem registration.

@quarkus-bot
Copy link

quarkus-bot bot commented Jul 24, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit f3c6c72.

Failing Jobs

Status Name Step Failures Logs Raw logs Build scan
Native Tests - Misc3 Build Failures Logs Raw logs 🔍

Full information is available in the Build summary check run.
You can consult the Develocity build scans.

Failures

⚙️ Native Tests - Misc3 #

- Failing: integration-tests/smallrye-config 

📦 integration-tests/smallrye-config

io.quarkus.it.smallrye.config.SmallRyeConfigIT.externalConfig - History - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
JSON path value doesn't match.
Expected: 1234
  Actual: null

	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)

Flaky tests - Develocity

⚙️ JVM Tests - JDK 21

📦 integration-tests/opentelemetry

io.quarkus.it.opentelemetry.OpenTelemetryInjectionsTest.testOTelInjections - History

  • Condition with Lambda expression in io.quarkus.it.opentelemetry.OpenTelemetryInjectionsTest was not fulfilled within 5 seconds. - org.awaitility.core.ConditionTimeoutException
org.awaitility.core.ConditionTimeoutException: Condition with Lambda expression in io.quarkus.it.opentelemetry.OpenTelemetryInjectionsTest was not fulfilled within 5 seconds.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:78)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:26)
	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:1006)
	at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:975)
	at io.quarkus.it.opentelemetry.OpenTelemetryInjectionsTest.reset(OpenTelemetryInjectionsTest.java:26)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)

⚙️ Native Tests - HTTP

📦 integration-tests/rest-client-reactive

io.quarkus.it.rest.client.BasicTestIT.shouldCreateClientSpans - History

  • expected: <1> but was: <2> - org.opentest4j.AssertionFailedError
org.opentest4j.AssertionFailedError: expected: <1> but was: <2>
	at io.quarkus.it.rest.client.BasicTest.shouldCreateClientSpans(BasicTest.java:216)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at io.quarkus.test.junit.QuarkusTestExtension.interceptTestMethod(QuarkusTestExtension.java:812)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

@zakkak zakkak closed this Jul 25, 2024
@quarkus-bot quarkus-bot bot added the triage/invalid This doesn't seem right label Jul 25, 2024
@zakkak zakkak deleted the 2024-07-24-smallryeconfigsources branch July 25, 2024 09:51
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