Skip to content

Commit

Permalink
Merge pull request #35723 from gsmet/3.3.2-backports-1
Browse files Browse the repository at this point in the history
3.3.2 backports 1
  • Loading branch information
gsmet authored Sep 5, 2023
2 parents 1731925 + 59c4f1d commit e06263c
Show file tree
Hide file tree
Showing 70 changed files with 743 additions and 165 deletions.
14 changes: 10 additions & 4 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
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 @@ -158,10 +158,10 @@
<aws-xray.version>2.14.0</aws-xray.version>
<azure-functions-java-library.version>2.2.0</azure-functions-java-library.version>
<azure-functions-java-spi.version>1.0.0</azure-functions-java-spi.version>
<kotlin.version>1.9.0</kotlin.version>
<kotlin.coroutine.version>1.7.2</kotlin.coroutine.version>
<kotlin.version>1.9.10</kotlin.version>
<kotlin.coroutine.version>1.7.3</kotlin.coroutine.version>
<azure.toolkit-lib.version>0.27.0</azure.toolkit-lib.version>
<kotlin-serialization.version>1.5.1</kotlin-serialization.version>
<kotlin-serialization.version>1.6.0</kotlin-serialization.version>
<dekorate.version>3.7.0</dekorate.version> <!-- Please check with Java Operator SDK team before updating -->
<maven-invoker.version>3.2.0</maven-invoker.version>
<awaitility.version>4.2.0</awaitility.version>
Expand Down Expand Up @@ -3621,6 +3621,12 @@
<version>${vaadin.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mvnpm.at.vaadin</groupId>
<artifactId>a11y-base</artifactId>
<version>${vaadin.version}</version>
<scope>runtime</scope>
</dependency>
<!-- There is a cyclic dependency on icon -->
<!-- TODO: Detect and fix in mvnpm -->
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<!-- These properties are needed in order for them to be resolvable by the generated projects -->
<compiler-plugin.version>3.11.0</compiler-plugin.version>
<kotlin.version>1.9.0</kotlin.version>
<kotlin.version>1.9.10</kotlin.version>
<dokka.version>1.8.20</dokka.version>
<scala.version>2.13.8</scala.version>
<scala-maven-plugin.version>4.8.1</scala-maven-plugin.version>
Expand Down Expand Up @@ -64,7 +64,7 @@
<!-- These 2 properties are used by CreateProjectMojo to add the Maven Wrapper -->
<proposed-maven-version>3.9.3</proposed-maven-version>
<maven-wrapper.version>3.2.0</maven-wrapper.version>
<gradle-wrapper.version>8.1.1</gradle-wrapper.version>
<gradle-wrapper.version>8.3</gradle-wrapper.version>
<quarkus-gradle-plugin.version>${project.version}</quarkus-gradle-plugin.version>
<quarkus-maven-plugin.version>${project.version}</quarkus-maven-plugin.version>
<maven-plugin-plugin.version>3.8.1</maven-plugin-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ final public class Constants {
public static final String ANNOTATION_CONFIG_WITH_UNNAMED_KEY = "io.smallrye.config.WithUnnamedKey";

public static final Set<String> SUPPORTED_ANNOTATIONS_TYPES = Set.of(ANNOTATION_BUILD_STEP, ANNOTATION_CONFIG_GROUP,
ANNOTATION_CONFIG_ROOT, ANNOTATION_RECORDER);
ANNOTATION_CONFIG_ROOT, ANNOTATION_RECORDER, ANNOTATION_CONFIG_MAPPING);

public static final Map<String, String> ALIASED_TYPES = Map.of(
OptionalLong.class.getName(), Long.class.getName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ public void doProcess(Set<? extends TypeElement> annotations, RoundEnvironment r
trackAnnotationUsed(Constants.ANNOTATION_RECORDER);
processRecorder(roundEnv, annotation);
break;
case Constants.ANNOTATION_CONFIG_MAPPING:
trackAnnotationUsed(Constants.ANNOTATION_CONFIG_MAPPING);
break;
}
}
}
Expand Down Expand Up @@ -257,7 +260,7 @@ public FileVisitResult postVisitDirectory(final Path dir, final IOException exc)
try {
if (generateDocs) {
final Set<ConfigDocGeneratedOutput> outputs = configDocItemScanner
.scanExtensionsConfigurationItems(javaDocProperties);
.scanExtensionsConfigurationItems(javaDocProperties, isAnnotationUsed(ANNOTATION_CONFIG_MAPPING));
for (ConfigDocGeneratedOutput output : outputs) {
DocGeneratorUtil.sort(output.getConfigDocItems()); // sort before writing
configDocWriter.writeAllExtensionConfigDocumentation(output);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,18 @@ class ConfigDocItemFinder {
private final Map<String, TypeElement> configGroupQualifiedNameToTypeElementMap;
private final FsMap allConfigurationGroups;
private final FsMap allConfigurationRoots;
private final boolean configMapping;

public ConfigDocItemFinder(Set<ConfigRootInfo> configRoots,
Map<String, TypeElement> configGroupQualifiedNameToTypeElementMap,
Properties javaDocProperties, FsMap allConfigurationGroups, FsMap allConfigurationRoots) {
Properties javaDocProperties, FsMap allConfigurationGroups, FsMap allConfigurationRoots,
boolean configMapping) {
this.configRoots = configRoots;
this.configGroupQualifiedNameToTypeElementMap = configGroupQualifiedNameToTypeElementMap;
this.javaDocProperties = javaDocProperties;
this.allConfigurationGroups = allConfigurationGroups;
this.allConfigurationRoots = allConfigurationRoots;
this.configMapping = configMapping;
}

/**
Expand All @@ -97,7 +100,7 @@ ScannedConfigDocsItemHolder findInMemoryConfigurationItems() throws IOException
ConfigPhase buildTime = ConfigPhase.BUILD_TIME;
final List<ConfigDocItem> configDocItems = recursivelyFindConfigItems(entry.getValue(), EMPTY, EMPTY, buildTime,
false, 1,
false);
false, configMapping);
allConfigurationGroups.put(entry.getKey(), OBJECT_MAPPER.writeValueAsString(configDocItems));
}

Expand All @@ -107,7 +110,7 @@ ScannedConfigDocsItemHolder findInMemoryConfigurationItems() throws IOException
String rootName = configRootInfo.getName();
ConfigPhase configPhase = configRootInfo.getConfigPhase();
final List<ConfigDocItem> configDocItems = recursivelyFindConfigItems(element, rootName, rootName, configPhase,
false, sectionLevel, true);
false, sectionLevel, true, configMapping);
holder.addConfigRootItems(configRootInfo, configDocItems);
allConfigurationRoots.put(configRootInfo.getClazz().toString(), OBJECT_MAPPER.writeValueAsString(configDocItems));
}
Expand All @@ -119,7 +122,8 @@ ScannedConfigDocsItemHolder findInMemoryConfigurationItems() throws IOException
* Recursively find config item found in a config root or config group given as {@link Element}
*/
private List<ConfigDocItem> recursivelyFindConfigItems(Element element, String rootName, String parentName,
ConfigPhase configPhase, boolean withinAMap, int sectionLevel, boolean generateSeparateConfigGroupDocsFiles)
ConfigPhase configPhase, boolean withinAMap, int sectionLevel, boolean generateSeparateConfigGroupDocsFiles,
boolean configMapping)
throws JsonProcessingException {
List<ConfigDocItem> configDocItems = new ArrayList<>();
TypeElement asTypeElement = (TypeElement) element;
Expand All @@ -138,7 +142,8 @@ private List<ConfigDocItem> recursivelyFindConfigItems(Element element, String r
if (rawConfigItems == null) { // element not yet scanned
Element superElement = ((DeclaredType) superType).asElement();
superTypeConfigItems = recursivelyFindConfigItems(superElement, rootName, parentName,
configPhase, withinAMap, sectionLevel, generateSeparateConfigGroupDocsFiles);
configPhase, withinAMap, sectionLevel, generateSeparateConfigGroupDocsFiles,
configMapping);
} else {
superTypeConfigItems = OBJECT_MAPPER.readValue(rawConfigItems, LIST_OF_CONFIG_ITEMS_TYPE_REF);
}
Expand All @@ -148,7 +153,7 @@ private List<ConfigDocItem> recursivelyFindConfigItems(Element element, String r
}

for (Element enclosedElement : element.getEnclosedElements()) {
if (!shouldProcessElement(enclosedElement)) {
if (!shouldProcessElement(enclosedElement, configMapping)) {
continue;
}

Expand Down Expand Up @@ -262,7 +267,7 @@ private List<ConfigDocItem> recursivelyFindConfigItems(Element element, String r

if (isConfigGroup(type)) {
List<ConfigDocItem> groupConfigItems = readConfigGroupItems(configPhase, rootName, name, emptyList(), type,
configSection, withinAMap, generateSeparateConfigGroupDocsFiles);
configSection, withinAMap, generateSeparateConfigGroupDocsFiles, configMapping);
DocGeneratorUtil.appendConfigItemsIntoExistingOnes(configDocItems, groupConfigItems);
} else {
final ConfigDocKey configDocKey = new ConfigDocKey();
Expand Down Expand Up @@ -293,7 +298,8 @@ private List<ConfigDocItem> recursivelyFindConfigItems(Element element, String r
additionalNames = emptyList();
}
List<ConfigDocItem> groupConfigItems = readConfigGroupItems(configPhase, rootName, name,
additionalNames, type, configSection, true, generateSeparateConfigGroupDocsFiles);
additionalNames, type, configSection, true, generateSeparateConfigGroupDocsFiles,
configMapping);
DocGeneratorUtil.appendConfigItemsIntoExistingOnes(configDocItems, groupConfigItems);
continue;
} else {
Expand All @@ -320,7 +326,7 @@ private List<ConfigDocItem> recursivelyFindConfigItems(Element element, String r
configSection.setOptional(true);
List<ConfigDocItem> groupConfigItems = readConfigGroupItems(configPhase, rootName, name,
emptyList(), typeInString, configSection, withinAMap,
generateSeparateConfigGroupDocsFiles);
generateSeparateConfigGroupDocsFiles, configMapping);
DocGeneratorUtil.appendConfigItemsIntoExistingOnes(configDocItems, groupConfigItems);
continue;
} else if ((typeInString.startsWith(List.class.getName())
Expand Down Expand Up @@ -424,11 +430,15 @@ private boolean isConfigGroup(String type) {
return configGroupQualifiedNameToTypeElementMap.containsKey(type) || allConfigurationGroups.hasKey(type);
}

private boolean shouldProcessElement(final Element enclosedElement) {
private boolean shouldProcessElement(final Element enclosedElement, final boolean configMapping) {
if (enclosedElement.getKind().isField()) {
return true;
}

if (!configMapping && enclosedElement.getKind() == ElementKind.METHOD) {
return false;
}

// A ConfigMapping method
if (enclosedElement.getKind().equals(ElementKind.METHOD)) {
ExecutableElement method = (ExecutableElement) enclosedElement;
Expand Down Expand Up @@ -537,7 +547,8 @@ private List<ConfigDocItem> readConfigGroupItems(
String configGroup,
ConfigDocSection configSection,
boolean withinAMap,
boolean generateSeparateConfigGroupDocs)
boolean generateSeparateConfigGroupDocs,
boolean configMapping)
throws JsonProcessingException {

configSection.setConfigGroupType(configGroup);
Expand All @@ -557,7 +568,7 @@ private List<ConfigDocItem> readConfigGroupItems(
} else {
TypeElement configGroupTypeElement = configGroupQualifiedNameToTypeElementMap.get(configGroup);
groupConfigItems = recursivelyFindConfigItems(configGroupTypeElement, EMPTY, EMPTY, configPhase,
false, 1, generateSeparateConfigGroupDocs);
false, 1, generateSeparateConfigGroupDocs, configMapping);
allConfigurationGroups.put(configGroup, OBJECT_MAPPER.writeValueAsString(groupConfigItems));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ public void addConfigRoot(final PackageElement pkg, TypeElement clazz) {
}
}

public Set<ConfigDocGeneratedOutput> scanExtensionsConfigurationItems(Properties javaDocProperties)
public Set<ConfigDocGeneratedOutput> scanExtensionsConfigurationItems(Properties javaDocProperties, boolean configMapping)
throws IOException {

Set<ConfigDocGeneratedOutput> configDocGeneratedOutputs = new HashSet<>();
final ConfigDocItemFinder configDocItemFinder = new ConfigDocItemFinder(configRoots, configGroupsToTypeElement,
javaDocProperties, allConfigGroupGeneratedDocs, allExtensionGeneratedDocs);
javaDocProperties, allConfigGroupGeneratedDocs, allExtensionGeneratedDocs, configMapping);
final ScannedConfigDocsItemHolder inMemoryScannedItemsHolder = configDocItemFinder.findInMemoryConfigurationItems();

if (!inMemoryScannedItemsHolder.isEmpty()) {
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
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public void shouldReturnMultipleOutputSourceDirectories() {

@Test
public void shouldNotFailOnProjectDependenciesWithoutMain(@TempDir Path testProjectDir) throws IOException {
var kotlinVersion = System.getProperty("kotlin_version", "1.9.0");
var kotlinVersion = System.getProperty("kotlin_version", "1.9.10");
var settingFile = testProjectDir.resolve("settings.gradle.kts");
var mppProjectDir = testProjectDir.resolve("mpp");
var quarkusProjectDir = testProjectDir.resolve("quarkus");
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.9.3"
assertj = "3.24.2"
Expand Down
4 changes: 2 additions & 2 deletions devtools/gradle/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
# https://gradle.org/release-checksums/
distributionSha256Sum=5625a0ae20fe000d9225d000b36909c7a0e0e8dda61c19b12da769add847c975
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip
distributionSha256Sum=bb09982fdf52718e4c7b25023d10df6d35a5fff969860bdf5a5bd27a3ab27a9e
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 0 additions & 2 deletions docs/src/main/asciidoc/getting-started-testing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1626,8 +1626,6 @@ The container is stopped and the config is released during the `after all` test
The fields annotated with `@Inject` and `@InjectMock` are injected after a test instance is created and unset before a test instance is destroyed.
Finally, the CDI request context is activated and terminated per each test method.

NOTE: By default, a new test instance is created for each test method. Therefore, a new CDI container is started for each test method. However, if the test class is annotated with `@org.junit.jupiter.api.TestInstance` and the test instance lifecycle is set to `org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS` then the CDI container will be shared across all test method executions of a given test class.

=== Auto Mocking Unsatisfied Dependencies

Unlike in regular CDI environments the test does not fail if a component injects an unsatisfied dependency.
Expand Down
5 changes: 4 additions & 1 deletion docs/src/main/asciidoc/hibernate-reactive.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ and pull requests should be submitted there:
https://github.com/quarkusio/quarkus/tree/main/docs/src/main/asciidoc
////
= Using Hibernate Reactive

include::_attributes.adoc[]
:config-file: application.properties
:reactive-doc-url-prefix: https://hibernate.org/reactive/documentation/1.1/reference/html_single/#getting-started
:extension-status: preview


link:https://hibernate.org/reactive/[Hibernate Reactive] is a reactive API for Hibernate ORM, supporting non-blocking database drivers
and a reactive style of interaction with the database.
Expand All @@ -19,6 +20,8 @@ xref:hibernate-orm.adoc[Hibernate ORM guide]. This guide will only focus on what
for Hibernate Reactive.
====

include::{includes}/extension-status.adoc[]

== Solution

We recommend that you follow the instructions in the next sections and create the application step by step.
Expand Down
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]
Loading

0 comments on commit e06263c

Please sign in to comment.