fix: don't treat quarkus property changes as hard errors (#39459)

closes: #39450

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
This commit is contained in:
Steven Hawkins 2025-05-05 12:03:53 -04:00 committed by GitHub
parent d106de4f83
commit 071accefe2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 25 additions and 1 deletions

View File

@ -357,7 +357,9 @@ public class Picocli {
throw new PropertyException("A provider JAR was updated since the last build, please rebuild for this to be fully utilized.");
}
} else if (newValue != null && !isIgnoredPersistedOption(key)
&& isUserModifiable(Configuration.getConfigValue(key))) {
&& isUserModifiable(Configuration.getConfigValue(key))
// let quarkus handle this - it's unsupported for direct usage in keycloak
&& !key.startsWith(MicroProfileConfigProvider.NS_QUARKUS_PREFIX)) {
ignoredBuildTime.add(key);
}
});

View File

@ -26,13 +26,18 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.stream.Stream;
import org.apache.commons.io.FileUtils;
import org.junit.Ignore;
import org.junit.Test;
import org.keycloak.config.LoggingOptions;
@ -684,6 +689,23 @@ public class PicocliTest extends AbstractConfigurationTest {
assertFalse(Picocli.timestampChanged("12345", "12000"));
}
@Test
public void quarkusRuntimeChangeNoError() throws IOException {
Path conf = Paths.get("src/test/resources/");
Path tmp = Paths.get("target/home-tmp");
FileUtils.copyDirectory(conf.toFile(), tmp.toFile());
Files.delete(tmp.resolve("conf/quarkus.properties"));
Environment.setHomeDir(tmp);
try {
build("build", "--db=dev-file");
} finally {
Environment.setHomeDir(conf);
}
var nonRunningPicocli = pseudoLaunch("start", "--optimized", "--http-enabled=true", "--hostname=foo");
assertEquals(CommandLine.ExitCode.OK, nonRunningPicocli.exitCode);
}
protected void assertLogAsyncHandlerInvalidValues(LoggingOptions.Handler handler) {
var handlerName = handler.toString();