Skip to content

Commit 7713b3d

Browse files
authored
Merge branch 'main' into fe/bugfix/RI-7463-sentinel-databases-rerender
2 parents 8b19db4 + 723c9a5 commit 7713b3d

File tree

225 files changed

+5611
-1652
lines changed

Some content is hidden

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

225 files changed

+5611
-1652
lines changed

.eslintrc.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,6 @@ module.exports = {
261261
rules: {
262262
semi: 'off',
263263
'@typescript-eslint/semi': 'off',
264-
'@typescript-eslint/no-unused-vars': 'off',
265-
'@typescript-eslint/no-use-before-define': 'off',
266-
'@typescript-eslint/no-unused-expressions': 'off',
267264
'sonarjs/no-identical-functions': 'off',
268265
'sonarjs/prefer-immediate-return': 'off',
269266
'sonarjs/no-duplicate-string': 'off',
@@ -274,14 +271,10 @@ module.exports = {
274271
'no-underscore-dangle': 'off',
275272
'import/no-duplicates': 'off',
276273
'no-console': 'off',
277-
'prettier/prettier': 'off',
278274
'prefer-destructuring': 'off',
279275
'no-unneeded-ternary': 'off',
280276
'prefer-template': 'off',
281277
'prefer-const': 'off',
282-
'@typescript-eslint/naming-convention': 'off',
283-
'@typescript-eslint/lines-between-class-members': 'off',
284-
'@typescript-eslint/no-shadow': 'off',
285278
// REDUNDANT: These are OFF by default in newer Airbnb config
286279
// 'prefer-arrow-callback': 'off',
287280
// 'no-restricted-syntax': 'off',
@@ -427,7 +420,9 @@ module.exports = {
427420
'node_modules',
428421
'release',
429422
'redisinsight/ui/src/packages/**/icons/*.js*',
423+
'redisinsight/ui/src/packages/**',
430424
'redisinsight/api/report/**',
425+
'redisinsight/api/static/**',
431426
'redisinsight/api/migration/**',
432427
// Config files that don't need linting
433428
'.eslintrc.js',

.github/workflows/tests-integration.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@ env:
5050
TEST_MEDIUM_DB_DUMP: ${{ secrets.TEST_MEDIUM_DB_DUMP }}
5151
TEST_BIG_DB_DUMP: ${{ secrets.TEST_BIG_DB_DUMP }}
5252
REPORT_NAME: 'report-it'
53+
# Disabled RTE for now. Need to prepare reasonable dataset to not take so much time for tests.
54+
# "oss-st-big": "OSS Standalone v6 and all modules and predefined amount of data inside (~3-4M)",
5355
ITESTS_NAMES: |
5456
{
5557
"oss-st-5": "OSS Standalone v5",
5658
"oss-st-5-pass": "OSS Standalone v5 with admin pass required",
5759
"oss-st-6": "OSS Standalone v6 and all modules",
58-
"oss-st-big": "OSS Standalone v6 and all modules and predefined amount of data inside (~3-4M)",
5960
"mods-preview": "OSS Standalone and all preview modules",
6061
"oss-st-6-tls": "OSS Standalone v6 with TLS enabled",
6162
"oss-st-6-tls-auth": "OSS Standalone v6 with TLS auth required",
@@ -153,6 +154,15 @@ jobs:
153154
cp ./redisinsight/api/test/test-runs/coverage/test-run-result.xml ./itest/results/${{ matrix.rte }}.result.xml
154155
cp ./redisinsight/api/test/test-runs/coverage/test-run-coverage.json ./itest/coverages/${{ matrix.rte }}.coverage.json
155156
157+
- name: Process test results
158+
if: always()
159+
run: |
160+
mkdir -p itest/coverages && mkdir -p itest/results
161+
162+
cp ./redisinsight/api/test/test-runs/coverage/test-run-result.json ./itest/results/${{ matrix.rte }}.result.json
163+
cp ./redisinsight/api/test/test-runs/coverage/test-run-result.xml ./itest/results/${{ matrix.rte }}.result.xml
164+
cp ./redisinsight/api/test/test-runs/coverage/test-run-coverage.json ./itest/coverages/${{ matrix.rte }}.coverage.json
165+
156166
- name: Upload coverage files as artifact
157167
if: always()
158168
uses: actions/upload-artifact@v4
@@ -230,7 +240,7 @@ jobs:
230240
reporter: java-junit
231241
list-tests: 'failed'
232242
list-suites: 'failed'
233-
fail-on-error: 'false'
243+
fail-on-error: 'true'
234244

235245
- name: Add link to report in the workflow summary
236246
if: always()

.storybook/preview-head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
display: flex;
2020
flex-direction: column;
2121
}
22-
22+
2323
.sbdocs-wrapper div:has(>div>.toc-wrapper){
2424
width:14rem;
2525
}

redisinsight/api/config/default.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,8 @@ export default {
114114
databaseManagement: process.env.RI_DATABASE_MANAGEMENT !== 'false',
115115
maxPayloadSize: process.env.RI_MAX_PAYLOAD_SIZE || '512MB',
116116
cors: {
117-
origin: process.env.RI_CORS_ORIGIN
118-
? process.env.RI_CORS_ORIGIN
119-
: '*',
120-
credentials:
121-
process.env.RI_CORS_CREDENTIALS === 'true',
117+
origin: process.env.RI_CORS_ORIGIN ? process.env.RI_CORS_ORIGIN : '*',
118+
credentials: process.env.RI_CORS_CREDENTIALS === 'true',
122119
},
123120
},
124121
statics: {

redisinsight/api/config/features-config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@
121121
"vectorSearch": {
122122
"flag": false,
123123
"perc": [[0, 100]]
124+
},
125+
"databasesListV2": {
126+
"flag": true,
127+
"perc": [[0, 100]]
124128
}
125129
}
126130
}

redisinsight/api/config/logger.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ import {
66
} from 'nest-winston';
77
import { join } from 'path';
88
import config from 'src/utils/config';
9-
import {
10-
prepareLogsData,
11-
prettyFileFormat,
12-
} from 'src/utils/logsFormatter';
9+
import { prepareLogsData, prettyFileFormat } from 'src/utils/logsFormatter';
1310

1411
const PATH_CONFIG = config.get('dir_path');
1512
const LOGGER_CONFIG = config.get('logger');

redisinsight/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"typeorm": "ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli.js -d ./config/ormconfig.ts",
3535
"test:api": "cross-env NODE_ENV=test ts-mocha --paths --config ./test/api/.mocharc.yml",
3636
"test:api:cov": "nyc --reporter=html --reporter=text --reporter=text-summary yarn run test:api",
37-
"test:api:ci:cov": "cross-env NODE_ENV=test nyc --temp-dir coverage/.nyc_output --report-dir coverage --instrument -r text -r text-summary -r html yarn run test:api --reporter mocha-multi-reporters --reporter-options configFile=test/api/reporters.json; echo 'Exit code from tests:' $? > coverage/debug.log; echo 'NYC tests completed, checking .nyc_output...' >> coverage/debug.log; ls -la coverage/.nyc_output >> coverage/debug.log 2>&1; echo 'Running NYC merge...' >> coverage/debug.log; nyc merge coverage/.nyc_output coverage/test-run-coverage.json >> coverage/debug.log 2>&1; echo 'NYC merge exit code:' $? >> coverage/debug.log; echo 'NYC merge completed!' >> coverage/debug.log; ls -la coverage/test-run-coverage.json >> coverage/debug.log 2>&1",
37+
"test:api:ci:cov": "cross-env nyc -r text -r text-summary -r html yarn run test:api --reporter mocha-multi-reporters --reporter-options configFile=test/api/reporters.json && nyc merge .nyc_output ./coverage/test-run-coverage.json",
3838
"typeorm:migrate": "cross-env NODE_ENV=staging yarn typeorm migration:generate ./migration/migration",
3939
"typeorm:run": "yarn typeorm migration:run",
4040
"typeorm:run:stage": "cross-env NODE_ENV=staging yarn typeorm migration:run"

redisinsight/api/src/common/decorators/client-metadata/client-metadata.decorator.ts

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,24 @@ export const clientMetadataParamFactory = (
3838
uniqueId = req.params?.[options.uniqueIdParam];
3939
}
4040

41-
const clientMetadata = plainToInstance(ClientMetadata, {
42-
sessionMetadata: sessionMetadataFromRequestExecutionContext(undefined, ctx),
43-
databaseId,
44-
uniqueId,
45-
context: options?.context || ClientContext.Common,
46-
db: options?.ignoreDbIndex
47-
? undefined
48-
: req?.headers?.[API_HEADER_DATABASE_INDEX],
49-
}, {
50-
groups: ['security'],
51-
});
41+
const clientMetadata = plainToInstance(
42+
ClientMetadata,
43+
{
44+
sessionMetadata: sessionMetadataFromRequestExecutionContext(
45+
undefined,
46+
ctx,
47+
),
48+
databaseId,
49+
uniqueId,
50+
context: options?.context || ClientContext.Common,
51+
db: options?.ignoreDbIndex
52+
? undefined
53+
: req?.headers?.[API_HEADER_DATABASE_INDEX],
54+
},
55+
{
56+
groups: ['security'],
57+
},
58+
);
5259

5360
const errors = validator.validateSync(clientMetadata, {
5461
whitelist: false, // we need this to allow additional fields if needed for flexibility

redisinsight/api/src/common/decorators/session/session-metadata.decorator.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ export const sessionMetadataFromRequest = (
3434
requestMetadata,
3535
};
3636

37-
const session = plainToInstance(SessionMetadata, requestSession, { groups: ['security'] });
37+
const session = plainToInstance(SessionMetadata, requestSession, {
38+
groups: ['security'],
39+
});
3840

3941
const errors = validator.validateSync(session, {
4042
whitelist: false, // we need this to allow additional fields if needed for flexibility

redisinsight/api/src/common/logger/app-logger.spec.ts

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,30 @@ const logLevels = Object.keys(mockWinstonLogger);
2222
jest.spyOn(WinstonModule, 'createLogger').mockReturnValue(mockWinstonLogger);
2323

2424
const getSessionMetadata = () =>
25-
plainToInstance(SessionMetadata, {
26-
userId: '123',
27-
sessionId: 'test-session-id',
28-
requestMetadata: {
29-
any: 'data',
25+
plainToInstance(
26+
SessionMetadata,
27+
{
28+
userId: '123',
29+
sessionId: 'test-session-id',
30+
requestMetadata: {
31+
any: 'data',
32+
},
3033
},
31-
}, { groups: ['security' ] });
34+
{ groups: ['security'] },
35+
);
3236

3337
const getClientMetadata = () =>
34-
plainToInstance(ClientMetadata, {
35-
sessionMetadata: getSessionMetadata(),
36-
databaseId: 'db-123',
37-
context: ClientContext.Browser,
38-
uniqueId: 'unique-id',
39-
db: 1,
40-
}, { groups: ['security' ] });
38+
plainToInstance(
39+
ClientMetadata,
40+
{
41+
sessionMetadata: getSessionMetadata(),
42+
databaseId: 'db-123',
43+
context: ClientContext.Browser,
44+
uniqueId: 'unique-id',
45+
db: 1,
46+
},
47+
{ groups: ['security'] },
48+
);
4149

4250
describe('AppLogger', () => {
4351
let logger: AppLogger;

0 commit comments

Comments
 (0)