From e1709c1ae4a204e5971d6d814184ff175a73f02b Mon Sep 17 00:00:00 2001 From: Nadia Mayor Date: Fri, 22 Dec 2023 12:24:40 -0300 Subject: [PATCH 1/8] [SDKS-7867] Add new impressionsListener builder in IntegrationConfig --- .../java/io/split/integrations/IntegrationsConfig.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/src/main/java/io/split/integrations/IntegrationsConfig.java b/client/src/main/java/io/split/integrations/IntegrationsConfig.java index b13f6f114..8e512bdd6 100644 --- a/client/src/main/java/io/split/integrations/IntegrationsConfig.java +++ b/client/src/main/java/io/split/integrations/IntegrationsConfig.java @@ -58,6 +58,14 @@ public Builder impressionsListener(ImpressionListener listener, int queueSize) { return this; } + public Builder impressionsListener(ImpressionListener listener, int queueSize, Execution executionType) { + if (queueSize <= 0) { + throw new IllegalArgumentException("An ImpressionListener was provided, but its capacity was non-positive: " + queueSize); + } + _listeners.add(new ImpressionListenerWithMeta(listener, executionType, queueSize)); + return this; + } + public Builder newRelicImpressionListener() { if (_newRelicEnabled) { _log.warn("You can only add one new relic integration instance. Ignoring"); From c6e16170b5943589de6dd92e4684d0f6ad832ddf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 1 Jan 2024 03:04:00 +0000 Subject: [PATCH 2/8] Updated License Year --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 65f5999da..c022e9200 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright © 2023 Split Software, Inc. +Copyright © 2024 Split Software, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 8bb9a5bce69ce8eeb0bdf26e54901b037c8e23c2 Mon Sep 17 00:00:00 2001 From: Nadia Mayor Date: Thu, 4 Jan 2024 14:14:00 -0300 Subject: [PATCH 3/8] [SDKS-7888] Add test case in SplitClientConfig --- .../split/client/SplitClientConfigTest.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/client/src/test/java/io/split/client/SplitClientConfigTest.java b/client/src/test/java/io/split/client/SplitClientConfigTest.java index 2285e22a2..8e87ce938 100644 --- a/client/src/test/java/io/split/client/SplitClientConfigTest.java +++ b/client/src/test/java/io/split/client/SplitClientConfigTest.java @@ -7,6 +7,7 @@ import io.split.integrations.IntegrationsConfig; import org.junit.Assert; import org.junit.Test; +import org.mockito.Mockito; import java.util.List; import java.util.stream.Collectors; @@ -214,4 +215,24 @@ public void threadFactoryNotNull() { SplitClientConfig config = SplitClientConfig.builder().threadFactory(new ThreadFactoryBuilder().build()).build(); Assert.assertNotNull(config.getThreadFactory()); } + + @Test + public void IntegrationConfigSyncNotNull() { + SplitClientConfig config = SplitClientConfig.builder().integrations(IntegrationsConfig.builder() + .impressionsListener(Mockito.mock(ImpressionListener.class), 500, IntegrationsConfig.Execution.SYNC) + .build()).build(); + Assert.assertNotNull(config.integrationsConfig()); + Assert.assertEquals(1, config.integrationsConfig().getImpressionsListeners(IntegrationsConfig.Execution.SYNC).size()); + Assert.assertEquals(0, config.integrationsConfig().getImpressionsListeners(IntegrationsConfig.Execution.ASYNC).size()); + } + + @Test + public void IntegrationConfigAsyncNotNull() { + SplitClientConfig config = SplitClientConfig.builder().integrations(IntegrationsConfig.builder() + .impressionsListener(Mockito.mock(ImpressionListener.class), 500, IntegrationsConfig.Execution.ASYNC) + .build()).build(); + Assert.assertNotNull(config.integrationsConfig()); + Assert.assertEquals(0, config.integrationsConfig().getImpressionsListeners(IntegrationsConfig.Execution.SYNC).size()); + Assert.assertEquals(1, config.integrationsConfig().getImpressionsListeners(IntegrationsConfig.Execution.ASYNC).size()); + } } \ No newline at end of file From 55c2e8e87322292df9cc44e4df21b5912366cd57 Mon Sep 17 00:00:00 2001 From: Nadia Mayor Date: Thu, 4 Jan 2024 14:41:40 -0300 Subject: [PATCH 4/8] Update github actions --- .github/workflows/ci.yml | 2 +- .github/workflows/update-license-year.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f258689cb..721a67076 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/update-license-year.yml b/.github/workflows/update-license-year.yml index 13aaac8a2..7e0a945f9 100644 --- a/.github/workflows/update-license-year.yml +++ b/.github/workflows/update-license-year.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -24,7 +24,7 @@ jobs: run: "echo PREVIOUS=$(($CURRENT-1)) >> $GITHUB_ENV" - name: Update LICENSE - uses: jacobtomlinson/gha-find-replace@v2 + uses: jacobtomlinson/gha-find-replace@v3 with: find: ${{ env.PREVIOUS }} replace: ${{ env.CURRENT }} @@ -38,7 +38,7 @@ jobs: git commit -m "Updated License Year" -a - name: Create Pull Request - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.GITHUB_TOKEN }} title: Update License Year From f17d44ae535b4501857079c34fccdaa844bebb91 Mon Sep 17 00:00:00 2001 From: Nadia Mayor Date: Thu, 4 Jan 2024 14:51:30 -0300 Subject: [PATCH 5/8] Update changelog --- CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 36b9b2662..6fdec255e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,6 @@ +4.11.0 (Jan XX, 2024) +- Added impressionsListener method in the IntegrationConfig builder to set Sync and Async Listener. + 4.10.2 (Dec 1, 2023) - Added getTreatmentsByFlagSets without attributes. - Fixed some issues for flag sets: Not logging a warning when using flag sets that don't contain cached feature flags. From f9c7e0177fd2bc714a360a357d56dd90f9cf0ff3 Mon Sep 17 00:00:00 2001 From: Nadia Mayor Date: Thu, 4 Jan 2024 15:45:05 -0300 Subject: [PATCH 6/8] Update changelog --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 6fdec255e..ed46c6a0a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,5 @@ 4.11.0 (Jan XX, 2024) -- Added impressionsListener method in the IntegrationConfig builder to set Sync and Async Listener. +- Added impressionsListener method in the IntegrationConfig builder to set Sync or Async Listener execution. 4.10.2 (Dec 1, 2023) - Added getTreatmentsByFlagSets without attributes. From 947cee8954f7767806d7063fe7188b4c53eb2cba Mon Sep 17 00:00:00 2001 From: Nadia Mayor Date: Mon, 8 Jan 2024 14:44:26 -0300 Subject: [PATCH 7/8] Pr suggestion --- .../main/java/io/split/integrations/IntegrationsConfig.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/client/src/main/java/io/split/integrations/IntegrationsConfig.java b/client/src/main/java/io/split/integrations/IntegrationsConfig.java index 8e512bdd6..1a0fa4846 100644 --- a/client/src/main/java/io/split/integrations/IntegrationsConfig.java +++ b/client/src/main/java/io/split/integrations/IntegrationsConfig.java @@ -51,11 +51,7 @@ public Builder() { } public Builder impressionsListener(ImpressionListener listener, int queueSize) { - if (queueSize <= 0) { - throw new IllegalArgumentException("An ImpressionListener was provided, but its capacity was non-positive: " + queueSize); - } - _listeners.add(new ImpressionListenerWithMeta(listener, Execution.ASYNC, queueSize)); - return this; + return impressionsListener(listener, queueSize, Execution.ASYNC); } public Builder impressionsListener(ImpressionListener listener, int queueSize, Execution executionType) { From 02f0b10fc625f5be7f7f2ec5c156097eb3c8eebb Mon Sep 17 00:00:00 2001 From: Nadia Mayor Date: Mon, 8 Jan 2024 18:00:03 -0300 Subject: [PATCH 8/8] Update changelog --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index ed46c6a0a..f1137abdb 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -4.11.0 (Jan XX, 2024) +4.11.0 (Jan 9, 2024) - Added impressionsListener method in the IntegrationConfig builder to set Sync or Async Listener execution. 4.10.2 (Dec 1, 2023)