Skip to content

Commit 58f4219

Browse files
committed
api; register as integration and package
1 parent 9b9b025 commit 58f4219

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
public final class io/sentry/openfeature/BuildConfig {
2+
public static final field SENTRY_OPENFEATURE_SDK_NAME Ljava/lang/String;
3+
public static final field VERSION_NAME Ljava/lang/String;
4+
}
5+
6+
public final class io/sentry/openfeature/SentryOpenFeatureHook : dev/openfeature/sdk/BooleanHook {
7+
public fun <init> ()V
8+
public fun after (Ldev/openfeature/sdk/HookContext;Ldev/openfeature/sdk/FlagEvaluationDetails;Ljava/util/Map;)V
9+
}
10+

sentry-openfeature/src/main/java/io/sentry/openfeature/SentryOpenFeatureHook.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
package io.sentry.openfeature;
22

3+
import static io.sentry.util.IntegrationUtils.addIntegrationToSdkVersion;
4+
35
import dev.openfeature.sdk.BooleanHook;
46
import dev.openfeature.sdk.FlagEvaluationDetails;
57
import dev.openfeature.sdk.FlagValueType;
68
import dev.openfeature.sdk.HookContext;
79
import io.sentry.IScopes;
810
import io.sentry.ScopesAdapter;
11+
import io.sentry.SentryIntegrationPackageStorage;
912
import io.sentry.SentryLevel;
1013
import java.util.Map;
1114
import java.util.Objects;
@@ -16,8 +19,18 @@
1619
public final class SentryOpenFeatureHook implements BooleanHook {
1720
private final IScopes scopes;
1821

22+
static {
23+
SentryIntegrationPackageStorage.getInstance()
24+
.addPackage("maven:io.sentry:sentry-openfeature", BuildConfig.VERSION_NAME);
25+
}
26+
1927
public SentryOpenFeatureHook() {
2028
this(ScopesAdapter.getInstance());
29+
addPackageAndIntegrationInfo();
30+
}
31+
32+
private void addPackageAndIntegrationInfo() {
33+
addIntegrationToSdkVersion("OpenFeature");
2134
}
2235

2336
@VisibleForTesting

sentry-system-test-support/api/sentry-system-test-support.api

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,19 @@ public final class io/sentry/systemtest/util/EnvelopesReceived {
516516
public fun toString ()Ljava/lang/String;
517517
}
518518

519+
public final class io/sentry/systemtest/util/FeatureFlagResponse {
520+
public fun <init> (Ljava/lang/String;Z)V
521+
public final fun component1 ()Ljava/lang/String;
522+
public final fun component2 ()Z
523+
public final fun copy (Ljava/lang/String;Z)Lio/sentry/systemtest/util/FeatureFlagResponse;
524+
public static synthetic fun copy$default (Lio/sentry/systemtest/util/FeatureFlagResponse;Ljava/lang/String;ZILjava/lang/Object;)Lio/sentry/systemtest/util/FeatureFlagResponse;
525+
public fun equals (Ljava/lang/Object;)Z
526+
public final fun getFlagKey ()Ljava/lang/String;
527+
public final fun getValue ()Z
528+
public fun hashCode ()I
529+
public fun toString ()Ljava/lang/String;
530+
}
531+
519532
public class io/sentry/systemtest/util/LoggingInsecureRestClient {
520533
public fun <init> ()V
521534
protected final fun call (Lokhttp3/Request$Builder;ZLjava/util/Map;)Lokhttp3/Response;
@@ -530,10 +543,12 @@ public class io/sentry/systemtest/util/LoggingInsecureRestClient {
530543

531544
public final class io/sentry/systemtest/util/RestTestClient : io/sentry/systemtest/util/LoggingInsecureRestClient {
532545
public fun <init> (Ljava/lang/String;)V
546+
public final fun checkFeatureFlag (Ljava/lang/String;)Lio/sentry/systemtest/util/FeatureFlagResponse;
533547
public final fun createPerson (Lio/sentry/systemtest/Person;Ljava/util/Map;)Lio/sentry/systemtest/Person;
534548
public static synthetic fun createPerson$default (Lio/sentry/systemtest/util/RestTestClient;Lio/sentry/systemtest/Person;Ljava/util/Map;ILjava/lang/Object;)Lio/sentry/systemtest/Person;
535549
public final fun createPersonDistributedTracing (Lio/sentry/systemtest/Person;Ljava/util/Map;)Lio/sentry/systemtest/Person;
536550
public static synthetic fun createPersonDistributedTracing$default (Lio/sentry/systemtest/util/RestTestClient;Lio/sentry/systemtest/Person;Ljava/util/Map;ILjava/lang/Object;)Lio/sentry/systemtest/Person;
551+
public final fun errorWithFeatureFlag (Ljava/lang/String;)Ljava/lang/String;
537552
public final fun getPerson (J)Lio/sentry/systemtest/Person;
538553
public final fun getPersonDistributedTracing (JLjava/util/Map;)Lio/sentry/systemtest/Person;
539554
public static synthetic fun getPersonDistributedTracing$default (Lio/sentry/systemtest/util/RestTestClient;JLjava/util/Map;ILjava/lang/Object;)Lio/sentry/systemtest/Person;

0 commit comments

Comments
 (0)