Skip to content

Commit a800f1a

Browse files
Merge remote-tracking branch 'origin/main' into feature/RI-6265_update-list-of-databases
2 parents 313b702 + 3533807 commit a800f1a

28 files changed

+412
-272
lines changed

.github/workflows/tests-integration.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ jobs:
106106
if: inputs.build == 'docker'
107107
uses: actions/download-artifact@v4
108108
with:
109-
name: docker
109+
name: docker-builds
110110
path: ./release
111111

112112
- name: Load built docker image from workspace
113113
if: inputs.build == 'docker'
114114
run: |
115-
docker image load -i ./release/docker-linux-alpine.amd64.tar
115+
docker image load -i ./release/docker/docker-linux-alpine.amd64.tar
116116
117117
- name: Run tests
118118
run: |

redisinsight/api/package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"@nestjs/websockets": "^10.4.5",
6464
"@okta/okta-auth-js": "^7.8.1",
6565
"@segment/analytics-node": "^2.1.3",
66+
"@types/json-bigint": "^1.0.4",
6667
"adm-zip": "^0.5.9",
6768
"axios": "^1.7.4",
6869
"body-parser": "^1.20.3",
@@ -78,6 +79,7 @@
7879
"fs-extra": "^10.0.0",
7980
"ioredis": "^5.2.2",
8081
"is-glob": "^4.0.1",
82+
"json-bigint": "^1.0.0",
8183
"jsonwebtoken": "^9.0.2",
8284
"keytar": "^7.9.0",
8385
"lodash": "^4.17.20",
@@ -173,10 +175,13 @@
173175
},
174176
"reporters": [
175177
"default",
176-
["jest-html-reporters", {
177-
"publicPath": "./report",
178-
"filename": "index.html"
179-
}]
178+
[
179+
"jest-html-reporters",
180+
{
181+
"publicPath": "./report",
182+
"filename": "index.html"
183+
}
184+
]
180185
]
181186
}
182187
}

redisinsight/api/src/__mocks__/databases.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
import { CloudDatabaseDetailsEntity } from 'src/modules/cloud/database/entities/cloud-database-details.entity';
1818
import { mockCloudDatabaseDetails, mockCloudDatabaseDetailsEntity } from 'src/__mocks__/cloud-database';
1919
import { mockRedisClientListResult } from 'src/__mocks__/database-info';
20+
import { DatabaseOverviewKeyspace } from 'src/modules/database/constants/overview';
2021

2122
export const mockDatabaseId = 'a77b23c1-7816-4ea4-b61f-d37795a0f805-db-id';
2223

@@ -79,6 +80,12 @@ export const mockDatabaseModules = [
7980
semanticVersion: '1.2.5',
8081
},
8182
];
83+
84+
export const mockDatabaseWithModules = Object.assign(new Database(), {
85+
...mockDatabase,
86+
modules: mockDatabaseModules,
87+
});
88+
8289
export const mockDatabaseWithCloudDetails = Object.assign(new Database(), {
8390
...mockDatabase,
8491
cloudDetails: mockCloudDatabaseDetails,
@@ -220,6 +227,8 @@ export const mockDatabaseOverview: DatabaseOverview = {
220227
cpuUsagePercentage: null,
221228
};
222229

230+
export const mockDatabaseOverviewCurrentKeyspace = DatabaseOverviewKeyspace.Current;
231+
223232
export const mockRedisServerInfoDto = {
224233
redis_version: '7.0.5',
225234
redis_mode: 'standalone',

redisinsight/api/src/modules/browser/keys/key-info/strategies/rejson-rl.key-info.strategy.spec.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ describe('RejsonRlKeyInfoStrategy', () => {
3535

3636
describe('getInfo', () => {
3737
const key = getKeyInfoResponse.name;
38-
const path = '.';
3938
beforeEach(() => {
4039
when(mockStandaloneRedisClient.sendPipeline)
4140
.calledWith([
@@ -48,13 +47,13 @@ describe('RejsonRlKeyInfoStrategy', () => {
4847
]);
4948
when(mockStandaloneRedisClient.sendCommand)
5049
.calledWith(
51-
[BrowserToolRejsonRlCommands.JsonType, key, path],
50+
[BrowserToolRejsonRlCommands.JsonType, key],
5251
{ replyEncoding: 'utf8' },
5352
)
5453
.mockResolvedValue('object');
5554
when(mockStandaloneRedisClient.sendCommand)
5655
.calledWith(
57-
[BrowserToolRejsonRlCommands.JsonObjLen, key, path],
56+
[BrowserToolRejsonRlCommands.JsonObjLen, key],
5857
{ replyEncoding: 'utf8' },
5958
)
6059
.mockResolvedValue(10);
@@ -71,13 +70,13 @@ describe('RejsonRlKeyInfoStrategy', () => {
7170
it('should return appropriate value for key that store string', async () => {
7271
when(mockStandaloneRedisClient.sendCommand)
7372
.calledWith(
74-
[BrowserToolRejsonRlCommands.JsonType, key, path],
73+
[BrowserToolRejsonRlCommands.JsonType, key],
7574
{ replyEncoding: 'utf8' },
7675
)
7776
.mockResolvedValue('string');
7877
when(mockStandaloneRedisClient.sendCommand)
7978
.calledWith(
80-
[BrowserToolRejsonRlCommands.JsonStrLen, key, path],
79+
[BrowserToolRejsonRlCommands.JsonStrLen, key],
8180
{ replyEncoding: 'utf8' },
8281
)
8382
.mockResolvedValue(10);
@@ -93,13 +92,13 @@ describe('RejsonRlKeyInfoStrategy', () => {
9392
it('should return appropriate value for key that store array', async () => {
9493
when(mockStandaloneRedisClient.sendCommand)
9594
.calledWith(
96-
[BrowserToolRejsonRlCommands.JsonType, key, path],
95+
[BrowserToolRejsonRlCommands.JsonType, key],
9796
{ replyEncoding: 'utf8' },
9897
)
9998
.mockResolvedValue('array');
10099
when(mockStandaloneRedisClient.sendCommand)
101100
.calledWith(
102-
[BrowserToolRejsonRlCommands.JsonArrLen, key, path],
101+
[BrowserToolRejsonRlCommands.JsonArrLen, key],
103102
{ replyEncoding: 'utf8' },
104103
)
105104
.mockResolvedValue(10);
@@ -115,7 +114,7 @@ describe('RejsonRlKeyInfoStrategy', () => {
115114
it('should return appropriate value for key that store not iterable type', async () => {
116115
when(mockStandaloneRedisClient.sendCommand)
117116
.calledWith(
118-
[BrowserToolRejsonRlCommands.JsonType, key, path],
117+
[BrowserToolRejsonRlCommands.JsonType, key],
119118
{ replyEncoding: 'utf8' },
120119
)
121120
.mockResolvedValue('boolean');

redisinsight/api/src/modules/browser/keys/key-info/strategies/rejson-rl.key-info.strategy.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,24 @@ export class RejsonRlKeyInfoStrategy extends KeyInfoStrategy {
3636
private async getLength(client: RedisClient, key: RedisString): Promise<number> {
3737
try {
3838
const objectKeyType = await client.sendCommand(
39-
[BrowserToolRejsonRlCommands.JsonType, key, '.'],
39+
[BrowserToolRejsonRlCommands.JsonType, key],
4040
{ replyEncoding: 'utf8' },
4141
);
4242

4343
switch (objectKeyType) {
4444
case 'object':
4545
return await client.sendCommand(
46-
[BrowserToolRejsonRlCommands.JsonObjLen, key, '.'],
46+
[BrowserToolRejsonRlCommands.JsonObjLen, key],
4747
{ replyEncoding: 'utf8' },
4848
) as number;
4949
case 'array':
5050
return await client.sendCommand(
51-
[BrowserToolRejsonRlCommands.JsonArrLen, key, '.'],
51+
[BrowserToolRejsonRlCommands.JsonArrLen, key],
5252
{ replyEncoding: 'utf8' },
5353
) as number;
5454
case 'string':
5555
return await client.sendCommand(
56-
[BrowserToolRejsonRlCommands.JsonStrLen, key, '.'],
56+
[BrowserToolRejsonRlCommands.JsonStrLen, key],
5757
{ replyEncoding: 'utf8' },
5858
) as number;
5959
default:

redisinsight/api/src/modules/browser/rejson-rl/dto/get.rejson-rl.dto.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ export class GetRejsonRlDto extends KeyDto {
66
@ApiPropertyOptional({
77
type: String,
88
description: 'Path to look for data',
9-
})
9+
})
1010
@IsString()
1111
@IsNotEmpty()
12-
path?: string = '.';
12+
path?: string = '$';
1313

1414
@ApiPropertyOptional({
1515
type: Boolean,
1616
description:
17-
"Don't check for json size and return whole json in path when enabled",
18-
})
17+
"Don't check for json size and return whole json in path when enabled",
18+
})
1919
@IsBoolean()
2020
forceRetrieve?: boolean;
2121
}

0 commit comments

Comments
 (0)