Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.12.1 backports 1 #27740

Merged
merged 40 commits into from Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
e91a619
Use http.target to drop non application spans
radcortez Jul 22, 2022
04e4300
Fix reference to quarkus.http.proxy.proxy-address-forwarding
gsmet Aug 23, 2022
238eb07
Ensure that HTTP OPTIONS handling involves the proper handler chain
geoand Jul 27, 2022
dd137ae
Ensure that @RequestScope doesn't break field parameter injection
geoand Aug 24, 2022
22de496
Allow for more complex config transformation in DevServicesAdditional…
yrodiere Aug 24, 2022
47c2109
Re-generate OTel override of dev service configuration on application…
yrodiere Aug 24, 2022
9f0ab5f
Test re-enabling OTel in a JDBC driver in dev mode
yrodiere Aug 24, 2022
9974883
Add support for DOCKER_CONFIG env var when using Jib
geoand Aug 24, 2022
dc0ba36
Fix service binding for MS SqlServer and Oracle
xieshenzh Aug 18, 2022
b07ec5c
Re-enable `ParseOnce` starting with GraalVM / Mandrel 22.2
zakkak Aug 16, 2022
70ef223
Ensure that CDI request scope is active in TemplateResponseUniHandler
geoand Aug 25, 2022
1f85798
Output ACR loginServer as tsv format.
galiacheng Aug 26, 2022
b911287
Jandex quarkus-bootstrap-app-model
gastaldi Aug 25, 2022
7819ba8
Properly use ParamConverter to converting the values of collection types
geoand Aug 26, 2022
ca804d4
Fix SSE cancellation in the Reactive REST Client
cescoffier Aug 29, 2022
e8ea83e
Ensure that quarkus.native.reuse-existing=true does not fail if Graal…
geoand Aug 25, 2022
dc8bd64
Support Instance<Optional> injection
radcortez Aug 29, 2022
89b7eb9
add JIB custom entrypoint examples on documentation
schmittjoaopedro Aug 30, 2022
5141f20
Resteasy Reactive: Fix nested bean params for sub resources
Sgitario Aug 30, 2022
01af2c5
Add high level logging for RESTEasy Reactive exceptions
geoand Aug 30, 2022
3bb4a40
Fix to run first example on vertx page
deewhyweb Aug 30, 2022
f174eef
Mark quarkus:go-offline as threadSafe=true
aloubyansky Aug 30, 2022
02b3dc5
BeanManager.getBeans() - assume the default qualifier if none specified
mkouba Aug 30, 2022
27d781e
Respect quarkus.class-loading.removed-artifacts when re-augmenting an
aloubyansky Aug 30, 2022
e115203
Make 'postgres print-command' quarkus command work with reactive data…
geoand Aug 31, 2022
02b2cb4
Add notes about logging exception in RESTEasy Reactive
geoand Aug 31, 2022
c8356f7
Check whether the dependency node has been already processed before w…
aloubyansky Aug 31, 2022
84497cb
Support config expansion when validating config changes
radcortez Aug 29, 2022
6bbb834
Use devRootAppend for all links in grpc devmode
0SkillAllLuck Sep 1, 2022
66739a1
Bring JBossNettyLoggerFactory implementation in line with other imple…
geoand Sep 1, 2022
184d316
Funqy - fix constructor injection for normal scoped beans
michalvavrik Sep 1, 2022
c201913
Added note about `quarkus.native.container-build=true` to building-na…
hbelmiro Aug 31, 2022
14dfd20
feat: support empty env var values in kubernetes/openshift/knative
Sgitario Sep 2, 2022
9e5b288
Update KeycloakTestClient.java
viswatejan Sep 3, 2022
6c17ec5
Minor correction in a doc
ynojima Sep 3, 2022
04ae9b9
GraphQL Field level context and error event on blocking fixes
phillip-kruger Sep 3, 2022
d912f90
Bump dekorate version to 2.11.2
Sgitario Sep 2, 2022
d722559
Support empty-dir volumes in Kubernetes, OpenShift, Knative extensions
Sgitario Sep 5, 2022
e37b95e
Reactive routes - don't append trailing slash if empty path and base set
mkouba Sep 5, 2022
844e01e
Unclutter test resource start error message
geoand Sep 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions bom/application/pom.xml
Expand Up @@ -44,7 +44,7 @@
<smallrye-health.version>3.2.1</smallrye-health.version>
<smallrye-metrics.version>3.0.5</smallrye-metrics.version>
<smallrye-open-api.version>2.2.0</smallrye-open-api.version>
<smallrye-graphql.version>1.7.0</smallrye-graphql.version>
<smallrye-graphql.version>1.7.1</smallrye-graphql.version>
<smallrye-opentracing.version>2.1.1</smallrye-opentracing.version>
<smallrye-fault-tolerance.version>5.5.0</smallrye-fault-tolerance.version>
<smallrye-jwt.version>3.5.3</smallrye-jwt.version>
Expand Down Expand Up @@ -152,7 +152,7 @@
<kotlin.coroutine.version>1.6.4</kotlin.coroutine.version>
<kotlin-serialization.version>1.4.0</kotlin-serialization.version>
<kubernetes-client.version>5.12.3</kubernetes-client.version> <!-- Please check with Java Operator SDK team before updating -->
<dekorate.version>2.11.0</dekorate.version> <!-- Please check with Java Operator SDK team before updating -->
<dekorate.version>2.11.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.0</awaitility.version>
<jboss-logmanager.version>1.0.10</jboss-logmanager.version>
Expand Down
@@ -1,7 +1,9 @@
package io.quarkus.deployment.builditem;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;

import io.quarkus.builder.item.MultiBuildItem;

Expand All @@ -15,14 +17,15 @@
*/
public final class DevServicesAdditionalConfigBuildItem extends MultiBuildItem {

private final DevServicesAdditionalConfigProvider configProvider;
private final Collection<String> triggeringKeys;
private final String key;
private final String value;
private final Runnable callbackWhenEnabled;

/**
* @deprecated Call
* {@link DevServicesAdditionalConfigBuildItem#DevServicesAdditionalConfigBuildItem(Collection, String, String, Runnable)}
* {@link DevServicesAdditionalConfigBuildItem#DevServicesAdditionalConfigBuildItem(DevServicesAdditionalConfigProvider)}
* instead.
*/
@Deprecated
Expand All @@ -31,35 +34,85 @@ public DevServicesAdditionalConfigBuildItem(String triggeringKey,
this(List.of(triggeringKey), key, value, callbackWhenEnabled);
}

/**
* @deprecated Call
* {@link DevServicesAdditionalConfigBuildItem#DevServicesAdditionalConfigBuildItem(DevServicesAdditionalConfigProvider)}
* instead.
*/
@Deprecated
public DevServicesAdditionalConfigBuildItem(Collection<String> triggeringKeys,
String key, String value, Runnable callbackWhenEnabled) {
this.triggeringKeys = triggeringKeys;
this.key = key;
this.value = value;
this.callbackWhenEnabled = callbackWhenEnabled;
this.configProvider = devServicesConfig -> {
if (triggeringKeys.stream().anyMatch(devServicesConfig::containsKey)) {
if (callbackWhenEnabled != null) {
callbackWhenEnabled.run();
}
return Map.of(key, value);
} else {
return Map.of();
}
};
}

public DevServicesAdditionalConfigBuildItem(DevServicesAdditionalConfigProvider configProvider) {
this.triggeringKeys = Collections.emptyList();
this.key = null;
this.value = null;
this.callbackWhenEnabled = null;
this.configProvider = configProvider;
}

/**
* @deprecated Call {@link #getTriggeringKeys()} instead.
* @deprecated Don't call this method, use {@link #getConfigProvider()} instead.
*/
@Deprecated
public String getTriggeringKey() {
return getTriggeringKeys().iterator().next();
}

/**
* @deprecated Don't call this method, use {@link #getConfigProvider()} instead.
*/
@Deprecated
public Collection<String> getTriggeringKeys() {
return triggeringKeys;
}

/**
* @deprecated Don't call this method, use {@link #getConfigProvider()} instead.
*/
@Deprecated
public String getKey() {
return key;
}

/**
* @deprecated Don't call this method, use {@link #getConfigProvider()} instead.
*/
@Deprecated
public String getValue() {
return value;
}

/**
* @deprecated Don't call this method, use {@link #getConfigProvider()} instead.
*/
@Deprecated
public Runnable getCallbackWhenEnabled() {
return callbackWhenEnabled;
}

public DevServicesAdditionalConfigProvider getConfigProvider() {
return configProvider;
}

public interface DevServicesAdditionalConfigProvider {

Map<String, String> provide(Map<String, String> devServicesConfig);

}
}
Expand Up @@ -50,5 +50,9 @@ public int getJavaVersion() {
public String getDistribution() {
return distribution;
}

public static GraalVMVersion unknown() {
return new GraalVMVersion("unknown", "unknown", -1, "unknown");
}
}
}
Expand Up @@ -425,7 +425,7 @@ public boolean test(String path) {
*/
private static boolean includeAppDep(ResolvedDependency appDep, Optional<Set<ArtifactKey>> optionalDependencies,
Set<ArtifactKey> removedArtifacts) {
if (!"jar".equals(appDep.getType())) {
if (!appDep.isJar()) {
return false;
}
if (appDep.isOptional()) {
Expand Down Expand Up @@ -577,7 +577,6 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem,
} else {
IoUtils.createOrEmptyDir(quarkus);
}
Map<ArtifactKey, List<Path>> copiedArtifacts = new HashMap<>();

Path decompiledOutputDir = null;
boolean wasDecompiledSuccessfully = true;
Expand Down Expand Up @@ -672,14 +671,15 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem,
}
}
final Set<ArtifactKey> parentFirstKeys = getParentFirstKeys(curateOutcomeBuildItem, classLoadingConfig);
StringBuilder classPath = new StringBuilder();
final StringBuilder classPath = new StringBuilder();
final Set<ArtifactKey> removed = getRemovedKeys(classLoadingConfig);
final Map<ArtifactKey, List<Path>> copiedArtifacts = new HashMap<>();
for (ResolvedDependency appDep : curateOutcomeBuildItem.getApplicationModel().getRuntimeDependencies()) {
if (rebuild) {
appDep.getResolvedPaths().forEach(jars::add);
} else {
if (!rebuild) {
copyDependency(parentFirstKeys, outputTargetBuildItem, copiedArtifacts, mainLib, baseLib, jars, true,
classPath, appDep, transformedClasses, removed);
} else if (includeAppDep(appDep, outputTargetBuildItem.getIncludedOptionalDependencies(), removed)) {
appDep.getResolvedPaths().forEach(jars::add);
}
if (parentFirstKeys.contains(appDep.getKey())) {
appDep.getResolvedPaths().forEach(parentFirst::add);
Expand Down Expand Up @@ -745,15 +745,13 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem,

//now copy the deployment artifacts, if required
if (mutableJar) {

Path deploymentLib = libDir.resolve(DEPLOYMENT_LIB);
Files.createDirectories(deploymentLib);
for (ResolvedDependency appDep : curateOutcomeBuildItem.getApplicationModel().getDependencies()) {
copyDependency(parentFirstKeys, outputTargetBuildItem, copiedArtifacts, deploymentLib, baseLib, jars,
false, classPath,
appDep, new TransformedClassesBuildItem(Collections.emptyMap()), removed); //we don't care about transformation here, so just pass in an empty item
appDep, new TransformedClassesBuildItem(Map.of()), removed); //we don't care about transformation here, so just pass in an empty item
}

Map<ArtifactKey, List<String>> relativePaths = new HashMap<>();
for (Map.Entry<ArtifactKey, List<Path>> e : copiedArtifacts.entrySet()) {
relativePaths.put(e.getKey(),
Expand Down Expand Up @@ -804,7 +802,6 @@ private JarBuildItem buildThinJar(CurateOutcomeBuildItem curateOutcomeBuildItem,
}
} else {
//if it is a rebuild we might have classes

}
try (Stream<Path> files = Files.walk(buildDir)) {
files.forEach(new Consumer<Path>() {
Expand Down
Expand Up @@ -202,6 +202,12 @@ public NativeImageBuildItem build(NativeConfig nativeConfig, LocalesBuildTimeCon
String resultingExecutableName = getResultingExecutableName(nativeImageName, isContainerBuild);
Path generatedExecutablePath = outputDir.resolve(resultingExecutableName);
Path finalExecutablePath = outputTargetBuildItem.getOutputDirectory().resolve(resultingExecutableName);
if (nativeConfig.reuseExisting) {
if (Files.exists(finalExecutablePath)) {
return new NativeImageBuildItem(finalExecutablePath,
NativeImageBuildItem.GraalVMVersion.unknown());
}
}

NativeImageBuildRunner buildRunner = getNativeImageBuildRunner(nativeConfig, outputDir,
nativeImageName, resultingExecutableName);
Expand All @@ -213,15 +219,6 @@ public NativeImageBuildItem build(NativeConfig nativeConfig, LocalesBuildTimeCon
} else {
log.error("Unable to get GraalVM version from the native-image binary.");
}
if (nativeConfig.reuseExisting) {
if (Files.exists(finalExecutablePath)) {
return new NativeImageBuildItem(finalExecutablePath,
new NativeImageBuildItem.GraalVMVersion(graalVMVersion.fullVersion,
graalVMVersion.version.toString(),
graalVMVersion.javaFeatureVersion,
graalVMVersion.distribution.name()));
}
}

try {
if (nativeConfig.cleanupServer) {
Expand Down Expand Up @@ -677,19 +674,21 @@ public NativeImageInvokerInfo build() {
}
nativeImageArgs.add("--features=" + String.join(",", featuresList));

/*
* Instruct GraalVM / Mandrel parse compiler graphs twice, once for the static analysis and once again
* for the AOT compilation.
*
* We do this because single parsing significantly increases memory usage at build time
* see https://github.com/oracle/graal/issues/3435 and
* https://github.com/graalvm/mandrel/issues/304#issuecomment-952070568 for more details.
*
* Note: This option must come before the invocation of
* {@code handleAdditionalProperties(nativeImageArgs)} to ensure that devs and advanced users can
* override it by passing -Dquarkus.native.additional-build-args=-H:+ParseOnce
*/
nativeImageArgs.add("-H:-ParseOnce");
if (graalVMVersion.isOlderThan(GraalVM.Version.VERSION_22_2_0)) {
/*
* Instruct GraalVM / Mandrel parse compiler graphs twice, once for the static analysis and once again
* for the AOT compilation.
*
* We do this because single parsing significantly increases memory usage at build time
* see https://github.com/oracle/graal/issues/3435 and
* https://github.com/graalvm/mandrel/issues/304#issuecomment-952070568 for more details.
*
* Note: This option must come before the invocation of
* {@code handleAdditionalProperties(nativeImageArgs)} to ensure that devs and advanced users can
* override it by passing -Dquarkus.native.additional-build-args=-H:+ParseOnce
*/
nativeImageArgs.add("-H:-ParseOnce");
}

/**
* This makes sure the Kerberos integration module is made available in case any library
Expand Down
Expand Up @@ -65,16 +65,11 @@ public void run() {
oldConfig = newProperties;

Map<String, String> newPropertiesWithAdditionalConfig = new HashMap<>(newProperties);
var unmodifiableNewProperties = Collections.unmodifiableMap(newProperties);
// On contrary to dev services config, "additional" config build items are
// produced on each restart, so we don't want to remember them from one restart to the next.
for (DevServicesAdditionalConfigBuildItem item : devServicesAdditionalConfigBuildItems) {
if (item.getTriggeringKeys().stream().anyMatch(newProperties::containsKey)) {
var callback = item.getCallbackWhenEnabled();
if (callback != null) {
callback.run(); // This generally involves logging
}
newPropertiesWithAdditionalConfig.put(item.getKey(), item.getValue());
}
newPropertiesWithAdditionalConfig.putAll(item.getConfigProvider().provide(unmodifiableNewProperties));
}

for (Map.Entry<String, String> entry : newPropertiesWithAdditionalConfig.entrySet()) {
Expand Down
@@ -1,16 +1,20 @@
package io.quarkus.runtime.configuration;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.eclipse.microprofile.config.Config;
import org.eclipse.microprofile.config.ConfigProvider;
import org.eclipse.microprofile.config.ConfigValue;
import org.eclipse.microprofile.config.spi.ConfigSource;
import org.jboss.logging.Logger;

import io.quarkus.runtime.annotations.Recorder;
import io.quarkus.runtime.configuration.ConfigurationRuntimeConfig.BuildTimeMismatchAtRuntime;
import io.smallrye.config.ConfigSourceInterceptorContext;
import io.smallrye.config.ExpressionConfigSourceInterceptor;
import io.smallrye.config.SmallRyeConfig;
import io.smallrye.config.SmallRyeConfigBuilder;

Expand All @@ -26,18 +30,51 @@ public ConfigRecorder(ConfigurationRuntimeConfig configurationConfig) {
}

public void handleConfigChange(Map<String, ConfigValue> buildTimeRuntimeValues) {
// Create a new Config without the "BuildTime RunTime Fixed" sources to check for different values
SmallRyeConfigBuilder configBuilder = ConfigUtils.emptyConfigBuilder();
// We need to disable the expression resolution, because we may be missing expressions from the "BuildTime RunTime Fixed" source
configBuilder.withDefaultValue(Config.PROPERTY_EXPRESSIONS_ENABLED, "false");
for (ConfigSource configSource : ConfigProvider.getConfig().getConfigSources()) {
if ("BuildTime RunTime Fixed".equals(configSource.getName())) {
continue;
}
configBuilder.withSources(configSource);
}
// Add a new expression resolution to fall back to the current Config if we cannot expand the expression
configBuilder.withInterceptors(new ExpressionConfigSourceInterceptor() {
@Override
public io.smallrye.config.ConfigValue getValue(final ConfigSourceInterceptorContext context, final String name) {
return super.getValue(new ConfigSourceInterceptorContext() {
@Override
public io.smallrye.config.ConfigValue proceed(final String name) {
io.smallrye.config.ConfigValue configValue = context.proceed(name);
if (configValue == null) {
configValue = (io.smallrye.config.ConfigValue) ConfigProvider.getConfig().getConfigValue(name);
if (configValue.getValue() == null) {
return null;
}
}
return configValue;
}

@Override
public Iterator<String> iterateNames() {
return context.iterateNames();
}

@Override
public Iterator<io.smallrye.config.ConfigValue> iterateValues() {
return context.iterateValues();
}
}, name);
}
});
SmallRyeConfig config = configBuilder.build();

List<String> mismatches = new ArrayList<>();
for (Map.Entry<String, ConfigValue> entry : buildTimeRuntimeValues.entrySet()) {
ConfigValue currentValue = config.getConfigValue(entry.getKey());
// Check for changes. Also, we only have a change if the source ordinal is higher
if (currentValue.getValue() != null && !entry.getValue().getValue().equals(currentValue.getValue())
&& entry.getValue().getSourceOrdinal() < currentValue.getSourceOrdinal()) {
mismatches.add(
Expand Down