Skip to content

Commit

Permalink
Merge branch 'main' into fix/kotlin-livereload
Browse files Browse the repository at this point in the history
  • Loading branch information
lujun2 authored Aug 7, 2024
2 parents 594ccc8 + 3be2c10 commit 8991414
Show file tree
Hide file tree
Showing 19 changed files with 177 additions and 137 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ is followed for every pull request.
can be used temporarily during the review process but things should be squashed at the end to have meaningful commits.
We use merge commits so the GitHub Merge button cannot do that for us. If you don't know how to do that, just ask in
your pull request, we will be happy to help!
* Please limit the use of lambdas and streams as much as possible in code that executes at runtime, in order to minimize runtime footprint.

### Continuous Integration

Expand Down
15 changes: 10 additions & 5 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,19 @@
<wildfly-elytron.version>2.5.0.Final</wildfly-elytron.version>
<jboss-marshalling.version>2.1.4.SP1</jboss-marshalling.version>
<jboss-threads.version>3.6.1.Final</jboss-threads.version>
<vertx.version>4.5.8</vertx.version>
<vertx.version>4.5.9</vertx.version>
<httpclient.version>4.5.14</httpclient.version>
<httpcore.version>4.4.16</httpcore.version>
<httpasync.version>4.1.5</httpasync.version>
<cronutils.version>9.2.1</cronutils.version>
<quartz.version>2.3.2</quartz.version>
<h2.version>2.2.224</h2.version> <!-- When updating, needs to be matched in io.quarkus.hibernate.orm.runtime.config.DialectVersions -->
<h2.version>2.3.230</h2.version> <!-- When updating, needs to be matched in io.quarkus.hibernate.orm.runtime.config.DialectVersions -->
<postgresql-jdbc.version>42.7.3</postgresql-jdbc.version>
<mariadb-jdbc.version>3.4.0</mariadb-jdbc.version>
<mysql-jdbc.version>8.3.0</mysql-jdbc.version>
<mssql-jdbc.version>12.8.0.jre11</mssql-jdbc.version>
<adal4j.version>1.6.7</adal4j.version>
<oracle-jdbc.version>23.4.0.24.05</oracle-jdbc.version>
<oracle-jdbc.version>23.5.0.24.07</oracle-jdbc.version>
<derby-jdbc.version>10.16.1.1</derby-jdbc.version>
<db2-jdbc.version>11.5.8.0</db2-jdbc.version>
<shrinkwrap.version>1.2.6</shrinkwrap.version>
Expand All @@ -143,7 +143,7 @@
<kafka3.version>3.7.1</kafka3.version>
<lz4.version>1.8.0</lz4.version> <!-- dependency of the kafka-clients that could be overridden by other imported BOMs in the platform -->
<snappy.version>1.1.10.5</snappy.version>
<strimzi-test-container.version>0.106.0</strimzi-test-container.version>
<strimzi-test-container.version>0.107.0</strimzi-test-container.version>
<!-- Scala is used by Kafka so we need to choose a compatible version -->
<scala.version>2.13.14</scala.version>
<aws-lambda-java.version>1.2.3</aws-lambda-java.version>
Expand All @@ -161,7 +161,7 @@
<awaitility.version>4.2.1</awaitility.version>
<jboss-logmanager.version>3.0.6.Final</jboss-logmanager.version>
<flyway.version>10.17.0</flyway.version>
<yasson.version>3.0.3</yasson.version>
<yasson.version>3.0.4</yasson.version>
<!-- liquibase-mongodb is not released everytime with liquibase anymore, but the two versions need to be compatible -->
<liquibase.version>4.27.0</liquibase.version>
<liquibase-mongodb.version>4.24.0</liquibase-mongodb.version>
Expand Down Expand Up @@ -5749,6 +5749,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.smallrye.reactive</groupId>
<artifactId>mutiny-zero</artifactId>
<version>${mutiny-zero.version}</version>
</dependency>
<dependency>
<groupId>io.smallrye.reactive</groupId>
<artifactId>mutiny-zero-flow-adapters</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bom/dev-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<description>Dependency management for dev-ui. Importable by third party extension developers.</description>

<properties>
<vaadin.version>24.4.4</vaadin.version>
<vaadin.version>24.4.5</vaadin.version>
<lit.version>3.1.4</lit.version>
<lit-element.version>4.0.6</lit-element.version>
<lit-html.version>3.1.4</lit-html.version>
Expand Down
2 changes: 1 addition & 1 deletion bom/test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<jaxb-api.version>2.3.1</jaxb-api.version>

<rxjava1.version>1.3.8</rxjava1.version>
<strimzi-test-container.version>0.106.0</strimzi-test-container.version>
<strimzi-test-container.version>0.107.0</strimzi-test-container.version>

<opentelemetry-proto.version>1.0.0-alpha</opentelemetry-proto.version>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion devtools/gradle/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
plugin-publish = "1.2.1"

# updating Kotlin here makes QuarkusPluginTest > shouldNotFailOnProjectDependenciesWithoutMain(Path) fail
kotlin = "2.0.0"
kotlin = "2.0.10"
smallrye-config = "3.9.1"

junit5 = "5.10.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public CheckCrossReferences(Path srcDir, Path referenceIndexPath)

if (!Files.exists(referenceIndexPath) || !Files.isReadable(referenceIndexPath)) {
throw new IllegalStateException(
String.format("Reference index does not exist or is not readable", referenceIndexPath.toAbsolutePath()));
String.format("Reference index %s does not exist or is not readable", referenceIndexPath.toAbsolutePath()));
}

ObjectMapper om = new ObjectMapper(new YAMLFactory().enable(YAMLGenerator.Feature.MINIMIZE_QUOTES));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public String delete() {
AuditReader auditReader = AuditReaderFactory.get(em);
List<Number> revisions = auditReader.getRevisions(MyAuditedEntity.class, entity.getId());
if (revisions.size() != 2) {
throw new IllegalStateException(String.format("found {} revisions", revisions.size()));
throw new IllegalStateException(String.format("found %d revisions", revisions.size()));
}

for (Number revision : revisions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public String save(String name) {
AuditReader auditReader = AuditReaderFactory.get(em);
List<Number> revisions = auditReader.getRevisions(MyAuditedEntity.class, entity.getId());
if (revisions.size() != 2) {
throw new IllegalStateException(String.format("found {} revisions", revisions.size()));
throw new IllegalStateException(String.format("found %d revisions", revisions.size()));
}

MyRevisionEntity revEntity = auditReader.findRevision(MyRevisionEntity.class, revisions.get(0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static final class Defaults {

// This must be aligned on the H2 version in the Quarkus BOM
// This must never be removed
public static final String H2 = "2.2.224";
public static final String H2 = "2.3.230";

private Defaults() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ public void startRecoveryService(NarayanaJtaRecorder recorder,
@BuildStep(onlyIf = IsTest.class)
void testTx(BuildProducer<GeneratedBeanBuildItem> generatedBeanBuildItemBuildProducer,
BuildProducer<AdditionalBeanBuildItem> additionalBeans) {

if (!testTransactionOnClassPath()) {
return;
}

//generate the annotated interceptor with gizmo
//all the logic is in the parent, but we don't have access to the
//binding annotation here
Expand All @@ -219,6 +224,15 @@ void testTx(BuildProducer<GeneratedBeanBuildItem> generatedBeanBuildItemBuildPro
.addBeanClass(TEST_TRANSACTION).build());
}

private static boolean testTransactionOnClassPath() {
try {
Class.forName(TEST_TRANSACTION, false, Thread.currentThread().getContextClassLoader());
return true;
} catch (ClassNotFoundException ignored) {
return false;
}
}

@BuildStep
public ContextConfiguratorBuildItem transactionContext(ContextRegistrationPhaseBuildItem contextRegistrationPhase) {
return new ContextConfiguratorBuildItem(contextRegistrationPhase.getContext()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ public static void setHttpClientOptions(OidcCommonConfig oidcConfig, HttpClientO
}
} catch (IOException ex) {
throw new ConfigurationException(String.format(
"OIDC truststore file does not exist or can not be read",
oidcConfig.tls.trustStoreFile.get().toString()), ex);
"OIDC truststore file %s does not exist or can not be read",
oidcConfig.tls.trustStoreFile.get()), ex);
}
}
if (oidcConfig.tls.keyStoreFile.isPresent()) {
Expand All @@ -182,8 +182,8 @@ public static void setHttpClientOptions(OidcCommonConfig oidcConfig, HttpClientO

} catch (IOException ex) {
throw new ConfigurationException(String.format(
"OIDC keystore file does not exist or can not be read",
oidcConfig.tls.keyStoreFile.get().toString()), ex);
"OIDC keystore file %s does not exist or can not be read",
oidcConfig.tls.keyStoreFile.get()), ex);
}
}
Optional<ProxyOptions> proxyOpt = toProxyOptions(oidcConfig.getProxy());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,6 @@ public DevServicesResultBuildItem startKeycloakContainer(
StartupLogCompressor compressor = new StartupLogCompressor(
(launchMode.isTest() ? "(test) " : "") + "Keycloak Dev Services Starting:",
consoleInstalledBuildItem, loggingSetupBuildItem);
if (vertxInstance == null) {
vertxInstance = Vertx.vertx();
}
try {
List<String> errors = new ArrayList<>();

Expand Down Expand Up @@ -281,6 +278,12 @@ private Map<String, String> prepareConfiguration(

List<String> realmNames = new LinkedList<>();

// this needs to be only if we actually start the dev-service as it adds a shutdown hook
// whose TCCL is the Augmentation CL, which if not removed, causes a massive memory leaks
if (vertxInstance == null) {
vertxInstance = Vertx.vertx();
}

WebClient client = OidcDevServicesUtils.createWebClient(vertxInstance);
try {
String adminToken = getAdminToken(client, clientAuthServerBaseUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ public final class PanacheJpaCommonResourceProcessor {
@BuildStep(onlyIf = IsTest.class)
void testTx(BuildProducer<GeneratedBeanBuildItem> generatedBeanBuildItemBuildProducer,
BuildProducer<AdditionalBeanBuildItem> additionalBeans) {

if (!testReactiveTransactionOnClassPath()) {
return;
}

//generate the annotated interceptor with gizmo
//all the logic is in the parent, but we don't have access to the
//binding annotation here
Expand All @@ -76,6 +81,15 @@ void testTx(BuildProducer<GeneratedBeanBuildItem> generatedBeanBuildItemBuildPro
.addBeanClass(TEST_REACTIVE_TRANSACTION).build());
}

private static boolean testReactiveTransactionOnClassPath() {
try {
Class.forName(TEST_REACTIVE_TRANSACTION, false, Thread.currentThread().getContextClassLoader());
return true;
} catch (ClassNotFoundException ignored) {
return false;
}
}

@BuildStep
void registerInterceptors(BuildProducer<AdditionalBeanBuildItem> additionalBeans) {
AdditionalBeanBuildItem.Builder builder = AdditionalBeanBuildItem.builder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ boolean isEnumConstantMessageKey(String key, IndexView index, ClassInfo bundleIn
return true;
}
throw new MessageBundleException(
String.format("%s is not an enum constant of %: %s", constant, maybeEnum, key));
String.format("%s is not an enum constant of %s: %s", constant, maybeEnum, key));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package io.quarkus.vertx.http.deployment;

import io.quarkus.builder.item.SimpleBuildItem;

/**
* Marker class that can be used to force the socket to open even when using virtual HTTP.
*
* There are some use cases that may want to handle both real and virtual HTTP requests, such as mapping incoming
* gRPC requests onto JAX-RS handlers.
*/
public final class RequireSocketHttpBuildItem extends SimpleBuildItem {
public static final RequireSocketHttpBuildItem MARKER = new RequireSocketHttpBuildItem();
}
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ void openSocket(ApplicationStartBuildItem start,
BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
HttpBuildTimeConfig httpBuildTimeConfig,
Optional<RequireVirtualHttpBuildItem> requireVirtual,
Optional<RequireSocketHttpBuildItem> requireSocket,
EventLoopCountBuildItem eventLoopCount,
List<WebsocketSubProtocolsBuildItem> websocketSubProtocols,
Capabilities capabilities,
Expand All @@ -452,8 +453,9 @@ void openSocket(ApplicationStartBuildItem start,
.produce(ReflectiveClassBuildItem.builder(VirtualServerChannel.class)
.build());
}
boolean startSocket = (!startVirtual || launchMode.getLaunchMode() != LaunchMode.NORMAL)
&& (requireVirtual.isEmpty() || !requireVirtual.get().isAlwaysVirtual());
boolean startSocket = requireSocket.isPresent() ||
((!startVirtual || launchMode.getLaunchMode() != LaunchMode.NORMAL)
&& (requireVirtual.isEmpty() || !requireVirtual.get().isAlwaysVirtual()));
recorder.startServer(vertx.getVertx(), shutdown,
launchMode.getLaunchMode(), startVirtual, startSocket,
eventLoopCount.getEventLoopCount(),
Expand Down
Loading

0 comments on commit 8991414

Please sign in to comment.