File tree 17 files changed +788
-0
lines changed
.github/.github/workflows
main/java/dev/openfeature/contrib/providers/flagd
test/java/dev/openfeature/contrib/providers/flagd
main/java/dev/openfeature/contrib/hooks/otel
test/java/dev/openfeature/contrib/hooks/otel
17 files changed +788
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : CI
2
+ on :
3
+ pull_request :
4
+ branches : ["main"]
5
+
6
+ jobs :
7
+ main :
8
+ runs-on : ubuntu-latest
9
+ steps :
10
+ - uses : actions/checkout@v2
11
+ # publish with SNAPSHOT version modifier from pom
12
+ run : mvn --no-transfer-progress --batch-mode --settings release/m2-settings.xml verify deploy
Original file line number Diff line number Diff line change
1
+ name : ' Lint PR'
2
+
3
+ on :
4
+ pull_request_target :
5
+ types :
6
+ - opened
7
+ - edited
8
+ - synchronize
9
+
10
+ jobs :
11
+ main :
12
+ name : Validate PR title
13
+ runs-on : ubuntu-latest
14
+ steps :
15
+ - uses : amannn/action-semantic-pull-request@v4
16
+ env :
17
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
1
+ on :
2
+ push :
3
+ branches :
4
+ - main
5
+ name : Run Release Please
6
+ jobs :
7
+ release-please :
8
+ runs-on : ubuntu-latest
9
+
10
+ # Release-please creates a PR that tracks all changes
11
+ steps :
12
+ - uses : google-github-actions/release-please-action@v3
13
+ id : release
14
+ with :
15
+ command : manifest
16
+ token : ${{secrets.GITHUB_TOKEN}}
17
+ default-branch : main
18
+
19
+ # The logic below handles the maven publication:
20
+ - name : Checkout Repository
21
+ if : ${{ steps.release.outputs.releases_created }}
22
+ uses : actions/checkout@v3
23
+
24
+ - name : Configure GPG Key
25
+ run : |
26
+ echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
27
+ env :
28
+ GPG_SIGNING_KEY : ${{ secrets.GPG_SIGNING_KEY }}
29
+
30
+ # Release Please has already incremented versions and published tags, so we just need to publish.
31
+ # Our maven config will only publish versions that do not already exist.
32
+ - name : Publish
33
+ if : ${{ steps.release.outputs.releases_created }}
34
+ run : |
35
+ mvn --no-transfer-progress --batch-mode --settings release/m2-settings.xml verify deploy -Dversion.modifier=''
Original file line number Diff line number Diff line change
1
+ # Ignore Gradle project-specific cache directory
2
+ .gradle
3
+
4
+ # Ignore Gradle build output directory
5
+ build
6
+ .idea
7
+ specification.json
8
+ target
9
+ .DS_Store
10
+
11
+ # vscode stuff
12
+ .vscode /
Original file line number Diff line number Diff line change
1
+ {}
Original file line number Diff line number Diff line change 1
1
# java-sdk-contrib
2
+
2
3
Java SDK contrib
4
+
5
+ To publish:
6
+ ` mvn --no-transfer-progress --batch-mode --settings release/m2-settings.xml verify deploy -Dversion.modifier='' `
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <project xmlns =" http://maven.apache.org/POM/4.0.0" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" >
3
+ <modelVersion >4.0.0</modelVersion >
4
+ <parent >
5
+ <groupId >dev.openfeature.contrib</groupId >
6
+ <artifactId >java-sdk-contrib</artifactId >
7
+ <version >0.0.0</version >
8
+ <relativePath >../pom.xml</relativePath >
9
+ </parent >
10
+ <groupId >dev.openfeature.providers</groupId >
11
+ <artifactId >flagd</artifactId >
12
+ <version >0.0.1${version.modifier} </version >
13
+ <name >flagd</name >
14
+ <description >FlagD provider for Java</description >
15
+
16
+ <properties >
17
+ <!-- override no-deploy rule from parent -->
18
+ <maven .deploy.skip>false</maven .deploy.skip>
19
+ </properties >
20
+
21
+ <dependencies >
22
+ <!-- we inherent dev.openfeature.javasdk and the test dependencies from the parent pom -->
23
+ </dependencies >
24
+
25
+ </project >
Original file line number Diff line number Diff line change
1
+ package dev .openfeature .contrib .providers .flagd ;
2
+
3
+ import dev .openfeature .javasdk .Client ;
4
+ import dev .openfeature .javasdk .NoOpProvider ;
5
+ import dev .openfeature .javasdk .OpenFeatureAPI ;
6
+
7
+ class FlagdProvider {
8
+
9
+ public static boolean test () {
10
+ OpenFeatureAPI .getInstance ().setProvider (new NoOpProvider ());
11
+ Client client = OpenFeatureAPI .getInstance ().getClient ();
12
+ return client .getBooleanValue ("test" , true );
13
+ }
14
+
15
+ }
Original file line number Diff line number Diff line change
1
+ package dev .openfeature .contrib .providers .flagd ;
2
+
3
+ import static org .assertj .core .api .Assertions .assertThat ;
4
+
5
+ import org .junit .jupiter .api .DisplayName ;
6
+ import org .junit .jupiter .api .Test ;
7
+
8
+ class FlagdProviderTest {
9
+
10
+ @ Test
11
+ @ DisplayName ("a simple test" )
12
+ void test () {
13
+ assertThat (FlagdProvider .test ()).isEqualTo (true );
14
+ }
15
+ }
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <project xmlns =" http://maven.apache.org/POM/4.0.0" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" >
3
+ <modelVersion >4.0.0</modelVersion >
4
+ <parent >
5
+ <groupId >dev.openfeature.contrib</groupId >
6
+ <artifactId >java-sdk-contrib</artifactId >
7
+ <version >0.0.0</version >
8
+ <relativePath >../pom.xml</relativePath >
9
+ </parent >
10
+ <groupId >dev.openfeature.hooks</groupId >
11
+ <artifactId >otel</artifactId >
12
+ <version >0.0.1${version.modifier} </version >
13
+ <name >open-telemetry-hook</name >
14
+ <description >Open Telemetry Hook</description >
15
+
16
+ <properties >
17
+ <!-- override no-deploy rule from parent -->
18
+ <maven .deploy.skip>false</maven .deploy.skip>
19
+ </properties >
20
+
21
+ <dependencies >
22
+ <!-- we inherent dev.openfeature.javasdk and the test dependencies from the parent pom -->
23
+ </dependencies >
24
+
25
+ </project >
Original file line number Diff line number Diff line change
1
+ package dev .openfeature .contrib .hooks .otel ;
2
+
3
+ import dev .openfeature .javasdk .Client ;
4
+ import dev .openfeature .javasdk .NoOpProvider ;
5
+ import dev .openfeature .javasdk .OpenFeatureAPI ;
6
+
7
+ class OpenTelemetryHook {
8
+
9
+ public static boolean test () {
10
+ OpenFeatureAPI .getInstance ().setProvider (new NoOpProvider ());
11
+ Client client = OpenFeatureAPI .getInstance ().getClient ();
12
+ return client .getBooleanValue ("test" , true );
13
+ }
14
+
15
+ }
Original file line number Diff line number Diff line change
1
+ package dev .openfeature .contrib .hooks .otel ;
2
+
3
+ import static org .assertj .core .api .Assertions .assertThat ;
4
+
5
+ import org .junit .jupiter .api .DisplayName ;
6
+ import org .junit .jupiter .api .Test ;
7
+
8
+ class OpenTelemetryHookTest {
9
+
10
+ @ Test
11
+ @ DisplayName ("a simple test" )
12
+ void test () {
13
+ assertThat (OpenTelemetryHook .test ()).isEqualTo (true );
14
+ }
15
+ }
You can’t perform that action at this time.
0 commit comments