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

Replace usage of deprecated ConfigProperties with ConfigMapping #1814

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
<openapi.version>2.0</openapi.version>
<prometheus.version>0.9.0</prometheus.version>
<protobuf.version>3.17.3</protobuf.version>
<quarkus.version>2.1.3.Final</quarkus.version>
<quarkus.version>2.2.0.CR1</quarkus.version>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2.2.0.Final should be released today, so we/dependabot can switch to that new version then

<reactor.version>2020.0.10</reactor.version>
<scala2.12.version>2.12.13</scala2.12.version>
<scala2.13.version>2.13.6</scala2.13.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,24 @@
*/
package org.projectnessie.server.config;

import io.quarkus.arc.config.ConfigProperties;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;
import io.smallrye.config.WithName;
import org.projectnessie.versioned.dynamodb.DynamoStoreConfig;

/** DynamoDB version store configuration. */
@ConfigProperties(prefix = "nessie.version.store.dynamo")
@ConfigMapping(prefix = "nessie.version.store.dynamo")
public interface DynamoVersionStoreConfig {

@ConfigProperty(name = "initialize", defaultValue = "false")
@WithName("initialize")
@WithDefault("false")
boolean isDynamoInitialize();

@ConfigProperty(defaultValue = DynamoStoreConfig.TABLE_PREFIX)
@WithName("table-prefix")
@WithDefault(DynamoStoreConfig.TABLE_PREFIX)
String getTablePrefix();

@ConfigProperty(name = "tracing", defaultValue = "true")
@WithName("tracing")
@WithDefault("true")
boolean enableTracing();
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,25 @@
*/
package org.projectnessie.server.config;

import io.quarkus.arc.config.ConfigProperties;
import io.quarkus.runtime.annotations.RegisterForReflection;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;
import io.smallrye.config.WithName;
import java.util.Optional;
import org.eclipse.microprofile.config.inject.ConfigProperty;

/** JGit version store configuration. */
@ConfigProperties(prefix = "nessie.version.store.jgit")
@ConfigMapping(prefix = "nessie.version.store.jgit")
public interface JGitVersionStoreConfig {
@RegisterForReflection
public enum JGitStoreType {
DISK,
INMEMORY
}

@ConfigProperty(name = "type", defaultValue = "INMEMORY")
@WithName("type")
@WithDefault("INMEMORY")
JGitStoreType getJgitStoreType();

@ConfigProperty(name = "directory")
@WithName("directory")
Optional<String> getJgitDirectory();
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,22 @@
*/
package org.projectnessie.server.config;

import io.quarkus.arc.config.ConfigProperties;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;
import io.smallrye.config.WithName;
import org.projectnessie.services.config.ServerConfig;

/** Nessie server config for Quarkus. */
@ConfigProperties(prefix = "nessie.server")
@ConfigMapping(prefix = "nessie.server")
public interface QuarkusServerConfig extends ServerConfig {

@ConfigProperty(name = "default-branch", defaultValue = "main")
@Override
@WithName("default-branch")
@WithDefault("main")
String getDefaultBranch();

@ConfigProperty(name = "send-stacktrace-to-client", defaultValue = "false")
@Override
@WithName("send-stacktrace-to-client")
@WithDefault("false")
boolean sendStacktraceToClient();
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
*/
package org.projectnessie.server.config;

import io.quarkus.arc.config.ConfigProperties;
import io.quarkus.runtime.annotations.RegisterForReflection;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;
import io.smallrye.config.WithName;

/** Version store configuration. */
@ConfigProperties(prefix = "nessie.version.store")
@ConfigMapping(prefix = "nessie.version.store")
public interface VersionStoreConfig {

@RegisterForReflection
Expand All @@ -30,17 +31,20 @@ public enum VersionStoreType {
JGIT
}

@ConfigProperty(name = "type", defaultValue = "INMEMORY")
@WithName("type")
@WithDefault("INMEMORY")
VersionStoreType getVersionStoreType();

/**
* Whether calls against the version-store are traced with OpenTracing/OpenTelemetry (Jaeger),
* enabled by default.
*/
@ConfigProperty(name = "trace.enable", defaultValue = "true")
@WithName("trace.enable")
@WithDefault("true")
boolean isTracingEnabled();

/** Whether metrics for the version-store are enabled (enabled by default). */
@ConfigProperty(name = "metrics.enable", defaultValue = "true")
@WithName("metrics.enable")
@WithDefault("true")
boolean isMetricsEnabled();
}