Skip to content

Commit

Permalink
Merge branch 'main' into flyway_baseline_at_start
Browse files Browse the repository at this point in the history
  • Loading branch information
rmanibus authored Sep 3, 2023
2 parents b2cded4 + b82b03a commit e5b52f7
Show file tree
Hide file tree
Showing 104 changed files with 1,620 additions and 243 deletions.
3 changes: 2 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ updates:
# Agroal
- dependency-name: io.agroal:*
# WireMock
- dependency-name: com.github.tomakehurst:wiremock-jre8-standalone
- dependency-name: org.wiremock:wiremock
- dependency-name: org.wiremock:wiremock-standalone
- dependency-name: uk.co.automatictester:wiremock-maven-plugin
# Picocli
- dependency-name: info.picocli:*
Expand Down
4 changes: 2 additions & 2 deletions .github/virtual-threads-tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"include": [
{
"category": "Main",
"timeout": 45,
"test-modules": "grpc-virtual-threads, mailer-virtual-threads, redis-virtual-threads, rest-client-reactive-virtual-threads, resteasy-reactive-virtual-threads, vertx-event-bus-virtual-threads",
"timeout": 50,
"test-modules": "grpc-virtual-threads, mailer-virtual-threads, redis-virtual-threads, rest-client-reactive-virtual-threads, resteasy-reactive-virtual-threads, vertx-event-bus-virtual-threads, scheduler-virtual-threads, quartz-virtual-threads",
"os-name": "ubuntu-latest"
},
{
Expand Down
6 changes: 3 additions & 3 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<bouncycastle.tls.fips.version>1.0.16</bouncycastle.tls.fips.version>
<expressly.version>5.0.0</expressly.version>
<findbugs.version>3.0.2</findbugs.version>
<jandex.version>3.1.2</jandex.version>
<jandex.version>3.1.3</jandex.version>
<javax.annotation-api.version>1.3.2</javax.annotation-api.version>
<javax.inject.version>1</javax.inject.version>
<parsson.version>1.1.2</parsson.version>
Expand Down Expand Up @@ -51,7 +51,7 @@
<microprofile-lra.version>2.0</microprofile-lra.version>
<microprofile-openapi.version>3.1.1</microprofile-openapi.version>
<smallrye-common.version>2.1.0</smallrye-common.version>
<smallrye-config.version>3.3.3</smallrye-config.version>
<smallrye-config.version>3.3.4</smallrye-config.version>
<smallrye-health.version>4.0.4</smallrye-health.version>
<smallrye-metrics.version>4.0.0</smallrye-metrics.version>
<smallrye-open-api.version>3.5.1</smallrye-open-api.version>
Expand Down Expand Up @@ -100,7 +100,7 @@
<!-- When updating, align bytebuddy.version to Hibernate needs as well (just below),
as well as hibernate-orm.version-for-documentation in docs/pom.xml -->
<hibernate-orm.version>6.2.7.Final</hibernate-orm.version>
<bytebuddy.version>1.12.18</bytebuddy.version> <!-- Version controlled by Hibernate ORM's needs -->
<bytebuddy.version>1.14.7</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.4.Final</hibernate-reactive.version>
<hibernate-validator.version>8.0.1.Final</hibernate-validator.version>
Expand Down
16 changes: 8 additions & 8 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<failsafe-plugin.version>${version.surefire.plugin}</failsafe-plugin.version>

<!-- Jandex versions -->
<jandex.version>3.1.2</jandex.version>
<jandex.version>3.1.3</jandex.version>
<jandex-gradle-plugin.version>1.0.0</jandex-gradle-plugin.version>

<asciidoctorj.version>2.5.10</asciidoctorj.version>
Expand Down Expand Up @@ -110,7 +110,7 @@

<assertj.version>3.24.2</assertj.version>

<wiremock-jre8.version>2.35.0</wiremock-jre8.version>
<wiremock.version>3.0.0</wiremock.version>
<wiremock-maven-plugin.version>7.3.0</wiremock-maven-plugin.version>

<!-- Artemis test dependencies -->
Expand Down Expand Up @@ -262,9 +262,9 @@
<version>${unboundid-ldap.version}</version>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8-standalone</artifactId>
<version>${wiremock-jre8.version}</version>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-standalone</artifactId>
<version>${wiremock.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
Expand Down Expand Up @@ -689,9 +689,9 @@
<version>${wiremock-maven-plugin.version}</version>
<dependencies>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8-standalone</artifactId>
<version>${wiremock-jre8.version}</version>
<groupId>org.wiremock</groupId>
<artifactId>wiremock-standalone</artifactId>
<version>${wiremock.version}</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
public class ExtensionAnnotationProcessor extends AbstractProcessor {

private static final Pattern REMOVE_LEADING_SPACE = Pattern.compile("^ ", Pattern.MULTILINE);
private static final String QUARKUS_GENERATED = "io.quarkus.Generated";

private final ConfigDocWriter configDocWriter = new ConfigDocWriter();
private final ConfigDocItemScanner configDocItemScanner = new ConfigDocItemScanner();
Expand Down Expand Up @@ -711,6 +712,7 @@ private void generateAccessor(final TypeElement clazz) {
}
final JClassDef classDef = sourceFile._class(JMod.PUBLIC | JMod.FINAL, className);
classDef.constructor(JMod.PRIVATE); // no construction
classDef.annotate(QUARKUS_GENERATED).value("Quarkus annotation processor");
final JAssignableExpr instanceName = JExprs.name(Constants.INSTANCE_SYM);
boolean isEnclosingClassPublic = clazz.getModifiers().contains(Modifier.PUBLIC);
// iterate fields
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.grpc.common;
package io.quarkus;

import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
Expand All @@ -17,7 +17,7 @@
* The {@code @Generated} annotation is used to mark source code that has been generated during the gRPC generation phase.
* Classes generated by {@code protoc} are post-processed to remove the {@code jakarta.annotation.Generated} and use
* this annotation instead, avoiding a dependency on a pre-jakarta annotation.
*
* <p>
* This class is a direct copy of {@code jakarta.annotation.Generated}.
*/
@Documented
Expand All @@ -38,14 +38,14 @@
* Date when the source was generated. The date element must follow the ISO
* 8601 standard. For example the date element would have the following
* value 2017-07-04T12:08:56.235-0700 which represents 2017-07-04 12:08:56
* local time in the U.S. Pacific Time time zone.
* local time in the U.S. Pacific Time zone.
*
* @return The date the source was generated
*/
String date() default "";

/**
* A place holder for any comments that the code generator may want to
* A placeholder for any comments that the code generator may want to
* include in the generated code.
*
* @return Comments that the code generated included
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.logging.LogRecord;

import org.jboss.logging.Logger;
import org.jboss.logmanager.ExtLogRecord;

public class LogCleanupFilter implements Filter {

Expand All @@ -30,7 +31,12 @@ public boolean isLoggable(LogRecord record) {
//we also use this filter to add a warning about errors generated after shutdown
if (record.getLevel().intValue() >= org.jboss.logmanager.Level.ERROR.intValue() && shutdownNotifier.shutdown) {
if (!record.getMessage().endsWith(SHUTDOWN_MESSAGE)) {
record.setMessage(record.getMessage() + SHUTDOWN_MESSAGE);
if (record instanceof ExtLogRecord) {
ExtLogRecord elr = (ExtLogRecord) record;
elr.setMessage(record.getMessage() + SHUTDOWN_MESSAGE, elr.getFormatStyle());
} else {
record.setMessage(record.getMessage() + SHUTDOWN_MESSAGE);
}
}
}
// Only allow filtering messages of warning level and lower
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 @@ -3,7 +3,7 @@ plugin-publish = "1.2.1"

# updating Kotlin here makes QuarkusPluginTest > shouldNotFailOnProjectDependenciesWithoutMain(Path) fail
kotlin = "1.8.10"
smallrye-config = "3.3.3"
smallrye-config = "3.3.4"

junit5 = "5.10.0"
assertj = "3.24.2"
Expand Down
12 changes: 12 additions & 0 deletions docs/src/main/asciidoc/quartz.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,18 @@ public class MyListenerManager {
}
----

[[virtual-threads]]
== Run scheduled methods on virtual threads

Methods annotated with `@Scheduled` can also be annotated with `@RunOnVirtualThread`.
In this case, the method is invoked on a virtual thread.

The method must return `void` and your Java runtime must provide support for virtual threads.
Read xref:./virtual-threads.adoc[the virtual thread guide] for more details.

WARNING: This feature cannot be combined with the `run-blocking-method-on-quartz-thread` option.
If `run-blocking-method-on-quartz-thread` is set, the scheduled method runs on a (platform) thread managed by Quartz.

[[quartz-configuration-reference]]
== Quartz Configuration Reference

Expand Down
10 changes: 5 additions & 5 deletions docs/src/main/asciidoc/rest-client.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -669,20 +669,20 @@ First, Wiremock needs to be added as a test dependency. For a Maven project that
.pom.xml
----
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8</artifactId>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<scope>test</scope>
<version>${wiremock.version}</version> <1>
</dependency>
----
<1> Use a proper Wiremock version. All available versions can be found link:https://search.maven.org/artifact/com.github.tomakehurst/wiremock-jre8[here].
<1> Use a proper Wiremock version. All available versions can be found link:https://search.maven.org/artifact/org.wiremock/wiremock[here].

[source,gradle,role="secondary asciidoc-tabs-target-sync-gradle"]
.build.gradle
----
testImplementation("com.github.tomakehurst:wiremock-jre8:$wiremockVersion") <1>
testImplementation("org.wiremock:wiremock:$wiremockVersion") <1>
----
<1> Use a proper Wiremock version. All available versions can be found link:https://search.maven.org/artifact/com.github.tomakehurst/wiremock-jre8[here].
<1> Use a proper Wiremock version. All available versions can be found link:https://search.maven.org/artifact/org.wiremock/wiremock[here].

In Quarkus tests when some service needs to be started before the Quarkus tests are ran, we utilize the `@io.quarkus.test.common.QuarkusTestResource`
annotation to specify a `io.quarkus.test.common.QuarkusTestResourceLifecycleManager` which can start the service and supply configuration
Expand Down
8 changes: 8 additions & 0 deletions docs/src/main/asciidoc/scheduler-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,14 @@ If the xref:smallrye-metrics.adoc[SmallRye Metrics extension] is present, then a

If `quarkus.scheduler.tracing.enabled` is set to `true` and the xref:opentelemetry.adoc[OpenTelemetry extension] is present then the `@io.opentelemetry.instrumentation.annotations.WithSpan` annotation is added automatically to every `@Scheduled` method. As a result, each execution of this method has a new `io.opentelemetry.api.trace.Span` associated.

== Run @Scheduled methods on virtual threads

Methods annotated with `@Scheduled` can also be annotated with `@RunOnVirtualThread`.
In this case, the method is invoked on a virtual thread.

The method must return `void` and your Java runtime must provide support for virtual threads.
Read xref:./virtual-threads.adoc[the virtual thread guide] for more details.

== Configuration Reference

include::{generated-dir}/config/quarkus-scheduler.adoc[leveloffset=+1, opts=optional]
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/security-architecture.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ You can customize the following core security components of Quarkus:
* `IdentityProvider`
* `SecurityidentityAugmentor`

For more information about customizing Quarkus Security, including reactive security and how to register a security provider, see the Quarkus link:{url-quarkusio-guides}security-customization[Security tips and tricks] guide.
For more information about customizing Quarkus Security, including reactive security and how to register a security provider, see the Quarkus xref:security-customization.adoc[Security tips and tricks] guide.

== References

* xref:security-overview.adoc[Quarkus Security overview]
* xref:security-authentication-mechanisms.adoc#other-supported-authentication-mechanisms[Other supported authentication mechanisms]
* xref:security-identity-providers.adoc[Identity providers]
* xref:security-authorize-web-endpoints-reference.adoc[Authorization of web endpoints]
* xref:security-authorize-web-endpoints-reference.adoc[Authorization of web endpoints]
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ X509Certificate certificate = credential.getCertificate();

The information from the client certificate can be used to enhance Quarkus `SecurityIdentity`.
For example, you can add new roles after checking a client certificate subject name, and so on.
For more information about customizing `SecurityIdentity`, see the link:{url-quarkusio-guides}security-customization#security-identity-customization[Security identity customization] section in the Quarkus "Security tips and tricks" guide.
For more information about customizing `SecurityIdentity`, see the xref:security-customization.adoc#security-identity-customization[Security identity customization] section in the Quarkus "Security tips and tricks" guide.

[[other-supported-authentication-mechanisms]]
== Other supported authentication mechanisms
Expand Down Expand Up @@ -209,7 +209,7 @@ For more information about OIDC authentication and authorization methods that yo
To enable the Quarkus OIDC extension at runtime, set `quarkus.oidc.tenant-enabled=false` at build time.
Then re-enable it at runtime by using a system property.
For more information about managing the individual tenant configurations in multitenant OIDC deployments, see the link:{url-quarkusio-guides}security-openid-connect-multitenancy#disable-tenant[Disabling tenant configurations] section in the "Using OpenID Connect (OIDC) multi-tenancy" guide.
For more information about managing the individual tenant configurations in multitenant OIDC deployments, see the xref:security-openid-connect-multitenancy.adoc#disable-tenant[Disabling tenant configurations] section in the "Using OpenID Connect (OIDC) multi-tenancy" guide.
====

==== OpenID Connect client and filters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Enable xref:security-basic-authentication.adoc[Basic authentication] for your Qu

== Prerequisites

* You have installed at least one extension that provides an `IdentityProvider` based on username and password, such as link:{url-quarkusio-guides}security-jdbc[Elytron JDBC].
* You have installed at least one extension that provides an `IdentityProvider` based on username and password, such as xref:security-jdbc.adoc[Elytron JDBC].

== Procedure

Expand Down
10 changes: 5 additions & 5 deletions docs/src/main/asciidoc/security-oauth2.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -332,20 +332,20 @@ First, Wiremock needs to be added as a test dependency. For a Maven project that
.pom.xml
----
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8</artifactId>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<scope>test</scope>
<version>${wiremock.version}</version> // <1>
</dependency>
----
<1> Use a proper Wiremock version. All available versions can be found link:https://search.maven.org/artifact/com.github.tomakehurst/wiremock-jre8[here].
<1> Use a proper Wiremock version. All available versions can be found link:https://search.maven.org/artifact/org.wiremock/wiremock[here].

[source,gradle,role="secondary asciidoc-tabs-target-sync-gradle"]
.build.gradle
----
testImplementation("com.github.tomakehurst:wiremock-jre8:${wiremock.version}") <1>
testImplementation("org.wiremock:wiremock:${wiremock.version}") <1>
----
<1> Use a proper Wiremock version. All available versions can be found link:https://search.maven.org/artifact/com.github.tomakehurst/wiremock-jre8[here].
<1> Use a proper Wiremock version. All available versions can be found link:https://search.maven.org/artifact/org.wiremock/wiremock[here].

In Quarkus tests when some service needs to be started before the Quarkus tests are ran, we utilize the `@io.quarkus.test.common.QuarkusTestResource`
annotation to specify a `io.quarkus.test.common.QuarkusTestResourceLifecycleManager` which can start the service and supply configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -766,8 +766,8 @@ Add the following dependencies to your test project:
[source,xml]
----
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8</artifactId>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<scope>test</scope>
</dependency>
----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import io.quarkus.arc.impl.ArcContainerImpl;
import io.quarkus.test.QuarkusUnitTest;

public class ApiLookupProblemDetectedTest {
public class ArcContainerLookupProblemDetectedTest {

@RegisterExtension
static final QuarkusUnitTest config = new QuarkusUnitTest()
Expand All @@ -31,10 +31,10 @@ public class ApiLookupProblemDetectedTest {
Formatter fmt = new PatternFormatter("%m");
String message = fmt.format(warning);
assertTrue(message.contains(
"Stack frame: io.quarkus.arc.test.unused.ApiLookupProblemDetectedTest.testWarning"),
"Stack frame: io.quarkus.arc.test.unused.ArcContainerLookupProblemDetectedTest.testWarning"),
message);
assertTrue(message.contains(
"Required type: class io.quarkus.arc.test.unused.ApiLookupProblemDetectedTest$Alpha"),
"Required type: class io.quarkus.arc.test.unused.ArcContainerLookupProblemDetectedTest$Alpha"),
message);
});

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package io.quarkus.arc.test.unused;

import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.logging.Formatter;
import java.util.logging.LogRecord;

import jakarta.enterprise.context.ApplicationScoped;

import org.jboss.logmanager.formatters.PatternFormatter;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.arc.Arc;
import io.quarkus.arc.impl.ArcContainerImpl;
import io.quarkus.test.QuarkusUnitTest;

public class ArcContainerSupplierLookupProblemDetectedTest {

@RegisterExtension
static final QuarkusUnitTest config = new QuarkusUnitTest()
.withApplicationRoot(root -> root
.addClasses(Alpha.class))
.setLogRecordPredicate(log -> ArcContainerImpl.class.getPackage().getName().equals(log.getLoggerName()))
.assertLogRecords(records -> {
LogRecord warning = records.stream()
.filter(l -> l.getMessage().contains("programmatic lookup problem detected")).findAny().orElse(null);
assertNotNull(warning);
Formatter fmt = new PatternFormatter("%m");
String message = fmt.format(warning);
assertTrue(message.contains(
"Stack frame: io.quarkus.arc.test.unused.ArcContainerSupplierLookupProblemDetectedTest.testWarning"),
message);
assertTrue(message.contains(
"Required type: class io.quarkus.arc.test.unused.ArcContainerSupplierLookupProblemDetectedTest$Alpha"),
message);
});

@Test
public void testWarning() {
// Note that the warning is only displayed once, subsequent calls use a cached result
assertNull(Arc.container().beanInstanceSupplier(Alpha.class));
}

// unused bean, will be removed
@ApplicationScoped
static class Alpha {

public String ping() {
return "ok";
}

}

}
Loading

0 comments on commit e5b52f7

Please sign in to comment.