Skip to content

Commit e79ac3f

Browse files
Merge branch 'redis:main' into topic/kiryazovi-redis/use-docker-for-tests
2 parents 79c2171 + d33237b commit e79ac3f

File tree

43 files changed

+1078
-223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1078
-223
lines changed

.github/workflows/docs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ concurrency:
1010
group: "pages"
1111
cancel-in-progress: false
1212
jobs:
13-
build-and-deploy:
13+
publish-docs:
1414
concurrency: ci-${{ github.ref }}
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
- uses: actions/setup-python@v4
1919
with:
2020
python-version: 3.9
@@ -26,11 +26,11 @@ jobs:
2626
run: |
2727
mkdocs build -d docsbuild
2828
- name: Setup Pages
29-
uses: actions/configure-pages@v3
29+
uses: actions/configure-pages@v4
3030
- name: Upload artifact
31-
uses: actions/upload-pages-artifact@v1
31+
uses: actions/upload-pages-artifact@v3
3232
with:
3333
path: 'docsbuild'
3434
- name: Deploy to GitHub Pages
3535
id: deployment
36-
uses: actions/deploy-pages@v2
36+
uses: actions/deploy-pages@v4

.github/workflows/integration.yml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,35 @@ on:
1515
schedule:
1616
- cron: '0 1 * * *' # nightly build
1717
workflow_dispatch:
18-
inputs:
19-
redis_version:
20-
description: "Redis stack version to use for testing"
21-
required: false
22-
default: "8.0-M02"
23-
type: choice
24-
options:
25-
- "8.0-M02"
26-
- "rs-7.4.0-v1"
27-
- "rs-7.2.0-v13"
2818

2919
jobs:
30-
3120
build:
3221
name: Build and Test
3322
runs-on: ubuntu-24.04
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
redis_version:
27+
- "unstable"
28+
- "8.0"
29+
- "7.4"
30+
- "7.2"
31+
3432
steps:
33+
- name: Test Redis Server Version
34+
id: map-tags
35+
run: |
36+
# Map requested version to github or tag
37+
case "${{ matrix.redis_version }}" in
38+
"unstable") redis_branch="unstable" stack_version="8.0-M04-pre" ;;
39+
"8.0") redis_branch="8.0" stack_version="8.0-M04-pre" ;;
40+
"7.4") redis_branch="7.4" stack_version="rs-7.4.0-v2" ;;
41+
"7.2") redis_branch="7.2" stack_version="rs-7.2.0-v14" ;;
42+
*) echo "Unsupported version: ${{ matrix.redis_version }}" && exit 1 ;;
43+
esac
44+
# Save them as outputs for later use
45+
echo "redis_branch=$redis_branch" >> $GITHUB_OUTPUT
46+
echo "redis_stack_version=$stack_version" >> $GITHUB_OUTPUT
3547
- name: Checkout project
3648
uses: actions/checkout@v4
3749
- name: Set Java up in the runner
@@ -61,7 +73,8 @@ jobs:
6173
run: |
6274
make test-coverage
6375
env:
64-
REDIS_STACK_VERSION: ${{ inputs.redis_version || '8.0-M02' }}
76+
REDIS: ${{ steps.map-tags.outputs.redis_branch }}
77+
REDIS_STACK_VERSION: ${{ steps.map-tags.outputs.redis_stack_version }}
6578
JVM_OPTS: -Xmx3200m
6679
TERM: dumb
6780
- name: Upload coverage reports to Codecov

pom.xml

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
and much more.
1414
</description>
1515

16-
<url>http://github.com/lettuce-io/lettuce-core</url>
16+
<url>https://github.com/redis/lettuce</url>
1717

1818
<organization>
1919
<name>lettuce.io</name>
@@ -30,7 +30,7 @@
3030

3131
<issueManagement>
3232
<system>Github</system>
33-
<url>https://github.com/lettuce-io/lettuce-core/issues</url>
33+
<url>https://github.com/redis/lettuce/issues</url>
3434
</issueManagement>
3535

3636
<developers>
@@ -82,10 +82,10 @@
8282
</properties>
8383

8484
<scm>
85-
<connection>scm:git:https://github.com/lettuce-io/lettuce-core.git</connection>
86-
<developerConnection>scm:git:https://github.com/lettuce-io/lettuce-core.git
85+
<connection>scm:git:https://github.com/redis/lettuce.git</connection>
86+
<developerConnection>scm:git:https://github.com/redis/lettuce.git
8787
</developerConnection>
88-
<url>http://github.com/lettuce-io/lettuce-core</url>
88+
<url>https://github.com/redis/lettuce</url>
8989
<tag>HEAD</tag>
9090
</scm>
9191

@@ -189,12 +189,6 @@
189189
<version>0.1.1-beta1</version>
190190
<scope>test</scope>
191191
</dependency>
192-
<dependency>
193-
<groupId>io.github.cdimascio</groupId>
194-
<artifactId>dotenv-java</artifactId>
195-
<version>2.2.0</version>
196-
<scope>test</scope>
197-
</dependency>
198192
<!-- Start of core dependencies -->
199193

200194
<dependency>
@@ -1063,6 +1057,38 @@
10631057
<profile>
10641058
<id>ci</id>
10651059
</profile>
1060+
<profile>
1061+
<id>entraid-it</id>
1062+
<build>
1063+
<plugins>
1064+
<plugin>
1065+
<artifactId>maven-surefire-plugin</artifactId>
1066+
<configuration>
1067+
<skipTests>true</skipTests>
1068+
</configuration>
1069+
</plugin>
1070+
<plugin>
1071+
<artifactId>maven-failsafe-plugin</artifactId>
1072+
<configuration>
1073+
<groups>entraid</groups>
1074+
<skipITs>false</skipITs>
1075+
<includes>
1076+
<include>**/*IntegrationTests</include>
1077+
</includes>
1078+
</configuration>
1079+
<executions>
1080+
<execution>
1081+
<phase>integration-test</phase>
1082+
<goals>
1083+
<goal>integration-test</goal>
1084+
<goal>verify</goal>
1085+
</goals>
1086+
</execution>
1087+
</executions>
1088+
</plugin>
1089+
</plugins>
1090+
</build>
1091+
</profile>
10661092

10671093
<profile>
10681094

src/main/java/io/lettuce/core/AbstractRedisAsyncCommands.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@
4848
import io.lettuce.core.protocol.CommandType;
4949
import io.lettuce.core.protocol.ProtocolKeyword;
5050
import io.lettuce.core.protocol.RedisCommand;
51-
import reactor.core.publisher.Mono;
5251

5352
import java.time.Duration;
5453
import java.time.Instant;
5554
import java.util.Date;
5655
import java.util.List;
5756
import java.util.Map;
5857
import java.util.Set;
58+
import java.util.function.Supplier;
5959

6060
import static io.lettuce.core.ClientOptions.DEFAULT_JSON_PARSER;
6161
import static io.lettuce.core.protocol.CommandType.EXEC;
@@ -87,7 +87,7 @@ public abstract class AbstractRedisAsyncCommands<K, V> implements RedisAclAsyncC
8787

8888
private final RedisJsonCommandBuilder<K, V> jsonCommandBuilder;
8989

90-
private final Mono<JsonParser> parser;
90+
private final Supplier<JsonParser> parser;
9191

9292
/**
9393
* Initialize a new instance.
@@ -96,7 +96,8 @@ public abstract class AbstractRedisAsyncCommands<K, V> implements RedisAclAsyncC
9696
* @param codec the codec for command encoding
9797
* @param parser the implementation of the {@link JsonParser} to use
9898
*/
99-
public AbstractRedisAsyncCommands(StatefulConnection<K, V> connection, RedisCodec<K, V> codec, Mono<JsonParser> parser) {
99+
public AbstractRedisAsyncCommands(StatefulConnection<K, V> connection, RedisCodec<K, V> codec,
100+
Supplier<JsonParser> parser) {
100101
this.parser = parser;
101102
this.connection = connection;
102103
this.commandBuilder = new RedisCommandBuilder<>(codec);
@@ -3396,7 +3397,7 @@ public RedisFuture<List<Map<String, Object>>> clusterLinks() {
33963397

33973398
@Override
33983399
public JsonParser getJsonParser() {
3399-
return this.parser.block();
3400+
return this.parser.get();
34003401
}
34013402

34023403
private byte[] encodeFunction(String functionCode) {

src/main/java/io/lettuce/core/AbstractRedisReactiveCommands.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public abstract class AbstractRedisReactiveCommands<K, V>
9797

9898
private final RedisJsonCommandBuilder<K, V> jsonCommandBuilder;
9999

100-
private final Mono<JsonParser> parser;
100+
private final Supplier<JsonParser> parser;
101101

102102
private final ClientResources clientResources;
103103

@@ -112,7 +112,8 @@ public abstract class AbstractRedisReactiveCommands<K, V>
112112
* @param codec the codec for command encoding.
113113
* @param parser the implementation of the {@link JsonParser} to use
114114
*/
115-
public AbstractRedisReactiveCommands(StatefulConnection<K, V> connection, RedisCodec<K, V> codec, Mono<JsonParser> parser) {
115+
public AbstractRedisReactiveCommands(StatefulConnection<K, V> connection, RedisCodec<K, V> codec,
116+
Supplier<JsonParser> parser) {
116117
this.connection = connection;
117118
this.parser = parser;
118119
this.commandBuilder = new RedisCommandBuilder<>(codec);
@@ -149,7 +150,7 @@ private EventExecutorGroup getScheduler() {
149150

150151
@Override
151152
public JsonParser getJsonParser() {
152-
return parser.block();
153+
return parser.get();
153154
}
154155

155156
@Override

src/main/java/io/lettuce/core/AclCategory.java

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,45 @@ public enum AclCategory {
111111
/**
112112
* scripting command
113113
*/
114-
SCRIPTING
114+
SCRIPTING,
115+
116+
/**
117+
* bloom command
118+
*/
119+
BLOOM,
120+
121+
/**
122+
* cuckoo command
123+
*/
124+
CUCKOO,
125+
126+
/**
127+
* count-min-sketch command
128+
*/
129+
CMS,
130+
131+
/**
132+
* top-k command
133+
*/
134+
TOPK,
135+
136+
/**
137+
* t-digest command
138+
*/
139+
TDIGEST,
140+
141+
/**
142+
* search command
143+
*/
144+
SEARCH,
145+
146+
/**
147+
* timeseries command
148+
*/
149+
TIMESERIES,
150+
151+
/**
152+
* json command
153+
*/
154+
JSON
115155
}

src/main/java/io/lettuce/core/ClientOptions.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.util.Iterator;
2626
import java.util.ServiceConfigurationError;
2727
import java.util.ServiceLoader;
28+
import java.util.function.Supplier;
2829

2930
import io.lettuce.core.api.StatefulConnection;
3031
import io.lettuce.core.internal.LettuceAssert;
@@ -71,15 +72,15 @@ public class ClientOptions implements Serializable {
7172

7273
public static final SocketOptions DEFAULT_SOCKET_OPTIONS = SocketOptions.create();
7374

74-
public static final Mono<JsonParser> DEFAULT_JSON_PARSER = Mono.defer(() -> Mono.fromCallable(() -> {
75+
public static final Supplier<JsonParser> DEFAULT_JSON_PARSER = () -> {
7576
try {
7677
Iterator<JsonParser> services = ServiceLoader.load(JsonParser.class).iterator();
7778
return services.hasNext() ? services.next() : null;
7879
} catch (ServiceConfigurationError e) {
7980
throw new RedisJsonException("Could not load JsonParser, please consult the guide"
8081
+ "at https://redis.github.io/lettuce/user-guide/redis-json/", e);
8182
}
82-
}));
83+
};
8384

8485
public static final SslOptions DEFAULT_SSL_OPTIONS = SslOptions.create();
8586

@@ -111,7 +112,7 @@ public class ClientOptions implements Serializable {
111112

112113
private final Charset scriptCharset;
113114

114-
private final Mono<JsonParser> jsonParser;
115+
private final Supplier<JsonParser> jsonParser;
115116

116117
private final SocketOptions socketOptions;
117118

@@ -216,7 +217,7 @@ public static class Builder {
216217

217218
private Charset scriptCharset = DEFAULT_SCRIPT_CHARSET;
218219

219-
private Mono<JsonParser> jsonParser = DEFAULT_JSON_PARSER;
220+
private Supplier<JsonParser> jsonParser = DEFAULT_JSON_PARSER;
220221

221222
private SocketOptions socketOptions = DEFAULT_SOCKET_OPTIONS;
222223

@@ -429,7 +430,7 @@ public Builder scriptCharset(Charset scriptCharset) {
429430
* @see JsonParser
430431
* @since 6.5
431432
*/
432-
public Builder jsonParser(Mono<JsonParser> parser) {
433+
public Builder jsonParser(Supplier<JsonParser> parser) {
433434

434435
LettuceAssert.notNull(parser, "JsonParser must not be null");
435436
this.jsonParser = parser;
@@ -705,7 +706,7 @@ public Charset getScriptCharset() {
705706
* @return the implementation of the {@link JsonParser} to use.
706707
* @since 6.5
707708
*/
708-
public Mono<JsonParser> getJsonParser() {
709+
public Supplier<JsonParser> getJsonParser() {
709710
return jsonParser;
710711
}
711712

src/main/java/io/lettuce/core/RedisAsyncCommandsImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import io.lettuce.core.cluster.api.async.RedisClusterAsyncCommands;
66
import io.lettuce.core.codec.RedisCodec;
77
import io.lettuce.core.json.JsonParser;
8-
import reactor.core.publisher.Mono;
8+
import java.util.function.Supplier;
99

1010
/**
1111
* An asynchronous and thread-safe API for a Redis connection.
@@ -24,7 +24,8 @@ public class RedisAsyncCommandsImpl<K, V> extends AbstractRedisAsyncCommands<K,
2424
* @param codec the codec for command encoding
2525
* @param parser the implementation of the {@link JsonParser} to use
2626
*/
27-
public RedisAsyncCommandsImpl(StatefulRedisConnection<K, V> connection, RedisCodec<K, V> codec, Mono<JsonParser> parser) {
27+
public RedisAsyncCommandsImpl(StatefulRedisConnection<K, V> connection, RedisCodec<K, V> codec,
28+
Supplier<JsonParser> parser) {
2829
super(connection, codec, parser);
2930
}
3031

0 commit comments

Comments
 (0)