diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 4ff06ca6..e2ab0256 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -20,9 +20,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - uses: actions/checkout@9a9194f87191a7e9055e3e9b95b8cfb13023bb08 - name: Set up JDK 8 - uses: actions/setup-java@fd08b9c8dc6f530393a204a04e1f05101a5d00fd + uses: actions/setup-java@67fbd726daaf08212a7b021c1c4d117f94a81dd3 with: java-version: '8' distribution: 'temurin' @@ -32,7 +32,7 @@ jobs: server-password: ${{ secrets.OSSRH_PASSWORD }} - name: Cache local Maven repository - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + uses: actions/cache@81382a721fc89d96eca335d0c3ba33144b2baa9d with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index e565d68c..95624732 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -10,22 +10,22 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out the code - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + uses: actions/checkout@9a9194f87191a7e9055e3e9b95b8cfb13023bb08 - name: Set up JDK 8 - uses: actions/setup-java@fd08b9c8dc6f530393a204a04e1f05101a5d00fd + uses: actions/setup-java@67fbd726daaf08212a7b021c1c4d117f94a81dd3 with: java-version: '8' distribution: 'temurin' cache: maven - name: Initialize CodeQL - uses: github/codeql-action/init@de945755c9edd3a4e5d160a71f1482ece6a3c271 + uses: github/codeql-action/init@fd5fa130e2c632f29b237077157766ea2ef07a13 with: languages: java - name: Cache local Maven repository - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + uses: actions/cache@81382a721fc89d96eca335d0c3ba33144b2baa9d with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} @@ -45,4 +45,4 @@ jobs: verbose: true # optional (default = false) - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@de945755c9edd3a4e5d160a71f1482ece6a3c271 + uses: github/codeql-action/analyze@fd5fa130e2c632f29b237077157766ea2ef07a13 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 29866c56..b1b86fe4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,10 +28,10 @@ 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@692973e3d937129bcbf40652eb9f2f61becf3332 + uses: actions/checkout@9a9194f87191a7e9055e3e9b95b8cfb13023bb08 - name: Set up JDK 8 if: ${{ steps.release.outputs.release_created }} - uses: actions/setup-java@fd08b9c8dc6f530393a204a04e1f05101a5d00fd + uses: actions/setup-java@67fbd726daaf08212a7b021c1c4d117f94a81dd3 with: java-version: '8' distribution: 'temurin' diff --git a/.github/workflows/static-code-scanning.yaml b/.github/workflows/static-code-scanning.yaml index 2e8f35fc..1cf8476a 100644 --- a/.github/workflows/static-code-scanning.yaml +++ b/.github/workflows/static-code-scanning.yaml @@ -29,16 +29,16 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + uses: actions/checkout@9a9194f87191a7e9055e3e9b95b8cfb13023bb08 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@de945755c9edd3a4e5d160a71f1482ece6a3c271 + uses: github/codeql-action/init@fd5fa130e2c632f29b237077157766ea2ef07a13 with: languages: java - name: Autobuild - uses: github/codeql-action/autobuild@de945755c9edd3a4e5d160a71f1482ece6a3c271 + uses: github/codeql-action/autobuild@fd5fa130e2c632f29b237077157766ea2ef07a13 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@de945755c9edd3a4e5d160a71f1482ece6a3c271 + uses: github/codeql-action/analyze@fd5fa130e2c632f29b237077157766ea2ef07a13 diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 24ed335a..eefaab1f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{".":"1.9.0"} \ No newline at end of file +{".":"1.9.1"} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b3226d8f..46d52e4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,83 @@ # Changelog +## [1.9.1](https://github.com/open-feature/java-sdk/compare/v1.9.0...v1.9.1) (2024-08-22) + + +### ๐Ÿ› Bug Fixes + +* **deps:** update dependency io.cucumber:cucumber-bom to v7.18.1 ([#1011](https://github.com/open-feature/java-sdk/issues/1011)) ([91fa8cf](https://github.com/open-feature/java-sdk/commit/91fa8cf7d63374cd67d4c02d291467da379297cf)) +* **deps:** update dependency org.slf4j:slf4j-api to v2.0.14 ([#1033](https://github.com/open-feature/java-sdk/issues/1033)) ([4ec155d](https://github.com/open-feature/java-sdk/commit/4ec155d91b4cc637d1d447ea87308401a5fd7d87)) +* **deps:** update dependency org.slf4j:slf4j-api to v2.0.15 ([#1036](https://github.com/open-feature/java-sdk/issues/1036)) ([fed9394](https://github.com/open-feature/java-sdk/commit/fed93942b88e0042c50801e8fa193cd156487d4c)) +* **deps:** update dependency org.slf4j:slf4j-api to v2.0.16 ([#1039](https://github.com/open-feature/java-sdk/issues/1039)) ([beba1bd](https://github.com/open-feature/java-sdk/commit/beba1bd8d6c6d7f0d7d7c947777ad9e5ee0e4649)) +* **deps:** update junit5 monorepo ([#1045](https://github.com/open-feature/java-sdk/issues/1045)) ([5e77f8a](https://github.com/open-feature/java-sdk/commit/5e77f8ad337fa3230a71db7d722cce01a50f654b)) +* Pin byte-buddy(-agent) version to 1.14.19 to workaround Mockito issue ([#1060](https://github.com/open-feature/java-sdk/issues/1060)) ([32340a3](https://github.com/open-feature/java-sdk/commit/32340a3e0e11ce49c4405658f40568b04926264e)) +* updated context not passed to all hooks ([#1049](https://github.com/open-feature/java-sdk/issues/1049)) ([dbf967a](https://github.com/open-feature/java-sdk/commit/dbf967a860d38f4b76bb6d47b6507e87669fa59a)) +* Use ConcurrentHashMap for InMemoryProvider ([#1057](https://github.com/open-feature/java-sdk/issues/1057)) ([b7ed041](https://github.com/open-feature/java-sdk/commit/b7ed041eed19a7a872c2c73f18163f616ec146c2)) + + +### ๐Ÿงน Chore + +* **deps:** update actions/cache digest to 40c3b67 ([#1026](https://github.com/open-feature/java-sdk/issues/1026)) ([41128b8](https://github.com/open-feature/java-sdk/commit/41128b86fb55d060aed7af836ef9f2365d033446)) +* **deps:** update actions/cache digest to 4a28cbc ([#1022](https://github.com/open-feature/java-sdk/issues/1022)) ([865c3bb](https://github.com/open-feature/java-sdk/commit/865c3bb17a2fb5a8ab5832cf32b806b8b4a5660e)) +* **deps:** update actions/cache digest to 57b8e40 ([#1030](https://github.com/open-feature/java-sdk/issues/1030)) ([6990e21](https://github.com/open-feature/java-sdk/commit/6990e21b47befdb4c9b2431c63ddb6db6ccecff7)) +* **deps:** update actions/cache digest to 81382a7 ([#1044](https://github.com/open-feature/java-sdk/issues/1044)) ([d746dc0](https://github.com/open-feature/java-sdk/commit/d746dc0a11cd837fe9a1472b3cc2ef47fcb616a8)) +* **deps:** update actions/checkout digest to 9a9194f ([#1023](https://github.com/open-feature/java-sdk/issues/1023)) ([326a10b](https://github.com/open-feature/java-sdk/commit/326a10ba0160627387fff20c52c50250bb176a3a)) +* **deps:** update actions/setup-java digest to 67fbd72 ([#1037](https://github.com/open-feature/java-sdk/issues/1037)) ([b4f0550](https://github.com/open-feature/java-sdk/commit/b4f0550a2b9530dc23603f7e5aedf19a1ce0b08a)) +* **deps:** update actions/setup-java digest to 6a0805f ([#1027](https://github.com/open-feature/java-sdk/issues/1027)) ([0968674](https://github.com/open-feature/java-sdk/commit/09686741ad174f3467e7d8b8adfeef13f0afbcbf)) +* **deps:** update dependency com.github.spotbugs:spotbugs-maven-plugin to v4.8.6.2 ([#999](https://github.com/open-feature/java-sdk/issues/999)) ([d0b3b35](https://github.com/open-feature/java-sdk/commit/d0b3b3598115e55cda334a6c7ced72b6ae28a063)) +* **deps:** update dependency com.google.guava:guava to v33.3.0-jre ([#1050](https://github.com/open-feature/java-sdk/issues/1050)) ([a36d2ab](https://github.com/open-feature/java-sdk/commit/a36d2ab111b3f8e0f88291ea7baec83d082d233c)) +* **deps:** update dependency org.apache.maven.plugins:maven-checkstyle-plugin to v3.5.0 ([#1062](https://github.com/open-feature/java-sdk/issues/1062)) ([8370d42](https://github.com/open-feature/java-sdk/commit/8370d4209de8181bc5d3253b874f296089c110f6)) +* **deps:** update dependency org.apache.maven.plugins:maven-dependency-plugin to v3.8.0 ([#1061](https://github.com/open-feature/java-sdk/issues/1061)) ([a81957f](https://github.com/open-feature/java-sdk/commit/a81957ff560c46c5dfb5e38b2f374878e7f5df31)) +* **deps:** update dependency org.apache.maven.plugins:maven-failsafe-plugin to v3.3.1 ([#1004](https://github.com/open-feature/java-sdk/issues/1004)) ([7ae703e](https://github.com/open-feature/java-sdk/commit/7ae703e1da581d036c0f970b6712c2fb611bb805)) +* **deps:** update dependency org.apache.maven.plugins:maven-failsafe-plugin to v3.4.0 ([#1051](https://github.com/open-feature/java-sdk/issues/1051)) ([a1ceb1f](https://github.com/open-feature/java-sdk/commit/a1ceb1fbbfb428c6ea05b68a303640d6dd895713)) +* **deps:** update dependency org.apache.maven.plugins:maven-gpg-plugin to v3.2.5 ([#1040](https://github.com/open-feature/java-sdk/issues/1040)) ([b215dec](https://github.com/open-feature/java-sdk/commit/b215dec8b8ea7f87b515404fc14c740370cc67d0)) +* **deps:** update dependency org.apache.maven.plugins:maven-javadoc-plugin to v3.8.0 ([#1013](https://github.com/open-feature/java-sdk/issues/1013)) ([3d0cd62](https://github.com/open-feature/java-sdk/commit/3d0cd62c9838ef4bd354cb84bcf43518589ae3a7)) +* **deps:** update dependency org.apache.maven.plugins:maven-pmd-plugin to v3.24.0 ([#1009](https://github.com/open-feature/java-sdk/issues/1009)) ([efbb69a](https://github.com/open-feature/java-sdk/commit/efbb69a998f20e559b1b610cc190bdbd19ea8100)) +* **deps:** update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.3.1 ([#1005](https://github.com/open-feature/java-sdk/issues/1005)) ([e8568a8](https://github.com/open-feature/java-sdk/commit/e8568a8ea2c130be581a310be2214900eddf9d8f)) +* **deps:** update dependency org.apache.maven.plugins:maven-surefire-plugin to v3.4.0 ([#1052](https://github.com/open-feature/java-sdk/issues/1052)) ([13dd70f](https://github.com/open-feature/java-sdk/commit/13dd70f8472be2d0648f4880480c38f4aa51ec04)) +* **deps:** update dependency org.assertj:assertj-core to v3.26.3 ([#1002](https://github.com/open-feature/java-sdk/issues/1002)) ([2f5deb1](https://github.com/open-feature/java-sdk/commit/2f5deb1a3a578357bb8b965bc7ad0e61f5a8a782)) +* **deps:** update dependency org.awaitility:awaitility to v4.2.2 ([#1035](https://github.com/open-feature/java-sdk/issues/1035)) ([4591d3f](https://github.com/open-feature/java-sdk/commit/4591d3f1da330ba3631618b96576f48def6f59e0)) +* **deps:** update dependency org.codehaus.mojo:exec-maven-plugin to v3.4.0 ([#1034](https://github.com/open-feature/java-sdk/issues/1034)) ([ccabb18](https://github.com/open-feature/java-sdk/commit/ccabb1856cd697d54a227d3562278d03088b3aeb)) +* **deps:** update dependency org.codehaus.mojo:exec-maven-plugin to v3.4.1 ([#1042](https://github.com/open-feature/java-sdk/issues/1042)) ([37121e9](https://github.com/open-feature/java-sdk/commit/37121e9939338e83102fa004731efc209a8d32c4)) +* **deps:** update dependency org.cyclonedx:cyclonedx-maven-plugin to v2.8.1 ([#1029](https://github.com/open-feature/java-sdk/issues/1029)) ([89cb747](https://github.com/open-feature/java-sdk/commit/89cb7479f48b9f930b70e992aa94acd1ad9346a9)) +* **deps:** update github/codeql-action digest to 064a406 ([#1000](https://github.com/open-feature/java-sdk/issues/1000)) ([42d2d77](https://github.com/open-feature/java-sdk/commit/42d2d776a8e475bb2247d616cfc07bac896cf089)) +* **deps:** update github/codeql-action digest to 0d5982a ([#1043](https://github.com/open-feature/java-sdk/issues/1043)) ([f1ea405](https://github.com/open-feature/java-sdk/commit/f1ea4057fc9bccd4e32ac042060f967f934b0090)) +* **deps:** update github/codeql-action digest to 0e346f2 ([#1014](https://github.com/open-feature/java-sdk/issues/1014)) ([f1b0eb1](https://github.com/open-feature/java-sdk/commit/f1b0eb154dcbd1a02158b457a1bf848eb3040925)) +* **deps:** update github/codeql-action digest to 16639b4 ([#1024](https://github.com/open-feature/java-sdk/issues/1024)) ([d23a911](https://github.com/open-feature/java-sdk/commit/d23a9115c8f2fa43d05dde37b2aac88c872b0b8c)) +* **deps:** update github/codeql-action digest to 1b214db ([#1018](https://github.com/open-feature/java-sdk/issues/1018)) ([aa7f8b9](https://github.com/open-feature/java-sdk/commit/aa7f8b97f0464d36d3a87574915fe95901b612c5)) +* **deps:** update github/codeql-action digest to 202b3b9 ([#1056](https://github.com/open-feature/java-sdk/issues/1056)) ([61d821a](https://github.com/open-feature/java-sdk/commit/61d821ae8a2f64dbc20aa97002e973a423e3ccf7)) +* **deps:** update github/codeql-action digest to 25ad3c8 ([#1038](https://github.com/open-feature/java-sdk/issues/1038)) ([75b9acd](https://github.com/open-feature/java-sdk/commit/75b9acd79110bba199b84d262a7bf820fc515153)) +* **deps:** update github/codeql-action digest to 270a29d ([#1010](https://github.com/open-feature/java-sdk/issues/1010)) ([1d31726](https://github.com/open-feature/java-sdk/commit/1d31726e574ae09aeccb0365f6797e78187eb6ce)) +* **deps:** update github/codeql-action digest to 339aada ([#1053](https://github.com/open-feature/java-sdk/issues/1053)) ([aed4ea2](https://github.com/open-feature/java-sdk/commit/aed4ea21d6735c1aa4d2b16c2ec1d95b2de57672)) +* **deps:** update github/codeql-action digest to 44534b7 ([#1012](https://github.com/open-feature/java-sdk/issues/1012)) ([eca299b](https://github.com/open-feature/java-sdk/commit/eca299b3ad05dc198a91b29cac27c5df6a94eb3e)) +* **deps:** update github/codeql-action digest to 4b1d7da ([#1020](https://github.com/open-feature/java-sdk/issues/1020)) ([7db6d8a](https://github.com/open-feature/java-sdk/commit/7db6d8a3d3fb1dc17cb85740f0666601252a3c6e)) +* **deps:** update github/codeql-action digest to 512e306 ([#1055](https://github.com/open-feature/java-sdk/issues/1055)) ([7cac198](https://github.com/open-feature/java-sdk/commit/7cac1984f84e2aea631e98cb605c768123c870be)) +* **deps:** update github/codeql-action digest to 5c02493 ([#1032](https://github.com/open-feature/java-sdk/issues/1032)) ([1ed7fc1](https://github.com/open-feature/java-sdk/commit/1ed7fc15774af26b7c73238dc35b39a7c20ef129)) +* **deps:** update github/codeql-action digest to 5c681ef ([#1048](https://github.com/open-feature/java-sdk/issues/1048)) ([00bc060](https://github.com/open-feature/java-sdk/commit/00bc0609eb270e15129a3ebadb8671e61603b865)) +* **deps:** update github/codeql-action digest to 5cdd182 ([#1025](https://github.com/open-feature/java-sdk/issues/1025)) ([c574ec5](https://github.com/open-feature/java-sdk/commit/c574ec5c777017b2cdae770fbf35def4b6be1b55)) +* **deps:** update github/codeql-action digest to 6e04d51 ([#1001](https://github.com/open-feature/java-sdk/issues/1001)) ([145dfc7](https://github.com/open-feature/java-sdk/commit/145dfc70c276c0e9d3fe28f582ad5385a84ec0f6)) +* **deps:** update github/codeql-action digest to 79e9a50 ([#995](https://github.com/open-feature/java-sdk/issues/995)) ([e2c70d9](https://github.com/open-feature/java-sdk/commit/e2c70d9f0b4768ccbe9796cb14e99a92e5ba3dbc)) +* **deps:** update github/codeql-action digest to 7adf9ac ([#998](https://github.com/open-feature/java-sdk/issues/998)) ([62f95b6](https://github.com/open-feature/java-sdk/commit/62f95b651bb7bc18f984e42264900f2b486bf6bb)) +* **deps:** update github/codeql-action digest to 857f661 ([#1007](https://github.com/open-feature/java-sdk/issues/1007)) ([aab84b8](https://github.com/open-feature/java-sdk/commit/aab84b80af81a280d5729455048202090de7f7da)) +* **deps:** update github/codeql-action digest to 9ab7277 ([#1006](https://github.com/open-feature/java-sdk/issues/1006)) ([2bb58d6](https://github.com/open-feature/java-sdk/commit/2bb58d6e1b160848e7cb92394ae9f1b98f091b34)) +* **deps:** update github/codeql-action digest to 9c646c2 ([#1028](https://github.com/open-feature/java-sdk/issues/1028)) ([cd4c823](https://github.com/open-feature/java-sdk/commit/cd4c8239cd8c70dd8cdbc5398bfcb74668a65499)) +* **deps:** update github/codeql-action digest to a93f8c2 ([#1046](https://github.com/open-feature/java-sdk/issues/1046)) ([2934195](https://github.com/open-feature/java-sdk/commit/2934195a8f81b66c5b1ae45f0d7ec2252f830c24)) +* **deps:** update github/codeql-action digest to aa96d09 ([#1021](https://github.com/open-feature/java-sdk/issues/1021)) ([e57eafd](https://github.com/open-feature/java-sdk/commit/e57eafd86d9e333d70d027a64d7b83d4f2ce4f9f)) +* **deps:** update github/codeql-action digest to b400d0f ([#1016](https://github.com/open-feature/java-sdk/issues/1016)) ([5db43ad](https://github.com/open-feature/java-sdk/commit/5db43ad1aae4581d92f18eb8b209c701af55b1a5)) +* **deps:** update github/codeql-action digest to be825d5 ([#1003](https://github.com/open-feature/java-sdk/issues/1003)) ([f3d9a55](https://github.com/open-feature/java-sdk/commit/f3d9a55eb7c3955bc3dbf2c9db5f494749e2c890)) +* **deps:** update github/codeql-action digest to c24926b ([#1031](https://github.com/open-feature/java-sdk/issues/1031)) ([22435a6](https://github.com/open-feature/java-sdk/commit/22435a694a98022998d1b75a0cbee59caceccf15)) +* **deps:** update github/codeql-action digest to c2585ec ([#1008](https://github.com/open-feature/java-sdk/issues/1008)) ([9cc9241](https://github.com/open-feature/java-sdk/commit/9cc9241b014edb8ac25aa830ab250009d4bc506a)) +* **deps:** update github/codeql-action digest to d620faa ([#1041](https://github.com/open-feature/java-sdk/issues/1041)) ([69db287](https://github.com/open-feature/java-sdk/commit/69db2870071bfc5b307a0b5f6df27dc7f77daa26)) +* **deps:** update github/codeql-action digest to ee4ad8b ([#997](https://github.com/open-feature/java-sdk/issues/997)) ([fc40209](https://github.com/open-feature/java-sdk/commit/fc40209edcffc063a474aec7bfe9a880e0966750)) +* **deps:** update github/codeql-action digest to f67c9cd ([#1017](https://github.com/open-feature/java-sdk/issues/1017)) ([baa1331](https://github.com/open-feature/java-sdk/commit/baa13313e8cc10ab4f9f6dc6a216326dfcdc74b2)) +* **deps:** update github/codeql-action digest to f8e94f9 ([#1019](https://github.com/open-feature/java-sdk/issues/1019)) ([cf760e4](https://github.com/open-feature/java-sdk/commit/cf760e4cc4227b7bac4c4ce5192d06ed39a7783b)) +* **deps:** update github/codeql-action digest to fd5fa13 ([#1058](https://github.com/open-feature/java-sdk/issues/1058)) ([b0f915b](https://github.com/open-feature/java-sdk/commit/b0f915bb09d294e8b399941974b546cbd3bff187)) + + +### ๐Ÿ“š Documentation + +* Small typo sonartype vs sonatype ([#989](https://github.com/open-feature/java-sdk/issues/989)) ([7bff3ee](https://github.com/open-feature/java-sdk/commit/7bff3eebe624c9fecd705dd5fdd51d9483cb4643)) + ## [1.9.0](https://github.com/open-feature/java-sdk/compare/v1.8.0...v1.9.0) (2024-06-28) diff --git a/README.md b/README.md index 1d5598f5..e59b0824 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ - - Release + + Release @@ -59,7 +59,7 @@ Note that this library is intended to be used in server-side contexts and has no dev.openfeature sdk - 1.9.0 + 1.9.1 ``` @@ -72,8 +72,8 @@ If you would like snapshot builds, this is the relevant repository information: true - sonartype - Sonartype Repository + sonatype + Sonatype Repository https://s01.oss.sonatype.org/content/repositories/snapshots/ @@ -84,7 +84,7 @@ If you would like snapshot builds, this is the relevant repository information: ```groovy dependencies { - implementation 'dev.openfeature:sdk:1.9.0' + implementation 'dev.openfeature:sdk:1.9.1' } ``` diff --git a/pom.xml b/pom.xml index 6f6e8416..ecfa6e30 100644 --- a/pom.xml +++ b/pom.xml @@ -4,16 +4,16 @@ dev.openfeature sdk - 1.9.0 + 1.9.1 UTF-8 1.8 ${maven.compiler.source} - 5.10.3 + 5.11.0 **/e2e/*.java - ${groupId}.${artifactId} + ${project.groupId}.${project.artifactId} OpenFeature Java SDK @@ -60,7 +60,7 @@ org.slf4j slf4j-api - 2.0.13 + 2.0.16 @@ -74,7 +74,7 @@ org.assertj assertj-core - 3.26.0 + 3.26.3 test @@ -109,7 +109,7 @@ org.junit.platform junit-platform-suite - 1.10.3 + 1.11.0 test @@ -135,14 +135,14 @@ com.google.guava guava - 33.2.1-jre + 33.3.0-jre test org.awaitility awaitility - 4.2.1 + 4.2.2 test @@ -151,10 +151,28 @@ + + + + + net.bytebuddy + byte-buddy + 1.14.19 + test + + + + net.bytebuddy + byte-buddy-agent + 1.14.19 + test + + + io.cucumber cucumber-bom - 7.18.0 + 7.18.1 pom import @@ -162,7 +180,7 @@ org.junit junit-bom - 5.10.3 + 5.11.0 pom import @@ -175,7 +193,7 @@ org.cyclonedx cyclonedx-maven-plugin - 2.8.0 + 2.8.1 library 1.3 @@ -200,7 +218,7 @@ maven-dependency-plugin - 3.7.1 + 3.8.0 verify @@ -235,7 +253,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.3.0 + 3.4.0 ${surefireArgLine} @@ -250,7 +268,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.3.0 + 3.4.0 ${surefireArgLine} @@ -334,7 +352,7 @@ org.apache.maven.plugins maven-pmd-plugin - 3.23.0 + 3.24.0 run-pmd @@ -349,7 +367,7 @@ com.github.spotbugs spotbugs-maven-plugin - 4.8.6.1 + 4.8.6.2 spotbugs-exclusions.xml @@ -382,7 +400,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.4.0 + 3.5.0 checkstyle.xml UTF-8 @@ -452,7 +470,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.7.0 + 3.8.0 true all,-missing @@ -472,7 +490,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.4 + 3.2.5 sign-artifacts @@ -501,7 +519,7 @@ org.codehaus.mojo exec-maven-plugin - 3.3.0 + 3.4.1 update-test-harness-submodule diff --git a/src/main/java/dev/openfeature/sdk/ImmutableContext.java b/src/main/java/dev/openfeature/sdk/ImmutableContext.java index 0d02ba31..57009987 100644 --- a/src/main/java/dev/openfeature/sdk/ImmutableContext.java +++ b/src/main/java/dev/openfeature/sdk/ImmutableContext.java @@ -73,7 +73,7 @@ public String getTargetingKey() { * Merges this EvaluationContext object with the passed EvaluationContext, overriding in case of conflict. * * @param overridingContext overriding context - * @return resulting merged context + * @return new, resulting merged context */ @Override public EvaluationContext merge(EvaluationContext overridingContext) { diff --git a/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java b/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java index 4a1c1179..962f7d95 100644 --- a/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java +++ b/src/main/java/dev/openfeature/sdk/OpenFeatureClient.java @@ -105,7 +105,7 @@ private FlagEvaluationDetails evaluateFlag(FlagValueType type, String key FlagEvaluationDetails details = null; List mergedHooks = null; - HookContext hookCtx = null; + HookContext afterHookContext = null; FeatureProvider provider; try { @@ -115,12 +115,11 @@ private FlagEvaluationDetails evaluateFlag(FlagValueType type, String key mergedHooks = ObjectUtils.merge(provider.getProviderHooks(), flagOptions.getHooks(), clientHooks, openfeatureApi.getHooks()); - hookCtx = HookContext.from(key, type, this.getMetadata(), - provider.getMetadata(), ctx, defaultValue); + EvaluationContext mergedCtx = hookSupport.beforeHooks(type, HookContext.from(key, type, this.getMetadata(), + provider.getMetadata(), mergeEvaluationContext(ctx), defaultValue), mergedHooks, hints); - EvaluationContext ctxFromHook = hookSupport.beforeHooks(type, hookCtx, mergedHooks, hints); - - EvaluationContext mergedCtx = mergeEvaluationContext(ctxFromHook, ctx); + afterHookContext = HookContext.from(key, type, this.getMetadata(), + provider.getMetadata(), mergedCtx, defaultValue); ProviderEvaluation providerEval = (ProviderEvaluation) createProviderEvaluation(type, key, defaultValue, provider, mergedCtx); @@ -129,7 +128,7 @@ private FlagEvaluationDetails evaluateFlag(FlagValueType type, String key if (details.getErrorCode() != null) { throw ExceptionUtils.instantiateErrorByErrorCode(details.getErrorCode(), details.getErrorMessage()); } else { - hookSupport.afterHooks(type, hookCtx, details, mergedHooks, hints); + hookSupport.afterHooks(type, afterHookContext, details, mergedHooks, hints); } } catch (Exception e) { log.error("Unable to correctly evaluate flag with key '{}'", key, e); @@ -144,24 +143,22 @@ private FlagEvaluationDetails evaluateFlag(FlagValueType type, String key details.setErrorMessage(e.getMessage()); details.setValue(defaultValue); details.setReason(Reason.ERROR.toString()); - hookSupport.errorHooks(type, hookCtx, e, mergedHooks, hints); + hookSupport.errorHooks(type, afterHookContext, e, mergedHooks, hints); } finally { - hookSupport.afterAllHooks(type, hookCtx, mergedHooks, hints); + hookSupport.afterAllHooks(type, afterHookContext, mergedHooks, hints); } return details; } /** - * Merge hook and invocation contexts with API, transaction and client contexts. + * Merge invocation contexts with API, transaction and client contexts. + * Does not merge before context. * - * @param hookContext hook context * @param invocationContext invocation context * @return merged evaluation context */ - private EvaluationContext mergeEvaluationContext( - EvaluationContext hookContext, - EvaluationContext invocationContext) { + private EvaluationContext mergeEvaluationContext(EvaluationContext invocationContext) { final EvaluationContext apiContext = openfeatureApi.getEvaluationContext() != null ? openfeatureApi.getEvaluationContext() : new ImmutableContext(); @@ -172,7 +169,7 @@ private EvaluationContext mergeEvaluationContext( ? openfeatureApi.getTransactionContext() : new ImmutableContext(); - return apiContext.merge(transactionContext.merge(clientContext.merge(invocationContext.merge(hookContext)))); + return apiContext.merge(transactionContext.merge(clientContext.merge(invocationContext))); } private ProviderEvaluation createProviderEvaluation( diff --git a/src/main/java/dev/openfeature/sdk/providers/memory/InMemoryProvider.java b/src/main/java/dev/openfeature/sdk/providers/memory/InMemoryProvider.java index 8cd9fc8d..5b6d2870 100644 --- a/src/main/java/dev/openfeature/sdk/providers/memory/InMemoryProvider.java +++ b/src/main/java/dev/openfeature/sdk/providers/memory/InMemoryProvider.java @@ -1,12 +1,5 @@ package dev.openfeature.sdk.providers.memory; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - import dev.openfeature.sdk.EvaluationContext; import dev.openfeature.sdk.EventProvider; import dev.openfeature.sdk.Metadata; @@ -24,6 +17,13 @@ import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + /** * In-memory provider. */ @@ -33,7 +33,7 @@ public class InMemoryProvider extends EventProvider { @Getter private static final String NAME = "InMemoryProvider"; - private Map> flags; + private final Map> flags; @Getter private ProviderState state = ProviderState.NOT_READY; @@ -44,11 +44,11 @@ public Metadata getMetadata() { } public InMemoryProvider(Map> flags) { - this.flags = new HashMap<>(flags); + this.flags = new ConcurrentHashMap<>(flags); } /** - * Initialize the provider. + * Initializes the provider. * @param evaluationContext evaluation context * @throws Exception on error */ @@ -60,14 +60,15 @@ public void initialize(EvaluationContext evaluationContext) throws Exception { } /** - * Updating provider flags configuration, replacing existing flags. - * @param flags the flags to use instead of the previous flags. + * Updates the provider flags configuration. + * For existing flags, the new configurations replace the old one. + * For new flags, they are added to the configuration. + * @param newFlags the new flag configurations */ - public void updateFlags(Map> flags) { - Set flagsChanged = new HashSet<>(); - flagsChanged.addAll(this.flags.keySet()); - flagsChanged.addAll(flags.keySet()); - this.flags = new HashMap<>(flags); + public void updateFlags(Map> newFlags) { + Set flagsChanged = new HashSet<>(newFlags.keySet()); + this.flags.putAll(newFlags); + ProviderEventDetails details = ProviderEventDetails.builder() .flagsChanged(new ArrayList<>(flagsChanged)) .message("flags changed") @@ -76,13 +77,15 @@ public void updateFlags(Map> flags) { } /** - * Updating provider flags configuration with adding or updating a flag. - * @param flag the flag to update. If a flag with this key already exists, new flag replaces it. + * Updates a single provider flag configuration. + * For existing flag, the new configuration replaces the old one. + * For new flag, they are added to the configuration. + * @param newFlag the flag to update */ - public void updateFlag(String flagKey, Flag flag) { - this.flags.put(flagKey, flag); + public void updateFlag(String flagKey, Flag newFlag) { + this.flags.put(flagKey, newFlag); ProviderEventDetails details = ProviderEventDetails.builder() - .flagsChanged(Arrays.asList(flagKey)) + .flagsChanged(Collections.singletonList(flagKey)) .message("flag added/updated") .build(); emitProviderConfigurationChanged(details); diff --git a/src/test/java/dev/openfeature/sdk/FlagEvaluationSpecTest.java b/src/test/java/dev/openfeature/sdk/FlagEvaluationSpecTest.java index b2a7510e..6d2bca3a 100644 --- a/src/test/java/dev/openfeature/sdk/FlagEvaluationSpecTest.java +++ b/src/test/java/dev/openfeature/sdk/FlagEvaluationSpecTest.java @@ -2,7 +2,6 @@ import static dev.openfeature.sdk.DoSomethingProvider.DEFAULT_METADATA; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatCode; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -20,6 +19,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Optional; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; @@ -336,11 +336,25 @@ public void initialize(EvaluationContext evaluationContext) throws Exception { FeatureProviderTestUtils.setFeatureProvider(provider); TransactionContextPropagator transactionContextPropagator = new ThreadLocalTransactionContextPropagator(); api.setTransactionContextPropagator(transactionContextPropagator); + Hook hook = spy(new Hook() { + @Override + public Optional before(HookContext ctx, Map hints) { + Map attrs = ctx.getCtx().asMap(); + attrs.put("before", new Value("5")); + attrs.put("common7", new Value("5")); + return Optional.ofNullable(new ImmutableContext(attrs)); + } + @Override + public void after(HookContext ctx, FlagEvaluationDetails details, Map hints) { + Hook.super.after(ctx, details, hints); + } + }); Map apiAttributes = new HashMap<>(); apiAttributes.put("common1", new Value("1")); apiAttributes.put("common2", new Value("1")); apiAttributes.put("common3", new Value("1")); + apiAttributes.put("common7", new Value("1")); apiAttributes.put("api", new Value("1")); EvaluationContext apiCtx = new ImmutableContext(apiAttributes); @@ -377,21 +391,55 @@ public void initialize(EvaluationContext evaluationContext) throws Exception { invocationAttributes.put("invocation", new Value("4")); EvaluationContext invocationCtx = new ImmutableContext(invocationAttributes); - c.getBooleanValue("key", false, invocationCtx); - - // assert the connect overrides + c.getBooleanValue("key", false, invocationCtx, FlagEvaluationOptions.builder().hook(hook).build()); + + // assert the correct overrides in before hook + verify(hook).before(argThat((arg) -> { + EvaluationContext evaluationContext = arg.getCtx(); + return evaluationContext.getValue("api").asString().equals("1") && + evaluationContext.getValue("transaction").asString().equals("2") && + evaluationContext.getValue("client").asString().equals("3") && + evaluationContext.getValue("invocation").asString().equals("4") && + evaluationContext.getValue("common1").asString().equals("2") && + evaluationContext.getValue("common2").asString().equals("3") && + evaluationContext.getValue("common3").asString().equals("4") && + evaluationContext.getValue("common4").asString().equals("3") && + evaluationContext.getValue("common5").asString().equals("4") && + evaluationContext.getValue("common6").asString().equals("4"); + }), any()); + + // assert the correct overrides in evaluation verify(provider).getBooleanEvaluation(any(), any(), argThat((arg) -> { return arg.getValue("api").asString().equals("1") && arg.getValue("transaction").asString().equals("2") && arg.getValue("client").asString().equals("3") && arg.getValue("invocation").asString().equals("4") && + arg.getValue("before").asString().equals("5") && arg.getValue("common1").asString().equals("2") && arg.getValue("common2").asString().equals("3") && arg.getValue("common3").asString().equals("4") && arg.getValue("common4").asString().equals("3") && arg.getValue("common5").asString().equals("4") && - arg.getValue("common6").asString().equals("4"); + arg.getValue("common6").asString().equals("4") && + arg.getValue("common7").asString().equals("5"); })); + + // assert the correct overrides in after hook + verify(hook).after(argThat((arg) -> { + EvaluationContext evaluationContext = arg.getCtx(); + return evaluationContext.getValue("api").asString().equals("1") && + evaluationContext.getValue("transaction").asString().equals("2") && + evaluationContext.getValue("client").asString().equals("3") && + evaluationContext.getValue("invocation").asString().equals("4") && + evaluationContext.getValue("before").asString().equals("5") && + evaluationContext.getValue("common1").asString().equals("2") && + evaluationContext.getValue("common2").asString().equals("3") && + evaluationContext.getValue("common3").asString().equals("4") && + evaluationContext.getValue("common4").asString().equals("3") && + evaluationContext.getValue("common5").asString().equals("4") && + evaluationContext.getValue("common6").asString().equals("4") && + evaluationContext.getValue("common7").asString().equals("5"); + }), any(), any()); } @Specification(number="3.3.1.1", text="The API SHOULD have a method for setting a transaction context propagator.") diff --git a/src/test/java/dev/openfeature/sdk/HookSpecTest.java b/src/test/java/dev/openfeature/sdk/HookSpecTest.java index 098d80d7..2554457a 100644 --- a/src/test/java/dev/openfeature/sdk/HookSpecTest.java +++ b/src/test/java/dev/openfeature/sdk/HookSpecTest.java @@ -484,10 +484,11 @@ public void finallyAfter(HookContext ctx, Map hints) { @Specification(number = "4.1.4", text = "The evaluation context MUST be mutable only within the before hook.") @Specification(number = "4.3.4", text = "Any `evaluation context` returned from a `before` hook MUST be passed to subsequent `before` hooks (via `HookContext`).") @Test void beforeContextUpdated() { - EvaluationContext ctx = new ImmutableContext(); - Hook hook = mockBooleanHook(); + String targetingKey = "test-key"; + EvaluationContext ctx = new ImmutableContext(targetingKey); + Hook hook = mockBooleanHook(); when(hook.before(any(), any())).thenReturn(Optional.of(ctx)); - Hook hook2 = mockBooleanHook(); + Hook hook2 = mockBooleanHook(); when(hook.before(any(), any())).thenReturn(Optional.empty()); InOrder order = inOrder(hook, hook2); @@ -499,11 +500,11 @@ public void finallyAfter(HookContext ctx, Map hints) { .build()); order.verify(hook).before(any(), any()); - ArgumentCaptor captor = ArgumentCaptor.forClass(HookContext.class); + ArgumentCaptor> captor = ArgumentCaptor.forClass(HookContext.class); order.verify(hook2).before(captor.capture(), any()); - HookContext hc = captor.getValue(); - assertEquals(hc.getCtx(), ctx); + HookContext hc = captor.getValue(); + assertEquals(hc.getCtx().getTargetingKey(), targetingKey); } diff --git a/src/test/java/dev/openfeature/sdk/providers/memory/InMemoryProviderTest.java b/src/test/java/dev/openfeature/sdk/providers/memory/InMemoryProviderTest.java index ffdc3182..cb7770d4 100644 --- a/src/test/java/dev/openfeature/sdk/providers/memory/InMemoryProviderTest.java +++ b/src/test/java/dev/openfeature/sdk/providers/memory/InMemoryProviderTest.java @@ -2,6 +2,7 @@ import com.google.common.collect.ImmutableMap; import dev.openfeature.sdk.Client; +import dev.openfeature.sdk.EventDetails; import dev.openfeature.sdk.ImmutableContext; import dev.openfeature.sdk.OpenFeatureAPI; import dev.openfeature.sdk.Value; @@ -9,18 +10,22 @@ import dev.openfeature.sdk.exceptions.ProviderNotReadyError; import dev.openfeature.sdk.exceptions.TypeMismatchError; import lombok.SneakyThrows; -import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import java.util.HashMap; import java.util.Map; +import java.util.function.Consumer; import static dev.openfeature.sdk.Structure.mapToStructure; import static dev.openfeature.sdk.testutils.TestFlagsUtils.buildFlags; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.awaitility.Awaitility.await; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.argThat; +import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -32,8 +37,8 @@ class InMemoryProviderTest { private static InMemoryProvider provider; @SneakyThrows - @BeforeAll - static void beforeAll() { + @BeforeEach + void beforeEach() { Map> flags = buildFlags(); provider = spy(new InMemoryProvider(flags)); OpenFeatureAPI.getInstance().onProviderConfigurationChanged(eventDetails -> {}); @@ -105,4 +110,19 @@ void shouldThrowIfNotInitialized() { // ErrorCode.PROVIDER_NOT_READY should be returned when evaluated via the client assertThrows(ProviderNotReadyError.class, ()-> inMemoryProvider.getBooleanEvaluation("fail_not_initialized", false, new ImmutableContext())); } + + @SuppressWarnings("unchecked") + @Test + void emitChangedFlagsOnlyIfThereAreChangedFlags() { + Consumer handler = mock(Consumer.class); + Map> flags = buildFlags(); + + OpenFeatureAPI.getInstance().onProviderConfigurationChanged(handler); + OpenFeatureAPI.getInstance().setProviderAndWait(provider); + + provider.updateFlags(flags); + + await().untilAsserted(() -> verify(handler, times(1)) + .accept(argThat(details -> details.getFlagsChanged().size() == buildFlags().size()))); + } } \ No newline at end of file diff --git a/version.txt b/version.txt index f8e233b2..9ab8337f 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.9.0 +1.9.1