Skip to content

Commit a88f160

Browse files
author
Artem
committed
Merge branch 'main' into feature/RI-2088_get_rid_of_python_scripts
2 parents 8df49cf + 64f8491 commit a88f160

File tree

20 files changed

+257
-58
lines changed

20 files changed

+257
-58
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ main, latest, release/* ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ main ]
20+
schedule:
21+
- cron: '37 11 * * 3'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'javascript', 'python' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v2
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v1
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
52+
53+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54+
# If this step fails, then you should remove it and run the build manually (see below)
55+
- name: Autobuild
56+
uses: github/codeql-action/autobuild@v1
57+
58+
# ℹ️ Command-line programs to run using the OS shell.
59+
# 📚 https://git.io/JvXDl
60+
61+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62+
# and modify them (or add more) to build your code if your project
63+
# uses a compiled language
64+
65+
#- run: |
66+
# make bootstrap
67+
# make release
68+
69+
- name: Perform CodeQL Analysis
70+
uses: github/codeql-action/analyze@v1

redisinsight/api/src/modules/cli/dto/cli.dto.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ export enum ClusterNodeRole {
2727
Slave = 'SLAVE',
2828
}
2929

30+
class ClusterNode extends EndpointDto {
31+
@ApiPropertyOptional({
32+
description: 'Cluster node slot.',
33+
type: Number,
34+
example: 0,
35+
})
36+
slot?: number;
37+
}
38+
3039
export class CreateCliClientDto {
3140
@ApiPropertyOptional({
3241
type: String,
@@ -123,10 +132,10 @@ export class SendClusterCommandResponse {
123132
response: any;
124133

125134
@ApiPropertyOptional({
126-
type: () => EndpointDto,
135+
type: () => ClusterNode,
127136
description: 'Redis Cluster Node info',
128137
})
129-
node?: EndpointDto;
138+
node?: ClusterNode;
130139

131140
@ApiProperty({
132141
description: 'Redis CLI command execution status',

redisinsight/api/src/modules/cli/services/cli-business/cli-business.service.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ describe('CliBusinessService', () => {
555555
const command = 'set foo bar';
556556
const mockResult: SendClusterCommandResponse = {
557557
response: 'OK',
558-
node: { ...mockNode, port: 7002 },
558+
node: { ...mockNode, port: 7002, slot: 7008 },
559559
status: CommandExecutionStatus.Success,
560560
};
561561
cliTool.execCommandForNode
@@ -586,7 +586,7 @@ describe('CliBusinessService', () => {
586586
const command = 'set foo bar';
587587
const mockResult: SendClusterCommandResponse = {
588588
response: '-> Redirected to slot [7008] located at 127.0.0.1:7002\nOK',
589-
node: { ...mockNode, port: 7002 },
589+
node: { ...mockNode, port: 7002, slot: 7008 },
590590
status: CommandExecutionStatus.Success,
591591
};
592592
cliTool.execCommandForNode

redisinsight/api/src/modules/cli/services/cli-business/cli-business.service.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ export class CliBusinessService {
306306
replyEncoding,
307307
);
308308
result.response = formatter.format(result.response, { slot, address });
309+
result.slot = parseInt(slot, 10);
309310
} else {
310311
result.response = formatter.format(result.response);
311312
}
@@ -316,9 +317,9 @@ export class CliBusinessService {
316317
{ command, outputFormat },
317318
);
318319
const {
319-
host, port, error, ...rest
320+
host, port, error, slot, ...rest
320321
} = result;
321-
return { ...rest, node: { host, port } };
322+
return { ...rest, node: { host, port, slot } };
322323
} catch (error) {
323324
this.logger.error('Failed to execute redis.cluster CLI command.', error);
324325

redisinsight/api/src/modules/cli/services/cli-tool/cli-tool.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export interface ICliExecResultFromNode {
2525
port: number;
2626
response: any;
2727
status: CommandExecutionStatus;
28+
slot?: number;
2829
error?: any,
2930
}
3031

redisinsight/api/test/api/cli/POST-instance-id-cli-uuid-send_cluster_command.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const responseSchema = Joi.array().items(Joi.object().keys({
3737
node: Joi.object().keys({
3838
host: Joi.string().required(),
3939
port: Joi.number().integer().required(),
40+
slot: Joi.number().integer(),
4041
})
4142
}).required());
4243

@@ -46,6 +47,7 @@ const responseRawSchema = Joi.array().items(Joi.object().keys({
4647
node: Joi.object().keys({
4748
host: Joi.string().required(),
4849
port: Joi.number().integer().required(),
50+
slot: Joi.number().integer(),
4951
})
5052
}).required());
5153

redisinsight/main.dev.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ const bootstrap = async () => {
136136

137137
export const windows = new Set<BrowserWindow>();
138138

139-
const titleSplash = 'splash';
139+
const titleSplash = 'RedisInsight';
140140
export const createSplashScreen = async () => {
141141
const splash = new BrowserWindow({
142142
width: 500,
@@ -153,7 +153,7 @@ export const createSplashScreen = async () => {
153153
return splash;
154154
};
155155

156-
export const createWindow = async (splash: BrowserWindow | null) => {
156+
export const createWindow = async (splash: BrowserWindow | null = null) => {
157157
const RESOURCES_PATH = app.isPackaged
158158
? path.join(process.resourcesPath, 'resources')
159159
: path.join(__dirname, '../resources');

redisinsight/ui/src/components/cli/components/cli-helper/CliHelper/styles.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
border-top: 1px solid var(--euiColorLightShade);
1818

1919
z-index: 10;
20+
overflow: hidden;
2021
}
2122

2223
.searchWrapper {

redisinsight/ui/src/pages/workbench/components/wb-view/WBView/styles.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
display: flex;
1010
flex: 1;
1111
padding: 0 16px 0;
12-
height: 100%;
12+
height: calc(100% - 70px);
1313
}
1414

1515
.sidebar {

redisinsight/ui/src/pages/workbench/components/wb-view/WBViewWrapper.spec.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import {
1111
waitFor,
1212
} from 'uiSrc/utils/test-utils'
1313
import QueryWrapper, { Props as QueryProps } from 'uiSrc/components/query'
14-
import { BrowserStorageItem } from 'uiSrc/constants'
15-
import { localStorageService } from 'uiSrc/services'
1614
import { connectedInstanceSelector } from 'uiSrc/slices/instances'
1715
import { processWBClient } from 'uiSrc/slices/workbench/wb-settings'
1816
import { sendWBCommandClusterAction } from 'uiSrc/slices/workbench/wb-results'
@@ -101,15 +99,6 @@ describe('WBViewWrapper', () => {
10199
expect(render(<WBViewWrapper />)).toBeTruthy()
102100
})
103101

104-
it('should localStorage be called', () => {
105-
const mockUuid = 'test-uuid'
106-
localStorageService.get = jest.fn().mockReturnValue(mockUuid)
107-
108-
render(<WBViewWrapper />)
109-
110-
expect(localStorageService.get).toBeCalledWith(BrowserStorageItem.wbClientUuid)
111-
})
112-
113102
it('should render with SessionStorage', () => {
114103
render(<WBViewWrapper />)
115104

0 commit comments

Comments
 (0)