From 5097d7ca0ffb9b3df22c89ec62b98235708bdb8c Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Sat, 4 May 2024 04:33:42 +0000
Subject: [PATCH 01/70] chore(deps): update dependency
com.github.spotbugs:spotbugs to v4.8.5 (#922)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index b6fef55e..50d2742e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -53,7 +53,7 @@
com.github.spotbugs
spotbugs
- 4.8.4
+ 4.8.5
provided
@@ -365,7 +365,7 @@
com.github.spotbugs
spotbugs
- 4.8.4
+ 4.8.5
From 3dfbfac2684d5ae4633e8e3584aba728b0ce7827 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Sun, 5 May 2024 21:37:18 +0000
Subject: [PATCH 02/70] chore(deps): update dependency
com.github.spotbugs:spotbugs-maven-plugin to v4.8.5.0 (#924)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 50d2742e..e008548d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -349,7 +349,7 @@
com.github.spotbugs
spotbugs-maven-plugin
- 4.8.4.0
+ 4.8.5.0
spotbugs-exclusions.xml
From 81cba711905dcd06f324cd6a445d455cd9e601ad Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Mon, 6 May 2024 22:00:16 +0000
Subject: [PATCH 03/70] chore(deps): update github/codeql-action digest to
1e21373 (#925)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/pullrequest.yml | 4 ++--
.github/workflows/static-code-scanning.yaml | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index 5825acba..a0ca5a57 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -20,7 +20,7 @@ jobs:
cache: maven
- name: Initialize CodeQL
- uses: github/codeql-action/init@84d6ead480f493c32a39f012db4b9dfb02e8868b
+ uses: github/codeql-action/init@1e21373a75e0c2ecdf26721d40f68b3bff7f2165
with:
languages: java
@@ -45,4 +45,4 @@ jobs:
verbose: true # optional (default = false)
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@84d6ead480f493c32a39f012db4b9dfb02e8868b
+ uses: github/codeql-action/analyze@1e21373a75e0c2ecdf26721d40f68b3bff7f2165
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index 397d5144..7912a04b 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -33,12 +33,12 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@84d6ead480f493c32a39f012db4b9dfb02e8868b
+ uses: github/codeql-action/init@1e21373a75e0c2ecdf26721d40f68b3bff7f2165
with:
languages: java
- name: Autobuild
- uses: github/codeql-action/autobuild@84d6ead480f493c32a39f012db4b9dfb02e8868b
+ uses: github/codeql-action/autobuild@1e21373a75e0c2ecdf26721d40f68b3bff7f2165
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@84d6ead480f493c32a39f012db4b9dfb02e8868b
+ uses: github/codeql-action/analyze@1e21373a75e0c2ecdf26721d40f68b3bff7f2165
From 23c01b9fa34b80d1667cbbfd07c1b0e496b1071c Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Tue, 7 May 2024 13:31:21 +0000
Subject: [PATCH 04/70] chore(deps): update github/codeql-action digest to
4b812a5 (#926)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/pullrequest.yml | 4 ++--
.github/workflows/static-code-scanning.yaml | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index a0ca5a57..34cd0fd9 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -20,7 +20,7 @@ jobs:
cache: maven
- name: Initialize CodeQL
- uses: github/codeql-action/init@1e21373a75e0c2ecdf26721d40f68b3bff7f2165
+ uses: github/codeql-action/init@4b812a5dfff9268e215e9aaccfc6dbaed72a8a95
with:
languages: java
@@ -45,4 +45,4 @@ jobs:
verbose: true # optional (default = false)
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@1e21373a75e0c2ecdf26721d40f68b3bff7f2165
+ uses: github/codeql-action/analyze@4b812a5dfff9268e215e9aaccfc6dbaed72a8a95
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index 7912a04b..a18330a6 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -33,12 +33,12 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@1e21373a75e0c2ecdf26721d40f68b3bff7f2165
+ uses: github/codeql-action/init@4b812a5dfff9268e215e9aaccfc6dbaed72a8a95
with:
languages: java
- name: Autobuild
- uses: github/codeql-action/autobuild@1e21373a75e0c2ecdf26721d40f68b3bff7f2165
+ uses: github/codeql-action/autobuild@4b812a5dfff9268e215e9aaccfc6dbaed72a8a95
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@1e21373a75e0c2ecdf26721d40f68b3bff7f2165
+ uses: github/codeql-action/analyze@4b812a5dfff9268e215e9aaccfc6dbaed72a8a95
From 0e3c10fd741c3b808efec906e55f8aab52deb846 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Wed, 8 May 2024 23:32:22 +0000
Subject: [PATCH 05/70] chore(deps): update github/codeql-action digest to
7d9b7a1 (#927)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/pullrequest.yml | 4 ++--
.github/workflows/static-code-scanning.yaml | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index 34cd0fd9..ef727bbc 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -20,7 +20,7 @@ jobs:
cache: maven
- name: Initialize CodeQL
- uses: github/codeql-action/init@4b812a5dfff9268e215e9aaccfc6dbaed72a8a95
+ uses: github/codeql-action/init@7d9b7a187060ed04a98f18d26f24c03618f4e4eb
with:
languages: java
@@ -45,4 +45,4 @@ jobs:
verbose: true # optional (default = false)
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@4b812a5dfff9268e215e9aaccfc6dbaed72a8a95
+ uses: github/codeql-action/analyze@7d9b7a187060ed04a98f18d26f24c03618f4e4eb
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index a18330a6..1a983689 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -33,12 +33,12 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@4b812a5dfff9268e215e9aaccfc6dbaed72a8a95
+ uses: github/codeql-action/init@7d9b7a187060ed04a98f18d26f24c03618f4e4eb
with:
languages: java
- name: Autobuild
- uses: github/codeql-action/autobuild@4b812a5dfff9268e215e9aaccfc6dbaed72a8a95
+ uses: github/codeql-action/autobuild@7d9b7a187060ed04a98f18d26f24c03618f4e4eb
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@4b812a5dfff9268e215e9aaccfc6dbaed72a8a95
+ uses: github/codeql-action/analyze@7d9b7a187060ed04a98f18d26f24c03618f4e4eb
From 0c540f1f39f1b3e9576f0ff3f35dd774a257f1bd Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Thu, 9 May 2024 20:12:09 +0000
Subject: [PATCH 06/70] chore(deps): update github/codeql-action digest to
def4d2c (#929)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/pullrequest.yml | 4 ++--
.github/workflows/static-code-scanning.yaml | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index ef727bbc..624e2047 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -20,7 +20,7 @@ jobs:
cache: maven
- name: Initialize CodeQL
- uses: github/codeql-action/init@7d9b7a187060ed04a98f18d26f24c03618f4e4eb
+ uses: github/codeql-action/init@def4d2cd4e90baac0e70f826be49b93faf6505c5
with:
languages: java
@@ -45,4 +45,4 @@ jobs:
verbose: true # optional (default = false)
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@7d9b7a187060ed04a98f18d26f24c03618f4e4eb
+ uses: github/codeql-action/analyze@def4d2cd4e90baac0e70f826be49b93faf6505c5
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index 1a983689..f7ca4b2c 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -33,12 +33,12 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@7d9b7a187060ed04a98f18d26f24c03618f4e4eb
+ uses: github/codeql-action/init@def4d2cd4e90baac0e70f826be49b93faf6505c5
with:
languages: java
- name: Autobuild
- uses: github/codeql-action/autobuild@7d9b7a187060ed04a98f18d26f24c03618f4e4eb
+ uses: github/codeql-action/autobuild@def4d2cd4e90baac0e70f826be49b93faf6505c5
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@7d9b7a187060ed04a98f18d26f24c03618f4e4eb
+ uses: github/codeql-action/analyze@def4d2cd4e90baac0e70f826be49b93faf6505c5
From 09c9a5c254099f5e5b58746d2a1eed0b6191dc37 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Fri, 10 May 2024 14:11:12 +0000
Subject: [PATCH 07/70] chore(deps): update github/codeql-action digest to
4995c49 (#930)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/pullrequest.yml | 4 ++--
.github/workflows/static-code-scanning.yaml | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index 624e2047..a7a5f9e6 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -20,7 +20,7 @@ jobs:
cache: maven
- name: Initialize CodeQL
- uses: github/codeql-action/init@def4d2cd4e90baac0e70f826be49b93faf6505c5
+ uses: github/codeql-action/init@4995c490108b05623201cf5feaa9846ba80a7137
with:
languages: java
@@ -45,4 +45,4 @@ jobs:
verbose: true # optional (default = false)
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@def4d2cd4e90baac0e70f826be49b93faf6505c5
+ uses: github/codeql-action/analyze@4995c490108b05623201cf5feaa9846ba80a7137
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index f7ca4b2c..cb2cc2d4 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -33,12 +33,12 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@def4d2cd4e90baac0e70f826be49b93faf6505c5
+ uses: github/codeql-action/init@4995c490108b05623201cf5feaa9846ba80a7137
with:
languages: java
- name: Autobuild
- uses: github/codeql-action/autobuild@def4d2cd4e90baac0e70f826be49b93faf6505c5
+ uses: github/codeql-action/autobuild@4995c490108b05623201cf5feaa9846ba80a7137
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@def4d2cd4e90baac0e70f826be49b93faf6505c5
+ uses: github/codeql-action/analyze@4995c490108b05623201cf5feaa9846ba80a7137
From 29e6a90b102830c5112c079b4803c191dba1c232 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Fri, 10 May 2024 22:05:12 +0000
Subject: [PATCH 08/70] chore(deps): update github/codeql-action digest to
4a51972 (#931)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/pullrequest.yml | 4 ++--
.github/workflows/static-code-scanning.yaml | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index a7a5f9e6..dc8a5e9d 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -20,7 +20,7 @@ jobs:
cache: maven
- name: Initialize CodeQL
- uses: github/codeql-action/init@4995c490108b05623201cf5feaa9846ba80a7137
+ uses: github/codeql-action/init@4a519724772e4811655b89999b87e0e6caf6b798
with:
languages: java
@@ -45,4 +45,4 @@ jobs:
verbose: true # optional (default = false)
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@4995c490108b05623201cf5feaa9846ba80a7137
+ uses: github/codeql-action/analyze@4a519724772e4811655b89999b87e0e6caf6b798
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index cb2cc2d4..de2dc16b 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -33,12 +33,12 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@4995c490108b05623201cf5feaa9846ba80a7137
+ uses: github/codeql-action/init@4a519724772e4811655b89999b87e0e6caf6b798
with:
languages: java
- name: Autobuild
- uses: github/codeql-action/autobuild@4995c490108b05623201cf5feaa9846ba80a7137
+ uses: github/codeql-action/autobuild@4a519724772e4811655b89999b87e0e6caf6b798
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@4995c490108b05623201cf5feaa9846ba80a7137
+ uses: github/codeql-action/analyze@4a519724772e4811655b89999b87e0e6caf6b798
From c94a0ba8027c59aeced24af758fdb9eaf874d994 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Mon, 13 May 2024 18:51:03 +0000
Subject: [PATCH 09/70] chore(deps): update github/codeql-action digest to
08487db (#932)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/pullrequest.yml | 4 ++--
.github/workflows/static-code-scanning.yaml | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index dc8a5e9d..4ed23132 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -20,7 +20,7 @@ jobs:
cache: maven
- name: Initialize CodeQL
- uses: github/codeql-action/init@4a519724772e4811655b89999b87e0e6caf6b798
+ uses: github/codeql-action/init@08487dbb935885da4494ab75f3072fa0ebe0853e
with:
languages: java
@@ -45,4 +45,4 @@ jobs:
verbose: true # optional (default = false)
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@4a519724772e4811655b89999b87e0e6caf6b798
+ uses: github/codeql-action/analyze@08487dbb935885da4494ab75f3072fa0ebe0853e
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index de2dc16b..fdfc6fde 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -33,12 +33,12 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@4a519724772e4811655b89999b87e0e6caf6b798
+ uses: github/codeql-action/init@08487dbb935885da4494ab75f3072fa0ebe0853e
with:
languages: java
- name: Autobuild
- uses: github/codeql-action/autobuild@4a519724772e4811655b89999b87e0e6caf6b798
+ uses: github/codeql-action/autobuild@08487dbb935885da4494ab75f3072fa0ebe0853e
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@4a519724772e4811655b89999b87e0e6caf6b798
+ uses: github/codeql-action/analyze@08487dbb935885da4494ab75f3072fa0ebe0853e
From 2334906534d724c5a38df1ac6362759e7dbe1f96 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Tue, 14 May 2024 03:30:33 +0000
Subject: [PATCH 10/70] chore(deps): update
google-github-actions/release-please-action digest to e4dc86b (#933)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/release.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 26c8b868..a17af7c5 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -19,7 +19,7 @@ jobs:
# Release-please creates a PR that tracks all changes
steps:
- - uses: google-github-actions/release-please-action@a37ac6e4f6449ce8b3f7607e4d97d0146028dc0b
+ - uses: google-github-actions/release-please-action@e4dc86ba9405554aeba3c6bb2d169500e7d3b4ee
id: release
with:
token: ${{secrets.GITHUB_TOKEN}}
From 41213c74227b1eedf5e35292eb829b6e6c7b9515 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Tue, 14 May 2024 14:31:55 +0000
Subject: [PATCH 11/70] chore(deps): update github/codeql-action digest to
7fd4900 (#935)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/pullrequest.yml | 4 ++--
.github/workflows/static-code-scanning.yaml | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index 4ed23132..aae50098 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -20,7 +20,7 @@ jobs:
cache: maven
- name: Initialize CodeQL
- uses: github/codeql-action/init@08487dbb935885da4494ab75f3072fa0ebe0853e
+ uses: github/codeql-action/init@7fd4900b29c9865d61ace089788ac5c913cb730b
with:
languages: java
@@ -45,4 +45,4 @@ jobs:
verbose: true # optional (default = false)
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@08487dbb935885da4494ab75f3072fa0ebe0853e
+ uses: github/codeql-action/analyze@7fd4900b29c9865d61ace089788ac5c913cb730b
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index fdfc6fde..ca8252b8 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -33,12 +33,12 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@08487dbb935885da4494ab75f3072fa0ebe0853e
+ uses: github/codeql-action/init@7fd4900b29c9865d61ace089788ac5c913cb730b
with:
languages: java
- name: Autobuild
- uses: github/codeql-action/autobuild@08487dbb935885da4494ab75f3072fa0ebe0853e
+ uses: github/codeql-action/autobuild@7fd4900b29c9865d61ace089788ac5c913cb730b
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@08487dbb935885da4494ab75f3072fa0ebe0853e
+ uses: github/codeql-action/analyze@7fd4900b29c9865d61ace089788ac5c913cb730b
From 0844c8f7420f2674b19c1496e524bd105b98604c Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Tue, 14 May 2024 23:21:47 +0000
Subject: [PATCH 12/70] chore(deps): update codecov/codecov-action action to
v4.4.0 (#937)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/merge.yml | 2 +-
.github/workflows/pullrequest.yml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml
index 538322eb..eb014ff4 100644
--- a/.github/workflows/merge.yml
+++ b/.github/workflows/merge.yml
@@ -49,7 +49,7 @@ jobs:
run: mvn --batch-mode --update-snapshots verify
- name: Upload coverage to Codecov
- uses: codecov/codecov-action@v4.3.1
+ uses: codecov/codecov-action@v4.4.0
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
flags: unittests # optional
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index aae50098..bcc00877 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -36,7 +36,7 @@ jobs:
run: mvn --batch-mode --update-snapshots --activate-profiles e2e verify
- name: Upload coverage to Codecov
- uses: codecov/codecov-action@v4.3.1
+ uses: codecov/codecov-action@v4.4.0
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
flags: unittests # optional
From 1a46aea2422e6841a7909c01b8568450360477d7 Mon Sep 17 00:00:00 2001
From: Dave <89858058+DBlanchard88@users.noreply.github.com>
Date: Wed, 15 May 2024 13:18:33 -0400
Subject: [PATCH 13/70] fix: PMD warnings with new version (#936)
* chore(deps): update dependency org.apache.maven.plugins:maven-pmd-plugin to v3.22.0
* removed redundancy from eventdetails, SuppressWarnings in OpenfeatureAPI and Client
Signed-off-by: DBlanchard88
* Update src/main/java/dev/openfeature/sdk/OpenFeatureClient.java
Signed-off-by: Todd Baert
---------
Signed-off-by: DBlanchard88
Signed-off-by: Todd Baert
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Todd Baert
---
pom.xml | 2 +-
src/main/java/dev/openfeature/sdk/EventDetails.java | 4 ++--
src/main/java/dev/openfeature/sdk/OpenFeatureAPI.java | 1 +
src/main/java/dev/openfeature/sdk/OpenFeatureClient.java | 3 ++-
4 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/pom.xml b/pom.xml
index e008548d..a38e5297 100644
--- a/pom.xml
+++ b/pom.xml
@@ -334,7 +334,7 @@
org.apache.maven.plugins
maven-pmd-plugin
- 3.21.2
+ 3.22.0
run-pmd
diff --git a/src/main/java/dev/openfeature/sdk/EventDetails.java b/src/main/java/dev/openfeature/sdk/EventDetails.java
index 02b1964d..08cb7e21 100644
--- a/src/main/java/dev/openfeature/sdk/EventDetails.java
+++ b/src/main/java/dev/openfeature/sdk/EventDetails.java
@@ -13,14 +13,14 @@ public class EventDetails extends ProviderEventDetails {
private String providerName;
static EventDetails fromProviderEventDetails(ProviderEventDetails providerEventDetails, String providerName) {
- return EventDetails.fromProviderEventDetails(providerEventDetails, providerName, null);
+ return fromProviderEventDetails(providerEventDetails, providerName, null);
}
static EventDetails fromProviderEventDetails(
ProviderEventDetails providerEventDetails,
String providerName,
String clientName) {
- return EventDetails.builder()
+ return builder()
.clientName(clientName)
.providerName(providerName)
.flagsChanged(providerEventDetails.getFlagsChanged())
diff --git a/src/main/java/dev/openfeature/sdk/OpenFeatureAPI.java b/src/main/java/dev/openfeature/sdk/OpenFeatureAPI.java
index db28555a..d159c73d 100644
--- a/src/main/java/dev/openfeature/sdk/OpenFeatureAPI.java
+++ b/src/main/java/dev/openfeature/sdk/OpenFeatureAPI.java
@@ -18,6 +18,7 @@
* Configuration here will be shared across all {@link Client}s.
*/
@Slf4j
+@SuppressWarnings("PMD.UnusedLocalVariable")
public class OpenFeatureAPI implements EventBus {
// package-private multi-read/single-write lock
static AutoCloseableReentrantReadWriteLock lock = new AutoCloseableReentrantReadWriteLock();
diff --git a/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java b/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java
index ce763a34..b03ef6aa 100644
--- a/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java
+++ b/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java
@@ -19,7 +19,8 @@
* {@inheritDoc}
*/
@Slf4j
-@SuppressWarnings({ "PMD.DataflowAnomalyAnalysis", "PMD.BeanMembersShouldSerialize", "unchecked", "rawtypes" })
+@SuppressWarnings({ "PMD.DataflowAnomalyAnalysis", "PMD.BeanMembersShouldSerialize",
+ "PMD.UnusedLocalVariable", "unchecked", "rawtypes" })
public class OpenFeatureClient implements Client {
private final OpenFeatureAPI openfeatureApi;
From 00478ec57b8188a3fefea66640fa7ecf861ce669 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Thu, 16 May 2024 00:27:08 +0000
Subject: [PATCH 14/70] chore(deps): update github/codeql-action digest to
0d9161c (#938)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/pullrequest.yml | 4 ++--
.github/workflows/static-code-scanning.yaml | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index bcc00877..9635c39f 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -20,7 +20,7 @@ jobs:
cache: maven
- name: Initialize CodeQL
- uses: github/codeql-action/init@7fd4900b29c9865d61ace089788ac5c913cb730b
+ uses: github/codeql-action/init@0d9161ca1ca47cada43d1520c3ee53b96d4c31b3
with:
languages: java
@@ -45,4 +45,4 @@ jobs:
verbose: true # optional (default = false)
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@7fd4900b29c9865d61ace089788ac5c913cb730b
+ uses: github/codeql-action/analyze@0d9161ca1ca47cada43d1520c3ee53b96d4c31b3
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index ca8252b8..30676192 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -33,12 +33,12 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@7fd4900b29c9865d61ace089788ac5c913cb730b
+ uses: github/codeql-action/init@0d9161ca1ca47cada43d1520c3ee53b96d4c31b3
with:
languages: java
- name: Autobuild
- uses: github/codeql-action/autobuild@7fd4900b29c9865d61ace089788ac5c913cb730b
+ uses: github/codeql-action/autobuild@0d9161ca1ca47cada43d1520c3ee53b96d4c31b3
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@7fd4900b29c9865d61ace089788ac5c913cb730b
+ uses: github/codeql-action/analyze@0d9161ca1ca47cada43d1520c3ee53b96d4c31b3
From e65b2a0ecbb25c5bcba1006195b34112f2e53808 Mon Sep 17 00:00:00 2001
From: Justin Abrahms
Date: Thu, 16 May 2024 13:44:34 -0700
Subject: [PATCH 15/70] chore: Adding information needed for spec-compliance
tooling (#900)
Signed-off-by: Justin Abrahms
---
.gitignore | 5 ++-
.specrc | 5 +++
spec_finder.py | 111 -------------------------------------------------
3 files changed, 9 insertions(+), 112 deletions(-)
create mode 100644 .specrc
delete mode 100755 spec_finder.py
diff --git a/.gitignore b/.gitignore
index 1d5d37e4..a7575d54 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,4 +9,7 @@ target
.DS_Store
# vscode stuff - we may want to use a more specific pattern later if we'd like to suggest editor configurations
-.vscode/
\ No newline at end of file
+.vscode/
+
+# used for spec compliance tooling
+java-report.json
diff --git a/.specrc b/.specrc
new file mode 100644
index 00000000..4b31b31d
--- /dev/null
+++ b/.specrc
@@ -0,0 +1,5 @@
+[spec]
+file_extension=java
+multiline_regex=@Specification\((?P.*?)\)\s*$
+number_subregex=number\s*=\s*['"](.*?)['"]
+text_subregex=text\s*=\s*['"](.*)['"]
\ No newline at end of file
diff --git a/spec_finder.py b/spec_finder.py
deleted file mode 100755
index 17f8f4bd..00000000
--- a/spec_finder.py
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/usr/bin/env python
-import urllib.request
-import json
-import re
-import difflib
-import os
-import sys
-
-def _demarkdown(t):
- return t.replace('**', '').replace('`', '').replace('"', '')
-
-def get_spec(force_refresh=False):
- spec_path = './specification.json'
- data = ""
- if os.path.exists(spec_path) and not force_refresh:
- with open(spec_path) as f:
- data = ''.join(f.readlines())
- else:
- # TODO: Status code check
- spec_response = urllib.request.urlopen('https://raw.githubusercontent.com/open-feature/spec/main/specification.json')
- raw = []
- for i in spec_response.readlines():
- raw.append(i.decode('utf-8'))
- data = ''.join(raw)
- with open(spec_path, 'w') as f:
- f.write(data)
- return json.loads(data)
-
-
-def main(refresh_spec=False, diff_output=False, limit_numbers=None):
- actual_spec = get_spec(refresh_spec)
-
- spec_map = {}
- for entry in actual_spec['rules']:
- number = re.search('[\d.]+', entry['id']).group()
- if 'requirement' in entry['machine_id']:
- spec_map[number] = _demarkdown(entry['content'])
-
- if len(entry['children']) > 0:
- for ch in entry['children']:
- number = re.search('[\d.]+', ch['id']).group()
- if 'requirement' in ch['machine_id']:
- spec_map[number] = _demarkdown(ch['content'])
-
- java_specs = {}
- missing = set(spec_map.keys())
-
-
- import os
- for root, dirs, files in os.walk(".", topdown=False):
- for name in files:
- F = os.path.join(root, name)
- if '.java' not in name:
- continue
- with open(F) as f:
- data = ''.join(f.readlines())
-
- for match in re.findall('@Specification\((?P.*?)"\)', data.replace('\n', ''), re.MULTILINE | re.DOTALL):
- number = re.findall('number\s*=\s*"(.*?)"', match)[0]
-
- if number in missing:
- missing.remove(number)
- text_with_concat_chars = re.findall('text\s*=\s*(.*)', match)
- try:
- # We have to match for ") to capture text with parens inside, so we add the trailing " back in.
- text = _demarkdown(eval(''.join(text_with_concat_chars) + '"'))
- entry = java_specs[number] = {
- 'number': number,
- 'text': text,
- }
- except:
- print(f"Skipping {match} b/c we couldn't parse it")
-
- bad_num = len(missing)
- for number, entry in java_specs.items():
- if limit_numbers is not None and len(limit_numbers) > 0 and number not in limit_numbers:
- continue
- if number in spec_map:
- txt = entry['text']
- if txt == spec_map[number]:
- # print(f'{number} is good')
- continue
- else:
- print(f"{number} is bad")
- bad_num += 1
- if diff_output:
- print(number + '\n' + '\n'.join([li for li in difflib.ndiff([txt], [spec_map[number]]) if not li.startswith(' ')]))
- continue
-
- print(f"{number} is defined in our tests, but couldn't find it in the spec")
- print("")
-
- if len(missing) > 0:
- print('In the spec, but not in our tests: ')
- for m in missing:
- print(f" {m}: {spec_map[m]}")
-
- sys.exit(bad_num)
-
-
-if __name__ == '__main__':
- import argparse
-
- parser = argparse.ArgumentParser(description='Parse the spec to make sure our tests cover it')
- parser.add_argument('--refresh-spec', action='store_true', help='Re-downloads the spec')
- parser.add_argument('--diff-output', action='store_true', help='print the text differences')
- parser.add_argument('specific_numbers', metavar='num', type=str, nargs='*',
- help='limit this to specific numbers')
-
- args = parser.parse_args()
- main(refresh_spec=args.refresh_spec, diff_output=args.diff_output, limit_numbers=args.specific_numbers)
From 08567f43c85236d32101a608adad1586cb0bd952 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Fri, 17 May 2024 03:09:44 +0000
Subject: [PATCH 16/70] chore(deps): update actions/checkout digest to a5ac7e5
(#941)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/merge.yml | 2 +-
.github/workflows/pullrequest.yml | 2 +-
.github/workflows/release.yml | 2 +-
.github/workflows/static-code-scanning.yaml | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml
index eb014ff4..3e93ee3b 100644
--- a/.github/workflows/merge.yml
+++ b/.github/workflows/merge.yml
@@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
+ - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
- name: Set up JDK 8
uses: actions/setup-java@a1c6c9c8677803c9f4bd31e0f15ac0844258f955
with:
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index 9635c39f..990c6cdd 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the code
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
+ uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
- name: Set up JDK 8
uses: actions/setup-java@a1c6c9c8677803c9f4bd31e0f15ac0844258f955
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index a17af7c5..0b517ef7 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -28,7 +28,7 @@ jobs:
# These steps are only run if this was a merged release-please PR
- name: checkout
if: ${{ steps.release.outputs.release_created }}
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
+ uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
- name: Set up JDK 8
if: ${{ steps.release.outputs.release_created }}
uses: actions/setup-java@a1c6c9c8677803c9f4bd31e0f15ac0844258f955
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index 30676192..af47f0d2 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -29,7 +29,7 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
+ uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
From 1638b8974f4131bd9e2d2328c27419d1406cc444 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Sat, 18 May 2024 03:47:49 +0000
Subject: [PATCH 17/70] chore(deps): update github/codeql-action digest to
63d519c (#943)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/pullrequest.yml | 4 ++--
.github/workflows/static-code-scanning.yaml | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index 990c6cdd..c74dfc24 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -20,7 +20,7 @@ jobs:
cache: maven
- name: Initialize CodeQL
- uses: github/codeql-action/init@0d9161ca1ca47cada43d1520c3ee53b96d4c31b3
+ uses: github/codeql-action/init@63d519c0ae6a4b739e3377a517400c352a7d829b
with:
languages: java
@@ -45,4 +45,4 @@ jobs:
verbose: true # optional (default = false)
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@0d9161ca1ca47cada43d1520c3ee53b96d4c31b3
+ uses: github/codeql-action/analyze@63d519c0ae6a4b739e3377a517400c352a7d829b
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index af47f0d2..1edbfb43 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -33,12 +33,12 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@0d9161ca1ca47cada43d1520c3ee53b96d4c31b3
+ uses: github/codeql-action/init@63d519c0ae6a4b739e3377a517400c352a7d829b
with:
languages: java
- name: Autobuild
- uses: github/codeql-action/autobuild@0d9161ca1ca47cada43d1520c3ee53b96d4c31b3
+ uses: github/codeql-action/autobuild@63d519c0ae6a4b739e3377a517400c352a7d829b
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@0d9161ca1ca47cada43d1520c3ee53b96d4c31b3
+ uses: github/codeql-action/analyze@63d519c0ae6a4b739e3377a517400c352a7d829b
From bdc19b2cc07dfbad1093914933b52d405d9941f7 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Sat, 18 May 2024 09:29:23 +0000
Subject: [PATCH 18/70] fix(deps): update dependency io.cucumber:cucumber-bom
to v7.18.0 (#944)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index a38e5297..b071bb53 100644
--- a/pom.xml
+++ b/pom.xml
@@ -154,7 +154,7 @@
io.cucumber
cucumber-bom
- 7.17.0
+ 7.18.0
pom
import
From 015961b4fcce6ac2f24d17abedc01d1a48cc2672 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Tue, 21 May 2024 19:14:27 +0000
Subject: [PATCH 19/70] chore(deps): update actions/checkout digest to b80ff79
(#945)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/merge.yml | 2 +-
.github/workflows/pullrequest.yml | 2 +-
.github/workflows/release.yml | 2 +-
.github/workflows/static-code-scanning.yaml | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml
index 3e93ee3b..bdafc393 100644
--- a/.github/workflows/merge.yml
+++ b/.github/workflows/merge.yml
@@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
+ - uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62
- name: Set up JDK 8
uses: actions/setup-java@a1c6c9c8677803c9f4bd31e0f15ac0844258f955
with:
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index c74dfc24..989293aa 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the code
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
+ uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62
- name: Set up JDK 8
uses: actions/setup-java@a1c6c9c8677803c9f4bd31e0f15ac0844258f955
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 0b517ef7..2718cdd6 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -28,7 +28,7 @@ jobs:
# These steps are only run if this was a merged release-please PR
- name: checkout
if: ${{ steps.release.outputs.release_created }}
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
+ uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62
- name: Set up JDK 8
if: ${{ steps.release.outputs.release_created }}
uses: actions/setup-java@a1c6c9c8677803c9f4bd31e0f15ac0844258f955
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index 1edbfb43..96c31c20 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -29,7 +29,7 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
+ uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
From bca1f0bab67755236374c1b2afc5149f3a9833db Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Wed, 22 May 2024 04:09:07 +0000
Subject: [PATCH 20/70] chore(deps): update github/codeql-action digest to
b1bd8da (#946)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/pullrequest.yml | 4 ++--
.github/workflows/static-code-scanning.yaml | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index 989293aa..fc0b1cd0 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -20,7 +20,7 @@ jobs:
cache: maven
- name: Initialize CodeQL
- uses: github/codeql-action/init@63d519c0ae6a4b739e3377a517400c352a7d829b
+ uses: github/codeql-action/init@b1bd8da5e77d184fc454458c488c36cce2e52608
with:
languages: java
@@ -45,4 +45,4 @@ jobs:
verbose: true # optional (default = false)
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@63d519c0ae6a4b739e3377a517400c352a7d829b
+ uses: github/codeql-action/analyze@b1bd8da5e77d184fc454458c488c36cce2e52608
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index 96c31c20..6ceb6a25 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -33,12 +33,12 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@63d519c0ae6a4b739e3377a517400c352a7d829b
+ uses: github/codeql-action/init@b1bd8da5e77d184fc454458c488c36cce2e52608
with:
languages: java
- name: Autobuild
- uses: github/codeql-action/autobuild@63d519c0ae6a4b739e3377a517400c352a7d829b
+ uses: github/codeql-action/autobuild@b1bd8da5e77d184fc454458c488c36cce2e52608
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@63d519c0ae6a4b739e3377a517400c352a7d829b
+ uses: github/codeql-action/analyze@b1bd8da5e77d184fc454458c488c36cce2e52608
From be833a07f28bc967c65153787e823cce0adcc92c Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Wed, 22 May 2024 13:00:12 +0000
Subject: [PATCH 21/70] chore(deps): update codecov/codecov-action action to
v4.4.1 (#947)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/merge.yml | 2 +-
.github/workflows/pullrequest.yml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml
index bdafc393..3eae7229 100644
--- a/.github/workflows/merge.yml
+++ b/.github/workflows/merge.yml
@@ -49,7 +49,7 @@ jobs:
run: mvn --batch-mode --update-snapshots verify
- name: Upload coverage to Codecov
- uses: codecov/codecov-action@v4.4.0
+ uses: codecov/codecov-action@v4.4.1
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
flags: unittests # optional
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index fc0b1cd0..b59611d3 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -36,7 +36,7 @@ jobs:
run: mvn --batch-mode --update-snapshots --activate-profiles e2e verify
- name: Upload coverage to Codecov
- uses: codecov/codecov-action@v4.4.0
+ uses: codecov/codecov-action@v4.4.1
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
flags: unittests # optional
From c3c0fd2412504801fd8d976cf16344df98b13688 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Wed, 22 May 2024 15:12:49 +0000
Subject: [PATCH 22/70] chore(deps): update dependency
org.codehaus.mojo:exec-maven-plugin to v3.3.0 (#948)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index b071bb53..7f5cddcb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -501,7 +501,7 @@
org.codehaus.mojo
exec-maven-plugin
- 3.2.0
+ 3.3.0
update-test-harness-submodule
From 0467e999eea6bfe19c0c3bef8d92cf0e1b3a61d6 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Wed, 22 May 2024 22:54:57 +0000
Subject: [PATCH 23/70] chore(deps): update actions/setup-java digest to
2e74cbc (#949)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/merge.yml | 2 +-
.github/workflows/pullrequest.yml | 2 +-
.github/workflows/release.yml | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml
index 3eae7229..3c00c88e 100644
--- a/.github/workflows/merge.yml
+++ b/.github/workflows/merge.yml
@@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62
- name: Set up JDK 8
- uses: actions/setup-java@a1c6c9c8677803c9f4bd31e0f15ac0844258f955
+ uses: actions/setup-java@2e74cbce18569d23ca8b812590dbb83f13ac7c5a
with:
java-version: '8'
distribution: 'temurin'
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index b59611d3..dcf109b6 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -13,7 +13,7 @@ jobs:
uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62
- name: Set up JDK 8
- uses: actions/setup-java@a1c6c9c8677803c9f4bd31e0f15ac0844258f955
+ uses: actions/setup-java@2e74cbce18569d23ca8b812590dbb83f13ac7c5a
with:
java-version: '8'
distribution: 'temurin'
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 2718cdd6..c6ca68c9 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -31,7 +31,7 @@ jobs:
uses: actions/checkout@b80ff79f1755d06ba70441c368a6fe801f5f3a62
- name: Set up JDK 8
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-java@a1c6c9c8677803c9f4bd31e0f15ac0844258f955
+ uses: actions/setup-java@2e74cbce18569d23ca8b812590dbb83f13ac7c5a
with:
java-version: '8'
distribution: 'temurin'
From 767e1ef04a6e1c54ed8d293190f91752ab391546 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Thu, 23 May 2024 01:54:19 +0000
Subject: [PATCH 24/70] chore(deps): update github/codeql-action digest to
acdf238 (#950)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/pullrequest.yml | 4 ++--
.github/workflows/static-code-scanning.yaml | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index dcf109b6..cf8205aa 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -20,7 +20,7 @@ jobs:
cache: maven
- name: Initialize CodeQL
- uses: github/codeql-action/init@b1bd8da5e77d184fc454458c488c36cce2e52608
+ uses: github/codeql-action/init@acdf23828ad6151dd966f467acc7cf231aca129b
with:
languages: java
@@ -45,4 +45,4 @@ jobs:
verbose: true # optional (default = false)
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@b1bd8da5e77d184fc454458c488c36cce2e52608
+ uses: github/codeql-action/analyze@acdf23828ad6151dd966f467acc7cf231aca129b
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index 6ceb6a25..61ac4ae1 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -33,12 +33,12 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@b1bd8da5e77d184fc454458c488c36cce2e52608
+ uses: github/codeql-action/init@acdf23828ad6151dd966f467acc7cf231aca129b
with:
languages: java
- name: Autobuild
- uses: github/codeql-action/autobuild@b1bd8da5e77d184fc454458c488c36cce2e52608
+ uses: github/codeql-action/autobuild@acdf23828ad6151dd966f467acc7cf231aca129b
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@b1bd8da5e77d184fc454458c488c36cce2e52608
+ uses: github/codeql-action/analyze@acdf23828ad6151dd966f467acc7cf231aca129b
From 253f29da2bf858cf31105c2bed5f12b9749e2ba5 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Fri, 24 May 2024 18:22:51 +0000
Subject: [PATCH 25/70] chore(deps): update github/codeql-action digest to
8c4bc43 (#952)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/pullrequest.yml | 4 ++--
.github/workflows/static-code-scanning.yaml | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index cf8205aa..1e5b15e6 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -20,7 +20,7 @@ jobs:
cache: maven
- name: Initialize CodeQL
- uses: github/codeql-action/init@acdf23828ad6151dd966f467acc7cf231aca129b
+ uses: github/codeql-action/init@8c4bc43ead8029384d1969dafa5d7c904d17520f
with:
languages: java
@@ -45,4 +45,4 @@ jobs:
verbose: true # optional (default = false)
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@acdf23828ad6151dd966f467acc7cf231aca129b
+ uses: github/codeql-action/analyze@8c4bc43ead8029384d1969dafa5d7c904d17520f
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index 61ac4ae1..5cc58c5d 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -33,12 +33,12 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@acdf23828ad6151dd966f467acc7cf231aca129b
+ uses: github/codeql-action/init@8c4bc43ead8029384d1969dafa5d7c904d17520f
with:
languages: java
- name: Autobuild
- uses: github/codeql-action/autobuild@acdf23828ad6151dd966f467acc7cf231aca129b
+ uses: github/codeql-action/autobuild@8c4bc43ead8029384d1969dafa5d7c904d17520f
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@acdf23828ad6151dd966f467acc7cf231aca129b
+ uses: github/codeql-action/analyze@8c4bc43ead8029384d1969dafa5d7c904d17520f
From 340dd9c27ce2848e3875327aea4dd9c15fbbb803 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Sun, 26 May 2024 13:04:42 +0000
Subject: [PATCH 26/70] chore(deps): update dependency org.assertj:assertj-core
to v3.26.0 (#953)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 7f5cddcb..060de7c0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -74,7 +74,7 @@
org.assertj
assertj-core
- 3.25.3
+ 3.26.0
test
From 08e170e24a293bb7474efcb4f32d3afda262e764 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Mon, 27 May 2024 19:53:51 +0000
Subject: [PATCH 27/70] chore(deps): update dependency
org.sonatype.plugins:nexus-staging-maven-plugin to v1.6.14 (#954)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 060de7c0..9cdddefa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -424,7 +424,7 @@
org.sonatype.plugins
nexus-staging-maven-plugin
- 1.6.13
+ 1.6.14
true
ossrh
From a84f37562e89b30401b8150b6929181055605392 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Tue, 28 May 2024 14:39:28 +0000
Subject: [PATCH 28/70] chore(deps): update github/codeql-action digest to
7927df0 (#955)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/pullrequest.yml | 4 ++--
.github/workflows/static-code-scanning.yaml | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index 1e5b15e6..05a50f1a 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -20,7 +20,7 @@ jobs:
cache: maven
- name: Initialize CodeQL
- uses: github/codeql-action/init@8c4bc43ead8029384d1969dafa5d7c904d17520f
+ uses: github/codeql-action/init@7927df07e268eafe499c344cd19f8bf82f4f19f7
with:
languages: java
@@ -45,4 +45,4 @@ jobs:
verbose: true # optional (default = false)
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@8c4bc43ead8029384d1969dafa5d7c904d17520f
+ uses: github/codeql-action/analyze@7927df07e268eafe499c344cd19f8bf82f4f19f7
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index 5cc58c5d..690ffd05 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -33,12 +33,12 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@8c4bc43ead8029384d1969dafa5d7c904d17520f
+ uses: github/codeql-action/init@7927df07e268eafe499c344cd19f8bf82f4f19f7
with:
languages: java
- name: Autobuild
- uses: github/codeql-action/autobuild@8c4bc43ead8029384d1969dafa5d7c904d17520f
+ uses: github/codeql-action/autobuild@7927df07e268eafe499c344cd19f8bf82f4f19f7
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@8c4bc43ead8029384d1969dafa5d7c904d17520f
+ uses: github/codeql-action/analyze@7927df07e268eafe499c344cd19f8bf82f4f19f7
From 62bbd571e72d7618fc30fee4f9f4f0a8f2cb70af Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Tue, 28 May 2024 16:46:10 +0000
Subject: [PATCH 29/70] chore(deps): update dependency
org.sonatype.plugins:nexus-staging-maven-plugin to v1.7.0 (#956)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 9cdddefa..e57535a0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -424,7 +424,7 @@
org.sonatype.plugins
nexus-staging-maven-plugin
- 1.6.14
+ 1.7.0
true
ossrh
From 71098a85697eb6bf31d62142cf13da0a8cdb7132 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Tue, 28 May 2024 21:29:17 +0000
Subject: [PATCH 30/70] chore(deps): update github/codeql-action digest to
9550da9 (#957)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/pullrequest.yml | 4 ++--
.github/workflows/static-code-scanning.yaml | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index 05a50f1a..d7364a51 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -20,7 +20,7 @@ jobs:
cache: maven
- name: Initialize CodeQL
- uses: github/codeql-action/init@7927df07e268eafe499c344cd19f8bf82f4f19f7
+ uses: github/codeql-action/init@9550da953dd3b29aedf76cd635101e48eae5eebd
with:
languages: java
@@ -45,4 +45,4 @@ jobs:
verbose: true # optional (default = false)
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@7927df07e268eafe499c344cd19f8bf82f4f19f7
+ uses: github/codeql-action/analyze@9550da953dd3b29aedf76cd635101e48eae5eebd
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index 690ffd05..c9cbb1ec 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -33,12 +33,12 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@7927df07e268eafe499c344cd19f8bf82f4f19f7
+ uses: github/codeql-action/init@9550da953dd3b29aedf76cd635101e48eae5eebd
with:
languages: java
- name: Autobuild
- uses: github/codeql-action/autobuild@7927df07e268eafe499c344cd19f8bf82f4f19f7
+ uses: github/codeql-action/autobuild@9550da953dd3b29aedf76cd635101e48eae5eebd
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@7927df07e268eafe499c344cd19f8bf82f4f19f7
+ uses: github/codeql-action/analyze@9550da953dd3b29aedf76cd635101e48eae5eebd
From 27c9114c589b26d028b5d8b5e2a8e0bc600b79bd Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Wed, 29 May 2024 03:40:16 +0000
Subject: [PATCH 31/70] chore(deps): update github/codeql-action digest to
a095bf2 (#958)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/pullrequest.yml | 4 ++--
.github/workflows/static-code-scanning.yaml | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index d7364a51..3fb0f387 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -20,7 +20,7 @@ jobs:
cache: maven
- name: Initialize CodeQL
- uses: github/codeql-action/init@9550da953dd3b29aedf76cd635101e48eae5eebd
+ uses: github/codeql-action/init@a095bf2a16b83cb3b52e6adba696c70f41e82864
with:
languages: java
@@ -45,4 +45,4 @@ jobs:
verbose: true # optional (default = false)
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@9550da953dd3b29aedf76cd635101e48eae5eebd
+ uses: github/codeql-action/analyze@a095bf2a16b83cb3b52e6adba696c70f41e82864
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index c9cbb1ec..4761358f 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -33,12 +33,12 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@9550da953dd3b29aedf76cd635101e48eae5eebd
+ uses: github/codeql-action/init@a095bf2a16b83cb3b52e6adba696c70f41e82864
with:
languages: java
- name: Autobuild
- uses: github/codeql-action/autobuild@9550da953dd3b29aedf76cd635101e48eae5eebd
+ uses: github/codeql-action/autobuild@a095bf2a16b83cb3b52e6adba696c70f41e82864
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@9550da953dd3b29aedf76cd635101e48eae5eebd
+ uses: github/codeql-action/analyze@a095bf2a16b83cb3b52e6adba696c70f41e82864
From dbfeb72bc5c1cda089384cf15f034c92f9d795c5 Mon Sep 17 00:00:00 2001
From: jarebudev <23311805+jarebudev@users.noreply.github.com>
Date: Thu, 30 May 2024 21:47:23 +0100
Subject: [PATCH 32/70] fix: run error hook when provider returns error code
(#951)
Signed-off-by: jarebudev <23311805+jarebudev@users.noreply.github.com>
---
.../openfeature/sdk/OpenFeatureClient.java | 7 ++-
.../sdk/exceptions/ExceptionUtils.java | 34 ++++++++++++++
.../dev/openfeature/sdk/HookSpecTest.java | 37 +++++++++++++++
.../sdk/exceptions/ExceptionUtilsTest.java | 45 +++++++++++++++++++
4 files changed, 122 insertions(+), 1 deletion(-)
create mode 100644 src/main/java/dev/openfeature/sdk/exceptions/ExceptionUtils.java
create mode 100644 src/test/java/dev/openfeature/sdk/exceptions/ExceptionUtilsTest.java
diff --git a/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java b/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java
index b03ef6aa..452c98d6 100644
--- a/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java
+++ b/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java
@@ -11,6 +11,7 @@
import dev.openfeature.sdk.exceptions.OpenFeatureError;
import dev.openfeature.sdk.internal.AutoCloseableLock;
import dev.openfeature.sdk.internal.AutoCloseableReentrantReadWriteLock;
+import dev.openfeature.sdk.exceptions.ExceptionUtils;
import dev.openfeature.sdk.internal.ObjectUtils;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
@@ -125,7 +126,11 @@ private FlagEvaluationDetails evaluateFlag(FlagValueType type, String key
defaultValue, provider, mergedCtx);
details = FlagEvaluationDetails.from(providerEval, key);
- hookSupport.afterHooks(type, hookCtx, details, mergedHooks, hints);
+ if (details.getErrorCode() != null) {
+ throw ExceptionUtils.instantiateErrorByErrorCode(details.getErrorCode(), details.getErrorMessage());
+ } else {
+ hookSupport.afterHooks(type, hookCtx, details, mergedHooks, hints);
+ }
} catch (Exception e) {
log.error("Unable to correctly evaluate flag with key '{}'", key, e);
if (details == null) {
diff --git a/src/main/java/dev/openfeature/sdk/exceptions/ExceptionUtils.java b/src/main/java/dev/openfeature/sdk/exceptions/ExceptionUtils.java
new file mode 100644
index 00000000..28c7cd71
--- /dev/null
+++ b/src/main/java/dev/openfeature/sdk/exceptions/ExceptionUtils.java
@@ -0,0 +1,34 @@
+package dev.openfeature.sdk.exceptions;
+
+import dev.openfeature.sdk.ErrorCode;
+import lombok.experimental.UtilityClass;
+
+@SuppressWarnings("checkstyle:MissingJavadocType")
+@UtilityClass
+public class ExceptionUtils {
+
+ /**
+ * Creates an Error for the specific error code.
+ * @param errorCode the ErrorCode to use
+ * @param errorMessage the error message to include in the returned error
+ * @return the specific OpenFeatureError for the errorCode
+ */
+ public static OpenFeatureError instantiateErrorByErrorCode(ErrorCode errorCode, String errorMessage) {
+ switch (errorCode) {
+ case FLAG_NOT_FOUND:
+ return new FlagNotFoundError(errorMessage);
+ case PARSE_ERROR:
+ return new ParseError(errorMessage);
+ case TYPE_MISMATCH:
+ return new TypeMismatchError(errorMessage);
+ case TARGETING_KEY_MISSING:
+ return new TargetingKeyMissingError(errorMessage);
+ case INVALID_CONTEXT:
+ return new InvalidContextError(errorMessage);
+ case PROVIDER_NOT_READY:
+ return new ProviderNotReadyError(errorMessage);
+ default:
+ return new GeneralError(errorMessage);
+ }
+ }
+}
diff --git a/src/test/java/dev/openfeature/sdk/HookSpecTest.java b/src/test/java/dev/openfeature/sdk/HookSpecTest.java
index d0e173b2..098d80d7 100644
--- a/src/test/java/dev/openfeature/sdk/HookSpecTest.java
+++ b/src/test/java/dev/openfeature/sdk/HookSpecTest.java
@@ -1,5 +1,6 @@
package dev.openfeature.sdk;
+import dev.openfeature.sdk.exceptions.FlagNotFoundError;
import dev.openfeature.sdk.fixtures.HookFixtures;
import dev.openfeature.sdk.testutils.FeatureProviderTestUtils;
import lombok.SneakyThrows;
@@ -19,12 +20,14 @@
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.fail;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.inOrder;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -180,6 +183,40 @@ void emptyApiHooks() {
verify(h, times(0)).error(any(), any(), any());
}
+
+ @Test void error_hook_must_run_if_resolution_details_returns_an_error_code() {
+
+ String errorMessage = "not found...";
+
+ EvaluationContext invocationCtx = new ImmutableContext();
+ Hook hook = mockBooleanHook();
+ FeatureProvider provider = mock(FeatureProvider.class);
+ when(provider.getBooleanEvaluation(any(), any(), any())).thenReturn(ProviderEvaluation.builder()
+ .errorCode(ErrorCode.FLAG_NOT_FOUND)
+ .errorMessage(errorMessage)
+ .build());
+
+ OpenFeatureAPI api = OpenFeatureAPI.getInstance();
+ FeatureProviderTestUtils.setFeatureProvider(provider);
+ Client client = api.getClient();
+ client.getBooleanValue("key", false, invocationCtx,
+ FlagEvaluationOptions.builder()
+ .hook(hook)
+ .build());
+
+ ArgumentCaptor captor = ArgumentCaptor.forClass(Exception.class);
+
+ verify(hook, times(1)).before(any(), any());
+ verify(hook, times(1)).error(any(), captor.capture(), any());
+ verify(hook, times(1)).finallyAfter(any(), any());
+ verify(hook, never()).after(any(),any(), any());
+
+ Exception exception = captor.getValue();
+ assertEquals(errorMessage, exception.getMessage());
+ assertInstanceOf(FlagNotFoundError.class, exception);
+ }
+
+
@Specification(number="4.3.6", text="The after stage MUST run after flag resolution occurs. It accepts a hook context (required), flag evaluation details (required) and hook hints (optional). It has no return value.")
@Specification(number="4.3.7", text="The error hook MUST run when errors are encountered in the before stage, the after stage or during flag resolution. It accepts hook context (required), exception representing what went wrong (required), and hook hints (optional). It has no return value.")
@Specification(number="4.3.8", text="The finally hook MUST run after the before, after, and error stages. It accepts a hook context (required) and hook hints (optional). There is no return value.")
diff --git a/src/test/java/dev/openfeature/sdk/exceptions/ExceptionUtilsTest.java b/src/test/java/dev/openfeature/sdk/exceptions/ExceptionUtilsTest.java
new file mode 100644
index 00000000..58e59457
--- /dev/null
+++ b/src/test/java/dev/openfeature/sdk/exceptions/ExceptionUtilsTest.java
@@ -0,0 +1,45 @@
+package dev.openfeature.sdk.exceptions;
+
+import dev.openfeature.sdk.ErrorCode;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.ArgumentsProvider;
+import org.junit.jupiter.params.provider.ArgumentsSource;
+
+import java.util.stream.Stream;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+
+class ExceptionUtilsTest {
+
+ @ParameterizedTest
+ @DisplayName("should produce correct exception for a provided ErrorCode")
+ @ArgumentsSource(ErrorCodeTestParameters.class)
+ void shouldProduceCorrectExceptionForErrorCode(ErrorCode errorCode, Class extends OpenFeatureError> exception) {
+
+ String errorMessage = "error message";
+ OpenFeatureError openFeatureError = ExceptionUtils.instantiateErrorByErrorCode(errorCode, errorMessage);
+ assertInstanceOf(exception, openFeatureError);
+ assertThat(openFeatureError.getMessage()).isEqualTo(errorMessage);
+ assertThat(openFeatureError.getErrorCode()).isEqualByComparingTo(errorCode);
+ }
+
+ static class ErrorCodeTestParameters implements ArgumentsProvider {
+
+ @Override
+ public Stream extends Arguments> provideArguments(ExtensionContext context) {
+ return Stream.of(
+ Arguments.of(ErrorCode.GENERAL, GeneralError.class),
+ Arguments.of(ErrorCode.FLAG_NOT_FOUND, FlagNotFoundError.class),
+ Arguments.of(ErrorCode.PROVIDER_NOT_READY, ProviderNotReadyError.class),
+ Arguments.of(ErrorCode.INVALID_CONTEXT, InvalidContextError.class),
+ Arguments.of(ErrorCode.PARSE_ERROR, ParseError.class),
+ Arguments.of(ErrorCode.TARGETING_KEY_MISSING, TargetingKeyMissingError.class),
+ Arguments.of(ErrorCode.TYPE_MISMATCH, TypeMismatchError.class)
+ );
+ }
+ }
+}
From c363bdd1ca3dff452a589ec8cd74295ee44a0834 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Fri, 31 May 2024 15:25:09 +0000
Subject: [PATCH 33/70] chore(deps): update github/codeql-action digest to
add199b (#959)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/pullrequest.yml | 4 ++--
.github/workflows/static-code-scanning.yaml | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index 3fb0f387..4d99f107 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -20,7 +20,7 @@ jobs:
cache: maven
- name: Initialize CodeQL
- uses: github/codeql-action/init@a095bf2a16b83cb3b52e6adba696c70f41e82864
+ uses: github/codeql-action/init@add199be7753abbeb58eee647967afe140edaba1
with:
languages: java
@@ -45,4 +45,4 @@ jobs:
verbose: true # optional (default = false)
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@a095bf2a16b83cb3b52e6adba696c70f41e82864
+ uses: github/codeql-action/analyze@add199be7753abbeb58eee647967afe140edaba1
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index 4761358f..f0406b1a 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -33,12 +33,12 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@a095bf2a16b83cb3b52e6adba696c70f41e82864
+ uses: github/codeql-action/init@add199be7753abbeb58eee647967afe140edaba1
with:
languages: java
- name: Autobuild
- uses: github/codeql-action/autobuild@a095bf2a16b83cb3b52e6adba696c70f41e82864
+ uses: github/codeql-action/autobuild@add199be7753abbeb58eee647967afe140edaba1
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@a095bf2a16b83cb3b52e6adba696c70f41e82864
+ uses: github/codeql-action/analyze@add199be7753abbeb58eee647967afe140edaba1
From 65e2bf3895eb9522390fb41621f8e132a0e51380 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Sat, 1 Jun 2024 01:34:38 +0000
Subject: [PATCH 34/70] chore(deps): update dependency com.google.guava:guava
to v33.2.1-jre (#960)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index e57535a0..6d789121 100644
--- a/pom.xml
+++ b/pom.xml
@@ -135,7 +135,7 @@
com.google.guava
guava
- 33.2.0-jre
+ 33.2.1-jre
test
From 4420bcaaa9c4f0f190796ba1ce61caf07a9515b0 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Sat, 1 Jun 2024 05:18:05 +0000
Subject: [PATCH 35/70] chore(deps): update dependency
org.apache.maven.plugins:maven-javadoc-plugin to v3.7.0 (#961)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 6d789121..bf25c6f8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -452,7 +452,7 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 3.6.3
+ 3.7.0
true
all,-missing
From b3ba6fe5a2994f284724754d5e5c11648463cdf5 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Mon, 3 Jun 2024 21:04:44 +0000
Subject: [PATCH 36/70] chore(deps): update github/codeql-action digest to
9c15e42 (#962)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/pullrequest.yml | 4 ++--
.github/workflows/static-code-scanning.yaml | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index 4d99f107..2ce9d5cd 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -20,7 +20,7 @@ jobs:
cache: maven
- name: Initialize CodeQL
- uses: github/codeql-action/init@add199be7753abbeb58eee647967afe140edaba1
+ uses: github/codeql-action/init@9c15e42f1946cfbe111f73c5ef018c6edc22f693
with:
languages: java
@@ -45,4 +45,4 @@ jobs:
verbose: true # optional (default = false)
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@add199be7753abbeb58eee647967afe140edaba1
+ uses: github/codeql-action/analyze@9c15e42f1946cfbe111f73c5ef018c6edc22f693
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index f0406b1a..2816e301 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -33,12 +33,12 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@add199be7753abbeb58eee647967afe140edaba1
+ uses: github/codeql-action/init@9c15e42f1946cfbe111f73c5ef018c6edc22f693
with:
languages: java
- name: Autobuild
- uses: github/codeql-action/autobuild@add199be7753abbeb58eee647967afe140edaba1
+ uses: github/codeql-action/autobuild@9c15e42f1946cfbe111f73c5ef018c6edc22f693
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@add199be7753abbeb58eee647967afe140edaba1
+ uses: github/codeql-action/analyze@9c15e42f1946cfbe111f73c5ef018c6edc22f693
From 515f38b3c7621ccf6b4dbe78a028e0b354367bc3 Mon Sep 17 00:00:00 2001
From: Michael Beemer
Date: Tue, 4 Jun 2024 14:58:43 -0400
Subject: [PATCH 37/70] docs: remove golang snippet and fix variable name
(#964)
Signed-off-by: Michael Beemer
---
README.md | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index b7fa813a..69deb083 100644
--- a/README.md
+++ b/README.md
@@ -48,7 +48,7 @@
- Java 8+ (compiler target is 1.8)
-Note that this library is intended to be used in server-side contexts and has not been evaluated for use in mobile devices.
+Note that this library is intended to be used in server-side contexts and has not been evaluated for use on mobile devices.
### Install
@@ -282,7 +282,7 @@ To register a `ThreadLocal` context propagator, you can use the `setTransactionC
// registering the ThreadLocalTransactionContextPropagator
OpenFeatureAPI.getInstance().setTransactionContextPropagator(new ThreadLocalTransactionContextPropagator());
```
-Once you've registered a transaction context propagator, you can propagate the data into request scoped transaction context.
+Once you've registered a transaction context propagator, you can propagate the data into request-scoped transaction context.
```java
// adding userId to transaction context
@@ -290,7 +290,7 @@ OpenFeatureAPI api = OpenFeatureAPI.getInstance();
Map transactionAttrs = new HashMap<>();
transactionAttrs.put("userId", new Value("userId"));
EvaluationContext transactionCtx = new ImmutableContext(transactionAttrs);
-api.setTransactionContext(apiCtx);
+api.setTransactionContext(transactionCtx);
```
Additionally, you can develop a custom transaction context propagator by implementing the `TransactionContextPropagator` interface and registering it as shown above.
@@ -390,8 +390,6 @@ class MyEventProvider extends EventProvider {
To develop a hook, you need to create a new project and include the OpenFeature SDK as a dependency.
This can be a new repository or included in [the existing contrib repository](https://github.com/open-feature/java-sdk-contrib) available under the OpenFeature organization.
Implement your own hook by conforming to the `Hook interface`.
-To satisfy the interface, all methods (`Before`/`After`/`Finally`/`Error`) need to be defined.
-To avoid defining empty functions make use of the `UnimplementedHook` struct (which already implements all the empty functions).
```java
class MyHook implements Hook {
@@ -434,7 +432,7 @@ class MyHook implements Hook {
Interested in contributing? Great, we'd love your help! To get started, take a look at the [CONTRIBUTING](CONTRIBUTING.md) guide.
-### Thanks to everyone that has already contributed
+### Thanks to everyone who has already contributed
From 6d6bcd1dea696fc8dac4b9b05426d8fced3ed9da Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Wed, 5 Jun 2024 19:13:15 +0000
Subject: [PATCH 38/70] chore(deps): update dependency
org.apache.maven.plugins:maven-checkstyle-plugin to v3.4.0 (#965)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index bf25c6f8..74d6df84 100644
--- a/pom.xml
+++ b/pom.xml
@@ -382,7 +382,7 @@
org.apache.maven.plugins
maven-checkstyle-plugin
- 3.3.1
+ 3.4.0
checkstyle.xml
UTF-8
From 402cb1bc221b85c447726265f21dd097eddeacca Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Wed, 5 Jun 2024 23:02:04 +0000
Subject: [PATCH 39/70] chore(deps): update github/codeql-action digest to
8f1a6fe (#963)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/pullrequest.yml | 4 ++--
.github/workflows/static-code-scanning.yaml | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index 2ce9d5cd..08b02558 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -20,7 +20,7 @@ jobs:
cache: maven
- name: Initialize CodeQL
- uses: github/codeql-action/init@9c15e42f1946cfbe111f73c5ef018c6edc22f693
+ uses: github/codeql-action/init@8f1a6fed33af5212fab8a999d004627ae8901d1b
with:
languages: java
@@ -45,4 +45,4 @@ jobs:
verbose: true # optional (default = false)
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@9c15e42f1946cfbe111f73c5ef018c6edc22f693
+ uses: github/codeql-action/analyze@8f1a6fed33af5212fab8a999d004627ae8901d1b
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index 2816e301..a04cf33f 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -33,12 +33,12 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@9c15e42f1946cfbe111f73c5ef018c6edc22f693
+ uses: github/codeql-action/init@8f1a6fed33af5212fab8a999d004627ae8901d1b
with:
languages: java
- name: Autobuild
- uses: github/codeql-action/autobuild@9c15e42f1946cfbe111f73c5ef018c6edc22f693
+ uses: github/codeql-action/autobuild@8f1a6fed33af5212fab8a999d004627ae8901d1b
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@9c15e42f1946cfbe111f73c5ef018c6edc22f693
+ uses: github/codeql-action/analyze@8f1a6fed33af5212fab8a999d004627ae8901d1b
From dd33ec82cbd2addc684c42258d44711fa10f0801 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Mon, 10 Jun 2024 19:47:11 +0000
Subject: [PATCH 40/70] chore(deps): update amannn/action-semantic-pull-request
digest to e32d7e6 (#966)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/lint-pr.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml
index e2fe79ce..1ceb951c 100644
--- a/.github/workflows/lint-pr.yml
+++ b/.github/workflows/lint-pr.yml
@@ -18,6 +18,6 @@ jobs:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- - uses: amannn/action-semantic-pull-request@cfb60706e18bc85e8aec535e3c577abe8f70378e
+ - uses: amannn/action-semantic-pull-request@e32d7e603df1aa1ba07e981f2a23455dee596825
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
From 4ea74d8a0acc4fb215dbbb846533f17d4f276404 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Tue, 11 Jun 2024 15:01:04 +0000
Subject: [PATCH 41/70] chore(deps): update github/codeql-action digest to
c796494 (#967)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
.github/workflows/pullrequest.yml | 4 ++--
.github/workflows/static-code-scanning.yaml | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml
index 08b02558..fb3202b2 100644
--- a/.github/workflows/pullrequest.yml
+++ b/.github/workflows/pullrequest.yml
@@ -20,7 +20,7 @@ jobs:
cache: maven
- name: Initialize CodeQL
- uses: github/codeql-action/init@8f1a6fed33af5212fab8a999d004627ae8901d1b
+ uses: github/codeql-action/init@c7964947b4494c64b429a729532a7a070db727c6
with:
languages: java
@@ -45,4 +45,4 @@ jobs:
verbose: true # optional (default = false)
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@8f1a6fed33af5212fab8a999d004627ae8901d1b
+ uses: github/codeql-action/analyze@c7964947b4494c64b429a729532a7a070db727c6
diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml
index a04cf33f..2b4a2441 100644
--- a/.github/workflows/static-code-scanning.yaml
+++ b/.github/workflows/static-code-scanning.yaml
@@ -33,12 +33,12 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@8f1a6fed33af5212fab8a999d004627ae8901d1b
+ uses: github/codeql-action/init@c7964947b4494c64b429a729532a7a070db727c6
with:
languages: java
- name: Autobuild
- uses: github/codeql-action/autobuild@8f1a6fed33af5212fab8a999d004627ae8901d1b
+ uses: github/codeql-action/autobuild@c7964947b4494c64b429a729532a7a070db727c6
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@8f1a6fed33af5212fab8a999d004627ae8901d1b
+ uses: github/codeql-action/analyze@c7964947b4494c64b429a729532a7a070db727c6
From 5c0aaaa8bc939412bf8f6ca21f47cd7a7f504ada Mon Sep 17 00:00:00 2001
From: jarebudev <23311805+jarebudev@users.noreply.github.com>
Date: Tue, 11 Jun 2024 17:49:46 +0100
Subject: [PATCH 42/70] feat: implement domain scoping (#934)
* initial changes for implementing domain scoping
Signed-off-by: jarebudev <23311805+jarebudev@users.noreply.github.com>
* completed the rest of the renaming and tidying up
Signed-off-by: jarebudev <23311805+jarebudev@users.noreply.github.com>
* applied code review suggested changes
Signed-off-by: jarebudev <23311805+jarebudev@users.noreply.github.com>
* introdcue a dedicated interface for client metadata
Signed-off-by: Kavindu Dodanduwa
* add deprecated default getName to be backward compatible as much as possible
Signed-off-by: Kavindu Dodanduwa
---------
Signed-off-by: jarebudev <23311805+jarebudev@users.noreply.github.com>
Signed-off-by: Kavindu Dodanduwa
Co-authored-by: Kavindu Dodanduwa
Co-authored-by: Kavindu Dodanduwa
---
README.md | 24 +++---
src/main/java/dev/openfeature/sdk/Client.java | 2 +-
.../dev/openfeature/sdk/ClientMetadata.java | 14 ++++
.../dev/openfeature/sdk/EventDetails.java | 6 +-
.../dev/openfeature/sdk/EventSupport.java | 35 ++++----
.../java/dev/openfeature/sdk/HookContext.java | 4 +-
.../dev/openfeature/sdk/OpenFeatureAPI.java | 82 +++++++++----------
.../openfeature/sdk/OpenFeatureClient.java | 18 ++--
.../openfeature/sdk/ProviderRepository.java | 30 +++----
.../openfeature/sdk/AlwaysBrokenProvider.java | 7 +-
.../openfeature/sdk/EventProviderTest.java | 9 +-
.../java/dev/openfeature/sdk/EventsTest.java | 46 +++++------
.../sdk/FlagEvaluationSpecTest.java | 21 +++--
.../dev/openfeature/sdk/HookContextTest.java | 5 +-
.../dev/openfeature/sdk/HookSupportTest.java | 1 -
.../sdk/InitializeBehaviorSpecTest.java | 6 +-
.../openfeature/sdk/OpenFeatureAPITest.java | 16 ++--
.../sdk/ProviderRepositoryTest.java | 34 ++++----
.../sdk/ShutdownBehaviorSpecTest.java | 14 ++--
.../testutils/FeatureProviderTestUtils.java | 6 +-
.../sdk/testutils/TestEventsProvider.java | 7 +-
21 files changed, 199 insertions(+), 188 deletions(-)
create mode 100644 src/main/java/dev/openfeature/sdk/ClientMetadata.java
diff --git a/README.md b/README.md
index 69deb083..18106312 100644
--- a/README.md
+++ b/README.md
@@ -126,7 +126,7 @@ See [here](https://javadoc.io/doc/dev.openfeature/sdk/latest/) for the Javadocs.
| โ
| [Targeting](#targeting) | Contextually-aware flag evaluation using [evaluation context](https://openfeature.dev/docs/reference/concepts/evaluation-context). |
| โ
| [Hooks](#hooks) | Add functionality to various stages of the flag evaluation life-cycle. |
| โ
| [Logging](#logging) | Integrate with popular logging packages. |
-| โ
| [Named clients](#named-clients) | Utilize multiple providers in a single application. |
+| โ
| [Domains](#domains) | Logically bind clients with providers. |
| โ
| [Eventing](#eventing) | React to state changes in the provider or flag management system. |
| โ
| [Shutdown](#shutdown) | Gracefully clean up a provider during application shutdown. |
| โ
| [Transaction Context Propagation](#transaction-context-propagation) | Set a specific [evaluation context](https://openfeature.dev/docs/reference/concepts/evaluation-context) for a transaction (e.g. an HTTP request or a thread). |
@@ -160,7 +160,7 @@ To register a provider in a non-blocking manner, you can use the `setProvider` m
```
In some situations, it may be beneficial to register multiple providers in the same application.
-This is possible using [named clients](#named-clients), which is covered in more details below.
+This is possible using [domains](#domains), which is covered in more detail below.
### Targeting
@@ -219,27 +219,27 @@ Once you've added a hook as a dependency, it can be registered at the global, cl
The Java SDK uses SLF4J. See the [SLF4J manual](https://slf4j.org/manual.html) for complete documentation.
-### Named clients
+### Domains
-Clients can be given a name.
-A name is a logical identifier which can be used to associate clients with a particular provider.
-If a name has no associated provider, the global provider is used.
+Clients can be assigned to a domain.
+A domain is a logical identifier which can be used to associate clients with a particular provider.
+If a domain has no associated provider, the global provider is used.
```java
FeatureProvider scopedProvider = new MyProvider();
// registering the default provider
OpenFeatureAPI.getInstance().setProvider(LocalProvider());
-// registering a named provider
-OpenFeatureAPI.getInstance().setProvider("clientForCache", new CachedProvider());
+// registering a provider to a domain
+OpenFeatureAPI.getInstance().setProvider("my-domain", new CachedProvider());
-// a client backed by default provider
+// A client bound to the default provider
Client clientDefault = OpenFeatureAPI.getInstance().getClient();
-// a client backed by CachedProvider
-Client clientNamed = OpenFeatureAPI.getInstance().getClient("clientForCache");
+// A client bound to the CachedProvider provider
+Client domainScopedClient = OpenFeatureAPI.getInstance().getClient("my-domain");
```
-Named providers can be set in a blocking or non-blocking way.
+Providers for domains can be set in a blocking or non-blocking way.
For more details, please refer to the [providers](#providers) section.
### Eventing
diff --git a/src/main/java/dev/openfeature/sdk/Client.java b/src/main/java/dev/openfeature/sdk/Client.java
index 4494180a..2184cdcb 100644
--- a/src/main/java/dev/openfeature/sdk/Client.java
+++ b/src/main/java/dev/openfeature/sdk/Client.java
@@ -6,7 +6,7 @@
* Interface used to resolve flags of varying types.
*/
public interface Client extends Features, EventBus {
- Metadata getMetadata();
+ ClientMetadata getMetadata();
/**
* Return an optional client-level evaluation context.
diff --git a/src/main/java/dev/openfeature/sdk/ClientMetadata.java b/src/main/java/dev/openfeature/sdk/ClientMetadata.java
new file mode 100644
index 00000000..fa0ed402
--- /dev/null
+++ b/src/main/java/dev/openfeature/sdk/ClientMetadata.java
@@ -0,0 +1,14 @@
+package dev.openfeature.sdk;
+
+/**
+ * Metadata specific to an OpenFeature {@code Client}.
+ */
+public interface ClientMetadata {
+ String getDomain();
+
+ @Deprecated
+ // this is here for compatibility with getName() exposed from {@link Metadata}
+ default String getName() {
+ return getDomain();
+ }
+}
diff --git a/src/main/java/dev/openfeature/sdk/EventDetails.java b/src/main/java/dev/openfeature/sdk/EventDetails.java
index 08cb7e21..f2113eea 100644
--- a/src/main/java/dev/openfeature/sdk/EventDetails.java
+++ b/src/main/java/dev/openfeature/sdk/EventDetails.java
@@ -9,7 +9,7 @@
@Data
@SuperBuilder(toBuilder = true)
public class EventDetails extends ProviderEventDetails {
- private String clientName;
+ private String domain;
private String providerName;
static EventDetails fromProviderEventDetails(ProviderEventDetails providerEventDetails, String providerName) {
@@ -19,9 +19,9 @@ static EventDetails fromProviderEventDetails(ProviderEventDetails providerEventD
static EventDetails fromProviderEventDetails(
ProviderEventDetails providerEventDetails,
String providerName,
- String clientName) {
+ String domain) {
return builder()
- .clientName(clientName)
+ .domain(domain)
.providerName(providerName)
.flagsChanged(providerEventDetails.getFlagsChanged())
.eventMetadata(providerEventDetails.getEventMetadata())
diff --git a/src/main/java/dev/openfeature/sdk/EventSupport.java b/src/main/java/dev/openfeature/sdk/EventSupport.java
index aa48b8b0..085c8eb8 100644
--- a/src/main/java/dev/openfeature/sdk/EventSupport.java
+++ b/src/main/java/dev/openfeature/sdk/EventSupport.java
@@ -33,19 +33,19 @@ class EventSupport {
});
/**
- * Run all the event handlers associated with this client name.
- * If the client name is null, handlers attached to unnamed clients will run.
+ * Run all the event handlers associated with this domain.
+ * If the domain is null, handlers attached to unnamed clients will run.
*
- * @param clientName the client name to run event handlers for, or null
+ * @param domain the domain to run event handlers for, or null
* @param event the event type
* @param eventDetails the event details
*/
- public void runClientHandlers(String clientName, ProviderEvent event, EventDetails eventDetails) {
- clientName = Optional.ofNullable(clientName)
+ public void runClientHandlers(String domain, ProviderEvent event, EventDetails eventDetails) {
+ domain = Optional.ofNullable(domain)
.orElse(defaultClientUuid);
// run handlers if they exist
- Optional.ofNullable(handlerStores.get(clientName))
+ Optional.ofNullable(handlerStores.get(domain))
.filter(store -> Optional.of(store).isPresent())
.map(store -> store.handlerMap.get(event))
.ifPresent(handlers -> handlers
@@ -66,15 +66,14 @@ public void runGlobalHandlers(ProviderEvent event, EventDetails eventDetails) {
}
/**
- * Add a handler for the specified client name, or all unnamed clients.
+ * Add a handler for the specified domain, or all unnamed clients.
*
- * @param clientName the client name to add handlers for, or else the unnamed
- * client
+ * @param domain the domain to add handlers for, or else unnamed
* @param event the event type
* @param handler the handler function to run
*/
- public void addClientHandler(String clientName, ProviderEvent event, Consumer handler) {
- final String name = Optional.ofNullable(clientName)
+ public void addClientHandler(String domain, ProviderEvent event, Consumer handler) {
+ final String name = Optional.ofNullable(domain)
.orElse(defaultClientUuid);
// lazily create and cache a HandlerStore if it doesn't exist
@@ -90,15 +89,15 @@ public void addClientHandler(String clientName, ProviderEvent event, Consumer handler) {
- clientName = Optional.ofNullable(clientName)
+ public void removeClientHandler(String domain, ProviderEvent event, Consumer handler) {
+ domain = Optional.ofNullable(domain)
.orElse(defaultClientUuid);
- this.handlerStores.get(clientName).removeHandler(event, handler);
+ this.handlerStores.get(domain).removeHandler(event, handler);
}
/**
@@ -122,11 +121,11 @@ public void removeGlobalHandler(ProviderEvent event, Consumer hand
}
/**
- * Get all client names for which we have event handlers registered.
+ * Get all domain names for which we have event handlers registered.
*
- * @return set of client names
+ * @return set of domain names
*/
- public Set getAllClientNames() {
+ public Set getAllDomainNames() {
return this.handlerStores.keySet();
}
diff --git a/src/main/java/dev/openfeature/sdk/HookContext.java b/src/main/java/dev/openfeature/sdk/HookContext.java
index 26b14f79..5c9091b8 100644
--- a/src/main/java/dev/openfeature/sdk/HookContext.java
+++ b/src/main/java/dev/openfeature/sdk/HookContext.java
@@ -16,7 +16,7 @@ public class HookContext {
@NonNull FlagValueType type;
@NonNull T defaultValue;
@NonNull EvaluationContext ctx;
- Metadata clientMetadata;
+ ClientMetadata clientMetadata;
Metadata providerMetadata;
/**
@@ -30,7 +30,7 @@ public class HookContext {
* @param type that the flag is evaluating against
* @return resulting context for hook
*/
- public static HookContext from(String key, FlagValueType type, Metadata clientMetadata,
+ public static HookContext from(String key, FlagValueType type, ClientMetadata clientMetadata,
Metadata providerMetadata, EvaluationContext ctx, T defaultValue) {
return HookContext.builder()
.flagKey(key)
diff --git a/src/main/java/dev/openfeature/sdk/OpenFeatureAPI.java b/src/main/java/dev/openfeature/sdk/OpenFeatureAPI.java
index d159c73d..bf7f24c5 100644
--- a/src/main/java/dev/openfeature/sdk/OpenFeatureAPI.java
+++ b/src/main/java/dev/openfeature/sdk/OpenFeatureAPI.java
@@ -1,5 +1,10 @@
package dev.openfeature.sdk;
+import dev.openfeature.sdk.exceptions.OpenFeatureError;
+import dev.openfeature.sdk.internal.AutoCloseableLock;
+import dev.openfeature.sdk.internal.AutoCloseableReentrantReadWriteLock;
+import lombok.extern.slf4j.Slf4j;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -7,11 +12,6 @@
import java.util.Set;
import java.util.function.Consumer;
-import dev.openfeature.sdk.exceptions.OpenFeatureError;
-import dev.openfeature.sdk.internal.AutoCloseableLock;
-import dev.openfeature.sdk.internal.AutoCloseableReentrantReadWriteLock;
-import lombok.extern.slf4j.Slf4j;
-
/**
* A global singleton which holds base configuration for the OpenFeature
* library.
@@ -52,8 +52,8 @@ public Metadata getProviderMetadata() {
return getProvider().getMetadata();
}
- public Metadata getProviderMetadata(String clientName) {
- return getProvider(clientName).getMetadata();
+ public Metadata getProviderMetadata(String domain) {
+ return getProvider(domain).getMetadata();
}
/**
@@ -66,16 +66,16 @@ public Client getClient() {
/**
* {@inheritDoc}
*/
- public Client getClient(String name) {
- return getClient(name, null);
+ public Client getClient(String domain) {
+ return getClient(domain, null);
}
/**
* {@inheritDoc}
*/
- public Client getClient(String name, String version) {
+ public Client getClient(String domain, String version) {
return new OpenFeatureClient(this,
- name,
+ domain,
version);
}
@@ -154,14 +154,14 @@ public void setProvider(FeatureProvider provider) {
}
/**
- * Add a provider for a named client.
+ * Add a provider for a domain.
*
- * @param clientName The name of the client.
+ * @param domain The domain to bind the provider to.
* @param provider The provider to set.
*/
- public void setProvider(String clientName, FeatureProvider provider) {
+ public void setProvider(String domain, FeatureProvider provider) {
try (AutoCloseableLock __ = lock.writeLockAutoCloseable()) {
- providerRepository.setProvider(clientName,
+ providerRepository.setProvider(domain,
provider,
this::attachEventProvider,
this::emitReady,
@@ -187,14 +187,14 @@ public void setProviderAndWait(FeatureProvider provider) throws OpenFeatureError
}
/**
- * Add a provider for a named client and wait for initialization to finish.
+ * Add a provider for a domain and wait for initialization to finish.
*
- * @param clientName The name of the client.
+ * @param domain The domain to bind the provider to.
* @param provider The provider to set.
*/
- public void setProviderAndWait(String clientName, FeatureProvider provider) throws OpenFeatureError {
+ public void setProviderAndWait(String domain, FeatureProvider provider) throws OpenFeatureError {
try (AutoCloseableLock __ = lock.writeLockAutoCloseable()) {
- providerRepository.setProvider(clientName,
+ providerRepository.setProvider(domain,
provider,
this::attachEventProvider,
this::emitReady,
@@ -240,13 +240,13 @@ public FeatureProvider getProvider() {
}
/**
- * Fetch a provider for a named client. If not found, return the default.
+ * Fetch a provider for a domain. If not found, return the default.
*
- * @param name The client name to look for.
+ * @param domain The domain to look for.
* @return A named {@link FeatureProvider}
*/
- public FeatureProvider getProvider(String name) {
- return providerRepository.getProvider(name);
+ public FeatureProvider getProvider(String domain) {
+ return providerRepository.getProvider(domain);
}
/**
@@ -344,20 +344,20 @@ public OpenFeatureAPI removeHandler(ProviderEvent event, Consumer
return this;
}
- void removeHandler(String clientName, ProviderEvent event, Consumer handler) {
+ void removeHandler(String domain, ProviderEvent event, Consumer handler) {
try (AutoCloseableLock __ = lock.writeLockAutoCloseable()) {
- eventSupport.removeClientHandler(clientName, event, handler);
+ eventSupport.removeClientHandler(domain, event, handler);
}
}
- void addHandler(String clientName, ProviderEvent event, Consumer handler) {
+ void addHandler(String domain, ProviderEvent event, Consumer handler) {
try (AutoCloseableLock __ = lock.writeLockAutoCloseable()) {
// if the provider is in the state associated with event, run immediately
- if (Optional.ofNullable(this.providerRepository.getProvider(clientName).getState())
+ if (Optional.ofNullable(this.providerRepository.getProvider(domain).getState())
.orElse(ProviderState.READY).matchesEvent(event)) {
- eventSupport.runHandler(handler, EventDetails.builder().clientName(clientName).build());
+ eventSupport.runHandler(handler, EventDetails.builder().domain(domain).build());
}
- eventSupport.addClientHandler(clientName, event, handler);
+ eventSupport.addClientHandler(domain, event, handler);
}
}
@@ -371,8 +371,8 @@ void addHandler(String clientName, ProviderEvent event, Consumer h
private void runHandlersForProvider(FeatureProvider provider, ProviderEvent event, ProviderEventDetails details) {
try (AutoCloseableLock __ = lock.readLockAutoCloseable()) {
- List clientNamesForProvider = providerRepository
- .getClientNamesForProvider(provider);
+ List domainsForProvider = providerRepository
+ .getDomainsForProvider(provider);
final String providerName = Optional.ofNullable(provider.getMetadata())
.map(metadata -> metadata.getName())
@@ -381,20 +381,20 @@ private void runHandlersForProvider(FeatureProvider provider, ProviderEvent even
// run the global handlers
eventSupport.runGlobalHandlers(event, EventDetails.fromProviderEventDetails(details, providerName));
- // run the handlers associated with named clients for this provider
- clientNamesForProvider.forEach(name -> {
- eventSupport.runClientHandlers(name, event,
- EventDetails.fromProviderEventDetails(details, providerName, name));
+ // run the handlers associated with domains for this provider
+ domainsForProvider.forEach(domain -> {
+ eventSupport.runClientHandlers(domain, event,
+ EventDetails.fromProviderEventDetails(details, providerName, domain));
});
if (providerRepository.isDefaultProvider(provider)) {
// run handlers for clients that have no bound providers (since this is the default)
- Set allClientNames = eventSupport.getAllClientNames();
- Set boundClientNames = providerRepository.getAllBoundClientNames();
- allClientNames.removeAll(boundClientNames);
- allClientNames.forEach(name -> {
- eventSupport.runClientHandlers(name, event,
- EventDetails.fromProviderEventDetails(details, providerName, name));
+ Set allDomainNames = eventSupport.getAllDomainNames();
+ Set boundDomains = providerRepository.getAllBoundDomains();
+ allDomainNames.removeAll(boundDomains);
+ allDomainNames.forEach(domain -> {
+ eventSupport.runClientHandlers(domain, event,
+ EventDetails.fromProviderEventDetails(details, providerName, domain));
});
}
}
diff --git a/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java b/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java
index 452c98d6..4a1c1179 100644
--- a/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java
+++ b/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java
@@ -26,7 +26,7 @@ public class OpenFeatureClient implements Client {
private final OpenFeatureAPI openfeatureApi;
@Getter
- private final String name;
+ private final String domain;
@Getter
private final String version;
private final List clientHooks;
@@ -39,16 +39,16 @@ public class OpenFeatureClient implements Client {
* Deprecated public constructor. Use OpenFeature.API.getClient() instead.
*
* @param openFeatureAPI Backing global singleton
- * @param name Name of the client (used by observability tools).
+ * @param domain An identifier which logically binds clients with providers (used by observability tools).
* @param version Version of the client (used by observability tools).
* @deprecated Do not use this constructor. It's for internal use only.
* Clients created using it will not run event handlers.
* Use the OpenFeatureAPI's getClient factory method instead.
*/
@Deprecated() // TODO: eventually we will make this non-public. See issue #872
- public OpenFeatureClient(OpenFeatureAPI openFeatureAPI, String name, String version) {
+ public OpenFeatureClient(OpenFeatureAPI openFeatureAPI, String domain, String version) {
this.openfeatureApi = openFeatureAPI;
- this.name = name;
+ this.domain = domain;
this.version = version;
this.clientHooks = new ArrayList<>();
this.hookSupport = new HookSupport();
@@ -110,7 +110,7 @@ private FlagEvaluationDetails evaluateFlag(FlagValueType type, String key
try {
// openfeatureApi.getProvider() must be called once to maintain a consistent reference
- provider = openfeatureApi.getProvider(this.name);
+ provider = openfeatureApi.getProvider(this.domain);
mergedHooks = ObjectUtils.merge(provider.getProviderHooks(), flagOptions.getHooks(), clientHooks,
openfeatureApi.getHooks());
@@ -359,8 +359,8 @@ public FlagEvaluationDetails getObjectDetails(String key, Value defaultVa
}
@Override
- public Metadata getMetadata() {
- return () -> name;
+ public ClientMetadata getMetadata() {
+ return () -> domain;
}
/**
@@ -400,7 +400,7 @@ public Client onProviderStale(Consumer handler) {
*/
@Override
public Client on(ProviderEvent event, Consumer handler) {
- OpenFeatureAPI.getInstance().addHandler(name, event, handler);
+ OpenFeatureAPI.getInstance().addHandler(domain, event, handler);
return this;
}
@@ -409,7 +409,7 @@ public Client on(ProviderEvent event, Consumer handler) {
*/
@Override
public Client removeHandler(ProviderEvent event, Consumer handler) {
- OpenFeatureAPI.getInstance().removeHandler(name, event, handler);
+ OpenFeatureAPI.getInstance().removeHandler(domain, event, handler);
return this;
}
}
diff --git a/src/main/java/dev/openfeature/sdk/ProviderRepository.java b/src/main/java/dev/openfeature/sdk/ProviderRepository.java
index 1ebd9b4c..47b9ecf5 100644
--- a/src/main/java/dev/openfeature/sdk/ProviderRepository.java
+++ b/src/main/java/dev/openfeature/sdk/ProviderRepository.java
@@ -36,22 +36,22 @@ public FeatureProvider getProvider() {
}
/**
- * Fetch a provider for a named client. If not found, return the default.
+ * Fetch a provider for a domain. If not found, return the default.
*
- * @param name The client name to look for.
+ * @param domain The domain to look for.
* @return A named {@link FeatureProvider}
*/
- public FeatureProvider getProvider(String name) {
- return Optional.ofNullable(name).map(this.providers::get).orElse(this.defaultProvider.get());
+ public FeatureProvider getProvider(String domain) {
+ return Optional.ofNullable(domain).map(this.providers::get).orElse(this.defaultProvider.get());
}
- public List getClientNamesForProvider(FeatureProvider provider) {
+ public List getDomainsForProvider(FeatureProvider provider) {
return providers.entrySet().stream()
.filter(entry -> entry.getValue().equals(provider))
.map(entry -> entry.getKey()).collect(Collectors.toList());
}
- public Set getAllBoundClientNames() {
+ public Set getAllBoundDomains() {
return providers.keySet();
}
@@ -75,14 +75,14 @@ public void setProvider(FeatureProvider provider,
}
/**
- * Add a provider for a named client.
+ * Add a provider for a domain.
*
- * @param clientName The name of the client.
+ * @param domain The domain to bind the provider to.
* @param provider The provider to set.
* @param waitForInit When true, wait for initialization to finish, then returns.
* Otherwise, initialization happens in the background.
*/
- public void setProvider(String clientName,
+ public void setProvider(String domain,
FeatureProvider provider,
Consumer afterSet,
Consumer afterInit,
@@ -92,13 +92,13 @@ public void setProvider(String clientName,
if (provider == null) {
throw new IllegalArgumentException("Provider cannot be null");
}
- if (clientName == null) {
- throw new IllegalArgumentException("clientName cannot be null");
+ if (domain == null) {
+ throw new IllegalArgumentException("domain cannot be null");
}
- prepareAndInitializeProvider(clientName, provider, afterSet, afterInit, afterShutdown, afterError, waitForInit);
+ prepareAndInitializeProvider(domain, provider, afterSet, afterInit, afterShutdown, afterError, waitForInit);
}
- private void prepareAndInitializeProvider(String clientName,
+ private void prepareAndInitializeProvider(String domain,
FeatureProvider newProvider,
Consumer afterSet,
Consumer afterInit,
@@ -112,8 +112,8 @@ private void prepareAndInitializeProvider(String clientName,
}
// provider is set immediately, on this thread
- FeatureProvider oldProvider = clientName != null
- ? this.providers.put(clientName, newProvider)
+ FeatureProvider oldProvider = domain != null
+ ? this.providers.put(domain, newProvider)
: this.defaultProvider.getAndSet(newProvider);
if (waitForInit) {
diff --git a/src/test/java/dev/openfeature/sdk/AlwaysBrokenProvider.java b/src/test/java/dev/openfeature/sdk/AlwaysBrokenProvider.java
index 4beb28c3..c1097623 100644
--- a/src/test/java/dev/openfeature/sdk/AlwaysBrokenProvider.java
+++ b/src/test/java/dev/openfeature/sdk/AlwaysBrokenProvider.java
@@ -6,11 +6,8 @@ public class AlwaysBrokenProvider implements FeatureProvider {
@Override
public Metadata getMetadata() {
- return new Metadata() {
- @Override
- public String getName() {
- throw new FlagNotFoundError(TestConstants.BROKEN_MESSAGE);
- }
+ return () -> {
+ throw new FlagNotFoundError(TestConstants.BROKEN_MESSAGE);
};
}
diff --git a/src/test/java/dev/openfeature/sdk/EventProviderTest.java b/src/test/java/dev/openfeature/sdk/EventProviderTest.java
index 3744682b..a5be8589 100644
--- a/src/test/java/dev/openfeature/sdk/EventProviderTest.java
+++ b/src/test/java/dev/openfeature/sdk/EventProviderTest.java
@@ -77,14 +77,11 @@ void doesNotThrowWhenOnEmitSame() {
class TestEventProvider extends EventProvider {
+ private static final String NAME = "TestEventProvider";
+
@Override
public Metadata getMetadata() {
- return new Metadata() {
- @Override
- public String getName() {
- return "TestEventProvider";
- }
- };
+ return () -> NAME;
}
@Override
diff --git a/src/test/java/dev/openfeature/sdk/EventsTest.java b/src/test/java/dev/openfeature/sdk/EventsTest.java
index f9f8e4b8..6b70617f 100644
--- a/src/test/java/dev/openfeature/sdk/EventsTest.java
+++ b/src/test/java/dev/openfeature/sdk/EventsTest.java
@@ -48,7 +48,7 @@ class Initialization {
@Specification(number = "5.3.1", text = "If the provider's initialize function terminates normally," +
" PROVIDER_READY handlers MUST run.")
void apiInitReady() {
- final Consumer handler = (Consumer)mockHandler();
+ final Consumer handler = mockHandler();
final String name = "apiInitReady";
TestEventsProvider provider = new TestEventsProvider(INIT_DELAY);
@@ -105,7 +105,7 @@ void apiShouldPropagateEvents() {
@Specification(number = "5.2.2", text = "The API MUST provide a function for associating handler functions"
+
" with a particular provider event type.")
- void apiShouldSupportAllEventTypes() throws Exception {
+ void apiShouldSupportAllEventTypes() {
final String name = "apiShouldSupportAllEventTypes";
final Consumer handler1 = mockHandler();
final Consumer handler2 = mockHandler();
@@ -191,7 +191,7 @@ class Initialization {
@Test
@DisplayName("should fire initial READY event when provider init succeeds after client retrieved")
@Specification(number = "5.3.1", text = "If the provider's initialize function terminates normally, PROVIDER_READY handlers MUST run.")
- void initReadyProviderBefore() throws InterruptedException {
+ void initReadyProviderBefore() {
final Consumer handler = mockHandler();
final String name = "initReadyProviderBefore";
@@ -201,7 +201,7 @@ void initReadyProviderBefore() throws InterruptedException {
// set provider after getting a client
OpenFeatureAPI.getInstance().setProvider(name, provider);
verify(handler, timeout(TIMEOUT).atLeastOnce())
- .accept(argThat(details -> details.getClientName().equals(name)));
+ .accept(argThat(details -> details.getDomain().equals(name)));
}
@Test
@@ -217,7 +217,7 @@ void initReadyProviderAfter() {
Client client = OpenFeatureAPI.getInstance().getClient(name);
client.onProviderReady(handler);
verify(handler, timeout(TIMEOUT).atLeastOnce())
- .accept(argThat(details -> details.getClientName().equals(name)));
+ .accept(argThat(details -> details.getDomain().equals(name)));
}
@Test
@@ -234,7 +234,7 @@ void initErrorProviderAfter() {
// set provider after getting a client
OpenFeatureAPI.getInstance().setProvider(name, provider);
verify(handler, timeout(TIMEOUT)).accept(argThat(details -> {
- return name.equals(details.getClientName())
+ return name.equals(details.getDomain())
&& errMessage.equals(details.getMessage());
}));
}
@@ -253,7 +253,7 @@ void initErrorProviderBefore() {
Client client = OpenFeatureAPI.getInstance().getClient(name);
client.onProviderError(handler);
verify(handler, timeout(TIMEOUT)).accept(argThat(details -> {
- return name.equals(details.getClientName())
+ return name.equals(details.getDomain())
&& errMessage.equals(details.getMessage());
}));
}
@@ -277,7 +277,7 @@ void shouldPropagateBefore() {
client.onProviderConfigurationChanged(handler);
provider.mockEvent(ProviderEvent.PROVIDER_CONFIGURATION_CHANGED, EventDetails.builder().build());
- verify(handler, timeout(TIMEOUT)).accept(argThat(details -> details.getClientName().equals(name)));
+ verify(handler, timeout(TIMEOUT)).accept(argThat(details -> details.getDomain().equals(name)));
}
@Test
@@ -295,7 +295,7 @@ void shouldPropagateAfter() {
OpenFeatureAPI.getInstance().setProvider(name, provider);
provider.mockEvent(ProviderEvent.PROVIDER_CONFIGURATION_CHANGED, EventDetails.builder().build());
- verify(handler, timeout(TIMEOUT)).accept(argThat(details -> details.getClientName().equals(name)));
+ verify(handler, timeout(TIMEOUT)).accept(argThat(details -> details.getDomain().equals(name)));
}
@Test
@@ -306,7 +306,7 @@ void shouldPropagateAfter() {
@Specification(number = "5.2.1", text = "The client MUST provide a function for associating handler functions"
+
" with a particular provider event type.")
- void shouldSupportAllEventTypes() throws Exception {
+ void shouldSupportAllEventTypes() {
final String name = "shouldSupportAllEventTypes";
final Consumer handler1 = mockHandler();
final Consumer handler2 = mockHandler();
@@ -325,7 +325,7 @@ void shouldSupportAllEventTypes() throws Exception {
Arrays.asList(ProviderEvent.values()).stream().forEach(eventType -> {
provider.mockEvent(eventType, ProviderEventDetails.builder().build());
});
- ArgumentMatcher nameMatches = (EventDetails details) -> details.getClientName()
+ ArgumentMatcher nameMatches = (EventDetails details) -> details.getDomain()
.equals(name);
verify(handler1, timeout(TIMEOUT).atLeastOnce()).accept(argThat(nameMatches));
verify(handler2, timeout(TIMEOUT).atLeastOnce()).accept(argThat(nameMatches));
@@ -337,7 +337,7 @@ void shouldSupportAllEventTypes() throws Exception {
@Test
@DisplayName("shutdown provider should not run handlers")
- void shouldNotRunHandlers() throws Exception {
+ void shouldNotRunHandlers() {
final Consumer handler1 = mockHandler();
final Consumer handler2 = mockHandler();
final String name = "shouldNotRunHandlers";
@@ -369,7 +369,7 @@ void shouldNotRunHandlers() throws Exception {
@DisplayName("other client handlers should not run")
@Specification(number = "5.1.3", text = "When a provider signals the occurrence of a particular event, " +
"event handlers on clients which are not associated with that provider MUST NOT run.")
- void otherClientHandlersShouldNotRun() throws Exception {
+ void otherClientHandlersShouldNotRun() {
final String name1 = "otherClientHandlersShouldNotRun1";
final String name2 = "otherClientHandlersShouldNotRun2";
final Consumer handlerToRun = mockHandler();
@@ -396,7 +396,7 @@ void otherClientHandlersShouldNotRun() throws Exception {
@DisplayName("bound named client handlers should not run with default")
@Specification(number = "5.1.3", text = "When a provider signals the occurrence of a particular event, " +
"event handlers on clients which are not associated with that provider MUST NOT run.")
- void boundShouldNotRunWithDefault() throws Exception {
+ void boundShouldNotRunWithDefault() {
final String name = "boundShouldNotRunWithDefault";
final Consumer handlerNotToRun = mockHandler();
@@ -422,7 +422,7 @@ void boundShouldNotRunWithDefault() throws Exception {
@DisplayName("unbound named client handlers should run with default")
@Specification(number = "5.1.3", text = "When a provider signals the occurrence of a particular event, " +
"event handlers on clients which are not associated with that provider MUST NOT run.")
- void unboundShouldRunWithDefault() throws Exception {
+ void unboundShouldRunWithDefault() {
final String name = "unboundShouldRunWithDefault";
final Consumer handlerToRun = mockHandler();
@@ -445,7 +445,7 @@ void unboundShouldRunWithDefault() throws Exception {
@Test
@DisplayName("subsequent handlers run if earlier throws")
@Specification(number = "5.2.5", text = "If a handler function terminates abnormally, other handler functions MUST run.")
- void handlersRunIfOneThrows() throws Exception {
+ void handlersRunIfOneThrows() {
final String name = "handlersRunIfOneThrows";
final Consumer errorHandler = mockHandler();
doThrow(new NullPointerException()).when(errorHandler).accept(any());
@@ -471,7 +471,7 @@ void handlersRunIfOneThrows() throws Exception {
@DisplayName("should have all properties")
@Specification(number = "5.2.4", text = "The handler function MUST accept a event details parameter.")
@Specification(number = "5.2.3", text = "The `event details` MUST contain the `provider name` associated with the event.")
- void shouldHaveAllProperties() throws Exception {
+ void shouldHaveAllProperties() {
final Consumer handler1 = mockHandler();
final Consumer handler2 = mockHandler();
final String name = "shouldHaveAllProperties";
@@ -508,14 +508,14 @@ void shouldHaveAllProperties() throws Exception {
return metadata.equals(eventDetails.getEventMetadata())
&& flagsChanged.equals(eventDetails.getFlagsChanged())
&& message.equals(eventDetails.getMessage())
- && name.equals(eventDetails.getClientName());
+ && name.equals(eventDetails.getDomain());
}));
}
@Test
@DisplayName("if the provider is ready handlers must run immediately")
@Specification(number = "5.3.3", text = "Handlers attached after the provider is already in the associated state, MUST run immediately.")
- void matchingReadyEventsMustRunImmediately() throws Exception {
+ void matchingReadyEventsMustRunImmediately() {
final String name = "matchingEventsMustRunImmediately";
final Consumer handler = mockHandler();
@@ -532,7 +532,7 @@ void matchingReadyEventsMustRunImmediately() throws Exception {
@Test
@DisplayName("if the provider is ready handlers must run immediately")
@Specification(number = "5.3.3", text = "Handlers attached after the provider is already in the associated state, MUST run immediately.")
- void matchingStaleEventsMustRunImmediately() throws Exception {
+ void matchingStaleEventsMustRunImmediately() {
final String name = "matchingEventsMustRunImmediately";
final Consumer handler = mockHandler();
@@ -549,7 +549,7 @@ void matchingStaleEventsMustRunImmediately() throws Exception {
@Test
@DisplayName("if the provider is ready handlers must run immediately")
@Specification(number = "5.3.3", text = "Handlers attached after the provider is already in the associated state, MUST run immediately.")
- void matchingErrorEventsMustRunImmediately() throws Exception {
+ void matchingErrorEventsMustRunImmediately() {
final String name = "matchingEventsMustRunImmediately";
final Consumer handler = mockHandler();
@@ -566,7 +566,7 @@ void matchingErrorEventsMustRunImmediately() throws Exception {
@Test
@DisplayName("must persist across changes")
@Specification(number = "5.2.6", text = "Event handlers MUST persist across provider changes.")
- void mustPersistAcrossChanges() throws Exception {
+ void mustPersistAcrossChanges() {
final String name = "mustPersistAcrossChanges";
final Consumer handler = mockHandler();
@@ -578,7 +578,7 @@ void mustPersistAcrossChanges() throws Exception {
client.onProviderConfigurationChanged(handler);
provider1.mockEvent(ProviderEvent.PROVIDER_CONFIGURATION_CHANGED, ProviderEventDetails.builder().build());
- ArgumentMatcher nameMatches = (EventDetails details) -> details.getClientName().equals(name);
+ ArgumentMatcher nameMatches = (EventDetails details) -> details.getDomain().equals(name);
verify(handler, timeout(TIMEOUT).times(1)).accept(argThat(nameMatches));
diff --git a/src/test/java/dev/openfeature/sdk/FlagEvaluationSpecTest.java b/src/test/java/dev/openfeature/sdk/FlagEvaluationSpecTest.java
index 60b6ee13..d85d8825 100644
--- a/src/test/java/dev/openfeature/sdk/FlagEvaluationSpecTest.java
+++ b/src/test/java/dev/openfeature/sdk/FlagEvaluationSpecTest.java
@@ -135,10 +135,13 @@ public void initialize(EvaluationContext evaluationContext) throws Exception {
assertEquals(h2, api.getHooks().get(1));
}
- @Specification(number="1.1.6", text="The API MUST provide a function for creating a client which accepts the following options: - name (optional): A logical string identifier for the client.")
- @Test void namedClient() {
- assertThatCode(() -> api.getClient("Sir Calls-a-lot")).doesNotThrowAnyException();
- // TODO: Doesn't say that you can *get* the client name.. which seems useful?
+ @Specification(number="1.1.6", text="The API MUST provide a function for creating a client which accepts the following options: - domain (optional): A logical string identifier for binding clients to provider.")
+ @Test void domainName() {
+ assertNull(api.getClient().getMetadata().getDomain());
+
+ String domain = "Sir Calls-a-lot";
+ Client clientForDomain = api.getClient(domain);
+ assertEquals(domain, clientForDomain.getMetadata().getDomain());
}
@Specification(number="1.2.1", text="The client MUST provide a method to add hooks which accepts one or more API-conformant hooks, and appends them to the collection of any previously added hooks. When new hooks are added, previously added hooks are not removed.")
@@ -274,14 +277,18 @@ public void initialize(EvaluationContext evaluationContext) throws Exception {
ArgumentMatchers.isA(FlagNotFoundError.class));
}
- @Specification(number="1.2.2", text="The client interface MUST define a metadata member or accessor, containing an immutable name field or accessor of type string, which corresponds to the name value supplied during client creation.")
+ @Specification(number="1.2.2", text="The client interface MUST define a metadata member or accessor, containing an immutable domain field or accessor of type string, which corresponds to the domain value supplied during client creation. In previous drafts, this property was called name. For backwards compatibility, implementations should consider name an alias to domain.")
@Test void clientMetadata() {
Client c = _client();
assertNull(c.getMetadata().getName());
+ assertNull(c.getMetadata().getDomain());
+ String domainName = "test domain";
FeatureProviderTestUtils.setFeatureProvider(new AlwaysBrokenProvider());
- Client c2 = api.getClient("test");
- assertEquals("test", c2.getMetadata().getName());
+ Client c2 = api.getClient(domainName);
+
+ assertEquals(domainName, c2.getMetadata().getName());
+ assertEquals(domainName, c2.getMetadata().getDomain());
}
@Specification(number="1.4.9", text="In cases of abnormal execution (network failure, unhandled error, etc) the reason field in the evaluation details SHOULD indicate an error.")
diff --git a/src/test/java/dev/openfeature/sdk/HookContextTest.java b/src/test/java/dev/openfeature/sdk/HookContextTest.java
index 763069fd..50cc6617 100644
--- a/src/test/java/dev/openfeature/sdk/HookContextTest.java
+++ b/src/test/java/dev/openfeature/sdk/HookContextTest.java
@@ -9,17 +9,18 @@ class HookContextTest {
@Specification(number="4.2.2.2", text="Condition: The client metadata field in the hook context MUST be immutable.")
@Specification(number="4.2.2.3", text="Condition: The provider metadata field in the hook context MUST be immutable.")
@Test void metadata_field_is_type_metadata() {
+ ClientMetadata clientMetadata = mock(ClientMetadata.class);
Metadata meta = mock(Metadata.class);
HookContext
-
-
+
+
@@ -59,7 +59,7 @@ Note that this library is intended to be used in server-side contexts and has no
dev.openfeature
sdk
- 1.8.0
+ 1.9.0
```
@@ -84,7 +84,7 @@ If you would like snapshot builds, this is the relevant repository information:
```groovy
dependencies {
- implementation 'dev.openfeature:sdk:1.8.0'
+ implementation 'dev.openfeature:sdk:1.9.0'
}
```
diff --git a/pom.xml b/pom.xml
index 59eab174..6f6e8416 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
dev.openfeature
sdk
- 1.8.0
+ 1.9.0
UTF-8
diff --git a/version.txt b/version.txt
index 27f9cd32..f8e233b2 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-1.8.0
+1.9.0