Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
dfb67c7
#RI-2219 - get Redis setup info on ui from resources
Feb 15, 2022
d2e030c
add temp solution to deliver static content
Feb 16, 2022
f3071c9
change guides destination
Feb 17, 2022
aef2760
remove guides static + add logic for dev/test guides outside of curre…
Feb 17, 2022
421bd98
e2e - db info tests
tanyatrayanava Feb 18, 2022
4b85e6f
e2e-fix tests
tanyatrayanava Feb 18, 2022
e3db83b
e2e-add selectors
tanyatrayanava Feb 18, 2022
fd74b93
e2e - add timeout in the assertions
tanyatrayanava Feb 21, 2022
bd8f408
Merge pull request #309 from RedisInsight/feature/e2e-db-info
tanyatrayanava Feb 21, 2022
c04332d
just test build
Feb 21, 2022
5b641cb
#RI-2432 - implement REDIS_STACK build type
Feb 21, 2022
cbc9be3
fix job name
Feb 21, 2022
bff1ac6
test linux job
Feb 22, 2022
879f454
remove redundant jobs
Feb 22, 2022
386d0c1
fix version and expose artifacts
Feb 22, 2022
5b2597d
fix archive paths
Feb 22, 2022
938bafb
remove test code
Feb 22, 2022
f321e61
#RI-2437 - fix TypeError: Object has been destroyed
Feb 22, 2022
0cc1016
#RI-2458 - fix switching visualization views for commands
Feb 22, 2022
7f08ad2
fix pr comments
Feb 22, 2022
d0129d6
Merge branch 'feature/RI-2439-move-guides-to-the-own-repo' into featu…
Feb 22, 2022
ad4e4d6
* #RI-2219 - create AutoUpdateStaticsProvider
Feb 22, 2022
072d5ab
Merge pull request #303 from RedisInsight/feature/RI-2439-move-guides…
Feb 22, 2022
1eae6d5
Merge branch 'main' into feature/RI-2219_get-content-from-own-repo
Feb 22, 2022
f2aa678
fix pr comments
Feb 22, 2022
361da6b
Merge pull request #316 from RedisInsight/bugfix/RI-2458
rsergeenko Feb 22, 2022
c0bdd0f
Merge pull request #315 from RedisInsight/bugfix/RI-2437
rsergeenko Feb 22, 2022
86d6f7b
Merge pull request #317 from RedisInsight/feature/RI-2219_get-content…
ArtyomPSofteq Feb 22, 2022
76ba151
Merge branch 'main' into feature/RI-2219_cms-redis-setup-info
Feb 22, 2022
8a0c12b
#RI-2219 - get static content from repo
Feb 22, 2022
91cb74f
fix ui unit tests
Feb 22, 2022
dc0bed5
fix pr comments
Feb 23, 2022
56c12f2
Merge pull request #300 from RedisInsight/feature/RI-2219_cms-redis-s…
ArtyomPSofteq Feb 23, 2022
a953822
Merge branch 'main' into feature/RI-2432_redis-stack
Feb 23, 2022
0f36fa1
* #RI-2432 - add cloud promo button
Feb 23, 2022
4f0b972
#RI-2444 - fix some UI styles for overview
Feb 23, 2022
1527669
fix import for ROUTES
Feb 23, 2022
5079746
Merge pull request #318 from RedisInsight/bugfix/RI-2444
rsergeenko Feb 23, 2022
c238be4
Merge pull request #314 from RedisInsight/rs-test
Feb 23, 2022
55760c7
fix destination path for STAGE and PROD builds
Feb 23, 2022
64fb16b
Merge pull request #319 from RedisInsight/fix/RI-2219_folder-destination
ArtyomPSofteq Feb 23, 2022
22884cd
refactror env variables
Feb 23, 2022
24a0530
suggestion for be implementation
Feb 23, 2022
162cc55
e2e - add timeout for enablement area
tanyatrayanava Feb 23, 2022
117acb1
decrease timeout
tanyatrayanava Feb 23, 2022
ef3b7e6
Merge pull request #321 from RedisInsight/feature/e2e-desktop-fix
tanyatrayanava Feb 23, 2022
4387955
add unit tests and docs for stack.database.provider
Feb 23, 2022
1f01aff
Merge pull request #320 from RedisInsight/stack-be-suggestion
ArtyomPSofteq Feb 23, 2022
a334fbf
#RI-2443 - excluder routes
Feb 24, 2022
5e8a920
exclude additional routes
Feb 24, 2022
15c55ce
Merge pull request #323 from RedisInsight/feature/RI-2443_exclude-routes
ArtyomPSofteq Feb 24, 2022
f794ffa
fix pr comments
Feb 24, 2022
8243323
Merge pull request #313 from RedisInsight/feature/RI-2432_redis-stack
ArtyomPSofteq Feb 24, 2022
36a326d
* fix styles for promo link
Feb 24, 2022
04184d4
Merge pull request #324 from RedisInsight/fix/RI-2219_cloud-promo-styles
ArtyomPSofteq Feb 24, 2022
bc69041
move ConsentsSettingsPopup to MainRoute
Feb 24, 2022
21198cb
move ConsentsSettingsPopup outside off Switch component
Feb 24, 2022
b9393b2
Merge pull request #325 from RedisInsight/fix/RI-2443_consent-setting…
ArtyomPSofteq Feb 24, 2022
27dcb2c
#RI-2467 - fix router configuration
Feb 25, 2022
afcf222
Merge pull request #326 from RedisInsight/fix/RI-2467_router-configur…
ArtyomPSofteq Feb 25, 2022
b1ad430
e2e - fix tests
tanyatrayanava Feb 25, 2022
0d4a97f
e2e - remove only
tanyatrayanava Feb 25, 2022
0a54ad8
e2e - update comments
tanyatrayanava Feb 25, 2022
cf67ad4
Merge pull request #327 from RedisInsight/feature/e2e-tests-fix
tanyatrayanava Feb 25, 2022
8d236fd
e2e - create web runner for tests
tanyatrayanava Feb 26, 2022
7ae7576
#RI-2453 - add a shortcut to get access to workbench execution history
Feb 28, 2022
3c128b4
Merge pull request #333 from RedisInsight/feature/RI-2453_wb-history-…
ArtyomPSofteq Feb 28, 2022
e3a68da
Merge pull request #335 from RedisInsight/feature/e2e-runner
Feb 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 25 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -417,28 +417,36 @@ jobs:
if [ << parameters.env >> == "prod" ]; then
echo "Build version: $CURRENT_VERSION"
cp ./redisinsight/package.json ./electron/package.json
echo "$VERSION" > electron/version
exit 0
fi

VERSION=$CURRENT_VERSION-<< parameters.env >>-$CIRCLE_BUILD_NUM
echo "Build version: $VERSION"
echo "$VERSION" > electron/version
echo $(jq ".version=\"$VERSION\"" redisinsight/package.json) > electron/package.json
- persist_to_workspace:
root: /root/project
paths:
- electron
linux:
docker:
- image: circleci/node:15.14.0
machine:
image: ubuntu-2004:202101-01
resource_class: large
parameters:
env:
description: Build environment (stage || prod)
type: enum
default: stage
enum: ['stage', 'prod', 'dev']
redisstack:
description: Build RedisStack archives
type: boolean
default: true
steps:
- checkout
- node/install:
node-version: '14.17'
- attach_workspace:
at: .
- run:
Expand All @@ -465,12 +473,27 @@ jobs:
fi

UPGRADES_LINK='' SEGMENT_WRITE_KEY='' yarn package:stage
- when:
condition:
equal: [ true, << parameters.redisstack >> ]
steps:
- run:
name: Build sources
command: ./.circleci/redisstack/build.sh
- run:
name: Build modules
command: |
PLATFORM=linux ARCH=x64 .circleci/redisstack/build_modules.sh
PLATFORM=linux ARCH=arm64 .circleci/redisstack/build_modules.sh
PLATFORM=darwin ARCH=x64 .circleci/redisstack/build_modules.sh
PLATFORM=darwin ARCH=arm64 .circleci/redisstack/build_modules.sh
- persist_to_workspace:
root: .
paths:
- release/RedisInsight*.deb
- release/RedisInsight*.AppImage
- release/*-linux.yml
- release/redisstack
macosx:
macos:
xcode: 13.2.1
Expand Down Expand Up @@ -773,17 +796,6 @@ jobs:

done

release-guides:
executor: linux-executor
steps:
- checkout
- run:
name: Release guides
command: |
cd ./redisinsight/ui/src/packages/enablement-area && zip -r data.zip .
mkdir -p _build && mv data.zip ./_build
echo "{\"timestamp\":$(date +%s)}" > ./_build/build.json
aws s3 cp _build/ s3://${AWS_BUCKET_NAME}/public/guides --recursive
workflows:
build:
jobs:
Expand Down Expand Up @@ -1039,13 +1051,3 @@ workflows:
report: true
requires:
- Build app - Linux (stage)
guides:
jobs:
- guides-approve:
type: approval
name: Approve guides release
<<: *guidesFilter
- release-guides:
name: Build & release
requires:
- Approve guides release
10 changes: 10 additions & 0 deletions .circleci/redisstack/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# install deps
yarn
yarn --cwd redisinsight/api

# build
yarn build:statics
yarn build:web
yarn --cwd ./redisinsight/api build:prod
31 changes: 31 additions & 0 deletions .circleci/redisstack/build_modules.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

PLATFORM=${PLATFORM:-'linux'}
ELECTRON_VERSION=$(cat electron/version)
VERSION=${ELECTRON_VERSION:-'redisstack'}
ARCH=${ARCH:-'x64'}
FILENAME="RedisInsight-$PLATFORM.$VERSION.$ARCH.zip"

# reinstall backend prod dependencies only (optimise space)
rm -rf redisinsight/api/node_modules

npm_config_arch="$ARCH" \
npm_config_target_arch="$ARCH" \
npm_config_platform="$PLATFORM" \
npm_config_target_platform="$PLATFORM" \
npm_config_keytar_binary_host_mirror="$KEYTAR_MIRROR" \
npm_config_node_sqlite3_binary_host_mirror="$SQLITE_MIRROR" \
yarn --cwd ./redisinsight/api install --production

cp redisinsight/api/.yarnclean.prod redisinsight/api/.yarnclean
yarn --cwd ./redisinsight/api autoclean --force

rm -rf redisinsight/build.zip
cd redisinsight && zip -r build.zip \
api/node_modules \
api/dist \
ui/dist \
&& cd ..

mkdir -p release/redisstack
cp redisinsight/build.zip release/redisstack/"$FILENAME"
22 changes: 20 additions & 2 deletions redisinsight/api/config/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ export default {
pluginsAssets: join(staticDir, 'resources', 'plugins'),
commands: join(homedir, 'commands'),
defaultCommandsDir: join(defaultsDir, 'commands'),
enablementArea: join(homedir, 'enablement-area'),
enablementArea: process.env.GUIDES_DEV_PATH || join(homedir, 'enablement-area'),
defaultEnablementArea: join(defaultsDir, 'enablement-area'),
content: process.env.CONTENT_DEV_PATH || join(homedir, 'content'),
defaultContent: join(defaultsDir, 'content'),
caCertificates: join(homedir, 'ca_certificates'),
clientCertificates: join(homedir, 'client_certificates'),
},
Expand All @@ -34,6 +36,7 @@ export default {
customPluginsUri: '/plugins',
staticUri: '/static',
enablementAreaUri: '/static/workbench',
contentUri: '/static/content',
defaultPluginsUri: '/static/plugins',
pluginsAssetsUri: '/static/resources/plugins',
secretStoragePassword: process.env.SECRET_STORAGE_PASSWORD,
Expand All @@ -44,6 +47,7 @@ export default {
buildType: process.env.BUILD_TYPE || 'ELECTRON',
appVersion: process.env.APP_VERSION || '2.0.0',
requestTimeout: parseInt(process.env.REQUEST_TIMEOUT, 10) || 10000,
excludeRoutes: [],
},
sockets: {
cors: process.env.SOCKETS_CORS ? process.env.SOCKETS_CORS === 'true' : false,
Expand Down Expand Up @@ -90,9 +94,17 @@ export default {
},
enablementArea: {
updateUrl: process.env.ENABLEMENT_AREA_UPDATE_URL
|| 'https://s3.amazonaws.com/redisinsight.download/public/guides',
|| 'https://github.com/RedisInsight/Guides/releases/download/latest',
zip: process.env.ENABLEMENT_AREA_ZIP || 'data.zip',
buildInfo: process.env.ENABLEMENT_AREA_CHECKSUM || 'build.json',
devMode: !!process.env.GUIDES_DEV_PATH,
},
content: {
updateUrl: process.env.CONTENT_UPDATE_URL
|| 'https://github.com/RedisInsight/Statics/releases/download/latest',
zip: process.env.CONTENT_ZIP || 'data.zip',
buildInfo: process.env.CONTENT_CHECKSUM || 'build.json',
devMode: !!process.env.CONTENT_DEV_PATH,
},
workbench: {
maxResultSize: parseInt(process.env.COMMAND_EXECUTION_MAX_RESULT_SIZE, 10) || 1024 * 1024,
Expand Down Expand Up @@ -141,4 +153,10 @@ export default {
|| 'https://raw.githubusercontent.com/RedisBloom/RedisBloom/master/commands.json',
},
],
redisStack: {
id: process.env.BUILD_TYPE === 'REDIS_STACK' ? process.env.REDIS_STACK_DATABASE_ID || 'redis-stack' : undefined,
name: process.env.REDIS_STACK_DATABASE_NAME,
host: process.env.REDIS_STACK_DATABASE_HOST,
port: process.env.REDIS_STACK_DATABASE_PORT,
},
};
3 changes: 2 additions & 1 deletion redisinsight/api/config/production.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ export default {
logs: join(homedir, 'logs'),
customPlugins: join(homedir, 'plugins'),
commands: join(homedir, 'commands'),
enablementArea: join(homedir, 'enablement-area'),
enablementArea: process.env.GUIDES_DEV_PATH || join(homedir, 'enablement-area'),
content: process.env.CONTENT_DEV_PATH || join(homedir, 'content'),
caCertificates: join(homedir, 'ca_certificates'),
clientCertificates: join(homedir, 'client_certificates'),
},
Expand Down
15 changes: 15 additions & 0 deletions redisinsight/api/config/stack.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { RequestMethod } from '@nestjs/common';

export default {
server: {
excludeRoutes: [
'redis-enterprise/*',
'instance/redis-enterprise-dbs',
'instance/redis-cloud-dbs',
'instance/sentinel-masters',
{ path: 'instance', method: RequestMethod.POST },
{ path: 'instance', method: RequestMethod.DELETE },
{ path: 'instance/:id', method: RequestMethod.DELETE },
],
},
};
3 changes: 2 additions & 1 deletion redisinsight/api/config/staging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ export default {
logs: join(homedir, 'logs'),
customPlugins: join(homedir, 'plugins'),
commands: join(homedir, 'commands'),
enablementArea: join(homedir, 'enablement-area'),
enablementArea: process.env.GUIDES_DEV_PATH || join(homedir, 'enablement-area'),
content: process.env.CONTENT_DEV_PATH || join(homedir, 'content'),
caCertificates: join(homedir, 'ca_certificates'),
clientCertificates: join(homedir, 'client_certificates'),
},
Expand Down
1 change: 1 addition & 0 deletions redisinsight/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"body-parser": "^1.19.0",
"class-transformer": "^0.2.3",
"class-validator": "^0.12.2",
"dotenv": "^16.0.0",
"express": "^4.17.1",
"fs-extra": "^10.0.0",
"ioredis": "^4.27.1",
Expand Down
19 changes: 15 additions & 4 deletions redisinsight/api/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import * as fs from 'fs';
import { Module, OnModuleInit } from '@nestjs/common';
import {
MiddlewareConsumer, Module, NestModule, OnModuleInit,
} from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { ServeStaticModule } from '@nestjs/serve-static';
import { EventEmitterModule } from '@nestjs/event-emitter';
Expand All @@ -9,16 +11,17 @@ import config from 'src/utils/config';
import { PluginModule } from 'src/modules/plugin/plugin.module';
import { CommandsModule } from 'src/modules/commands/commands.module';
import { WorkbenchModule } from 'src/modules/workbench/workbench.module';
import { EnablementAreaModule } from 'src/modules/enablement-area/enablement-area.module';
import { SharedModule } from './modules/shared/shared.module';
import { InstancesModule } from './modules/instances/instances.module';
import { BrowserModule } from './modules/browser/browser.module';
import { RedisEnterpriseModule } from './modules/redis-enterprise/redis-enterprise.module';
import { RedisSentinelModule } from './modules/redis-sentinel/redis-sentinel.module';
import { MonitorModule } from './modules/monitor/monitor.module';
import { CliModule } from './modules/cli/cli.module';
import { StaticsManagementModule } from './modules/statics-management/statics-management.module';
import { SettingsController } from './controllers/settings.controller';
import { ServerInfoController } from './controllers/server-info.controller';
import { ExcludeRouteMiddleware } from './middleware/exclude-route.middleware';
import { routes } from './app.routes';
import ormConfig from '../config/ormconfig';

Expand Down Expand Up @@ -64,12 +67,12 @@ const PATH_CONFIG = config.get('dir_path');
fallthrough: false,
},
}),
EnablementAreaModule,
StaticsManagementModule,
],
controllers: [SettingsController, ServerInfoController],
providers: [],
})
export class AppModule implements OnModuleInit {
export class AppModule implements OnModuleInit, NestModule {
onModuleInit() {
// creating required folders
const foldersToCreate = [
Expand All @@ -83,4 +86,12 @@ export class AppModule implements OnModuleInit {
}
});
}

configure(consumer: MiddlewareConsumer) {
consumer
.apply(ExcludeRouteMiddleware)
.forRoutes(
...SERVER_CONFIG.excludeRoutes,
);
}
}
12 changes: 10 additions & 2 deletions redisinsight/api/src/decorators/api-endpoint.decorator.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
import { applyDecorators, HttpCode } from '@nestjs/common';
import { ApiOperation, ApiResponse } from '@nestjs/swagger';
import { ApiExcludeEndpoint, ApiOperation, ApiResponse } from '@nestjs/swagger';
import { ApiResponseOptions } from '@nestjs/swagger/dist/decorators/api-response.decorator';
import config from 'src/utils/config';
import { BuildType } from 'src/modules/core/models/server-provider.interface';

const SERVER_CONFIG = config.get('server');

export interface IApiEndpointOptions {
description: string;
statusCode?: number;
responses?: ApiResponseOptions[];
excludeFor?: BuildType[]
}

export function ApiEndpoint(
options: IApiEndpointOptions,
): MethodDecorator & ClassDecorator {
const { description, statusCode, responses = [] } = options;
const {
description, statusCode, responses = [], excludeFor = [],
} = options;
return applyDecorators(
ApiOperation({ description }),
ApiExcludeEndpoint(excludeFor.includes(SERVER_CONFIG.buildType)),
HttpCode(statusCode),
...responses?.map((response) => ApiResponse(response)),
);
Expand Down
8 changes: 7 additions & 1 deletion redisinsight/api/src/dto/server.dto.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApiProperty } from '@nestjs/swagger';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export class GetServerInfoResponse {
@ApiProperty({
Expand Down Expand Up @@ -36,6 +36,12 @@ export class GetServerInfoResponse {
})
buildType: string;

@ApiPropertyOptional({
description: 'Fixed Redis database id.',
type: String,
})
fixedDatabaseId?: string;

@ApiProperty({
description: 'List of available encryption strategies',
type: [String],
Expand Down
1 change: 1 addition & 0 deletions redisinsight/api/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dotenv/config'
import { NestFactory } from '@nestjs/core';
import { SwaggerModule } from '@nestjs/swagger';
import { NestApplicationOptions } from '@nestjs/common';
Expand Down
9 changes: 9 additions & 0 deletions redisinsight/api/src/middleware/exclude-route.middleware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Injectable, NestMiddleware, NotFoundException } from '@nestjs/common';
import { Request } from 'express';

@Injectable()
export class ExcludeRouteMiddleware implements NestMiddleware {
use(req: Request) {
throw new NotFoundException(`Cannot ${req.method} ${req.originalUrl}`);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { GetServerInfoResponse } from 'src/dto/server.dto';

export enum BuildType {
RedisStack = 'REDIS_STACK',
Electron = 'ELECTRON',
DockerOnPremise = 'DOCKER_ON_PREMISE',
}

export interface IServerProvider {
getInfo(): Promise<GetServerInfoResponse>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { ServerInfoNotFoundException } from 'src/constants/exceptions';
import { EncryptionService } from 'src/modules/core/encryption/encryption.service';

const SERVER_CONFIG = config.get('server');
const REDIS_STACK_CONFIG = config.get('redisStack');

@Injectable()
export class ServerOnPremiseService
Expand Down Expand Up @@ -90,6 +91,7 @@ implements OnApplicationBootstrap, IServerProvider {
osPlatform: process.platform,
buildType: SERVER_CONFIG.buildType,
encryptionStrategies: await this.encryptionService.getAvailableEncryptionStrategies(),
fixedDatabaseId: REDIS_STACK_CONFIG?.id,
};
this.logger.log('Succeed to get server info.');
return result;
Expand Down
Loading