Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4d89351
allow defining APP FOLDER NAME by using env variable only for production
Nov 25, 2021
a60e331
Create codeql-analysis.yml
gkorland Dec 1, 2021
131632c
#RI-2088 - codeql fe fixes
Dec 3, 2021
6e9633d
update default homedir for production env
Dec 7, 2021
7dd4d4a
#RI-2088 - codeql fe fixes
Dec 7, 2021
800c53c
#RI-1841 - add support for auto updates to stage builds
Dec 8, 2021
0bdc854
* #RI-2120 - refactor CLUSTER_CURSOR_REGEX, create separate util for …
Dec 10, 2021
97c1b43
include branch in codeql workflow
Dec 13, 2021
7cb8336
test LGTM Alert suppression
Dec 13, 2021
359c15b
Merge pull request #105 from RedisInsight/feature/codeql-be-fixes
ArtyomPSofteq Dec 13, 2021
24906b8
#RI-1977 - download default commands jsons on build
Dec 13, 2021
c467b42
#RI-1977 - change static paths for win script
Dec 14, 2021
5c6a627
[E2E] Workbench tests with arguments hints are added
elenaNaboko Dec 14, 2021
730ddc5
Merge branch 'main' into feature/e2e-workbench
elenaNaboko Dec 14, 2021
6b1d576
#RI-1756 - rework CLI & Command Helper
Dec 14, 2021
2484eb1
run "build:defaults" for win too
Dec 14, 2021
5d74240
Merge branch 'main' into feature/RI-1756_rework-cli-ch
Dec 14, 2021
baca81a
[E2E] Workbench test with placeholder for empty command history is added
elenaNaboko Dec 14, 2021
079be52
update codeql-analysis config
Dec 14, 2021
d7db92b
Merge pull request #118 from RedisInsight/feature/e2e-workbench
elenaNaboko Dec 14, 2021
8df49cf
#RI-2088 remove python scripts with plain curl commands on test datab…
Dec 14, 2021
64f8491
Merge pull request #67 from RedisInsight/gkorland-codeql
Dec 15, 2021
5815667
#RI-1977 avoid blocking of main thread using I/O sync commands
Dec 15, 2021
a88f160
Merge branch 'main' into feature/RI-2088_get_rid_of_python_scripts
Dec 15, 2021
f90f106
remove python language from the codeql analysis since there is no pyt…
Dec 15, 2021
352874b
Merge pull request #45 from RedisInsight/fix/app-folder-name
Dec 15, 2021
b6f35af
Overwrite UPGRADES_LINK using circle instead of extra logic
Dec 15, 2021
973ef61
#RI-1756 - add unit tests, refactor
Dec 15, 2021
939319e
Merge branch 'main' into feature/codeql-fe-fixes
Dec 15, 2021
215ad81
#RI-2088 - remove unused function
Dec 15, 2021
a374a6b
#RI-1756 - fix tests
Dec 15, 2021
15579fa
#RI-2088 - remove unused lines
Dec 15, 2021
1c4ffac
Merge pull request #119 from RedisInsight/feature/RI-2088_get_rid_of_…
Dec 15, 2021
0492eee
Merge pull request #108 from RedisInsight/feature/RI-1977-auto-update…
Dec 15, 2021
6d6f329
fix typos
Dec 15, 2021
fd40f79
Merge pull request #93 from RedisInsight/feature/RI-1841-auto-update-…
Dec 15, 2021
977f30f
Merge pull request #80 from RedisInsight/feature/codeql-fe-fixes
rsergeenko Dec 15, 2021
24c6867
Merge pull request #115 from RedisInsight/feature/RI-1756_rework-cli-ch
rsergeenko Dec 15, 2021
04c05c2
#RI-2127, #RI-2128, #RI-2130 - fix letter-spacing
Dec 16, 2021
4e92057
Merge pull request #122 from RedisInsight/bugfix/change_fonts
rsergeenko Dec 16, 2021
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
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ jobs:
exit 0;
fi

SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY_STAGE yarn package:<< parameters.env >>
UPGRADES_LINK=$UPGRADES_LINK_STAGE SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY_STAGE yarn package:<< parameters.env >>
- persist_to_workspace:
root: .
paths:
Expand Down Expand Up @@ -474,7 +474,7 @@ jobs:
exit 0;
fi

SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY_STAGE yarn package:<< parameters.env >>
UPGRADES_LINK=$UPGRADES_LINK_STAGE SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY_STAGE yarn package:<< parameters.env >>
rm -rf release/mac
no_output_timeout: 15m
- persist_to_workspace:
Expand Down Expand Up @@ -514,7 +514,7 @@ jobs:
exit 0;
fi

SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY_STAGE yarn package:<< parameters.env >>
UPGRADES_LINK=$UPGRADES_LINK_STAGE SEGMENT_WRITE_KEY=$SEGMENT_WRITE_KEY_STAGE yarn package:<< parameters.env >>
rm -rf release/win-unpacked
shell: bash.exe
no_output_timeout: 20m
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ main, latest, release/*, codeql ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '37 11 * * 3'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
1 change: 0 additions & 1 deletion configs/webpack.config.main.prod.babel.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import path from 'path';
import webpack from 'webpack';
import { merge } from 'webpack-merge';
import TerserPlugin from 'terser-webpack-plugin';
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
import baseConfig from './webpack.config.base';
import DeleteSourceMaps from '../scripts/DeleteSourceMaps';
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
"build:main": "webpack --config ./configs/webpack.config.main.prod.babel.js",
"build:main:stage": "webpack --config ./configs/webpack.config.main.stage.babel.js",
"build:web": "webpack --config ./configs/webpack.config.web.prod.babel.js",
"build:statics": "sh ./scripts/build-statics.sh",
"build:statics:win": "./scripts/build-statics.cmd",
"build:defaults": "yarn --cwd redisinsight/api build:defaults",
"build:statics": "yarn build:defaults & sh ./scripts/build-statics.sh",
"build:statics:win": "yarn build:defaults & ./scripts/build-statics.cmd",
"build:renderer": "webpack --config ./configs/webpack.config.renderer.prod.babel.js",
"build:renderer:stage": "webpack --config ./configs/webpack.config.renderer.stage.babel.js",
"rebuild": "electron-rebuild --parallel --types prod,dev,optional --module-dir redisinsight/ui",
Expand Down
3 changes: 2 additions & 1 deletion redisinsight/api/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# compiled output
/dist
/node_modules
/src/static
/static
/defaults

# Logs
logs
Expand Down
52 changes: 38 additions & 14 deletions redisinsight/api/config/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@ const staticDir = process.env.BUILD_TYPE === 'ELECTRON' && process['resourcesPat
? join(process['resourcesPath'], 'static')
: join(__dirname, '..', 'static');

const defaultsDir = process.env.BUILD_TYPE === 'ELECTRON' && process['resourcesPath']
? join(process['resourcesPath'], 'defaults')
: join(__dirname, '..', 'defaults');

export default {
dir_path: {
homedir,
staticDir,
defaultsDir,
logs: join(homedir, 'logs'),
defaultPlugins: join(staticDir, 'plugins'),
customPlugins: join(homedir, 'plugins'),
pluginsAssets: join(staticDir, 'resources', 'plugins'),
commands: join(homedir, 'commands'),
defaultCommandsDir: join(defaultsDir, 'commands'),
caCertificates: join(homedir, 'ca_certificates'),
clientCertificates: join(homedir, 'client_certificates'),
},
Expand Down Expand Up @@ -72,18 +78,36 @@ export default {
omitSensitiveData: process.env.LOGGER_OMIT_DATA ? process.env.LOGGER_OMIT_DATA === 'true' : true,
pipelineSummaryLimit: parseInt(process.env.LOGGER_PIPELINE_SUMMARY_LIMIT, 10) || 5,
},
commands: {
mainUrl: process.env.COMMANDS_MAIN_URL
|| 'https://raw.githubusercontent.com/redis/redis-doc/master/commands.json',
redisearchUrl: process.env.COMMANDS_REDISEARCH_URL
|| 'https://raw.githubusercontent.com/RediSearch/RediSearch/master/commands.json',
redijsonUrl: process.env.COMMANDS_REDIJSON_URL
|| 'https://raw.githubusercontent.com/RedisJSON/RedisJSON/master/commands.json',
redistimeseriesUrl: process.env.COMMANDS_REDISTIMESERIES_URL
|| 'https://raw.githubusercontent.com/RedisTimeSeries/RedisTimeSeries/master/commands.json',
redisaiUrl: process.env.COMMANDS_REDISAI_URL
|| 'https://raw.githubusercontent.com/RedisAI/RedisAI/master/commands.json',
redisgraphUrl: process.env.COMMANDS_REDISGRAPH_URL
|| 'https://raw.githubusercontent.com/RedisGraph/RedisGraph/master/commands.json',
},
commands: [
{
name: 'main',
url: process.env.COMMANDS_MAIN_URL
|| 'https://raw.githubusercontent.com/redis/redis-doc/master/commands.json',
},
{
name: 'redisearch',
url: process.env.COMMANDS_REDISEARCH_URL
|| 'https://raw.githubusercontent.com/RediSearch/RediSearch/master/commands.json',
},
{
name: 'redijson',
url: process.env.COMMANDS_REDIJSON_URL
|| 'https://raw.githubusercontent.com/RedisJSON/RedisJSON/master/commands.json',
},
{
name: 'redistimeseries',
url: process.env.COMMANDS_REDISTIMESERIES_URL
|| 'https://raw.githubusercontent.com/RedisTimeSeries/RedisTimeSeries/master/commands.json',
},
{
name: 'redisai',
url: process.env.COMMANDS_REDISAI_URL
|| 'https://raw.githubusercontent.com/RedisAI/RedisAI/master/commands.json',
},
{
name: 'redisgraph',
url: process.env.COMMANDS_REDISGRAPH_URL
|| 'https://raw.githubusercontent.com/RedisGraph/RedisGraph/master/commands.json',
},
],
};
2 changes: 1 addition & 1 deletion redisinsight/api/config/production.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { join } from 'path';

const homedir = join(require('os').homedir(), process.env.APP_FOLDER_NAME || '.redisinsight-v2.0');
const homedir = join(require('os').homedir(), process.env.APP_FOLDER_NAME || '.redisinsight-preview');

export default {
dir_path: {
Expand Down
9 changes: 8 additions & 1 deletion redisinsight/api/nest-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
"sourceRoot": "src",
"compilerOptions": {
"assets": [
"static/**/*"
{
"include": "../static/**/*",
"outDir": "dist/static"
},
{
"include": "../defaults/**/*",
"outDir": "dist/defaults"
}
]
}
}
3 changes: 3 additions & 0 deletions redisinsight/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"url": "https://redis.com/redis-enterprise/redis-insight"
},
"scripts": {
"build:defaults:commands": "ts-node ./scripts/default-commands.ts",
"build:defaults": "yarn build:defaults:commands",
"prebuild": "rimraf dist",
"build": "nest build",
"build:prod": "rimraf dist && nest build -p ./tsconfig.build.prod.json && cross-env NODE_ENV=production",
Expand Down Expand Up @@ -46,6 +48,7 @@
"class-transformer": "^0.2.3",
"class-validator": "^0.12.2",
"express": "^4.17.1",
"fs-extra": "^10.0.0",
"ioredis": "^4.27.1",
"is-glob": "^4.0.1",
"jsonpath": "^1.1.1",
Expand Down
40 changes: 40 additions & 0 deletions redisinsight/api/scripts/default-commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import axios from 'axios';
import * as fs from 'fs';
import * as path from 'path';
import { get } from '../src/utils/config';

const PATH_CONFIG = get('dir_path');
const COMMANDS_CONFIG = get('commands');

async function init() {
try {
await Promise.all(COMMANDS_CONFIG.map(async ({ name, url }) => {
try {
console.log(`Trying to get ${name} commands...`);
const { data } = await axios.get(url, {
responseType: 'text',
transformResponse: [(raw) => raw],
});

if (!fs.existsSync(PATH_CONFIG.defaultCommandsDir)) {
fs.mkdirSync(PATH_CONFIG.defaultCommandsDir, { recursive: true });
}

fs.writeFileSync(
path.join(PATH_CONFIG.defaultCommandsDir, `${name}.json`),
JSON.stringify(JSON.parse(data)), // check that we received proper json object
);
console.log(`Successfully generated default ${name} commands`);
} catch (error) {
console.error(`Unable to update ${name} commands`, error);
}
}));

process.exit(0);
} catch (e) {
console.error('Something went wrong trying to get default commands jsons', e);
process.exit(1);
}
}

init();
2 changes: 2 additions & 0 deletions redisinsight/api/src/__mocks__/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,7 @@ export const mockRedisgraphCommands = {
};

export const mockCommandsJsonProvider = () => ({
updateLatestJson: jest.fn(),
getCommands: jest.fn(),
getDefaultCommands: jest.fn(),
});
Loading