Skip to content

Commit

Permalink
Merge branch 'main' into gelf-missing-mdc-config
Browse files Browse the repository at this point in the history
  • Loading branch information
donkon authored Jan 4, 2024
2 parents 7a25c56 + 76b2f29 commit b79b1ea
Show file tree
Hide file tree
Showing 106 changed files with 1,639 additions and 595 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-istio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
shell: bash
run: tar -xzf maven-repo.tgz -C ~
- name: Set up Minikube-Kubernetes
uses: manusa/actions-setup-minikube@v2.9.0
uses: manusa/actions-setup-minikube@v2.10.0
with:
minikube version: v1.16.0
kubernetes version: ${{ matrix.kubernetes }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
shell: bash
run: tar -xzf maven-repo.tgz -C ~
- name: Set up Minikube-Kubernetes
uses: manusa/actions-setup-minikube@v2.9.0
uses: manusa/actions-setup-minikube@v2.10.0
with:
minikube version: v1.16.0
kubernetes version: ${{ matrix.kubernetes }}
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/develocity-publish-build-scans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,17 @@ jobs:
develocity-access-key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
skip-comment: true
skip-summary: true
- name: Output JSON file
run: |
if [ -f "${{ steps.publish.outputs.build-metadata-file-path }}" ]; then
echo "```json" >> $GITHUB_STEP_SUMMARY
jq '.' ${{ steps.publish.outputs.build-metadata-file-path }} >> $GITHUB_STEP_SUMMARY
echo "\n```" >> $GITHUB_STEP_SUMMARY;
fi
- name: Inject build scans in reports
uses: quarkusio/action-helpers@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
action: inject-build-scans
workflow-run-id: ${{ github.event.workflow_run.id }}
build-metadata-file-path: ${{ steps.publish.outputs.build-metadata-file-path }}
- name: Output JSON file
run: |
if [ -f "${{ steps.publish.outputs.build-metadata-file-path }}" ]; then jq '.' ${{ steps.publish.outputs.build-metadata-file-path }} >> $GITHUB_STEP_SUMMARY; fi
14 changes: 7 additions & 7 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,18 @@
<microprofile-lra.version>2.0</microprofile-lra.version>
<microprofile-openapi.version>3.1.1</microprofile-openapi.version>
<smallrye-common.version>2.2.0</smallrye-common.version>
<smallrye-config.version>3.4.4</smallrye-config.version>
<smallrye-config.version>3.5.1</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.7.0</smallrye-open-api.version>
<smallrye-open-api.version>3.8.0</smallrye-open-api.version>
<smallrye-graphql.version>2.6.1</smallrye-graphql.version>
<smallrye-fault-tolerance.version>6.2.6</smallrye-fault-tolerance.version>
<smallrye-jwt.version>4.4.0</smallrye-jwt.version>
<smallrye-context-propagation.version>2.1.0</smallrye-context-propagation.version>
<smallrye-reactive-streams-operators.version>1.0.13</smallrye-reactive-streams-operators.version>
<smallrye-reactive-types-converter.version>3.0.1</smallrye-reactive-types-converter.version>
<smallrye-mutiny-vertx-binding.version>3.7.2</smallrye-mutiny-vertx-binding.version>
<smallrye-reactive-messaging.version>4.12.0</smallrye-reactive-messaging.version>
<smallrye-reactive-messaging.version>4.13.0</smallrye-reactive-messaging.version>
<smallrye-stork.version>2.4.0</smallrye-stork.version>
<jakarta.activation.version>2.1.2</jakarta.activation.version>
<jakarta.annotation-api.version>2.1.1</jakarta.annotation-api.version>
Expand Down Expand Up @@ -91,7 +91,7 @@
<plexus-component-annotations.version>2.1.0</plexus-component-annotations.version>
<graal-sdk.version>23.0.1</graal-sdk.version>
<gizmo.version>1.7.0</gizmo.version>
<jackson-bom.version>2.16.0</jackson-bom.version>
<jackson-bom.version>2.16.1</jackson-bom.version>
<commons-logging-jboss-logging.version>1.0.0.Final</commons-logging-jboss-logging.version>
<commons-lang3.version>3.14.0</commons-lang3.version>
<commons-codec.version>1.16.0</commons-codec.version>
Expand Down Expand Up @@ -160,7 +160,7 @@
<aws-xray.version>2.15.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.21</kotlin.version>
<kotlin.version>1.9.22</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.6.2</kotlin-serialization.version>
Expand Down Expand Up @@ -191,10 +191,10 @@
<jna.version>5.8.0</jna.version><!-- should satisfy both testcontainers and mongodb -->
<antlr.version>4.13.0</antlr.version><!-- needs to align with same property in build-parent/pom.xml -->
<quarkus-security.version>2.0.2.Final</quarkus-security.version>
<keycloak.version>23.0.1</keycloak.version>
<keycloak.version>23.0.3</keycloak.version>
<logstash-gelf.version>1.15.1</logstash-gelf.version>
<checker-qual.version>3.42.0</checker-qual.version>
<error-prone-annotations.version>2.23.0</error-prone-annotations.version>
<error-prone-annotations.version>2.24.0</error-prone-annotations.version>
<jib-core.version>0.25.0</jib-core.version>
<google-http-client.version>1.43.3</google-http-client.version>
<scram-client.version>2.1</scram-client.version>
Expand Down
6 changes: 3 additions & 3 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.21</kotlin.version>
<kotlin.version>1.9.22</kotlin.version>
<dokka.version>1.9.10</dokka.version>
<scala.version>2.13.12</scala.version>
<scala-maven-plugin.version>4.8.1</scala-maven-plugin.version>
Expand All @@ -36,7 +36,7 @@
<jandex.version>3.1.6</jandex.version>
<jandex-gradle-plugin.version>1.0.0</jandex-gradle-plugin.version>

<asciidoctorj.version>2.5.10</asciidoctorj.version>
<asciidoctorj.version>2.5.11</asciidoctorj.version>
<htmlunit.version>2.70.0</htmlunit.version>
<javaparser-core.version>3.25.6</javaparser-core.version>
<jdeparser.version>2.0.3.Final</jdeparser.version>
Expand Down Expand Up @@ -104,7 +104,7 @@

<!-- The image to use for tests that run Keycloak -->
<!-- IMPORTANT: If this is changed you must also update bom/application/pom.xml and KeycloakBuildTimeConfig/DevServicesConfig in quarkus-oidc/deployment to match the version -->
<keycloak.version>23.0.1</keycloak.version>
<keycloak.version>23.0.3</keycloak.version>
<keycloak.wildfly.version>19.0.3</keycloak.wildfly.version>
<keycloak.docker.image>quay.io/keycloak/keycloak:${keycloak.version}</keycloak.docker.image>
<keycloak.docker.legacy.image>quay.io/keycloak/keycloak:${keycloak.wildfly.version}-legacy</keycloak.docker.legacy.image>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,10 +508,17 @@ ReadResult run() {
nameBuilder.setLength(0);
}

// Register defaults for Roots
allBuildTimeValues.putAll(getDefaults(buildTimePatternMap));
buildTimeRunTimeValues.putAll(getDefaults(buildTimeRunTimePatternMap));
runTimeDefaultValues.putAll(getDefaults(runTimePatternMap));

// Register defaults for Mappings
// Runtime defaults are added in ConfigGenerationBuildStep.generateBuilders to include user mappings
for (ConfigClassWithPrefix buildTimeRunTimeMapping : buildTimeRunTimeMappings) {
buildTimeRunTimeValues.putAll(ConfigMappings.getDefaults(buildTimeRunTimeMapping));
}

SmallRyeConfig runtimeDefaultsConfig = getConfigForRuntimeDefaults();
Set<String> registeredRoots = allRoots.stream().map(RootDefinition::getName).collect(toSet());
registeredRoots.add("quarkus");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,111 +683,6 @@ private MethodDescriptor generateInitGroup(ClassDefinition definition) {
return methodDescriptor;
}

private static MethodDescriptor generateDefaultValueParse(final ClassCreator dvcc,
final ConfigPatternMap<Container> keyMap, final StringBuilder methodName) {

final Container matched = keyMap.getMatched();
final boolean hasDefault;
if (matched != null) {
final ClassDefinition.ClassMember member = matched.getClassMember();
// matched members *must* be item members
assert member instanceof ClassDefinition.ItemMember;
ClassDefinition.ItemMember itemMember = (ClassDefinition.ItemMember) member;
hasDefault = itemMember.getDefaultValue() != null;
} else {
hasDefault = false;
}

final Iterable<String> names = keyMap.childNames();
final Map<String, MethodDescriptor> children = new HashMap<>();
MethodDescriptor wildCard = null;
for (String name : names) {
final int length = methodName.length();
if (name.equals(ConfigPatternMap.WILD_CARD)) {
methodName.append(":*");
wildCard = generateDefaultValueParse(dvcc, keyMap.getChild(ConfigPatternMap.WILD_CARD), methodName);
} else {
methodName.append(':').append(name);
final MethodDescriptor value = generateDefaultValueParse(dvcc, keyMap.getChild(name), methodName);
if (value != null) {
children.put(name, value);
}
}
methodName.setLength(length);
}
if (children.isEmpty() && wildCard == null && !hasDefault) {
// skip parse trees with no default values in them
return null;
}

try (MethodCreator body = dvcc.getMethodCreator(methodName.toString(), String.class, NameIterator.class)) {
body.setModifiers(Opcodes.ACC_PRIVATE);

final ResultHandle keyIter = body.getMethodParam(0);
// if we've matched the whole thing...
// if (! keyIter.hasNext()) {
try (BytecodeCreator matchedBody = body.ifNonZero(body.invokeVirtualMethod(NI_HAS_NEXT, keyIter))
.falseBranch()) {
if (matched != null) {
final ClassDefinition.ClassMember member = matched.getClassMember();
// matched members *must* be item members
assert member instanceof ClassDefinition.ItemMember;
ClassDefinition.ItemMember itemMember = (ClassDefinition.ItemMember) member;
// match?
final String defaultValue = itemMember.getDefaultValue();
if (defaultValue != null) {
// matched with default value
// return "defaultValue";
matchedBody.returnValue(matchedBody.load(defaultValue));
} else {
// matched but no default value
// return null;
matchedBody.returnValue(matchedBody.loadNull());
}
} else {
// no match
// return null;
matchedBody.returnValue(matchedBody.loadNull());
}
}
// }
// branches for each next-string
for (String name : children.keySet()) {
// TODO: string switch
// if (keyIter.nextSegmentEquals(name)) {
try (BytecodeCreator nameMatched = body
.ifNonZero(body.invokeVirtualMethod(NI_NEXT_EQUALS, keyIter, body.load(name))).trueBranch()) {
// keyIter.next();
nameMatched.invokeVirtualMethod(NI_NEXT, keyIter);
// (generated recursive)
// result = getDefault$..$name(keyIter);
ResultHandle result = nameMatched.invokeVirtualMethod(children.get(name), body.getThis(), keyIter);
// return result;
nameMatched.returnValue(result);
}
// }
}
if (wildCard != null) {
// consume and parse
try (BytecodeCreator matchedBody = body.ifNonZero(body.invokeVirtualMethod(NI_HAS_NEXT, keyIter))
.trueBranch()) {
// keyIter.next();
matchedBody.invokeVirtualMethod(NI_NEXT, keyIter);
// (generated recursive)
// result = getDefault$..$*(keyIter);
final ResultHandle result = matchedBody.invokeVirtualMethod(wildCard, body.getThis(), keyIter);
// return result;
matchedBody.returnValue(result);
}
}
// unknown
// return null;
body.returnValue(body.loadNull());

return body.getMethodDescriptor();
}
}

private void generateEmptyParsers() {
MethodCreator body = cc.getMethodCreator(RT_EMPTY_PARSER);
body.setModifiers(Opcodes.ACC_PRIVATE | Opcodes.ACC_STATIC);
Expand Down Expand Up @@ -1295,37 +1190,6 @@ private FieldDescriptor getOrCreateConverterInstance(Field field, ConverterType
return fd;
}

private void reportUnknown(final MethodCreator mc) {
mc.setModifiers(Opcodes.ACC_PRIVATE | Opcodes.ACC_STATIC);

ResultHandle unknownProperty = mc.getMethodParam(0);
ResultHandle unknown = mc.getMethodParam(1);

// Ignore all build property names. This is to ignore any properties mapped with @ConfigMapping, because
// these do not fall into the ignored ConfigPattern.
for (String buildTimeProperty : allBuildTimeValues.keySet()) {
ResultHandle equalsResult = mc.invokeVirtualMethod(
MethodDescriptor.ofMethod(Object.class, "equals", boolean.class, Object.class), unknownProperty,
mc.load(buildTimeProperty));
mc.ifTrue(equalsResult).trueBranch().returnValue(null);
}

// Ignore recorded runtime property names. This is to ignore any properties mapped with @ConfigMapping, because
// these do not fall into the ignored ConfigPattern.
for (String buildTimeProperty : runTimeDefaultValues.keySet()) {
ResultHandle equalsResult = mc.invokeVirtualMethod(
MethodDescriptor.ofMethod(Object.class, "equals", boolean.class, Object.class), unknownProperty,
mc.load(buildTimeProperty));
mc.ifTrue(equalsResult).trueBranch().returnValue(null);
}

// Add the property as unknown only if all checks fail
mc.invokeVirtualMethod(HS_ADD, unknown, unknownProperty);

mc.returnValue(null);
mc.close();
}

static final MethodDescriptor KM_NEW = MethodDescriptor.ofConstructor(KeyMap.class);
static final MethodDescriptor KM_FIND_OR_ADD = MethodDescriptor.ofMethod(KeyMap.class, "findOrAdd", KeyMap.class,
String.class);
Expand All @@ -1335,13 +1199,13 @@ private void reportUnknown(final MethodCreator mc) {
private void generateUnknownFilter() {
Set<String> mappedProperties = new HashSet<>();
for (ConfigClassWithPrefix buildTimeMapping : buildTimeConfigResult.getBuildTimeMappings()) {
mappedProperties.addAll(ConfigMappings.getProperties(buildTimeMapping).keySet());
mappedProperties.addAll(ConfigMappings.getKeys(buildTimeMapping));
}
for (ConfigClassWithPrefix staticConfigMapping : buildTimeConfigResult.getBuildTimeRunTimeMappings()) {
mappedProperties.addAll(ConfigMappings.getProperties(staticConfigMapping).keySet());
mappedProperties.addAll(ConfigMappings.getKeys(staticConfigMapping));
}
for (ConfigClassWithPrefix runtimeConfigMapping : buildTimeConfigResult.getRunTimeMappings()) {
mappedProperties.addAll(ConfigMappings.getProperties(runtimeConfigMapping).keySet());
mappedProperties.addAll(ConfigMappings.getKeys(runtimeConfigMapping));
}

// Add a method that generates a KeyMap that can check if a property is mapped by a @ConfigMapping
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ public void accept(Container node) {
private void processMappings(List<ConfigClassWithPrefix> mappings, List<ConfigDescriptionBuildItem> descriptionBuildItems,
Properties javaDocProperties, ConfigPhase configPhase) {
for (ConfigClassWithPrefix mapping : mappings) {
Map<String, Property> properties = ConfigMappings.getProperties(mapping);
Map<String, Property> properties = ConfigMappings.getProperties(mapping).get(mapping.getKlass())
.get(mapping.getPrefix());
for (Map.Entry<String, Property> entry : properties.entrySet()) {
String propertyName = entry.getKey();
Property property = entry.getValue();
Expand Down
Loading

0 comments on commit b79b1ea

Please sign in to comment.