Skip to content

Commit

Permalink
Merge pull request #36533 from gsmet/3.5.0-backports-1
Browse files Browse the repository at this point in the history
3.5.0 backports 1
  • Loading branch information
gsmet authored Oct 18, 2023
2 parents 7a88aa6 + 91cddc6 commit dc7b4a3
Show file tree
Hide file tree
Showing 331 changed files with 3,740 additions and 3,413 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci-actions-incremental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -771,11 +771,11 @@ jobs:
path: .
- name: Extract .m2/repository/io/quarkus
run: tar -xzf m2-io-quarkus.tgz -C ~
- name: Set up JDK 20
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 20
java-version: 21
# We do this so we can get better analytics for the downloaded version of the build images
- name: Update Docker Client User Agent
run: |
Expand All @@ -785,7 +785,7 @@ jobs:
TEST_MODULES: ${{matrix.test-modules}}
CONTAINER_BUILD: ${{startsWith(matrix.os-name, 'windows') && 'false' || 'true'}}
run: |
export LANG=en_US && ./mvnw $COMMON_MAVEN_ARGS -f integration-tests/virtual-threads -pl "$TEST_MODULES" $NATIVE_TEST_MAVEN_ARGS -Dextra-args=--enable-preview -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-20
export LANG=en_US && ./mvnw $COMMON_MAVEN_ARGS -f integration-tests/virtual-threads -pl "$TEST_MODULES" $NATIVE_TEST_MAVEN_ARGS -Dextra-args=--enable-preview -Dquarkus.native.container-build=true
- name: Upload build reports (if build failed)
uses: actions/upload-artifact@v3
if: ${{ failure() || cancelled() }}
Expand Down Expand Up @@ -908,8 +908,8 @@ jobs:
if: startsWith(matrix.os-name, 'windows')
with:
version: 'mandrel-latest'
java-version: '17'
components: 'native-image'
java-version: '21'
distribution: 'mandrel'
github-token: ${{ secrets.GITHUB_TOKEN }}
# We do this so we can get better analytics for the downloaded version of the build images
- name: Update Docker Client User Agent
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
run: sleep 30
build-doc:
name: "Documentation Build"
timeout-minutes: 60
runs-on: ubuntu-latest
# Skip main in forks
if: "github.repository == 'quarkusio/quarkus' || !endsWith(github.ref, '/main')"
Expand Down
1 change: 1 addition & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip
distributionSha256Sum=80b3b63df0e40ca8cde902bb1a40e4488ede24b3f282bd7bd6fba8eb5a7e055c
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
10 changes: 5 additions & 5 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<classmate.version>1.5.1</classmate.version>
<!-- 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.11.Final</hibernate-orm.version>
<hibernate-orm.version>6.2.13.Final</hibernate-orm.version>
<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.6.Final</hibernate-reactive.version>
Expand Down Expand Up @@ -132,17 +132,17 @@
<mysql-jdbc.version>8.0.30</mysql-jdbc.version>
<mssql-jdbc.version>12.4.0.jre11</mssql-jdbc.version>
<adal4j.version>1.6.7</adal4j.version>
<oracle-jdbc.version>23.2.0.0</oracle-jdbc.version>
<oracle-jdbc.version>23.3.0.23.09</oracle-jdbc.version>
<derby-jdbc.version>10.14.2.0</derby-jdbc.version>
<db2-jdbc.version>11.5.8.0</db2-jdbc.version>
<shrinkwrap.version>1.2.6</shrinkwrap.version>
<rest-assured.version>5.3.0</rest-assured.version>
<junit.jupiter.version>5.10.0</junit.jupiter.version>
<junit-pioneer.version>1.5.0</junit-pioneer.version>
<infinispan.version>14.0.17.Final</infinispan.version>
<infinispan.version>14.0.19.Final</infinispan.version>
<infinispan.protostream.version>4.6.5.Final</infinispan.protostream.version>
<caffeine.version>3.1.5</caffeine.version>
<netty.version>4.1.97.Final</netty.version>
<netty.version>4.1.100.Final</netty.version>
<brotli4j.version>1.12.0</brotli4j.version>
<reactive-streams.version>1.0.4</reactive-streams.version>
<jboss-logging.version>3.5.3.Final</jboss-logging.version>
Expand Down Expand Up @@ -180,7 +180,7 @@
<okhttp.version>3.14.9</okhttp.version><!-- keep in sync with okio -->
<okio.version>1.17.2</okio.version><!-- keep in sync with okhttp -->
<hibernate-quarkus-local-cache.version>0.2.1</hibernate-quarkus-local-cache.version>
<flapdoodle.mongo.version>4.7.0</flapdoodle.mongo.version>
<flapdoodle.mongo.version>4.9.2</flapdoodle.mongo.version>
<quarkus-spring-api.version>5.2.SP7</quarkus-spring-api.version>
<quarkus-spring-data-api.version>2.1.SP2</quarkus-spring-data-api.version>
<quarkus-spring-security-api.version>5.4.Final</quarkus-spring-security-api.version>
Expand Down
4 changes: 2 additions & 2 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<supported-maven-versions>[3.8.2,)</supported-maven-versions>

<!-- These 2 properties are used by CreateProjectMojo to add the Maven Wrapper -->
<proposed-maven-version>3.9.3</proposed-maven-version>
<proposed-maven-version>3.9.5</proposed-maven-version>
<maven-wrapper.version>3.2.0</maven-wrapper.version>
<gradle-wrapper.version>8.3</gradle-wrapper.version>
<quarkus-gradle-plugin.version>${project.version}</quarkus-gradle-plugin.version>
Expand Down Expand Up @@ -110,7 +110,7 @@

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

<wiremock.version>3.1.0</wiremock.version>
<wiremock.version>3.2.0</wiremock.version>
<wiremock-maven-plugin.version>7.3.0</wiremock-maven-plugin.version>

<!-- Artemis test dependencies -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1018,28 +1018,40 @@ private Converter<?> getConverter(SmallRyeConfig config, Field field, ConverterT
*/
private Set<String> getAllProperties(final Set<String> registeredRoots) {
Set<String> properties = new HashSet<>();

// Get all properties, including the ones generated by interceptors, but these do not include profiles
for (String property : config.getPropertyNames()) {
properties.add(property);
}

Set<String> propertiesToRemove = new HashSet<>();
Set<String> propertiesToAdd = new HashSet<>();

// Get properties per source to collect profiled properties and exclude properties that are build related
for (ConfigSource configSource : config.getConfigSources()) {
if (configSource instanceof SysPropConfigSource || configSource instanceof EnvConfigSource
|| "PropertiesConfigSource[source=Build system]".equals(configSource.getName())) {
for (String property : configSource.getPropertyNames()) {
NameIterator ni = new NameIterator(property);
if (ni.hasNext() && PropertiesUtil.isPropertyInRoot(registeredRoots, ni)) {
properties.add(property);
propertiesToAdd.add(property);
} else {
properties.remove(property);
propertiesToRemove.add(property);
if (configSource instanceof EnvConfigSource) {
properties.remove(StringUtil.toLowerCaseAndDotted(property));
propertiesToRemove.add(StringUtil.toLowerCaseAndDotted(property));
}
}
}
} else {
properties.addAll(configSource.getPropertyNames());
propertiesToAdd.addAll(configSource.getPropertyNames());
}
}

// A property may exist in an excluded source and an include source. We don't have a way to know, so we
// just remove the excluded ones and add the ones to be included, so the property is back there again
properties.removeAll(propertiesToRemove);
properties.addAll(propertiesToAdd);

return properties;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.eclipse.microprofile.config.Config;
import org.eclipse.microprofile.config.spi.ConfigBuilder;
import org.eclipse.microprofile.config.spi.ConfigProviderResolver;
import org.eclipse.microprofile.config.spi.ConfigSource;
import org.eclipse.microprofile.config.spi.Converter;
import org.objectweb.asm.Opcodes;
import org.wildfly.common.Assert;
Expand Down Expand Up @@ -66,7 +65,6 @@
import io.quarkus.runtime.configuration.NameIterator;
import io.quarkus.runtime.configuration.PropertiesUtil;
import io.quarkus.runtime.configuration.QuarkusConfigFactory;
import io.quarkus.runtime.configuration.RuntimeOverrideConfigSource;
import io.smallrye.config.ConfigMappings;
import io.smallrye.config.ConfigMappings.ConfigClassWithPrefix;
import io.smallrye.config.Converters;
Expand Down Expand Up @@ -191,8 +189,6 @@ public final class RunTimeConfigurationGenerator {

static final MethodDescriptor SRCB_WITH_CONVERTER = MethodDescriptor.ofMethod(SmallRyeConfigBuilder.class,
"withConverter", ConfigBuilder.class, Class.class, int.class, Converter.class);
static final MethodDescriptor SRCB_WITH_SOURCES = MethodDescriptor.ofMethod(SmallRyeConfigBuilder.class,
"withSources", ConfigBuilder.class, ConfigSource[].class);
static final MethodDescriptor SRCB_WITH_CUSTOMIZER = MethodDescriptor.ofMethod(AbstractConfigBuilder.class,
"withCustomizer", void.class, SmallRyeConfigBuilder.class, String.class);
static final MethodDescriptor SRCB_BUILD = MethodDescriptor.ofMethod(SmallRyeConfigBuilder.class, "build",
Expand Down Expand Up @@ -391,14 +387,6 @@ public void run() {
// runtime config builder
readConfig.invokeStaticMethod(SRCB_WITH_CUSTOMIZER, runTimeBuilder, readConfig.load(CONFIG_RUNTIME_NAME));

// add in our custom sources
if (launchMode.isDevOrTest()) {
MethodDescriptor registerRuntimeOverrideConfigSource = MethodDescriptor.ofMethod(
RuntimeOverrideConfigSource.class, "registerRuntimeOverrideConfigSource", void.class,
SmallRyeConfigBuilder.class);
readConfig.invokeStaticMethod(registerRuntimeOverrideConfigSource, runTimeBuilder);
}

final ResultHandle runTimeConfig = readConfig.invokeVirtualMethod(SRCB_BUILD, runTimeBuilder);
installConfiguration(runTimeConfig, readConfig);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,26 +369,50 @@ protected void prepare() throws Exception {
port = Integer.parseInt(debug);
}
}
int originalPort = port;
if (port <= 0) {
port = getRandomPort();
}

if (debug != null && debug.equalsIgnoreCase("client")) {
args.add("-agentlib:jdwp=transport=dt_socket,address=" + debugHost + ":" + port + ",server=n,suspend=" + suspend);
} else if (debug == null || !debug.equalsIgnoreCase("false")) {
// make sure the debug port is not used, we don't want to just fail if something else is using it
// we don't check this on restarts, as the previous process is still running
// if the debug port is used, we want to make an effort to pick another one
// if we can't find an open port, we don't fail the process launch, we just don't enable debugging
// Furthermore, we don't check this on restarts, as the previous process is still running
boolean warnAboutChange = false;
if (debugPortOk == null) {
try (Socket socket = new Socket(getInetAddress(debugHost), port)) {
error("Port " + port + " in use, not starting in debug mode");
debugPortOk = false;
} catch (IOException e) {
debugPortOk = true;
int tries = 0;
while (true) {
boolean isPortUsed;
try (Socket socket = new Socket(getInetAddress(debugHost), port)) {
// we can make a connection, that means the port is in use
isPortUsed = true;
warnAboutChange = warnAboutChange || (originalPort != 0); // we only want to warn if the user had not configured a random port
} catch (IOException e) {
// no connection made, so the port is not in use
isPortUsed = false;
}
if (!isPortUsed) {
debugPortOk = true;
break;
}
if (++tries >= 5) {
debugPortOk = false;
break;
} else {
port = getRandomPort();
}
}
}
if (debugPortOk) {
if (warnAboutChange) {
warn("Changed debug port to " + port + " because of a port conflict");
}
args.add("-agentlib:jdwp=transport=dt_socket,address=" + debugHost + ":" + port + ",server=y,suspend="
+ suspend);
} else {
error("Port " + port + " in use, not starting in debug mode");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
@ConfigMapping(prefix = "quarkus.native")
public interface NativeConfig {

String DEFAULT_GRAALVM_BUILDER_IMAGE = "quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:jdk-17";
String DEFAULT_MANDREL_BUILDER_IMAGE = "quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-17";
String DEFAULT_GRAALVM_BUILDER_IMAGE = "quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:jdk-21";
String DEFAULT_MANDREL_BUILDER_IMAGE = "quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-21";

/**
* Comma-separated, additional arguments to pass to the build process.
Expand Down Expand Up @@ -225,7 +225,7 @@ default boolean isExplicitContainerBuild() {
interface BuilderImageConfig {
/**
* The docker image to use to do the image build. It can be one of `graalvm`, `mandrel`, or the full image path, e.g.
* {@code quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-17}.
* {@code quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-21}.
*/
@WithParentName
@WithDefault("${platform.quarkus.native.builder-image}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public static final class Version implements Comparable<Version> {
public static final Version VERSION_23_1_0 = new Version("GraalVM 23.1.0", "23.1.0", Distribution.GRAALVM);

public static final Version MINIMUM = VERSION_22_2_0;
public static final Version CURRENT = VERSION_23_0_0;
public static final Version CURRENT = VERSION_23_1_0;
public static final int UNDEFINED = -1;

final String fullVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
import io.quarkus.runtime.configuration.QuarkusConfigValue;
import io.quarkus.runtime.configuration.RuntimeConfigBuilder;
import io.quarkus.runtime.configuration.RuntimeOverrideConfigSource;
import io.quarkus.runtime.configuration.RuntimeOverrideConfigSourceBuilder;
import io.quarkus.runtime.configuration.StaticInitConfigBuilder;
import io.smallrye.config.ConfigMappings.ConfigClassWithPrefix;
import io.smallrye.config.ConfigSourceFactory;
Expand Down Expand Up @@ -157,6 +158,15 @@ void buildTimeRunTimeConfig(
runTimeConfigBuilder.produce(new RunTimeConfigBuilderBuildItem(builderClassName));
}

@BuildStep(onlyIfNot = { IsNormal.class }) // for dev or test
void runtimeOverrideConfig(
BuildProducer<StaticInitConfigBuilderBuildItem> staticInitConfigBuilder,
BuildProducer<RunTimeConfigBuilderBuildItem> runTimeConfigBuilder) {
staticInitConfigBuilder
.produce(new StaticInitConfigBuilderBuildItem(RuntimeOverrideConfigSourceBuilder.class.getName()));
runTimeConfigBuilder.produce(new RunTimeConfigBuilderBuildItem(RuntimeOverrideConfigSourceBuilder.class.getName()));
}

@BuildStep
void generateMappings(
ConfigurationBuildItem configItem,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ class NativeConfigTest {
@Test
public void testBuilderImageProperlyDetected() {
assertThat(createConfig("graalvm").builderImage().getEffectiveImage()).contains("ubi-quarkus-graalvmce-builder-image")
.contains("jdk-17");
.contains("jdk-21");
assertThat(createConfig("GraalVM").builderImage().getEffectiveImage()).contains("ubi-quarkus-graalvmce-builder-image")
.contains("jdk-17");
.contains("jdk-21");
assertThat(createConfig("GraalVM").builderImage().getEffectiveImage()).contains("ubi-quarkus-graalvmce-builder-image")
.contains("jdk-17");
.contains("jdk-21");
assertThat(createConfig("GRAALVM").builderImage().getEffectiveImage()).contains("ubi-quarkus-graalvmce-builder-image")
.contains("jdk-17");
.contains("jdk-21");

assertThat(createConfig("mandrel").builderImage().getEffectiveImage()).contains("ubi-quarkus-mandrel-builder-image")
.contains("jdk-17");
.contains("jdk-21");
assertThat(createConfig("Mandrel").builderImage().getEffectiveImage()).contains("ubi-quarkus-mandrel-builder-image")
.contains("jdk-17");
.contains("jdk-21");
assertThat(createConfig("MANDREL").builderImage().getEffectiveImage()).contains("ubi-quarkus-mandrel-builder-image")
.contains("jdk-17");
.contains("jdk-21");

assertThat(createConfig("aRandomString").builderImage().getEffectiveImage()).isEqualTo("aRandomString");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

import org.eclipse.microprofile.config.spi.ConfigSource;

import io.smallrye.config.SmallRyeConfigBuilder;

/**
* Config source that is used to handle {@code io.quarkus.bootstrap.app.StartupAction#overrideConfig(java.util.Map)}
*
Expand Down Expand Up @@ -63,8 +61,4 @@ public String getValue(String s) {
public String getName() {
return "Config Override Config Source";
}

public static void registerRuntimeOverrideConfigSource(SmallRyeConfigBuilder builder) {
builder.withSources(new RuntimeOverrideConfigSource(builder.getClassLoader()));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package io.quarkus.runtime.configuration;

import io.smallrye.config.SmallRyeConfigBuilder;

public class RuntimeOverrideConfigSourceBuilder implements ConfigBuilder {
@Override
public SmallRyeConfigBuilder configBuilder(final SmallRyeConfigBuilder builder) {
return builder.withSources(new RuntimeOverrideConfigSource(builder.getClassLoader()));
}
}
8 changes: 4 additions & 4 deletions docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
<properties>
<!-- The Graal version we suggest using in documentation - as that's
what we work with by self downloading it: -->
<graal-community.version-for-documentation>for JDK 17</graal-community.version-for-documentation>
<graal-community.tag-for-documentation>jdk17</graal-community.tag-for-documentation>
<graal-community.image-tag-for-documentation>jdk-17</graal-community.image-tag-for-documentation>
<mandrel.image-tag-for-documentation>jdk-17</mandrel.image-tag-for-documentation>
<graal-community.version-for-documentation>for JDK 21</graal-community.version-for-documentation>
<graal-community.tag-for-documentation>jdk21</graal-community.tag-for-documentation>
<graal-community.image-tag-for-documentation>jdk-21</graal-community.image-tag-for-documentation>
<mandrel.image-tag-for-documentation>jdk-21</mandrel.image-tag-for-documentation>

<assembly-maven-plugin.version>3.5.0</assembly-maven-plugin.version>
<asciidoctor-maven-plugin.version>2.0.0</asciidoctor-maven-plugin.version>
Expand Down
Loading

0 comments on commit dc7b4a3

Please sign in to comment.