Skip to content

Commit

Permalink
Merge pull request #41477 from gsmet/3.12.1-backports-1
Browse files Browse the repository at this point in the history
[3.12] 3.12.1 backports 1
  • Loading branch information
gsmet authored Jun 27, 2024
2 parents f383612 + 3e32193 commit 3710bba
Show file tree
Hide file tree
Showing 70 changed files with 1,475 additions and 997 deletions.
4 changes: 2 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
distributionSha256Sum=7822eb593d29558d8edf87845a2c47e36e2a89d17a84cd2390824633214ed423
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip
distributionSha256Sum=8351955a9acf2f83c136c4eee0f6db894ab6265fdbe0a94b32a380307dbaa3e1
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
2 changes: 1 addition & 1 deletion .sdkmanrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=17.0.10-tem
mvnd=1.0-m8-m39
mvnd=1.0.0
18 changes: 9 additions & 9 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<javax.inject.version>1</javax.inject.version>
<parsson.version>1.1.6</parsson.version>
<resteasy-microprofile.version>2.1.5.Final</resteasy-microprofile.version>
<resteasy-spring-web.version>3.1.2.Final</resteasy-spring-web.version>
<resteasy-spring-web.version>3.1.3.Final</resteasy-spring-web.version>
<resteasy.version>6.2.9.Final</resteasy.version>
<opentracing.version>0.33.0</opentracing.version>
<opentracing-jdbc.version>0.2.4</opentracing-jdbc.version>
Expand All @@ -51,11 +51,11 @@
<microprofile-lra.version>2.0</microprofile-lra.version>
<microprofile-openapi.version>3.1.1</microprofile-openapi.version>
<smallrye-common.version>2.3.0</smallrye-common.version>
<smallrye-config.version>3.8.2</smallrye-config.version>
<smallrye-config.version>3.8.3</smallrye-config.version>
<smallrye-health.version>4.1.0</smallrye-health.version>
<smallrye-metrics.version>4.0.0</smallrye-metrics.version>
<smallrye-open-api.version>3.10.0</smallrye-open-api.version>
<smallrye-graphql.version>2.8.4</smallrye-graphql.version>
<smallrye-graphql.version>2.8.6</smallrye-graphql.version>
<smallrye-fault-tolerance.version>6.3.0</smallrye-fault-tolerance.version>
<smallrye-jwt.version>4.5.2</smallrye-jwt.version>
<smallrye-context-propagation.version>2.1.2</smallrye-context-propagation.version>
Expand Down Expand Up @@ -131,8 +131,8 @@
<shrinkwrap.version>1.2.6</shrinkwrap.version>
<hamcrest.version>2.2</hamcrest.version><!-- The version needs to be compatible with both REST Assured and Awaitility -->
<junit.jupiter.version>5.10.2</junit.jupiter.version>
<infinispan.version>15.0.4.Final</infinispan.version>
<infinispan.protostream.version>5.0.4.Final</infinispan.protostream.version>
<infinispan.version>15.0.5.Final</infinispan.version>
<infinispan.protostream.version>5.0.5.Final</infinispan.protostream.version>
<caffeine.version>3.1.5</caffeine.version>
<netty.version>4.1.108.Final</netty.version>
<brotli4j.version>1.16.0</brotli4j.version>
Expand All @@ -153,7 +153,7 @@
<kotlin.version>2.0.0</kotlin.version>
<kotlin.coroutine.version>1.8.1</kotlin.coroutine.version>
<azure.toolkit-lib.version>0.27.0</azure.toolkit-lib.version>
<kotlin-serialization.version>1.7.0</kotlin-serialization.version>
<kotlin-serialization.version>1.7.1</kotlin-serialization.version>
<dekorate.version>4.1.2</dekorate.version> <!-- Please check with Java Operator SDK team before updating -->
<maven-invoker.version>3.2.0</maven-invoker.version>
<awaitility.version>4.2.1</awaitility.version>
Expand All @@ -168,7 +168,7 @@
<mongo-client.version>4.11.1</mongo-client.version>
<mongo-crypt.version>1.8.0</mongo-crypt.version>
<proton-j.version>0.34.1</proton-j.version>
<javaparser.version>3.26.0</javaparser.version>
<javaparser.version>3.26.1</javaparser.version>
<hibernate-quarkus-local-cache.version>0.3.0</hibernate-quarkus-local-cache.version>
<flapdoodle.mongo.version>4.14.0</flapdoodle.mongo.version>
<quarkus-spring-api.version>6.1.SP2</quarkus-spring-api.version>
Expand Down Expand Up @@ -201,8 +201,8 @@
<!-- Check the compatibility matrix (https://github.com/opensearch-project/opensearch-testcontainers) before upgrading: -->
<opensearch-testcontainers.version>2.0.0</opensearch-testcontainers.version>
<com.dajudge.kindcontainer>1.4.5</com.dajudge.kindcontainer>
<aesh.version>2.7</aesh.version>
<aesh-readline.version>2.4</aesh-readline.version>
<aesh.version>2.8.2</aesh.version>
<aesh-readline.version>2.6</aesh-readline.version>
<jansi.version>2.4.0</jansi.version> <!-- Keep in sync with aesh-readline and dekorate -->
<jgit.version>6.9.0.202403050737-r</jgit.version>
<!-- these two artifacts needs to be compatible together -->
Expand Down
12 changes: 2 additions & 10 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<asciidoctorj.version>2.5.13</asciidoctorj.version>
<htmlunit.version>4.2.0</htmlunit.version>
<javaparser-core.version>3.26.0</javaparser-core.version>
<javaparser-core.version>3.26.1</javaparser-core.version>
<jdeparser.version>2.0.3.Final</jdeparser.version>
<subethasmtp.version>6.0.1</subethasmtp.version>

Expand All @@ -57,7 +57,7 @@
<supported-maven-versions>[${maven.min.version},)</supported-maven-versions>

<!-- These 2 properties are used by CreateProjectMojo to add the Maven Wrapper -->
<proposed-maven-version>3.9.7</proposed-maven-version>
<proposed-maven-version>3.9.8</proposed-maven-version>
<maven-wrapper.version>3.2.0</maven-wrapper.version>
<gradle-wrapper.version>8.8</gradle-wrapper.version>
<quarkus-gradle-plugin.version>${project.version}</quarkus-gradle-plugin.version>
Expand All @@ -66,14 +66,6 @@

<!-- MicroProfile TCK versions used to be defined here but have moved to the concrete tck modules -->

<!-- Panache needs to run the hibernate-jpamodelgen annotation processor,
and unfortunately annotation processors are not covered by dependency management
in kotlin-maven-plugin; see https://github.com/quarkusio/quarkus/issues/37477#issuecomment-1923662964
-->
<hibernate-orm.version>6.5.2.Final</hibernate-orm.version>
<!-- Antlr 4 is used by the PanacheQL parser but also needs to match the requirements of Hibernate ORM 6.x-->
<antlr.version>4.13.0</antlr.version>

<!-- SELinux access label, used when mounting local volumes into containers in tests -->
<volume.access.modifier>:Z</volume.access.modifier>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1204,11 +1204,32 @@ private RuntimeUpdatesProcessor setWatchedFilePathsInternal(Map<String, Boolean>
// Then process glob patterns
for (Entry<String, Boolean> e : watchedFilePaths.entrySet()) {
String watchedFilePath = e.getKey();
Path path = Paths.get(watchedFilePath);
if (!path.isAbsolute() && !watchedRootPaths.contains(e.getKey()) && maybeGlobPattern(watchedFilePath)) {
Path resolvedPath = root.resolve(watchedFilePath);
for (WatchedPath extra : expandGlobPattern(root, resolvedPath, watchedFilePath, e.getValue())) {
timestamps.watchedPaths.put(extra.filePath, extra);
Path path = Paths.get(sanitizedPattern(watchedFilePath));
if (!path.isAbsolute() && !watchedRootPaths.contains(e.getKey())
&& maybeGlobPattern(watchedFilePath)) {
try {
final PathMatcher matcher = FileSystems.getDefault().getPathMatcher("glob:" + watchedFilePath);
Files.walkFileTree(root, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
Path relativePath = root.relativize(file);
if (matcher.matches(relativePath)) {
log.debugf("Glob pattern [%s] matched %s from %s", watchedFilePath, relativePath,
root);
WatchedPath extra = new WatchedPath(file, relativePath, e.getValue(),
attrs.lastModifiedTime().toMillis());
timestamps.watchedPaths.put(extra.filePath, extra);
}
return FileVisitResult.CONTINUE;
}

@Override
public FileVisitResult visitFileFailed(Path file, IOException exc) {
return FileVisitResult.CONTINUE;
}
});
} catch (IOException ex) {
throw new UncheckedIOException(ex);
}
}
}
Expand All @@ -1219,8 +1240,9 @@ private RuntimeUpdatesProcessor setWatchedFilePathsInternal(Map<String, Boolean>
// Finally process watched absolute paths
for (Entry<String, Boolean> e : watchedFilePaths.entrySet()) {
String watchedFilePath = e.getKey();
Path path = Paths.get(watchedFilePath);
Path path = Paths.get(sanitizedPattern(watchedFilePath));
if (path.isAbsolute()) {
path = Paths.get(watchedFilePath);
log.debugf("Watch %s", path);
if (Files.exists(path)) {
putLastModifiedTime(path, path, e.getValue(), timestamps);
Expand All @@ -1235,6 +1257,10 @@ private RuntimeUpdatesProcessor setWatchedFilePathsInternal(Map<String, Boolean>
return this;
}

private String sanitizedPattern(String pattern) {
return pattern.replaceAll("[*?]", "");
}

private boolean maybeGlobPattern(String path) {
return path.contains("*") || path.contains("?");
}
Expand Down Expand Up @@ -1282,32 +1308,6 @@ public void close() throws IOException {
}
}

private List<WatchedPath> expandGlobPattern(Path root, Path path, String pattern, boolean restart) {
PathMatcher pathMatcher = FileSystems.getDefault().getPathMatcher("glob:" + path.toString());
List<WatchedPath> files = new ArrayList<>();
try {
Files.walkFileTree(root, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
if (pathMatcher.matches(file)) {
Path relativePath = root.relativize(file);
log.debugf("Glob pattern [%s] matched %s from %s", pattern, relativePath, root);
files.add(new WatchedPath(file, relativePath, restart, attrs.lastModifiedTime().toMillis()));
}
return FileVisitResult.CONTINUE;
}

@Override
public FileVisitResult visitFileFailed(Path file, IOException exc) {
return FileVisitResult.CONTINUE;
}
});
} catch (IOException e) {
throw new UncheckedIOException(e);
}
return files;
}

public boolean toggleInstrumentation() {
instrumentationEnabled = !instrumentationEnabled();
if (instrumentationEnabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import picocli.CommandLine.TypeConversionException;

public class TargetGAVGroup {
static final String BAD_IDENTIFIER = "The specified %s identifier (%s) contains invalid characters. Valid characters are alphanumeric (A-Za-z), underscore, dash and dot.";
static final String BAD_IDENTIFIER = "The specified %s identifier (%s) contains invalid characters. Valid characters are alphanumeric characters (A-Za-z0-9), underscores, dashes and dots.";
static final Pattern OK_ID = Pattern.compile("[0-9A-Za-z_.-]+");

static final String DEFAULT_GAV = CreateProjectHelper.DEFAULT_GROUP_ID + ":"
Expand Down
4 changes: 3 additions & 1 deletion devtools/cli/src/main/java/io/quarkus/cli/image/Build.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
import picocli.CommandLine;

@CommandLine.Command(name = "build", sortOptions = false, showDefaultValues = true, mixinStandardHelpOptions = false, header = "Build a container image.", description = "%n"
+ "This command will build a container image for the project.", subcommands = { Docker.class, Buildpack.class,
+ "This command will build a container image for the project.", subcommands = { Docker.class,
Podman.class,
Buildpack.class,
Jib.class,
Openshift.class }, footer = { "%n"
+ "For example (using default values), it will create a container image using docker with REPOSITORY='${user.name}/<project.artifactId>' and TAG='<project.version>'."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

public enum Builder {
docker,
podman,
jib,
buildpack,
openshift
Expand Down
37 changes: 37 additions & 0 deletions devtools/cli/src/main/java/io/quarkus/cli/image/Podman.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package io.quarkus.cli.image;

import java.util.Optional;

import io.quarkus.cli.BuildToolContext;
import picocli.CommandLine;

@CommandLine.Command(name = "podman", sortOptions = false, showDefaultValues = true, mixinStandardHelpOptions = false, header = "Build a container image using Podman.", description = "%n"
+ "This command will build or push a container image for the project, using Podman.", footer = "%n"
+ "For example (using default values), it will create a container image using with REPOSITORY='${user.name}/<project.artifactId>' and TAG='<project.version>'.", headerHeading = "%n", commandListHeading = "%nCommands:%n", synopsisHeading = "%nUsage: ", parameterListHeading = "%n", optionListHeading = "Options:%n")
public class Podman extends BaseImageSubCommand {

private static final String PODMAN = "podman";
private static final String PODMAN_CONFIG_PREFIX = "quarkus.podman.";
private static final String DOCKERFILE_JVM_PATH = "dockerfile-jvm-path";
private static final String DOCKERFILE_NATIVE_PATH = "dockerfile-native-path";

@CommandLine.Option(order = 7, names = { "--dockerfile" }, description = "The path to the Dockerfile.")
public Optional<String> dockerFile;

@Override
public void populateContext(BuildToolContext context) {
var properties = context.getPropertiesOptions().properties;
properties.put(QUARKUS_CONTAINER_IMAGE_BUILDER, PODMAN);

dockerFile.ifPresent(d -> properties.put(
PODMAN_CONFIG_PREFIX + (context.getBuildOptions().buildNative ? DOCKERFILE_NATIVE_PATH : DOCKERFILE_JVM_PATH),
d));

context.getForcedExtensions().add(QUARKUS_CONTAINER_IMAGE_EXTENSION_KEY_PREFIX + PODMAN);
}

@Override
public String toString() {
return "Podman {imageOptions='" + imageOptions + "', dockerFile:'" + dockerFile.orElse("<none>") + "'}";
}
}
57 changes: 11 additions & 46 deletions devtools/cli/src/test/java/io/quarkus/cli/CliHelpTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

import io.quarkus.devtools.messagewriter.MessageIcons;
import io.quarkus.devtools.messagewriter.MessageWriter;
Expand Down Expand Up @@ -218,32 +220,18 @@ public void testImageBuildHelp() throws Exception {
assertThat(result.stdout).contains("Usage");
assertTrue(result.getStdout().contains("Commands:"), "Should list subcommands\n");
assertTrue(result.getStdout().contains("docker"), "Should list docker subcommand\n");
assertTrue(result.getStdout().contains("podman"), "Should list podman subcommand\n");
assertTrue(result.getStdout().contains("jib"), "Should list jib subcommand\n");
assertTrue(result.getStdout().contains("openshift"), "Should list openshift subcommand\n");
assertTrue(result.getStdout().contains("buildpack"), "Should list buildpack subcommand\n");

}

@Test
@ParameterizedTest
@Order(93)
public void testImageBuildDockerHelp() throws Exception {
CliDriver.Result result = CliDriver.execute(workspaceRoot, "image", "build", "docker", "--help");
result.echoSystemOut();
assertThat(result.stdout).contains("Usage");
}

@Test
@Order(94)
public void testImageBuildJibHelp() throws Exception {
CliDriver.Result result = CliDriver.execute(workspaceRoot, "image", "build", "jib", "--help");
result.echoSystemOut();
assertThat(result.stdout).contains("Usage");
}

@Test
@Order(95)
public void testImageBuildOpenshiftHelp() throws Exception {
CliDriver.Result result = CliDriver.execute(workspaceRoot, "image", "build", "openshift", "--help");
@ValueSource(strings = { "docker", "podman", "jib", "openshift", "buildpack" })
public void testImageBuildBuilderHelp(String builder) throws Exception {
CliDriver.Result result = CliDriver.execute(workspaceRoot, "image", "build", builder, "--help");
result.echoSystemOut();
assertThat(result.stdout).contains("Usage");
}
Expand All @@ -260,34 +248,11 @@ public void testImagePushHelp() throws Exception {
assertThat(result.stdout).contains("--registry-password-stdin");
}

@Test
@ParameterizedTest
@Order(97)
public void testImagePushDockerHelp() throws Exception {
CliDriver.Result result = CliDriver.execute(workspaceRoot, "image", "push", "docker", "--help");
result.echoSystemOut();
assertThat(result.stdout).contains("Usage");
}

@Test
@Order(98)
public void testImagePushJibHelp() throws Exception {
CliDriver.Result result = CliDriver.execute(workspaceRoot, "image", "push", "jib", "--help");
result.echoSystemOut();
assertThat(result.stdout).contains("Usage");
}

@Test
@Order(99)
public void testImagePushOpenshiftHelp() throws Exception {
CliDriver.Result result = CliDriver.execute(workspaceRoot, "image", "push", "openshift", "--help");
result.echoSystemOut();
assertThat(result.stdout).contains("Usage");
}

@Test
@Order(100)
public void testImagePushBuildpackHelp() throws Exception {
CliDriver.Result result = CliDriver.execute(workspaceRoot, "image", "push", "buildpack", "--help");
@ValueSource(strings = { "docker", "podman", "jib", "openshift", "buildpack" })
public void testImagePushBuilderHelp(String builder) throws Exception {
CliDriver.Result result = CliDriver.execute(workspaceRoot, "image", "push", builder, "--help");
result.echoSystemOut();
assertThat(result.stdout).contains("Usage");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ public void testUsage() throws Exception {
assertTrue(result.getStdout().contains("--builder=docker"));
assertTrue(result.getStdout().contains("--init-script="));

result = CliDriver.execute(project, "image", "build", "podman", "--dry-run");
assertEquals(CommandLine.ExitCode.OK, result.getExitCode(), "Expected OK return code." + result);
assertTrue(result.getStdout().contains("--builder=podman"));
assertTrue(result.getStdout().contains("--init-script="));

result = CliDriver.execute(project, "image", "build", "jib", "--dry-run");
assertEquals(CommandLine.ExitCode.OK, result.getExitCode(), "Expected OK return code." + result);
assertTrue(result.getStdout().contains("--builder=jib"));
Expand Down
Loading

0 comments on commit 3710bba

Please sign in to comment.