Skip to content

Commit

Permalink
Merge pull request #35297 from gsmet/3.2.4-backports-1
Browse files Browse the repository at this point in the history
3.2.4 backports 1
  • Loading branch information
gsmet authored Aug 11, 2023
2 parents cc61143 + 45dd9e7 commit 328abbc
Show file tree
Hide file tree
Showing 131 changed files with 2,764 additions and 964 deletions.
44 changes: 22 additions & 22 deletions .github/native-tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,133 +2,133 @@
"include": [
{
"category": "Main",
"timeout": 40,
"timeout": 45,
"test-modules": "main",
"os-name": "ubuntu-latest"
},
{
"category": "Data1",
"timeout": 90,
"timeout": 95,
"test-modules": "jpa-h2, jpa-h2-embedded, jpa-mariadb, jpa-mssql, jpa-derby, jpa-without-entity, hibernate-orm-tenancy/datasource, hibernate-orm-tenancy/connection-resolver, hibernate-orm-tenancy/connection-resolver-legacy-qualifiers",
"os-name": "ubuntu-latest"
},
{
"category": "Data2",
"timeout": 65,
"timeout": 70,
"test-modules": "jpa, jpa-mapping-xml/legacy-app, jpa-mapping-xml/modern-app, jpa-mysql, jpa-db2, jpa-oracle",
"os-name": "ubuntu-latest"
},
{
"category": "Data3",
"timeout": 70,
"timeout": 75,
"test-modules": "flyway, hibernate-orm-panache, hibernate-orm-panache-kotlin, hibernate-orm-envers, liquibase, liquibase-mongodb",
"os-name": "ubuntu-latest"
},
{
"category": "Data4",
"timeout": 55,
"timeout": 60,
"test-modules": "mongodb-client, mongodb-devservices, mongodb-panache, mongodb-rest-data-panache, mongodb-panache-kotlin, redis-client, hibernate-orm-rest-data-panache",
"os-name": "ubuntu-latest"
},
{
"category": "Data5",
"timeout": 65,
"timeout": 70,
"test-modules": "jpa-postgresql, jpa-postgresql-withxml, narayana-stm, narayana-jta, reactive-pg-client, hibernate-reactive-postgresql, hibernate-orm-tenancy/schema",
"os-name": "ubuntu-latest"
},
{
"category": "Data6",
"timeout": 90,
"timeout": 95,
"test-modules": "elasticsearch-rest-client, elasticsearch-rest-high-level-client, elasticsearch-java-client, hibernate-search-orm-elasticsearch, hibernate-search-orm-elasticsearch-tenancy, hibernate-search-orm-opensearch, hibernate-search-orm-elasticsearch-coordination-outbox-polling",
"os-name": "ubuntu-latest"
},
{
"category": "Data7",
"timeout": 80,
"timeout": 85,
"test-modules": "reactive-oracle-client, reactive-mysql-client, reactive-db2-client, hibernate-reactive-db2, hibernate-reactive-mysql, hibernate-reactive-panache, hibernate-reactive-panache-kotlin",
"os-name": "ubuntu-latest"
},
{
"category": "Amazon",
"timeout": 45,
"timeout": 50,
"test-modules": "amazon-lambda, amazon-lambda-http",
"os-name": "ubuntu-latest"
},
{
"category": "Messaging1",
"timeout": 110,
"timeout": 115,
"test-modules": "kafka, kafka-ssl, kafka-sasl, kafka-avro-apicurio2, kafka-snappy, kafka-streams, reactive-messaging-kafka, kafka-oauth-keycloak",
"os-name": "ubuntu-latest"
},
{
"category": "Messaging2",
"timeout": 70,
"timeout": 75,
"test-modules": "reactive-messaging-amqp, reactive-messaging-rabbitmq, reactive-messaging-rabbitmq-dyn",
"os-name": "ubuntu-latest"
},
{
"category": "Security1",
"timeout": 50,
"timeout": 60,
"test-modules": "elytron-security-oauth2, elytron-security, elytron-security-jdbc, elytron-undertow, elytron-security-ldap, bouncycastle, bouncycastle-jsse, bouncycastle-fips",
"os-name": "ubuntu-latest"
},
{
"category": "Security2",
"timeout": 70,
"timeout": 75,
"test-modules": "oidc, oidc-code-flow, oidc-tenancy, oidc-client, oidc-client-reactive, oidc-token-propagation, oidc-wiremock, oidc-client-wiremock",
"os-name": "ubuntu-latest"
},
{
"category": "Security3",
"timeout": 50,
"timeout": 55,
"test-modules": "keycloak-authorization, smallrye-jwt-token-propagation, security-webauthn",
"os-name": "ubuntu-latest"
},
{
"category": "Cache",
"timeout": 60,
"timeout": 65,
"test-modules": "infinispan-cache-jpa, infinispan-client, cache, redis-cache",
"os-name": "ubuntu-latest"
},
{
"category": "HTTP",
"timeout": 95,
"timeout": 110,
"test-modules": "elytron-resteasy, resteasy-jackson, elytron-resteasy-reactive, resteasy-mutiny, resteasy-reactive-kotlin/standard, vertx, vertx-http, vertx-web, vertx-web-jackson, vertx-graphql, virtual-http, rest-client, rest-client-reactive, rest-client-reactive-stork, rest-client-reactive-multipart, websockets, management-interface, management-interface-auth",
"os-name": "ubuntu-latest"
},
{
"category": "Misc1",
"timeout": 65,
"timeout": 80,
"test-modules": "maven, jackson, jsonb, kotlin-serialization, rest-client-reactive-kotlin-serialization, quartz, qute, logging-min-level-unset, logging-min-level-set, simple with space",
"os-name": "ubuntu-latest"
},
{
"category": "Misc2",
"timeout": 65,
"timeout": 70,
"test-modules": "hibernate-validator, test-extension/tests, logging-gelf, bootstrap-config/application, mailer, native-config-profile, locales",
"os-name": "ubuntu-latest"
},
{
"category": "Misc3",
"timeout": 75,
"timeout": 80,
"test-modules": "kubernetes-client, openshift-client, kubernetes-service-binding-jdbc, smallrye-config, smallrye-graphql, smallrye-graphql-client, smallrye-metrics, smallrye-opentracing",
"os-name": "ubuntu-latest"
},
{
"category": "Misc4",
"timeout": 120,
"timeout": 130,
"test-modules": "picocli-native, gradle, micrometer-mp-metrics, micrometer-prometheus, logging-json, jaxp, jaxb, opentelemetry, opentelemetry-jdbc-instrumentation, webjars-locator",
"os-name": "ubuntu-latest"
},
{
"category": "Spring",
"timeout": 55,
"timeout": 60,
"test-modules": "spring-di, spring-web, spring-data-jpa, spring-boot-properties, spring-cloud-config-client, spring-data-rest",
"os-name": "ubuntu-latest"
},
{
"category": "gRPC",
"timeout": 65,
"timeout": 70,
"test-modules": "grpc-health, grpc-interceptors, grpc-mutual-auth, grpc-plain-text-gzip, grpc-plain-text-mutiny, grpc-proto-v2, grpc-streaming, grpc-tls",
"os-name": "ubuntu-latest"
},
Expand Down
2 changes: 1 addition & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
<httpasync.version>4.1.5</httpasync.version>
<cronutils.version>9.2.1</cronutils.version>
<quartz.version>2.3.2</quartz.version>
<h2.version>2.1.214</h2.version> <!-- When updating, needs to be matched in io.quarkus.hibernate.orm.runtime.config.DialectVersions -->
<h2.version>2.2.220</h2.version> <!-- When updating, needs to be matched in io.quarkus.hibernate.orm.runtime.config.DialectVersions -->
<postgresql-jdbc.version>42.6.0</postgresql-jdbc.version>
<mariadb-jdbc.version>3.1.4</mariadb-jdbc.version>
<mysql-jdbc.version>8.0.30</mysql-jdbc.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import io.quarkus.bootstrap.prebuild.CodeGenException;
import io.quarkus.deployment.codegen.CodeGenData;
import io.quarkus.deployment.configuration.BuildTimeConfigurationReader;
import io.quarkus.deployment.configuration.tracker.ConfigTrackingValueTransformer;
import io.quarkus.deployment.dev.DevModeContext;
import io.quarkus.deployment.dev.DevModeContext.ModuleInfo;
import io.quarkus.maven.dependency.ResolvedDependency;
Expand Down Expand Up @@ -185,6 +186,43 @@ public static boolean trigger(ClassLoader deploymentClassLoader,
});
}

/**
* Initializes an application build time configuration and returns current values of properties
* passed in as {@code originalProperties}.
*
* @param appModel application model
* @param launchMode launch mode
* @param buildSystemProps build system (or project) properties
* @param deploymentClassLoader build classloader
* @param originalProperties properties to read from the initialized configuration
* @return current values of the passed in original properties
*/
public static Properties readCurrentConfigValues(ApplicationModel appModel, String launchMode,
Properties buildSystemProps,
QuarkusClassLoader deploymentClassLoader, Properties originalProperties) {
Config config = null;
try {
config = getConfig(appModel, LaunchMode.valueOf(launchMode), buildSystemProps, deploymentClassLoader);
} catch (CodeGenException e) {
throw new RuntimeException("Failed to load application configuration", e);
}
var valueTransformer = ConfigTrackingValueTransformer.newInstance(config);
final Properties currentValues = new Properties(originalProperties.size());
for (var originalProp : originalProperties.entrySet()) {
var name = originalProp.getKey().toString();
var currentValue = config.getConfigValue(name);
final String current = valueTransformer.transform(name, currentValue);
if (!originalProp.getValue().equals(current)) {
log.info("Option " + name + " has changed since the last build from "
+ originalProp.getValue() + " to " + current);
}
if (current != null) {
currentValues.put(name, current);
}
}
return currentValues;
}

public static Config getConfig(ApplicationModel appModel, LaunchMode launchMode, Properties buildSystemProps,
QuarkusClassLoader deploymentClassLoader) throws CodeGenException {
final Map<String, List<String>> unavailableConfigServices = getUnavailableConfigServices(appModel.getAppArtifact(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import io.quarkus.deployment.configuration.matching.FieldContainer;
import io.quarkus.deployment.configuration.matching.MapContainer;
import io.quarkus.deployment.configuration.matching.PatternMapBuilder;
import io.quarkus.deployment.configuration.tracker.ConfigTrackingInterceptor;
import io.quarkus.deployment.configuration.type.ArrayOf;
import io.quarkus.deployment.configuration.type.CollectionOf;
import io.quarkus.deployment.configuration.type.ConverterType;
Expand Down Expand Up @@ -124,6 +125,8 @@ private static List<Class<?>> collectConfigRoots(ClassLoader classLoader) throws
final Set<String> deprecatedProperties;
final Set<String> deprecatedRuntimeProperties;

final ConfigTrackingInterceptor buildConfigTracker;

/**
* Initializes a new instance with located configuration root classes on the classpath
* of a given classloader.
Expand Down Expand Up @@ -242,6 +245,8 @@ private BuildTimeConfigurationReader(ClassLoader classLoader, final List<Class<?

deprecatedProperties = getDeprecatedProperties(allRoots);
deprecatedRuntimeProperties = getDeprecatedProperties(runTimeRoots);

buildConfigTracker = new ConfigTrackingInterceptor();
}

private static void processClass(ClassDefinition.Builder builder, Class<?> clazz,
Expand Down Expand Up @@ -408,11 +413,15 @@ public SmallRyeConfig initConfiguration(LaunchMode launchMode, Properties buildS
for (ConfigClassWithPrefix mapping : getBuildTimeVisibleMappings()) {
builder.withMapping(mapping.getKlass(), mapping.getPrefix());
}
return builder.build();

builder.withInterceptors(buildConfigTracker);
var config = builder.build();
buildConfigTracker.configure(config);
return config;
}

public ReadResult readConfiguration(final SmallRyeConfig config) {
return SecretKeys.doUnlocked(() -> new ReadOperation(config).run());
return SecretKeys.doUnlocked(() -> new ReadOperation(config, buildConfigTracker).run());
}

private Set<String> getDeprecatedProperties(Iterable<RootDefinition> rootDefinitions) {
Expand Down Expand Up @@ -468,6 +477,7 @@ private void collectDeprecatedConfigItems(ClassMember classMember, Set<String> d

final class ReadOperation {
final SmallRyeConfig config;
final ConfigTrackingInterceptor buildConfigTracker;
final Set<String> processedNames = new HashSet<>();

final Map<Class<?>, Object> objectsByClass = new HashMap<>();
Expand All @@ -477,8 +487,9 @@ final class ReadOperation {

final Map<ConverterType, Converter<?>> convByType = new HashMap<>();

ReadOperation(final SmallRyeConfig config) {
ReadOperation(final SmallRyeConfig config, ConfigTrackingInterceptor buildConfigTracker) {
this.config = config;
this.buildConfigTracker = buildConfigTracker;
}

ReadResult run() {
Expand Down Expand Up @@ -684,6 +695,7 @@ ReadResult run() {
.setRunTimeMappings(runTimeMappings)
.setUnknownBuildProperties(unknownBuildProperties)
.setDeprecatedRuntimeProperties(deprecatedRuntimeProperties)
.setBuildConfigTracker(buildConfigTracker)
.createReadResult();
}

Expand Down Expand Up @@ -1151,6 +1163,7 @@ public static final class ReadResult {

final Set<String> unknownBuildProperties;
final Set<String> deprecatedRuntimeProperties;
final ConfigTrackingInterceptor.ReadOptionsProvider readOptionsProvider;

public ReadResult(final Builder builder) {
this.objectsByClass = builder.getObjectsByClass();
Expand All @@ -1176,6 +1189,8 @@ public ReadResult(final Builder builder) {

this.unknownBuildProperties = builder.getUnknownBuildProperties();
this.deprecatedRuntimeProperties = builder.deprecatedRuntimeProperties;
this.readOptionsProvider = builder.buildConfigTracker == null ? null
: builder.buildConfigTracker.getReadOptionsProvider();
}

private static Map<Class<?>, RootDefinition> rootsToMap(Builder builder) {
Expand Down Expand Up @@ -1276,6 +1291,10 @@ public Object requireObjectForClass(Class<?> clazz) {
return obj;
}

public ConfigTrackingInterceptor.ReadOptionsProvider getReadOptionsProvider() {
return readOptionsProvider;
}

static class Builder {
private Map<Class<?>, Object> objectsByClass;
private Map<String, String> allBuildTimeValues;
Expand All @@ -1292,6 +1311,7 @@ static class Builder {
private List<ConfigClassWithPrefix> runTimeMappings;
private Set<String> unknownBuildProperties;
private Set<String> deprecatedRuntimeProperties;
private ConfigTrackingInterceptor buildConfigTracker;

Map<Class<?>, Object> getObjectsByClass() {
return objectsByClass;
Expand Down Expand Up @@ -1424,6 +1444,11 @@ Builder setDeprecatedRuntimeProperties(Set<String> deprecatedRuntimeProperties)
return this;
}

Builder setBuildConfigTracker(ConfigTrackingInterceptor buildConfigTracker) {
this.buildConfigTracker = buildConfigTracker;
return this;
}

ReadResult createReadResult() {
return new ReadResult(this);
}
Expand Down
Loading

0 comments on commit 328abbc

Please sign in to comment.