Skip to content

Commit

Permalink
Merge pull request #38180 from aloubyansky/3.2.10-backports-1
Browse files Browse the repository at this point in the history
[3.2] 3.2.10.Final backports batch 1
  • Loading branch information
aloubyansky authored Jan 16, 2024
2 parents 396a6f3 + 2e4648b commit c36ab69
Show file tree
Hide file tree
Showing 44 changed files with 912 additions and 176 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ProjectExtensionsAdd extends BaseBuildCommand implements Callable<I
@CommandLine.Mixin
RunModeOption runMode;

@CommandLine.Parameters(arity = "1", paramLabel = "EXTENSION", description = "extensions to add to this project")
@CommandLine.Parameters(arity = "1", paramLabel = "EXTENSION", description = "extensions to add to this project", split = ",")
Set<String> extensions;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ProjectExtensionsRemove extends BaseBuildCommand implements Callabl
@CommandLine.Mixin
RunModeOption runMode;

@CommandLine.Parameters(arity = "1", paramLabel = "EXTENSION", description = "Extension(s) to remove from this project.")
@CommandLine.Parameters(arity = "1", paramLabel = "EXTENSION", description = "Extension(s) to remove from this project.", split = ",")
Set<String> extensions;

@Override
Expand Down
50 changes: 48 additions & 2 deletions devtools/cli/src/test/java/io/quarkus/cli/CliDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ public static Result invokeExtensionRemoveQute(Path projectRoot, Path file) thro
}

public static Result invokeExtensionAddMultiple(Path projectRoot, Path file) throws Exception {
// add the qute extension
// add amazon-lambda-http and jackson extensions
Result result = execute(projectRoot, "extension", "add", "amazon-lambda-http", "jackson", "-e", "-B", "--verbose");
Assertions.assertEquals(CommandLine.ExitCode.OK, result.exitCode,
"Expected OK return code. Result:\n" + result);
Expand All @@ -345,7 +345,7 @@ public static Result invokeExtensionAddMultiple(Path projectRoot, Path file) thr
}

public static Result invokeExtensionRemoveMultiple(Path projectRoot, Path file) throws Exception {
// add the qute extension
// remove amazon-lambda-http and jackson extensions
Result result = execute(projectRoot, "extension", "remove", "amazon-lambda-http", "jackson", "-e", "-B", "--verbose");
Assertions.assertEquals(CommandLine.ExitCode.OK, result.exitCode,
"Expected OK return code. Result:\n" + result);
Expand All @@ -370,6 +370,52 @@ public static Result invokeExtensionRemoveMultiple(Path projectRoot, Path file)
return result;
}

public static Result invokeExtensionAddMultipleCommas(Path projectRoot, Path file) throws Exception {
Result result = execute(projectRoot, "extension", "add",
"quarkus-resteasy-reactive-jsonb,quarkus-resteasy-reactive-jackson", "-e", "-B", "--verbose");
Assertions.assertEquals(CommandLine.ExitCode.OK, result.exitCode,
"Expected OK return code. Result:\n" + result);

result = invokeValidateExtensionList(projectRoot);
Assertions.assertTrue(result.stdout.contains("quarkus-qute"),
"Expected quarkus-qute to be in the list of extensions. Result:\n" + result);
Assertions.assertTrue(result.stdout.contains("quarkus-resteasy-reactive-jsonb"),
"Expected quarkus-resteasy-reactive-jsonb to be in the list of extensions. Result:\n" + result);
Assertions.assertTrue(result.stdout.contains("quarkus-resteasy-reactive-jackson"),
"Expected quarkus-resteasy-reactive-jackson to be in the list of extensions. Result:\n" + result);

String content = CliDriver.readFileAsString(file);
Assertions.assertTrue(content.contains("quarkus-qute"),
"quarkus-qute should still be listed as a dependency. Result:\n" + content);
Assertions.assertTrue(content.contains("quarkus-resteasy-reactive-jsonb"),
"quarkus-resteasy-reactive-jsonb should be listed as a dependency. Result:\n" + content);
Assertions.assertTrue(content.contains("quarkus-resteasy-reactive-jackson"),
"quarkus-resteasy-reactive-jackson should be listed as a dependency. Result:\n" + content);

return result;
}

public static Result invokeExtensionRemoveMultipleCommas(Path projectRoot, Path file) throws Exception {
Result result = execute(projectRoot, "extension", "remove",
"quarkus-resteasy-reactive-jsonb,quarkus-resteasy-reactive-jackson", "-e", "-B", "--verbose");
Assertions.assertEquals(CommandLine.ExitCode.OK, result.exitCode,
"Expected OK return code. Result:\n" + result);

result = invokeValidateExtensionList(projectRoot);
Assertions.assertFalse(result.stdout.contains("quarkus-resteasy-reactive-jsonb"),
"quarkus-resteasy-reactive-jsonb should not be in the list of extensions. Result:\n" + result);
Assertions.assertFalse(result.stdout.contains("quarkus-resteasy-reactive-jackson"),
"quarkus-resteasy-reactive-jackson should not be in the list of extensions. Result:\n" + result);

String content = CliDriver.readFileAsString(file);
Assertions.assertFalse(content.contains("quarkus-resteasy-reactive-jsonb"),
"quarkus-resteasy-reactive-jsonb should not be listed as a dependency. Result:\n" + content);
Assertions.assertFalse(content.contains("quarkus-resteasy-reactive-jackson"),
"quarkus-resteasy-reactive-jackson should not be listed as a dependency. Result:\n" + content);

return result;
}

public static Result invokeExtensionListInstallable(Path projectRoot) throws Exception {
Result result = CliDriver.execute(projectRoot, "extension", "list", "-e", "-B", "--verbose", "-i");
Assertions.assertEquals(CommandLine.ExitCode.OK, result.exitCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ public void testExtensionList() throws Exception {
CliDriver.invokeExtensionAddRedundantQute(project);
CliDriver.invokeExtensionListInstallable(project);
CliDriver.invokeExtensionAddMultiple(project, pom);
CliDriver.invokeExtensionAddMultipleCommas(project, pom);
CliDriver.invokeExtensionRemoveQute(project, pom);
CliDriver.invokeExtensionRemoveMultiple(project, pom);
CliDriver.invokeExtensionRemoveMultipleCommas(project, pom);

CliDriver.invokeExtensionListInstallableSearch(project);
CliDriver.invokeExtensionListFormatting(project);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import io.quarkus.gradle.QuarkusPlugin;
import io.quarkus.gradle.tasks.worker.BuildWorker;
import io.quarkus.maven.dependency.GACTV;
import io.smallrye.config.Expressions;

/**
* Base class for the {@link QuarkusBuildDependencies}, {@link QuarkusBuildCacheableAppParts}, {@link QuarkusBuild} tasks
Expand Down Expand Up @@ -205,12 +206,14 @@ void generateBuild() {

ApplicationModel appModel = resolveAppModelForBuild();
Map<String, String> configMap = new HashMap<>();
for (Map.Entry<String, String> entry : extension().buildEffectiveConfiguration(appModel.getAppArtifact()).configMap()
.entrySet()) {
if (entry.getKey().startsWith("quarkus.")) {
configMap.put(entry.getKey(), entry.getValue());
EffectiveConfig effectiveConfig = extension().buildEffectiveConfiguration(appModel.getAppArtifact());
Expressions.withoutExpansion(() -> {
for (Map.Entry<String, String> entry : effectiveConfig.configMap().entrySet()) {
if (entry.getKey().startsWith("quarkus.")) {
configMap.put(entry.getKey(), effectiveConfig.config().getRawValue(entry.getKey()));
}
}
}
});

getLogger().info("Starting Quarkus application build for package type {}", packageType);

Expand Down
24 changes: 19 additions & 5 deletions docs/src/main/asciidoc/infinispan-client-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -93,28 +93,42 @@ quarkus.infinispan-client.hosts=localhost:11222 <1>
quarkus.infinispan-client.username=admin <2>
quarkus.infinispan-client.password=password <3>
quarkus.infinispan-client.client-intelligence=BASIC <4>
----
<1> Sets Infinispan Server address list, separated with commas
<2> Sets the authentication username
<3> Sets the authentication password
<4> Sets the client intelligence. Use BASIC as a workaround if using Docker for Mac.

Alternatively, you can use uri connection by providing a single connection property
[source,properties]
----
quarkus.infinispan-client.uri=hotrod://admin:password@localhost:11222 <1>
quarkus.infinispan-client.client-intelligence=BASIC <2>
----
<1> Sets Infinispan URI connection. The following properties will be ignored: hosts, username and password.
<2> Sets the client intelligence. Use BASIC as a workaround if using Docker for Mac

[TIP]
====
Use Infinispan Dev Services to run a server and connect without configuration.
====

=== Client intelligence
Infinispan client uses intelligence mechanisms to efficiently send requests to Infinispan Server clusters.
By default, the *HASH_DISTRIBUTION_AWARE* intelligence mechanism is enabled.
However, locally with Docker for Mac, you might experience connectivity issues.
In this case, configure the client intelligence to *BASIC*.

Learn more in the https://infinispan.org/docs/stable/titles/hotrod_java/hotrod_java.html#hotrod-client-intelligence_hotrod-java-client[Infinispan documentation].

[source,properties]
----
quarkus.infinispan-client.client-intelligence=BASIC <1>
----
<1> Docker for Mac workaround.

[IMPORTANT]
====
Don't use *BASIC* in production environments by default, performance might be impacted.
====

=== Default and named connections
This extension lets you configure a _default_ Infinispan client connections and _named_ ones.
Named connections are essential to connect to multiple Infinispan clusters.
Expand Down
12 changes: 10 additions & 2 deletions docs/src/main/asciidoc/infinispan-client.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -303,14 +303,22 @@ Then, open the `src/main/resources/application.properties` file and add:
%prod.quarkus.infinispan-client.username=admin <2>
%prod.quarkus.infinispan-client.password=password <3>
## Docker 4 Mac workaround
%prod.quarkus.infinispan-client.client-intelligence=BASIC <4>
## Docker 4 Mac workaround. Uncomment only if you are using Docker for Mac.
## Read more about it in the Infinispan Reference Guide
# %prod.quarkus.infinispan-client.client-intelligence=BASIC <4>
----
<1> Sets Infinispan Server address list, separated with commas
<2> Sets the authentication username
<3> Sets the authentication password
<4> Sets the client intelligence. Use BASIC as a workaround if using Docker for Mac.

[IMPORTANT]
====
Client intelligence changes impact your performance in production.
Don't change the client intelligence unless strictly necessary for your case.
Read more in the xref:infinispan-client-reference.adoc[Infinispan Client extension reference guide].
====

== Packaging and running in JVM mode

You can run the application as a conventional jar file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,51 +59,35 @@ The solution is located in the `security-openid-connect-quickstart` link:{quicks
You can either create a new Maven project with the `oidc` extension or you can add the extension to an existing Maven project.
Complete one of the following commands:

* To create a new Maven project, use the following command:
+
====
To create a new Maven project, use the following command:

:create-app-artifact-id: security-openid-connect-quickstart
:create-app-extensions: oidc,resteasy-reactive-jackson
include::{includes}/devtools/create-app.adoc[]
====
This command generates a Maven project, importing the `oidc` extension
which is an implementation of OIDC for Quarkus.

* If you already have your Quarkus project configured, you can add the `oidc` extension
to your project by running the following command in your project base directory:
+
====
If you already have your Quarkus project configured, you can add the `oidc` extension to your project by running the following command in your project base directory:

:add-extension-extensions: oidc
include::{includes}/devtools/extension-add.adoc[]
====
The following configuration gets added to your build file:

* Using Maven (pom.xml):
+
====
--
This will add the following to your build file:

[source,xml,role="primary asciidoc-tabs-target-sync-cli asciidoc-tabs-target-sync-maven"]
.pom.xml
----
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-oidc</artifactId>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-oidc</artifactId>
</dependency>
----
--
====
+
* Using Gradle (build.gradle):
+
====
--

[source,gradle,role="secondary asciidoc-tabs-target-sync-gradle"]
.build.gradle
----
implementation("io.quarkus:quarkus-oidc")
----
--
====

=== Write the application
== Write the application

. Implement the `/api/users/me` endpoint as shown in the following example, which is a regular Jakarta REST resource:
+
Expand Down
7 changes: 6 additions & 1 deletion docs/sync-web-site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,16 @@ fi

if [ -z $TARGET_DIR ]; then
TARGET_DIR=target/web-site
rm -rf ${TARGET_DIR}
GIT_OPTIONS=""
if [[ "$QUARKUS_WEB_SITE_PUSH" != "true" ]]; then
GIT_OPTIONS="--depth=1"
fi
git clone -b develop --single-branch $GIT_OPTIONS git@github.com:quarkusio/quarkusio.github.io.git ${TARGET_DIR}
if [ -n "${RELEASE_GITHUB_TOKEN}" ]; then
git clone -b develop --single-branch $GIT_OPTIONS https://github.com/quarkusio/quarkusio.github.io.git ${TARGET_DIR}
else
git clone -b develop --single-branch $GIT_OPTIONS git@github.com:quarkusio/quarkusio.github.io.git ${TARGET_DIR}
fi
fi

if [ $BRANCH == "main" ] && [ "$QUARKUS_RELEASE" == "true" ]; then
Expand Down
Loading

0 comments on commit c36ab69

Please sign in to comment.