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

3.1.1 backports 2 #33853

Merged
merged 27 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a153b04
DevTool-cli Clarify --errors help message
emmanuelbernard May 30, 2023
26afe43
Prevent NPE in Jacoco report preparation when a workspace module has …
famod May 31, 2023
95923d8
Dev UI fix error in log on Hot Reload when properties change
phillip-kruger May 25, 2023
5ed6480
Dev UI Make sure user config is added to editor
phillip-kruger May 25, 2023
a4b0389
Do not show config filter if no filter exist
phillip-kruger May 26, 2023
a1b4393
Add ability to only show own properties
phillip-kruger May 30, 2023
53cc221
Properly implement ClientRequestContext#setEntity
geoand Jun 1, 2023
1c69e11
Update security-keycloak-admin-client.adoc
stefanwendelmann Jun 1, 2023
e7b363a
Normalizes podman vs. podman.exe and Podman Desktop
Karm May 31, 2023
4ca6788
When using RestMulti, don't require @Produces
geoand Jun 1, 2023
3964787
Upgrade to Hibernate ORM 6.2.4.Final
Sanne May 17, 2023
b182934
Amend integration for compatibility with Hibernate ORM 6.2.3.Final
Sanne May 17, 2023
1848d53
New Hibernate ORM service to be registered: BatchLoaderFactory
Sanne May 17, 2023
7dff533
Update to Hibernate Reactive 2.0.0.Final
Sanne May 19, 2023
81a1ee4
Register new Service BatchLoaderFactoryInitiator for Hibernate Reacti…
Sanne May 19, 2023
070534c
fix message typo
jtama Jun 2, 2023
3d7a96c
Fix a condition that detects OpenTelemetry presence based on an OpenT…
jmartisk Jun 1, 2023
b59c2f8
Prevent NPE in DEV UI JsonRpc#route method
michalvavrik Jun 5, 2023
180442d
Kafka serde discovery: handle channel names containing dot
ozangunalp Jun 5, 2023
1bf7e7f
Only expose the Dev UI Routes if Vert.x HTTP is present
cescoffier Jun 4, 2023
226ff97
Fix Dev UI v1 link in the guides
zbendhiba Jun 2, 2023
7552b20
Redis Hostname provider - do not call getHosts() twice
cescoffier Jun 4, 2023
b3866a1
Bump kotlinx-serialization-json from 1.5.0 to 1.5.1
dependabot[bot] May 31, 2023
cbe6b53
Bump apicurio-registry.version from 2.4.2.Final to 2.4.3.Final
dependabot[bot] May 31, 2023
15dcca8
set jackson-bom version to 2.15.2
KaiSuchomel Jun 1, 2023
04b2b8e
Update Jackson to 2.15.2 in independent-projects
gsmet Jun 6, 2023
6b50326
Register PGobject subtypes for reflection
marko-bekhta May 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,15 @@
<graal-sdk.version>22.3.2</graal-sdk.version>
<graal-svm.version>${graal-sdk.version}</graal-svm.version>
<gizmo.version>1.6.1.Final</gizmo.version>
<jackson-bom.version>2.15.0</jackson-bom.version>
<jackson-bom.version>2.15.2</jackson-bom.version>
<commons-logging-jboss-logging.version>1.0.0.Final</commons-logging-jboss-logging.version>
<commons-lang3.version>3.12.0</commons-lang3.version>
<commons-codec.version>1.15</commons-codec.version>
<classmate.version>1.5.1</classmate.version>
<hibernate-orm.version>6.2.1.Final</hibernate-orm.version> <!-- When updating, align bytebuddy.version to Hibernate needs as well (just below): -->
<hibernate-orm.version>6.2.4.Final</hibernate-orm.version> <!-- When updating, align bytebuddy.version to Hibernate needs as well (just below): -->
<bytebuddy.version>1.12.18</bytebuddy.version> <!-- Version controlled by Hibernate ORM's needs -->
<hibernate-commons-annotations.version>6.0.6.Final</hibernate-commons-annotations.version> <!-- version controlled by Hibernate ORM -->
<hibernate-reactive.version>2.0.0.CR1</hibernate-reactive.version>
<hibernate-reactive.version>2.0.0.Final</hibernate-reactive.version>
<hibernate-validator.version>8.0.0.Final</hibernate-validator.version>
<hibernate-search.version>6.1.7.Final</hibernate-search.version>
<narayana.version>6.0.1.Final</narayana.version>
Expand Down Expand Up @@ -159,7 +159,7 @@
<azure-functions-java-spi.version>1.0.0</azure-functions-java-spi.version>
<kotlin.version>1.8.21</kotlin.version>
<kotlin.coroutine.version>1.7.1</kotlin.coroutine.version>
<kotlin-serialization.version>1.5.0</kotlin-serialization.version>
<kotlin-serialization.version>1.5.1</kotlin-serialization.version>
<dekorate.version>3.6.1</dekorate.version> <!-- Please check with Java Operator SDK team before updating -->
<maven-invoker.version>3.2.0</maven-invoker.version>
<awaitility.version>4.2.0</awaitility.version>
Expand Down Expand Up @@ -201,7 +201,7 @@
<log4j2-api.version>2.20.0</log4j2-api.version>
<log4j-jboss-logmanager.version>1.3.0.Final</log4j-jboss-logmanager.version>
<avro.version>1.11.1</avro.version>
<apicurio-registry.version>2.4.2.Final</apicurio-registry.version>
<apicurio-registry.version>2.4.3.Final</apicurio-registry.version>
<apicurio-common-rest-client.version>0.1.15.Final</apicurio-common-rest-client.version> <!-- must be the version Apicurio Registry uses -->
<testcontainers.version>1.18.1</testcontainers.version> <!-- Make sure to also update docker-java.version to match its needs -->
<docker-java.version>3.3.0</docker-java.version> <!-- must be the version Testcontainers use -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@
import java.nio.charset.StandardCharsets;
import java.util.concurrent.TimeUnit;
import java.util.function.Predicate;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

import org.eclipse.microprofile.config.ConfigProvider;
import org.jboss.logging.Logger;

import io.smallrye.common.os.OS;
import io.smallrye.config.SmallRyeConfig;

public final class ContainerRuntimeUtil {

private static final Logger log = Logger.getLogger(ContainerRuntimeUtil.class);
private static final String CONTAINER_EXECUTABLE = ConfigProvider.getConfig().unwrap(SmallRyeConfig.class)
.getOptionalValue("quarkus.native.container-runtime", String.class).orElse(null);
private static final Pattern PODMAN_PATTERN = Pattern.compile("^podman(?:\\.exe)? version.*", Pattern.DOTALL);

/**
* Static variable is not used because the class gets loaded by different classloaders at
Expand All @@ -44,7 +45,7 @@ public static ContainerRuntime detectContainerRuntime(boolean required) {
return containerRuntime;
}

ContainerRuntime containerRuntimeEnvironment = getContainerRuntimeEnvironment();
final ContainerRuntime containerRuntimeEnvironment = getContainerRuntimeEnvironment();
if (containerRuntimeEnvironment == ContainerRuntime.UNAVAILABLE) {
storeContainerRuntimeInSystemProperty(ContainerRuntime.UNAVAILABLE);

Expand Down Expand Up @@ -83,7 +84,7 @@ private static ContainerRuntime getContainerRuntimeEnvironment() {
}
if (CONTAINER_EXECUTABLE.trim().equalsIgnoreCase("podman")) {
podmanVersionOutput = getVersionOutputFor(ContainerRuntime.PODMAN);
podmanAvailable = podmanVersionOutput.startsWith("podman version");
podmanAvailable = PODMAN_PATTERN.matcher(podmanVersionOutput).matches();
if (podmanAvailable) {
return ContainerRuntime.PODMAN;
}
Expand All @@ -96,15 +97,13 @@ private static ContainerRuntime getContainerRuntimeEnvironment() {
dockerAvailable = dockerVersionOutput.contains("Docker version");
if (dockerAvailable) {
// Check if "docker" is an alias to "podman"
if (dockerVersionOutput.startsWith("podman version") ||
dockerVersionOutput.startsWith("podman.exe version")) {
if (PODMAN_PATTERN.matcher(dockerVersionOutput).matches()) {
return ContainerRuntime.PODMAN;
}
return ContainerRuntime.DOCKER;
}
podmanVersionOutput = getVersionOutputFor(ContainerRuntime.PODMAN);
podmanAvailable = podmanVersionOutput.startsWith("podman version") ||
podmanVersionOutput.startsWith("podman.exe version");
podmanAvailable = PODMAN_PATTERN.matcher(podmanVersionOutput).matches();
if (podmanAvailable) {
return ContainerRuntime.PODMAN;
}
Expand All @@ -130,7 +129,7 @@ private static ContainerRuntime loadContainerRuntimeFromSystemProperty() {
return null;
}

ContainerRuntime containerRuntime = ContainerRuntime.valueOf(runtime);
final ContainerRuntime containerRuntime = ContainerRuntime.of(runtime);

if (containerRuntime == null) {
log.warnf("System property %s contains an unknown value %s. Ignoring it.",
Expand Down Expand Up @@ -225,7 +224,7 @@ public enum ContainerRuntime {
private final boolean rootless;

ContainerRuntime(String executableName, boolean rootless) {
this.executableName = executableName + (OS.current() == OS.WINDOWS ? ".exe" : "");
this.executableName = executableName;
this.rootless = rootless;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class OutputOptionMixin implements MessageWriter {

static final boolean picocliDebugEnabled = "DEBUG".equalsIgnoreCase(System.getProperty("picocli.trace"));

@CommandLine.Option(names = { "-e", "--errors" }, description = "Display error messages.")
@CommandLine.Option(names = { "-e", "--errors" }, description = "Print more context on errors and exceptions.")
boolean showErrors;

@CommandLine.Option(names = { "--verbose" }, description = "Verbose mode.")
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/dev-ui.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ include::_attributes.adoc[]
.Dev UI v1
====
This guide covers the Dev UI v1, which has been replaced in Quarkus 3.
You can still access the Dev UI v1 using http://localhost/q/dev-v1/
You can still access the Dev UI v1 using http://localhost:8080/q/dev-v1[/q/dev-v1]
====

This guide covers the Quarkus Dev UI for xref:building-my-first-extension.adoc[extension authors].
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/security-keycloak-admin-client.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ An example using the `client-credentials` grant type needs only a minor adjustme

[source,properties]
----
quarkus.keycloak.admin-client=true
quarkus.keycloak.admin-client.enabled=true
quarkus.keycloak.admin-client.server-url=http://localhost:8081
quarkus.keycloak.admin-client.realm=quarkus
quarkus.keycloak.admin-client.client-id=quarkus-client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ metadata:
categories:
- "data"
status: "stable"
unlisted: true
unlisted: true
config:
- "quarkus.datasource."
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public void enrollBeanValidationTypeSafeActivatorForReflection(Capabilities capa
if (capabilities.isPresent(Capability.HIBERNATE_VALIDATOR)) {
reflectiveClasses.produce(ReflectiveClassBuildItem.builder("org.hibernate.boot.beanvalidation.TypeSafeActivator")
.methods().fields().build());
reflectiveClasses.produce(ReflectiveClassBuildItem.builder(BeanValidationIntegrator.BV_CHECK_CLASS)
reflectiveClasses.produce(ReflectiveClassBuildItem.builder(BeanValidationIntegrator.JAKARTA_BV_CHECK_CLASS)
.constructors(false).build());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ private PrevalidatedQuarkusMetadata trimBootstrapMetadata(MetadataImpl fullMeta)
fullMeta.getMetadataBuildingOptions(), //TODO Replace this
fullMeta.getEntityBindingMap(),
fullMeta.getComposites(),
fullMeta.getGenericComponentsMap(),
fullMeta.getMappedSuperclassMap(),
fullMeta.getCollectionBindingMap(),
fullMeta.getTypeDefinitionMap(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.hibernate.engine.jdbc.internal.SqlStatementLoggerInitiator;
import org.hibernate.event.internal.EntityCopyObserverFactoryInitiator;
import org.hibernate.integrator.spi.Integrator;
import org.hibernate.loader.ast.internal.BatchLoaderFactoryInitiator;
import org.hibernate.persister.internal.PersisterClassResolverInitiator;
import org.hibernate.persister.internal.PersisterFactoryInitiator;
import org.hibernate.property.access.internal.PropertyAccessStrategyResolverInitiator;
Expand Down Expand Up @@ -235,6 +236,9 @@ private static List<StandardServiceInitiator<?>> buildQuarkusServiceInitiatorLis
// Default implementation
serviceInitiators.add(ParameterMarkerStrategyInitiator.INSTANCE);

// Default implementation
serviceInitiators.add(BatchLoaderFactoryInitiator.INSTANCE);

// Default implementation
serviceInitiators.add(SqlStatementLoggerInitiator.INSTANCE);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,11 @@ public void visitRegisteredComponents(Consumer<Component> consumer) {
metadata.visitRegisteredComponents(consumer);
}

@Override
public Component getGenericComponent(Class<?> componentClass) {
return metadata.getGenericComponent(componentClass);
}

public Map<String, PersistentClass> getEntityBindingMap() {
return metadata.getEntityBindingMap();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.hibernate.engine.jdbc.internal.JdbcServicesInitiator;
import org.hibernate.engine.jdbc.internal.SqlStatementLoggerInitiator;
import org.hibernate.event.internal.EntityCopyObserverFactoryInitiator;
import org.hibernate.loader.ast.internal.BatchLoaderFactoryInitiator;
import org.hibernate.persister.internal.PersisterClassResolverInitiator;
import org.hibernate.persister.internal.PersisterFactoryInitiator;
import org.hibernate.property.access.internal.PropertyAccessStrategyResolverInitiator;
Expand Down Expand Up @@ -106,6 +107,9 @@ public List<StandardServiceInitiator<?>> initialInitiatorList() {
// Default implementation
serviceInitiators.add(ParameterMarkerStrategyInitiator.INSTANCE);

// Default implementation
serviceInitiators.add(BatchLoaderFactoryInitiator.INSTANCE);

// Default implementation
serviceInitiators.add(SqlStatementLoggerInitiator.INSTANCE);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import jakarta.persistence.PersistenceUnit;

import org.hibernate.reactive.common.spi.Implementor;
import org.hibernate.reactive.common.spi.MutinyImplementor;
import org.hibernate.reactive.mutiny.Mutiny;
import org.hibernate.reactive.mutiny.impl.MutinySessionFactoryImpl;

Expand All @@ -29,7 +28,7 @@ public class ReactiveSessionFactoryProducer {
@ApplicationScoped
@DefaultBean
@Unremovable
@Typed({ Mutiny.SessionFactory.class, MutinyImplementor.class, Implementor.class })
@Typed({ Mutiny.SessionFactory.class, Implementor.class })
public MutinySessionFactoryImpl mutinySessionFactory() {
if (jpaConfig.getDeactivatedPersistenceUnitNames()
.contains(HibernateReactive.DEFAULT_REACTIVE_PERSISTENCE_UNIT_NAME)) {
Expand All @@ -38,7 +37,6 @@ public MutinySessionFactoryImpl mutinySessionFactory() {
+ HibernateReactive.DEFAULT_REACTIVE_PERSISTENCE_UNIT_NAME
+ ": Hibernate Reactive was deactivated through configuration properties");
}
// TODO Remove this cast when we get rid of the dependency to MutinyImplementor
return (MutinySessionFactoryImpl) emf.unwrap(Mutiny.SessionFactory.class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.hibernate.property.access.internal.PropertyAccessStrategyResolverInitiator;
import org.hibernate.reactive.engine.jdbc.mutation.internal.ReactiveMutationExecutorServiceInitiator;
import org.hibernate.reactive.id.factory.spi.ReactiveIdentifierGeneratorFactoryInitiator;
import org.hibernate.reactive.loader.ast.internal.ReactiveBatchLoaderFactoryInitiator;
import org.hibernate.reactive.provider.service.NativeParametersHandling;
import org.hibernate.reactive.provider.service.NoJtaPlatformInitiator;
import org.hibernate.reactive.provider.service.ReactiveMarkerServiceInitiator;
Expand Down Expand Up @@ -245,6 +246,9 @@ private static List<StandardServiceInitiator<?>> buildQuarkusServiceInitiatorLis
// Default implementation
serviceInitiators.add(SqlStatementLoggerInitiator.INSTANCE);

// Custom for Hibernate Reactive: BatchLoaderFactory
serviceInitiators.add(ReactiveBatchLoaderFactoryInitiator.INSTANCE);

serviceInitiators.trimToSize();
return serviceInitiators;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.hibernate.persister.internal.PersisterFactoryInitiator;
import org.hibernate.property.access.internal.PropertyAccessStrategyResolverInitiator;
import org.hibernate.reactive.id.factory.spi.ReactiveIdentifierGeneratorFactoryInitiator;
import org.hibernate.reactive.loader.ast.internal.ReactiveBatchLoaderFactoryInitiator;
import org.hibernate.reactive.provider.service.NativeParametersHandling;
import org.hibernate.reactive.provider.service.NoJtaPlatformInitiator;
import org.hibernate.reactive.provider.service.ReactiveMarkerServiceInitiator;
Expand Down Expand Up @@ -127,6 +128,9 @@ public List<StandardServiceInitiator<?>> initialInitiatorList() {
// Default implementation
serviceInitiators.add(SqlStatementLoggerInitiator.INSTANCE);

// Custom for Hibernate Reactive: BatchLoaderFactory
serviceInitiators.add(ReactiveBatchLoaderFactoryInitiator.INSTANCE);

serviceInitiators.trimToSize();
return serviceInitiators;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,27 @@ void build(BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
final String driverName = "org.postgresql.Driver";
reflectiveClass.produce(ReflectiveClassBuildItem.builder(driverName).build());

// We want to register these postgresql "object" types since they are used by a driver to build result set elements
// and reflection is used to create their instances. While ORM might only use a `PGInterval` if a @JdbcType(PostgreSQLIntervalSecondJdbcType.class)
// is applied to a Duration property, we still register other types as users might create their own JdbcTypes that
// would rely on some subtype of a PGobject:
final String[] pgObjectClasses = new String[] {
"org.postgresql.util.PGobject",
"org.postgresql.util.PGInterval",
"org.postgresql.util.PGmoney",
"org.postgresql.geometric.PGbox",
"org.postgresql.geometric.PGcircle",
"org.postgresql.geometric.PGline",
"org.postgresql.geometric.PGlseg",
"org.postgresql.geometric.PGpath",
"org.postgresql.geometric.PGpoint",
"org.postgresql.geometric.PGpolygon",
// One more subtype of the PGobject, it doesn't look like that this one will be instantiated through reflection,
// so let's not include it:
// "org.postgresql.jdbc.PgResultSet.NullObject"
};
reflectiveClass.produce(ReflectiveClassBuildItem.builder(pgObjectClasses).build());

// Needed when quarkus.datasource.jdbc.transactions=xa for the setting of the username and password
reflectiveClass.produce(ReflectiveClassBuildItem.builder("org.postgresql.ds.common.BaseDataSource").constructors(false)
.methods().build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,14 +561,17 @@ public AdditionalBeanBuildItem kafkaClientBeans() {
@BuildStep(onlyIf = IsDevelopment.class)
@Record(ExecutionTime.RUNTIME_INIT)
public void registerKafkaUiExecHandler(
Capabilities capabilities,
BuildProducer<DevConsoleRouteBuildItem> routeProducer,
KafkaUiRecorder recorder) {
routeProducer.produce(DevConsoleRouteBuildItem.builder()
.method("POST")
.handler(recorder.kafkaControlHandler())
.path(KAFKA_ADMIN_PATH)
.bodyHandlerRequired()
.build());
if (capabilities.isPresent(Capability.VERTX_HTTP)) {
routeProducer.produce(DevConsoleRouteBuildItem.builder()
.method("POST")
.handler(recorder.kafkaControlHandler())
.path(KAFKA_ADMIN_PATH)
.bodyHandlerRequired()
.build());
}
}

@BuildStep(onlyIf = IsDevelopment.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private TenantConfigContext createStaticTenantContext(Vertx vertx,
public TenantConfigContext apply(Throwable t) {
if (t instanceof OIDCException) {
LOG.warnf("Tenant '%s': '%s'."
+ " OIDC server is not available yet, an attempt to connect will be made duiring the first request."
+ " OIDC server is not available yet, an attempt to connect will be made during the first request."
+ " Access to resources protected by this tenant may fail"
+ " if OIDC server will not become available",
tenantId, t.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import io.quarkus.arc.Arc;
import io.quarkus.arc.ArcContainer;
Expand Down Expand Up @@ -51,8 +52,9 @@ public static Redis create(String name, Vertx vertx, RedisClientConfig config) {
}
} else if (config.hostsProviderName.isPresent()) {
RedisHostsProvider hostsProvider = findProvider(config.hostsProviderName.get());
hosts.addAll(hostsProvider.getHosts());
for (URI uri : hostsProvider.getHosts()) {
Set<URI> computedHosts = hostsProvider.getHosts();
hosts.addAll(computedHosts);
for (URI uri : computedHosts) {
options.addConnectionString(uri.toString());
}
} else {
Expand Down
Loading