From e473ffcbb0519ad7eb716f3c2444c2b670c15515 Mon Sep 17 00:00:00 2001 From: Gaston Thea Date: Thu, 19 Jun 2025 12:48:54 -0300 Subject: [PATCH 01/15] Modified POMs --- client/pom.xml | 10 ++++++---- okhttp-modules/pom.xml | 10 ++++++---- pluggable-storage/pom.xml | 13 ++++++------- pom.xml | 36 +++++++++--------------------------- redis-wrapper/pom.xml | 13 ++++++------- testing/pom.xml | 13 ++++++------- 6 files changed, 39 insertions(+), 56 deletions(-) diff --git a/client/pom.xml b/client/pom.xml index d0ae4a78..eb4ed8bd 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -19,12 +19,14 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.3 + org.sonatype.central + central-publishing-maven-plugin + 0.7.0 true - false + central + false + published diff --git a/okhttp-modules/pom.xml b/okhttp-modules/pom.xml index a8645f9c..f2866272 100644 --- a/okhttp-modules/pom.xml +++ b/okhttp-modules/pom.xml @@ -20,12 +20,14 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.3 + org.sonatype.central + central-publishing-maven-plugin + 0.7.0 true - false + central + false + published diff --git a/pluggable-storage/pom.xml b/pluggable-storage/pom.xml index 21b0bdac..7e1dc7e7 100644 --- a/pluggable-storage/pom.xml +++ b/pluggable-storage/pom.xml @@ -21,15 +21,14 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.3 + org.sonatype.central + central-publishing-maven-plugin + 0.7.0 true - ossrh - https://oss.sonatype.org/ - true - true + central + false + published diff --git a/pom.xml b/pom.xml index 7b21f1ec..10ba16fd 100644 --- a/pom.xml +++ b/pom.xml @@ -47,16 +47,7 @@ scm:git@github.com:splitio/java-client.git git@github.com:splitio/java-client.git - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://oss.sonatype.org/content/repositories/releases - - + ossrh @@ -188,16 +179,7 @@ release - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - ossrh - https://oss.sonatype.org/content/repositories/releases - - + @@ -230,16 +212,16 @@ - + - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.3 + org.sonatype.central + central-publishing-maven-plugin + 0.7.0 true - ossrh - https://oss.sonatype.org/ - true + central + false + published diff --git a/redis-wrapper/pom.xml b/redis-wrapper/pom.xml index 301739ce..61537413 100644 --- a/redis-wrapper/pom.xml +++ b/redis-wrapper/pom.xml @@ -43,15 +43,14 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.3 + org.sonatype.central + central-publishing-maven-plugin + 0.7.0 true - ossrh - https://oss.sonatype.org/ - true - true + central + false + published diff --git a/testing/pom.xml b/testing/pom.xml index 0fae6cdf..45479f34 100644 --- a/testing/pom.xml +++ b/testing/pom.xml @@ -31,15 +31,14 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.3 + org.sonatype.central + central-publishing-maven-plugin + 0.7.0 true - ossrh - https://oss.sonatype.org/ - true - false + central + false + published From 5a6ee5e0a0e9af62d0b6eab5d6aa69753f259c35 Mon Sep 17 00:00:00 2001 From: Gaston Thea Date: Thu, 19 Jun 2025 15:34:53 -0300 Subject: [PATCH 02/15] Publish to Central Repository --- client/pom.xml | 2 +- okhttp-modules/pom.xml | 2 +- pluggable-storage/pom.xml | 2 +- pom.xml | 2 +- redis-wrapper/pom.xml | 2 +- testing/pom.xml | 2 +- update_maven_settings.sh | 161 ++++++++++++++++++++++++++++++++++++++ 7 files changed, 167 insertions(+), 6 deletions(-) create mode 100755 update_maven_settings.sh diff --git a/client/pom.xml b/client/pom.xml index eb4ed8bd..7a429aed 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -21,7 +21,7 @@ org.sonatype.central central-publishing-maven-plugin - 0.7.0 + 0.8.0 true central diff --git a/okhttp-modules/pom.xml b/okhttp-modules/pom.xml index f2866272..1081dc20 100644 --- a/okhttp-modules/pom.xml +++ b/okhttp-modules/pom.xml @@ -22,7 +22,7 @@ org.sonatype.central central-publishing-maven-plugin - 0.7.0 + 0.8.0 true central diff --git a/pluggable-storage/pom.xml b/pluggable-storage/pom.xml index 7e1dc7e7..c4f7e76f 100644 --- a/pluggable-storage/pom.xml +++ b/pluggable-storage/pom.xml @@ -23,7 +23,7 @@ org.sonatype.central central-publishing-maven-plugin - 0.7.0 + 0.8.0 true central diff --git a/pom.xml b/pom.xml index 10ba16fd..fe966220 100644 --- a/pom.xml +++ b/pom.xml @@ -216,7 +216,7 @@ org.sonatype.central central-publishing-maven-plugin - 0.7.0 + 0.8.0 true central diff --git a/redis-wrapper/pom.xml b/redis-wrapper/pom.xml index 61537413..6faa8130 100644 --- a/redis-wrapper/pom.xml +++ b/redis-wrapper/pom.xml @@ -45,7 +45,7 @@ org.sonatype.central central-publishing-maven-plugin - 0.7.0 + 0.8.0 true central diff --git a/testing/pom.xml b/testing/pom.xml index 45479f34..5ea099d8 100644 --- a/testing/pom.xml +++ b/testing/pom.xml @@ -33,7 +33,7 @@ org.sonatype.central central-publishing-maven-plugin - 0.7.0 + 0.8.0 true central diff --git a/update_maven_settings.sh b/update_maven_settings.sh new file mode 100755 index 00000000..8bea975f --- /dev/null +++ b/update_maven_settings.sh @@ -0,0 +1,161 @@ +#!/bin/bash + +# Script to update Maven settings.xml with Central Repository credentials using xmlstarlet + +# ANSI color codes +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +BLUE='\033[0;34m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +# Check if xmlstarlet is installed +if ! command -v xmlstarlet &> /dev/null; then + echo -e "${RED}Error: xmlstarlet is not installed.${NC}" + echo "Please install xmlstarlet first:" + echo " macOS: brew install xmlstarlet" + echo " Debian/Ubuntu: sudo apt-get install xmlstarlet" + echo " RHEL/CentOS/Fedora: sudo yum install xmlstarlet" + echo "Then run this script again." + exit 1 +fi + +# Default values +DEFAULT_SETTINGS_PATH="$HOME/.m2/settings.xml" +DEFAULT_SERVER_ID="central" + +echo -e "${BLUE}Maven Settings.xml Update Script${NC}" +echo "This script will update your Maven settings.xml with Central Repository credentials." +echo + +# Ask for settings.xml path or use default +read -p "Path to settings.xml [$DEFAULT_SETTINGS_PATH]: " SETTINGS_PATH +SETTINGS_PATH=${SETTINGS_PATH:-$DEFAULT_SETTINGS_PATH} + +# Variables to store existing values +EXISTING_USERNAME="" +EXISTING_PASSWORD="" + +# Extract existing values if settings.xml exists +if [ -f "$SETTINGS_PATH" ] && command -v xmlstarlet &> /dev/null; then + # Check if the file is valid XML + if xmlstarlet val "$SETTINGS_PATH" &> /dev/null; then + echo -e "${YELLOW}Reading existing settings from ${SETTINGS_PATH}...${NC}" + + # Extract existing server ID + DEFAULT_SERVER_ID=$(xmlstarlet sel -t -v "/settings/servers/server[1]/id" "$SETTINGS_PATH" 2>/dev/null || echo "$DEFAULT_SERVER_ID") + + # Extract existing username and password for the server + EXISTING_USERNAME=$(xmlstarlet sel -t -v "/settings/servers/server[id='$DEFAULT_SERVER_ID']/username" "$SETTINGS_PATH" 2>/dev/null || echo "") + EXISTING_PASSWORD=$(xmlstarlet sel -t -v "/settings/servers/server[id='$DEFAULT_SERVER_ID']/password" "$SETTINGS_PATH" 2>/dev/null || echo "") + fi +fi + +# Ask for server ID or use default/existing +read -p "Server ID [$DEFAULT_SERVER_ID]: " SERVER_ID +SERVER_ID=${SERVER_ID:-$DEFAULT_SERVER_ID} + +# Ask for username (show existing if available) +USERNAME_PROMPT="Username" +if [ -n "$EXISTING_USERNAME" ]; then + USERNAME_PROMPT="Username (current: $EXISTING_USERNAME)" +fi +read -p "$USERNAME_PROMPT: " USERNAME +USERNAME=${USERNAME:-$EXISTING_USERNAME} + +# Ask for password (indicate if existing) +PASSWORD_PROMPT="Password" +if [ -n "$EXISTING_PASSWORD" ]; then + PASSWORD_PROMPT="Password (leave empty to keep current)" +fi +read -s -p "$PASSWORD_PROMPT: " PASSWORD +echo +# Only use existing password if the user didn't enter a new one +if [ -z "$PASSWORD" ] && [ -n "$EXISTING_PASSWORD" ]; then + PASSWORD="$EXISTING_PASSWORD" +fi + +# Create .m2 directory if it doesn't exist +M2_DIR=$(dirname "$SETTINGS_PATH") +mkdir -p "$M2_DIR" + +# No GPG configuration needed + +# Function to create a new settings.xml file +create_new_settings() { + echo -e "${YELLOW}Creating new settings.xml file...${NC}" + cat > "$SETTINGS_PATH" << EOF + + + + + $SERVER_ID + $USERNAME + $PASSWORD + + + +EOF +} + +# Check if settings.xml exists +if [ -f "$SETTINGS_PATH" ]; then + echo -e "${YELLOW}Existing settings.xml found. Backing up to ${SETTINGS_PATH}.bak${NC}" + cp "$SETTINGS_PATH" "${SETTINGS_PATH}.bak" + + # Check if the file is valid XML + if ! xmlstarlet val "$SETTINGS_PATH" &> /dev/null; then + echo -e "${RED}Warning: The existing settings.xml is not valid XML.${NC}" + read -p "Do you want to create a new settings.xml file? (y/n): " CREATE_NEW + if [[ $CREATE_NEW =~ ^[Yy]$ ]]; then + create_new_settings + else + echo -e "${RED}Exiting without making changes.${NC}" + exit 1 + fi + else + # Check if servers element exists + if ! xmlstarlet sel -t -v "/settings/servers" "$SETTINGS_PATH" &> /dev/null; then + echo -e "${YELLOW}No servers section found. Adding servers section...${NC}" + xmlstarlet ed --inplace \ + -s "/settings" -t elem -n "servers" \ + -s "/settings/servers" -t elem -n "server" \ + -s "/settings/servers/server" -t elem -n "id" -v "$SERVER_ID" \ + -s "/settings/servers/server" -t elem -n "username" -v "$USERNAME" \ + -s "/settings/servers/server" -t elem -n "password" -v "$PASSWORD" \ + "$SETTINGS_PATH" + else + # Check if server with this ID already exists + if xmlstarlet sel -t -v "/settings/servers/server[id='$SERVER_ID']" "$SETTINGS_PATH" &> /dev/null; then + echo -e "${YELLOW}Server with ID '$SERVER_ID' already exists. Updating credentials...${NC}" + # Update existing server credentials + xmlstarlet ed --inplace \ + -u "/settings/servers/server[id='$SERVER_ID']/username" -v "$USERNAME" \ + -u "/settings/servers/server[id='$SERVER_ID']/password" -v "$PASSWORD" \ + "$SETTINGS_PATH" + else + echo -e "${YELLOW}Adding new server with ID '$SERVER_ID'...${NC}" + # Add new server to existing servers section + xmlstarlet ed --inplace \ + -s "/settings/servers" -t elem -n "server" \ + -s "/settings/servers/server[last()]" -t elem -n "id" -v "$SERVER_ID" \ + -s "/settings/servers/server[last()]" -t elem -n "username" -v "$USERNAME" \ + -s "/settings/servers/server[last()]" -t elem -n "password" -v "$PASSWORD" \ + "$SETTINGS_PATH" + fi + fi + fi +else + create_new_settings +fi + +# Make sure the file has the right permissions +chmod 600 "$SETTINGS_PATH" + +echo -e "${GREEN}Maven settings.xml updated successfully at $SETTINGS_PATH${NC}" +echo -e "${GREEN}Server ID: $SERVER_ID${NC}" +echo -e "${GREEN}Username: $USERNAME${NC}" +echo -e "${GREEN}Password: ********${NC}" + From 7aa63c62d12f1722679acaca4d89336a0c8b9962 Mon Sep 17 00:00:00 2001 From: Gaston Thea Date: Mon, 23 Jun 2025 18:11:21 -0300 Subject: [PATCH 03/15] Add skip if already published in modules --- client/pom.xml | 5 +++-- okhttp-modules/pom.xml | 1 + pluggable-storage/pom.xml | 1 + pom.xml | 2 +- redis-wrapper/pom.xml | 1 + testing/pom.xml | 3 ++- 6 files changed, 9 insertions(+), 4 deletions(-) diff --git a/client/pom.xml b/client/pom.xml index 7a429aed..d70c9d80 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -5,9 +5,9 @@ io.split.client java-client-parent - 4.16.0 + 4.16.1-rc1 - 4.16.0 + 4.16.1-rc1 java-client jar Java Client @@ -24,6 +24,7 @@ 0.8.0 true + true central false published diff --git a/okhttp-modules/pom.xml b/okhttp-modules/pom.xml index 1081dc20..3a842c81 100644 --- a/okhttp-modules/pom.xml +++ b/okhttp-modules/pom.xml @@ -25,6 +25,7 @@ 0.8.0 true + true central false published diff --git a/pluggable-storage/pom.xml b/pluggable-storage/pom.xml index c4f7e76f..d5b1a995 100644 --- a/pluggable-storage/pom.xml +++ b/pluggable-storage/pom.xml @@ -26,6 +26,7 @@ 0.8.0 true + true central false published diff --git a/pom.xml b/pom.xml index fe966220..283667c4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 io.split.client java-client-parent - 4.16.0 + 4.16.1-rc1 diff --git a/redis-wrapper/pom.xml b/redis-wrapper/pom.xml index 6faa8130..64c5a115 100644 --- a/redis-wrapper/pom.xml +++ b/redis-wrapper/pom.xml @@ -48,6 +48,7 @@ 0.8.0 true + true central false published diff --git a/testing/pom.xml b/testing/pom.xml index 5ea099d8..a6399f78 100644 --- a/testing/pom.xml +++ b/testing/pom.xml @@ -9,7 +9,7 @@ java-client-testing jar - 4.16.0 + 4.16.1-rc1 Java Client For Testing Testing suite for Java SDK for Split @@ -39,6 +39,7 @@ central false published + true From 6d424b7f48b66ec4dec37bc124322fcdbcc3c004 Mon Sep 17 00:00:00 2001 From: Gaston Thea Date: Mon, 23 Jun 2025 18:12:19 -0300 Subject: [PATCH 04/15] Fix versions --- client/pom.xml | 4 ++-- pom.xml | 2 +- testing/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/pom.xml b/client/pom.xml index d70c9d80..1d4b32f4 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -5,9 +5,9 @@ io.split.client java-client-parent - 4.16.1-rc1 + 4.16.0 - 4.16.1-rc1 + 4.16.0 java-client jar Java Client diff --git a/pom.xml b/pom.xml index 283667c4..fe966220 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 io.split.client java-client-parent - 4.16.1-rc1 + 4.16.0 diff --git a/testing/pom.xml b/testing/pom.xml index a6399f78..de58f526 100644 --- a/testing/pom.xml +++ b/testing/pom.xml @@ -9,7 +9,7 @@ java-client-testing jar - 4.16.1-rc1 + 4.16.0 Java Client For Testing Testing suite for Java SDK for Split From 4141392c676eed9e9b55b7e79b8fccd8b015741f Mon Sep 17 00:00:00 2001 From: Bilal Al-Shahwany Date: Thu, 3 Jul 2025 09:45:35 -0700 Subject: [PATCH 05/15] fixed tracker warning --- .../java/io/split/client/impressions/UniqueKeysTrackerImp.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/main/java/io/split/client/impressions/UniqueKeysTrackerImp.java b/client/src/main/java/io/split/client/impressions/UniqueKeysTrackerImp.java index bd2ff918..80b3703d 100644 --- a/client/src/main/java/io/split/client/impressions/UniqueKeysTrackerImp.java +++ b/client/src/main/java/io/split/client/impressions/UniqueKeysTrackerImp.java @@ -117,7 +117,7 @@ private void sendUniqueKeys(){ } try { if (uniqueKeysTracker.size() == 0) { - _log.warn("The Unique Keys Tracker is empty"); + _log.debug("The Unique Keys Tracker is empty"); return; } HashMap> uniqueKeysHashMap = popAll(); From 02fce9dca20aaa5cda0bfd8196d3f76ecbf099d0 Mon Sep 17 00:00:00 2001 From: Bilal Al-Shahwany Date: Thu, 3 Jul 2025 10:14:04 -0700 Subject: [PATCH 06/15] upgraded gson --- client/pom.xml | 2 +- client/src/main/java/io/split/client/events/EventsSender.java | 2 +- .../main/java/io/split/client/events/InMemoryEventsStorage.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/pom.xml b/client/pom.xml index 1d4b32f4..8a40e029 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -176,7 +176,7 @@ com.google.code.gson gson - 2.9.0 + 2.13.1 org.yaml diff --git a/client/src/main/java/io/split/client/events/EventsSender.java b/client/src/main/java/io/split/client/events/EventsSender.java index 2c023ef3..900a9e28 100644 --- a/client/src/main/java/io/split/client/events/EventsSender.java +++ b/client/src/main/java/io/split/client/events/EventsSender.java @@ -12,7 +12,7 @@ import java.net.URISyntaxException; import java.util.List; -import static com.google.gson.internal.$Gson$Preconditions.checkNotNull; +import static com.google.gson.internal.GsonPreconditions.checkNotNull; public class EventsSender { diff --git a/client/src/main/java/io/split/client/events/InMemoryEventsStorage.java b/client/src/main/java/io/split/client/events/InMemoryEventsStorage.java index fae0d070..6e12349e 100644 --- a/client/src/main/java/io/split/client/events/InMemoryEventsStorage.java +++ b/client/src/main/java/io/split/client/events/InMemoryEventsStorage.java @@ -12,7 +12,7 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; -import static com.google.gson.internal.$Gson$Preconditions.checkNotNull; +import static com.google.gson.internal.GsonPreconditions.checkNotNull; public class InMemoryEventsStorage implements EventsStorage{ From 93361375e2a3550d84db52b2b169e95c33accebe Mon Sep 17 00:00:00 2001 From: Bilal Al-Shahwany Date: Thu, 3 Jul 2025 11:52:59 -0700 Subject: [PATCH 07/15] removed gson internal import --- client/src/main/java/io/split/client/events/EventsSender.java | 2 +- .../main/java/io/split/client/events/InMemoryEventsStorage.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/main/java/io/split/client/events/EventsSender.java b/client/src/main/java/io/split/client/events/EventsSender.java index 900a9e28..d83969dc 100644 --- a/client/src/main/java/io/split/client/events/EventsSender.java +++ b/client/src/main/java/io/split/client/events/EventsSender.java @@ -12,7 +12,7 @@ import java.net.URISyntaxException; import java.util.List; -import static com.google.gson.internal.GsonPreconditions.checkNotNull; +import static com.google.common.base.Preconditions.checkNotNull; public class EventsSender { diff --git a/client/src/main/java/io/split/client/events/InMemoryEventsStorage.java b/client/src/main/java/io/split/client/events/InMemoryEventsStorage.java index 6e12349e..a3463f0e 100644 --- a/client/src/main/java/io/split/client/events/InMemoryEventsStorage.java +++ b/client/src/main/java/io/split/client/events/InMemoryEventsStorage.java @@ -12,7 +12,7 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; -import static com.google.gson.internal.GsonPreconditions.checkNotNull; +import static com.google.common.base.Preconditions.checkNotNull; public class InMemoryEventsStorage implements EventsStorage{ From cd96c0a157c55c2c9cbc15a4fcbff3c8a1cbfcea Mon Sep 17 00:00:00 2001 From: Bilal Al-Shahwany Date: Fri, 11 Jul 2025 12:03:19 -0700 Subject: [PATCH 08/15] Fixed RBS cache contains method --- .../memory/RuleBasedSegmentCacheInMemoryImp.java | 2 +- ...UserCustomRuleBasedSegmentAdapterConsumer.java | 2 +- .../RuleBasedSegmentCacheInMemoryImplTest.java | 6 ++++++ ...CustomRuleBasedSegmentAdapterConsumerTest.java | 15 +++++++++++++-- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/client/src/main/java/io/split/storages/memory/RuleBasedSegmentCacheInMemoryImp.java b/client/src/main/java/io/split/storages/memory/RuleBasedSegmentCacheInMemoryImp.java index 53730cf9..660811ca 100644 --- a/client/src/main/java/io/split/storages/memory/RuleBasedSegmentCacheInMemoryImp.java +++ b/client/src/main/java/io/split/storages/memory/RuleBasedSegmentCacheInMemoryImp.java @@ -104,6 +104,6 @@ public Set getSegments() { @Override public boolean contains(Set ruleBasedSegmentNames) { - return getSegments().containsAll(ruleBasedSegmentNames); + return _concurrentMap.keySet().containsAll(ruleBasedSegmentNames); } } \ No newline at end of file diff --git a/client/src/main/java/io/split/storages/pluggable/adapters/UserCustomRuleBasedSegmentAdapterConsumer.java b/client/src/main/java/io/split/storages/pluggable/adapters/UserCustomRuleBasedSegmentAdapterConsumer.java index 438b7bf8..b04e4976 100644 --- a/client/src/main/java/io/split/storages/pluggable/adapters/UserCustomRuleBasedSegmentAdapterConsumer.java +++ b/client/src/main/java/io/split/storages/pluggable/adapters/UserCustomRuleBasedSegmentAdapterConsumer.java @@ -96,7 +96,7 @@ private List stringsToParsedRuleBasedSegments(List ruleBasedSegmentNames) { - return getSegments().containsAll(ruleBasedSegmentNames); + return _userStorageWrapper.getKeysByPrefix(PrefixAdapter.buildGetAllRuleBasedSegment()).containsAll(ruleBasedSegmentNames); } } \ No newline at end of file diff --git a/client/src/test/java/io/split/storages/memory/RuleBasedSegmentCacheInMemoryImplTest.java b/client/src/test/java/io/split/storages/memory/RuleBasedSegmentCacheInMemoryImplTest.java index 32487bf5..492cc8ae 100644 --- a/client/src/test/java/io/split/storages/memory/RuleBasedSegmentCacheInMemoryImplTest.java +++ b/client/src/test/java/io/split/storages/memory/RuleBasedSegmentCacheInMemoryImplTest.java @@ -16,6 +16,8 @@ import com.google.common.collect.Lists; import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; import java.util.List; public class RuleBasedSegmentCacheInMemoryImplTest extends TestCase { @@ -31,6 +33,8 @@ public void testAddAndDeleteSegment(){ ruleBasedSegmentCache.update(Lists.newArrayList(parsedRuleBasedSegment), null, 123); assertEquals(123, ruleBasedSegmentCache.getChangeNumber()); assertEquals(parsedRuleBasedSegment, ruleBasedSegmentCache.get("sample_rule_based_segment")); + assertTrue(ruleBasedSegmentCache.contains(new HashSet<>(Arrays.asList("sample_rule_based_segment")))); + assertFalse(ruleBasedSegmentCache.contains(new HashSet<>(Arrays.asList("sample_rule_based_segment", "123")))); ruleBasedSegmentCache.update(null, Lists.newArrayList("sample_rule_based_segment"), 124); assertEquals(124, ruleBasedSegmentCache.getChangeNumber()); @@ -62,5 +66,7 @@ public void testMultipleSegment(){ ruleBasedSegmentCache.update(Lists.newArrayList(parsedRuleBasedSegment1, parsedRuleBasedSegment2), null, 123); assertEquals(Lists.newArrayList("another_rule_based_segment", "sample_rule_based_segment"), ruleBasedSegmentCache.ruleBasedSegmentNames()); assertEquals(Sets.newHashSet("segment2", "segment1", "employees"), ruleBasedSegmentCache.getSegments()); + assertTrue(ruleBasedSegmentCache.contains(new HashSet<>(Arrays.asList("sample_rule_based_segment", "another_rule_based_segment")))); + assertTrue(ruleBasedSegmentCache.contains(new HashSet<>(Arrays.asList("sample_rule_based_segment")))); } } \ No newline at end of file diff --git a/client/src/test/java/io/split/storages/pluggable/adapters/UserCustomRuleBasedSegmentAdapterConsumerTest.java b/client/src/test/java/io/split/storages/pluggable/adapters/UserCustomRuleBasedSegmentAdapterConsumerTest.java index f1f39a73..b9baee95 100644 --- a/client/src/test/java/io/split/storages/pluggable/adapters/UserCustomRuleBasedSegmentAdapterConsumerTest.java +++ b/client/src/test/java/io/split/storages/pluggable/adapters/UserCustomRuleBasedSegmentAdapterConsumerTest.java @@ -1,6 +1,7 @@ package io.split.storages.pluggable.adapters; import com.google.common.collect.Lists; +import com.google.common.collect.Maps; import io.split.client.dtos.*; import io.split.client.utils.Json; import io.split.engine.ConditionsTestUtil; @@ -16,10 +17,14 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.*; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.atomic.AtomicLong; import java.util.stream.Collectors; import java.util.stream.Stream; import static io.split.TestHelper.makeRuleBasedSegment; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; public class UserCustomRuleBasedSegmentAdapterConsumerTest { @@ -66,10 +71,16 @@ public void testGetChangeNumberWithGsonFailing() { public void testGetRuleBasedSegment() { RuleBasedSegmentParser ruleBasedSegmentParser = new RuleBasedSegmentParser(); RuleBasedSegment ruleBasedSegment = getRuleBasedSegment(RULE_BASED_SEGMENT_NAME); + ParsedRuleBasedSegment expected = ruleBasedSegmentParser.parse(ruleBasedSegment); + ConcurrentMap rbsCollection = Maps.newConcurrentMap(); + rbsCollection.put(RULE_BASED_SEGMENT_NAME, expected); Mockito.when(_userStorageWrapper.get(PrefixAdapter.buildRuleBasedSegmentKey(RULE_BASED_SEGMENT_NAME))).thenReturn(getRuleBasedSegmentAsJson(ruleBasedSegment)); + Mockito.when(_userStorageWrapper.getKeysByPrefix("SPLITIO.rbsegment*")).thenReturn(new HashSet<>(Arrays.asList(RULE_BASED_SEGMENT_NAME))); ParsedRuleBasedSegment result = _userCustomRuleBasedSegmentAdapterConsumer.get(RULE_BASED_SEGMENT_NAME); - ParsedRuleBasedSegment expected = ruleBasedSegmentParser.parse(ruleBasedSegment); Assert.assertEquals(expected, result); + assertTrue(_userCustomRuleBasedSegmentAdapterConsumer.contains(new HashSet<>(Arrays.asList(RULE_BASED_SEGMENT_NAME)))); + assertFalse(_userCustomRuleBasedSegmentAdapterConsumer.contains(new HashSet<>(Arrays.asList(RULE_BASED_SEGMENT_NAME, "123")))); + } @Test @@ -135,7 +146,7 @@ public void testGetSegments() { Mockito.when(_userStorageWrapper.getMany(Mockito.anyObject())). thenReturn(getManyExpected); HashSet segmentResult = (HashSet) _userCustomRuleBasedSegmentAdapterConsumer.getSegments(); - Assert.assertTrue(segmentResult.contains("employee")); + assertTrue(segmentResult.contains("employee")); } @Test From 0dfdd8dc71a83842c6d375fd3fa45330bef7d536 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 12 Jul 2025 01:41:06 +0000 Subject: [PATCH 09/15] Bump org.apache.commons:commons-lang3 from 3.4 to 3.18.0 in /client Bumps org.apache.commons:commons-lang3 from 3.4 to 3.18.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-lang3 dependency-version: 3.18.0 dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- client/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/pom.xml b/client/pom.xml index d0ae4a78..c57214d9 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -185,7 +185,7 @@ org.apache.commons commons-lang3 - 3.4 + 3.18.0 test From 4b02a3feed040bd60581a377291a824941482e15 Mon Sep 17 00:00:00 2001 From: Bilal Al-Shahwany <41021307+chillaq@users.noreply.github.com> Date: Fri, 18 Jul 2025 09:17:58 -0700 Subject: [PATCH 10/15] Update ci.yml --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 721a6707..e2dc38cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,9 +51,9 @@ jobs: - name: Setup Maven run: cp .ci.settings.xml ${HOME}/.m2/settings.xml - - name: Test - if: matrix.jdk == '8' && github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' - run: mvn --batch-mode clean install +# - name: Test +# if: matrix.jdk == '8' && github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' +# run: mvn --batch-mode clean install - name: Linter if: matrix.jdk == '8' && github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' From 125648894af6eeab415b0e3022321015186854bd Mon Sep 17 00:00:00 2001 From: Bilal Al-Shahwany Date: Fri, 18 Jul 2025 09:23:19 -0700 Subject: [PATCH 11/15] Removed jfrog references --- pom.xml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/pom.xml b/pom.xml index fe966220..584b98df 100644 --- a/pom.xml +++ b/pom.xml @@ -53,16 +53,8 @@ ossrh https://oss.sonatype.org/content/repositories/releases - - maven-all-virtual - https://splitio.jfrog.io/artifactory/maven-all-virtual - - - maven-all-virtual - https://splitio.jfrog.io/artifactory/maven-all-virtual - UTF-8 @@ -145,16 +137,6 @@ test - - - maven-dev - https://splitio.jfrog.io/artifactory/maven-dev/ - - - maven-dev - https://splitio.jfrog.io/artifactory/maven-dev/ - - From 54b599037caf2a09bbd38666144c8355e80d96ba Mon Sep 17 00:00:00 2001 From: Bilal Al-Shahwany <41021307+chillaq@users.noreply.github.com> Date: Fri, 18 Jul 2025 11:24:31 -0700 Subject: [PATCH 12/15] Update ci.yml --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2dc38cf..e733934e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,9 +59,9 @@ jobs: if: matrix.jdk == '8' && github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' run: mvn checkstyle::check - - name: Deploy - if: matrix.jdk == '8' && github.event_name == 'push' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' - run: mvn --batch-mode deploy -P test +# - name: Deploy +# if: matrix.jdk == '8' && github.event_name == 'push' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' +# run: mvn --batch-mode deploy -P test - name: SonarQube Scan (Push) if: matrix.jdk == '11' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development') From 9b80fb7d41a63f5980ba72ccce1d7365043552ac Mon Sep 17 00:00:00 2001 From: Bilal Al-Shahwany <41021307+chillaq@users.noreply.github.com> Date: Fri, 18 Jul 2025 12:03:17 -0700 Subject: [PATCH 13/15] Update ci.yml --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 721a6707..e5333445 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,9 +59,9 @@ jobs: if: matrix.jdk == '8' && github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' run: mvn checkstyle::check - - name: Deploy - if: matrix.jdk == '8' && github.event_name == 'push' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' - run: mvn --batch-mode deploy -P test +# - name: Deploy +# if: matrix.jdk == '8' && github.event_name == 'push' && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/development' +# run: mvn --batch-mode deploy -P test - name: SonarQube Scan (Push) if: matrix.jdk == '11' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development') From e679ccf2b2657db97b3ce4780e718906bf34e9e2 Mon Sep 17 00:00:00 2001 From: Bilal Al-Shahwany Date: Mon, 21 Jul 2025 12:44:09 -0700 Subject: [PATCH 14/15] Updated version and changes --- CHANGES.txt | 4 ++++ client/pom.xml | 4 ++-- okhttp-modules/pom.xml | 4 ++-- pluggable-storage/pom.xml | 2 +- pom.xml | 2 +- redis-wrapper/pom.xml | 2 +- testing/pom.xml | 2 +- 7 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index a99b79df..2b82b0b6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,7 @@ +4.16.1 (Jul 21, 2025) +- Upgraded org.apache.commons-commons-lang3 to 3.18.0 +- Upgraded com.google.code.gson.gson to 2.13.1 + 4.16.0 (May 28, 2025) - Added support for rule-based segments. These segments determine membership at runtime by evaluating their configured rules against the user attributes provided to the SDK. - Added support for feature flag prerequisites. This allows customers to define dependency conditions between flags, which are evaluated before any allowlists or targeting rules. diff --git a/client/pom.xml b/client/pom.xml index 359bdacf..b6337c14 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -5,9 +5,9 @@ io.split.client java-client-parent - 4.16.0 + 4.16.1 - 4.16.0 + 4.16.1 java-client jar Java Client diff --git a/okhttp-modules/pom.xml b/okhttp-modules/pom.xml index 3a842c81..7346518d 100644 --- a/okhttp-modules/pom.xml +++ b/okhttp-modules/pom.xml @@ -5,10 +5,10 @@ java-client-parent io.split.client - 4.16.0 + 4.16.1 4.0.0 - 4.16.0 + 4.16.1 okhttp-modules jar http-modules diff --git a/pluggable-storage/pom.xml b/pluggable-storage/pom.xml index d5b1a995..5c304f98 100644 --- a/pluggable-storage/pom.xml +++ b/pluggable-storage/pom.xml @@ -6,7 +6,7 @@ java-client-parent io.split.client - 4.16.0 + 4.16.1 2.1.0 diff --git a/pom.xml b/pom.xml index 584b98df..9f91ded1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 io.split.client java-client-parent - 4.16.0 + 4.16.1 diff --git a/redis-wrapper/pom.xml b/redis-wrapper/pom.xml index 64c5a115..9ca70894 100644 --- a/redis-wrapper/pom.xml +++ b/redis-wrapper/pom.xml @@ -6,7 +6,7 @@ java-client-parent io.split.client - 4.16.0 + 4.16.1 redis-wrapper 3.1.1 diff --git a/testing/pom.xml b/testing/pom.xml index de58f526..5f0aa0c5 100644 --- a/testing/pom.xml +++ b/testing/pom.xml @@ -5,7 +5,7 @@ io.split.client java-client-parent - 4.16.0 + 4.16.1 java-client-testing jar From cd16622749084297c95b99f424f2aa800fd1f56f Mon Sep 17 00:00:00 2001 From: Bilal Al-Shahwany <41021307+chillaq@users.noreply.github.com> Date: Mon, 21 Jul 2025 14:35:22 -0700 Subject: [PATCH 15/15] Update CHANGES.txt Co-authored-by: Mauro Sanz <51236193+sanzmauro@users.noreply.github.com> --- CHANGES.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 2b82b0b6..ceaef9e6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,7 @@ 4.16.1 (Jul 21, 2025) -- Upgraded org.apache.commons-commons-lang3 to 3.18.0 -- Upgraded com.google.code.gson.gson to 2.13.1 +- Fixed vulnerabilities: + - Upgraded org.apache.commons-commons-lang3 to 3.18.0 + - Upgraded com.google.code.gson.gson to 2.13.1 4.16.0 (May 28, 2025) - Added support for rule-based segments. These segments determine membership at runtime by evaluating their configured rules against the user attributes provided to the SDK.