Skip to content

Commit 955d4e5

Browse files
committed
Merge branch 'main' into be/feature/RI-6154-updates-in-cloud-session
2 parents eb37e66 + 9457d2d commit 955d4e5

File tree

374 files changed

+17464
-8478
lines changed

Some content is hidden

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

374 files changed

+17464
-8478
lines changed

.circleci/build/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ yarn
66
yarn --cwd redisinsight/api
77

88
# build
9+
910
yarn build:statics
1011
yarn build:ui
1112
yarn --cwd ./redisinsight/api build:prod
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Install all libraries action
2+
description: Install all libraries and dependencies
3+
inputs:
4+
skip-electron-deps:
5+
description: Skip install electron dependencies
6+
default: '0'
7+
required: false
8+
9+
skip-backend-deps:
10+
description: Skip install backend dependencies
11+
default: '0'
12+
required: false
13+
14+
skip-postinstall:
15+
description: Skip postinstall
16+
default: '0'
17+
required: false
18+
19+
keytar-host-mirror:
20+
description: Keytar binary host mirror
21+
required: false
22+
23+
sqlite3-host-mirror:
24+
description: SQLite3 binary host mirror
25+
required: false
26+
27+
#TODO: check !contains
28+
29+
runs:
30+
using: 'composite'
31+
steps:
32+
# OS libraries
33+
- name: Setup Node
34+
uses: actions/[email protected]
35+
with:
36+
node-version: '20.15'
37+
# disable cache for windows
38+
# https://github.com/actions/setup-node/issues/975
39+
cache: ${{ runner.os != 'Windows' && 'yarn' || '' }}
40+
cache-dependency-path: ${{ runner.os != 'Windows' && '**/yarn.lock' || '' }}
41+
42+
- name: Setup Python
43+
# if: ${{ contains(inputs.skip-electron-deps, '1') }}
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: '3.11'
47+
48+
- name: Install linux libraries
49+
if: ${{ runner.os == 'Linux' }}
50+
# if: ${{ runner.os == 'Linux' && !contains(inputs.skip-electron-deps, '1') }}
51+
shell: bash
52+
run: |
53+
sudo apt-get update -qy
54+
sudo apt-get install -qy libsecret-1-dev rpm
55+
56+
- name: Install macos libraries
57+
if: ${{ runner.os == 'macOS' }}
58+
# if: ${{ runner.os == 'macOS' && !contains(inputs.skip-electron-deps, '1') }}
59+
shell: bash
60+
run: |
61+
brew install libsecret
62+
63+
# TODO: matrix?
64+
# Javascript dependencies
65+
- name: Install dependencies for redisinsight package.js
66+
# if: ${{ contains(inputs.skip-electron-deps, '1') }}
67+
uses: ./.github/actions/install-deps
68+
with:
69+
dir-path: './redisinsight'
70+
keytar-host-mirror: ${{ inputs.keytar-host-mirror }}
71+
sqlite3-host-mirror: ${{ inputs.sqlite3-host-mirror }}
72+
73+
- name: Install dependencies for BE package.js
74+
# if: ${{ !contains(inputs.skip-backend-deps, '1') }}
75+
uses: ./.github/actions/install-deps
76+
with:
77+
dir-path: './redisinsight/api'
78+
79+
- name: Install dependencies for root package.js
80+
# if: ${{ contains(inputs.skip-electron-deps, '1') }}
81+
uses: ./.github/actions/install-deps
82+
with:
83+
dir-path: './'
84+
keytar-host-mirror: ${{ inputs.keytar-host-mirror }}
85+
sqlite3-host-mirror: ${{ inputs.sqlite3-host-mirror }}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Add certs to the keychain (macos)
2+
3+
inputs:
4+
CSC_P12_BASE64:
5+
required: true
6+
CSC_MAC_INSTALLER_P12_BASE64:
7+
required: true
8+
CSC_MAS_P12_BASE64:
9+
required: true
10+
CSC_KEY_PASSWORD:
11+
required: true
12+
CSC_MAS_PASSWORD:
13+
required: true
14+
CSC_MAC_INSTALLER_PASSWORD:
15+
required: true
16+
17+
runs:
18+
using: 'composite'
19+
steps:
20+
- name: Setup sign certificates
21+
shell: bash
22+
env:
23+
CSC_P12_BASE64: ${{ inputs.CSC_P12_BASE64 }}
24+
CSC_MAC_INSTALLER_P12_BASE64: ${{ inputs.CSC_MAC_INSTALLER_P12_BASE64 }}
25+
CSC_MAS_P12_BASE64: ${{ inputs.CSC_MAS_P12_BASE64 }}
26+
run: |
27+
mkdir -p certs
28+
echo "$CSC_P12_BASE64" | base64 -d > certs/mac-developer.p12
29+
echo "$CSC_MAC_INSTALLER_P12_BASE64" | base64 -d > certs/mac-installer.p12
30+
echo "$CSC_MAS_P12_BASE64" | base64 -d > certs/mas-distribution.p12
31+
32+
- name: Add certs to the keychain
33+
shell: bash
34+
env:
35+
KEYCHAIN: redisinsight.keychain
36+
CSC_KEY_PASSWORD: ${{ inputs.CSC_KEY_PASSWORD }}
37+
CSC_MAS_PASSWORD: ${{ inputs.CSC_MAS_PASSWORD }}
38+
CSC_MAC_INSTALLER_PASSWORD: ${{ inputs.CSC_MAC_INSTALLER_PASSWORD }}
39+
run: |
40+
security create-keychain -p mysecretpassword $KEYCHAIN
41+
security default-keychain -s $KEYCHAIN
42+
security unlock-keychain -p mysecretpassword $KEYCHAIN
43+
security set-keychain-settings -u -t 10000000 $KEYCHAIN
44+
security import certs/mac-developer.p12 -k $KEYCHAIN -P "$CSC_KEY_PASSWORD" -T /usr/bin/codesign -T /usr/bin/productbuild
45+
security import certs/mas-distribution.p12 -k $KEYCHAIN -P "$CSC_MAS_PASSWORD" -T /usr/bin/codesign -T /usr/bin/productbuild
46+
security import certs/mac-installer.p12 -k $KEYCHAIN -P "$CSC_MAC_INSTALLER_PASSWORD" -T /usr/bin/codesign -T /usr/bin/productbuild
47+
security set-key-partition-list -S apple-tool:,apple: -s -k mysecretpassword $KEYCHAIN
48+
security list-keychain -d user -s $KEYCHAIN
49+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Install Dependencies action
2+
description: Caches and installs dependencies for a given path
3+
inputs:
4+
dir-path:
5+
description: Path to the directory
6+
required: true
7+
keytar-host-mirror:
8+
description: Keytar binary host mirror
9+
required: false
10+
sqlite3-host-mirror:
11+
description: SQLite3 binary host mirror
12+
required: false
13+
skip-postinstall:
14+
description: Skip postinstall
15+
required: false
16+
default: '0'
17+
18+
runs:
19+
using: 'composite'
20+
steps:
21+
- name: Install dependencies
22+
working-directory: ${{ inputs.dir-path }}
23+
shell: bash
24+
25+
# env:
26+
# SKIP_POSTINSTALL: ${{ inputs.skip-postinstall }}
27+
# run: yarn install
28+
run: |
29+
# todo: uncomment after build our binaries
30+
# export npm_config_keytar_binary_host_mirror=${{ inputs.keytar-host-mirror }}
31+
# export npm_config_node_sqlite3_binary_host_mirror=${{ inputs.sqlite3-host-mirror }}
32+
33+
yarn install --frozen-lockfile --network-timeout 1000000
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Install Windows certs
2+
3+
inputs:
4+
WIN_CSC_PFX_BASE64:
5+
required: true
6+
7+
runs:
8+
using: 'composite'
9+
steps:
10+
- name: Setup sign certificates
11+
shell: bash
12+
env:
13+
WIN_CSC_PFX_BASE64: ${{ inputs.WIN_CSC_PFX_BASE64 }}
14+
run: |
15+
mkdir -p certs
16+
echo "$WIN_CSC_PFX_BASE64" | base64 -d > certs/redislabs_win.pfx

.github/build/release-docker.sh

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/bin/bash
2+
set -e
3+
4+
HELP="Args:
5+
-v - Semver (2.58.0)
6+
-d - Build image repository (Ex: -d redisinsight)
7+
-r - Target repository (Ex: -r redis/redisinsight)
8+
"
9+
10+
while getopts "v:d:r:h:" opt; do
11+
case $opt in
12+
v) VERSION="$OPTARG";;
13+
d) DEV_REPO="$OPTARG";;
14+
r) RELEASE_REPO="$OPTARG";;
15+
h) echo "$HELP"; exit 0;;
16+
?) echo "$HELP" >&2; exit 1 ;;
17+
esac
18+
done
19+
20+
V_ARR=( ${VERSION//./ } )
21+
TAGS[0]=$VERSION
22+
TAGS[1]="${V_ARR[0]}.${V_ARR[1]}"
23+
TAGS[2]="latest"
24+
25+
DEV_IMAGE_AMD64=$DEV_REPO:amd64
26+
DEV_IMAGE_ARM64=$DEV_REPO:arm64
27+
RELEASE_IMAGE_AMD64=$RELEASE_REPO:$VERSION-amd64
28+
RELEASE_IMAGE_ARM64=$RELEASE_REPO:$VERSION-arm64
29+
30+
echo "
31+
TAGS: [${TAGS[0]}, ${TAGS[1]}, ${TAGS[2]}]
32+
DEV_REPO: $DEV_REPO
33+
RELEASE_REPO: $RELEASE_REPO
34+
35+
DEV_IMAGE_AMD64: $DEV_IMAGE_AMD64
36+
DEV_IMAGE_ARM64: $DEV_IMAGE_ARM64
37+
38+
RELEASE_IMAGE_AMD64: $RELEASE_IMAGE_AMD64
39+
RELEASE_IMAGE_ARM64: $RELEASE_IMAGE_ARM64
40+
"
41+
42+
# Load images from tar archives
43+
docker rmi $DEV_IMAGE_AMD64 || true
44+
docker rmi $DEV_IMAGE_ARM64 || true
45+
docker load -i release/docker-linux-alpine.amd64.tar
46+
docker load -i release/docker-linux-alpine.arm64.tar
47+
48+
echo "Push AMD64 image"
49+
docker tag $DEV_IMAGE_AMD64 $RELEASE_IMAGE_AMD64
50+
docker push $RELEASE_IMAGE_AMD64
51+
52+
echo "Push ARM64 image"
53+
docker tag $DEV_IMAGE_ARM64 $RELEASE_IMAGE_ARM64
54+
docker push $RELEASE_IMAGE_ARM64
55+
56+
for TAG in "${TAGS[@]}"; do
57+
echo "Releasing: $RELEASE_REPO:$TAG"
58+
docker manifest rm $RELEASE_REPO:$TAG || true
59+
docker manifest create --amend "$RELEASE_REPO:$TAG" $RELEASE_IMAGE_AMD64 $RELEASE_IMAGE_ARM64
60+
docker manifest push "$RELEASE_REPO:$TAG"
61+
done
62+
63+
echo "Success"

.github/codeql/config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
paths-ignore:
2+
- 'tests/**'
3+
- '**/*.test.ts'
4+
- '**/*.spec.ts'
5+
- '**/*.spec.tsx'
6+
- '**/__mocks__/**'
7+
- './redisinsight/api/test'

.github/e2e-results.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
const fs = require('fs');
2+
3+
let parallelNodeInfo = '';
4+
// const totalNodes = parseInt(process.env.NODE_TOTAL, 10);
5+
const totalNodes = 4;
6+
if (totalNodes > 1) {
7+
parallelNodeInfo = ` (node: ${parseInt(process.env.NODE_INDEX, 10) + 1}/${totalNodes})`
8+
}
9+
10+
const file = 'tests/e2e/results/e2e.results.json'
11+
const appBuildType = process.env.APP_BUILD_TYPE || 'Web'
12+
const results = {
13+
message: {
14+
text: `*E2ETest - ${appBuildType}${parallelNodeInfo}* (Branch: *${process.env.GITHUB_REF_NAME}*)` +
15+
`\n<https://github.com/RedisInsight/RedisInsight/actions/runs/${process.env.GITHUB_RUN_ID}|View on Github Actions>`,
16+
attachments: [],
17+
},
18+
};
19+
20+
const result = JSON.parse(fs.readFileSync(file, 'utf-8'))
21+
const testRunResult = {
22+
color: '#36a64f',
23+
title: `Started at: *${result.startTime}`,
24+
text: `Executed ${result.total} in ${(new Date(result.endTime) - new Date(result.startTime)) / 1000}s`,
25+
fields: [
26+
{
27+
title: 'Passed',
28+
value: result.passed,
29+
short: true,
30+
},
31+
{
32+
title: 'Skipped',
33+
value: result.skipped,
34+
short: true,
35+
},
36+
],
37+
};
38+
const failed = result.total - result.passed;
39+
if (failed) {
40+
results.passed = false;
41+
testRunResult.color = '#cc0000';
42+
testRunResult.fields.push({
43+
title: 'Failed',
44+
value: failed,
45+
short: true,
46+
});
47+
}
48+
49+
results.message.attachments.push(testRunResult);
50+
51+
if (results.passed === false) {
52+
results.message.text = '<!here> ' + results.message.text;
53+
}
54+
55+
fs.writeFileSync('e2e.report.json', JSON.stringify({
56+
channel: process.env.SLACK_TEST_REPORT_CHANNEL,
57+
...results.message,
58+
}));

.github/e2e/test.app-image.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
set -e
3+
4+
yarn --cwd tests/e2e install
5+
6+
# mount app resources
7+
chmod +x ./release/*.AppImage
8+
./release/*.AppImage --appimage-mount >> apppath &
9+
10+
# create folder before tests run to prevent permissions issue
11+
mkdir -p tests/e2e/remote
12+
mkdir -p tests/e2e/rdi
13+
14+
# run rte
15+
docker compose -f tests/e2e/rte.docker-compose.yml build
16+
docker compose -f tests/e2e/rte.docker-compose.yml up --force-recreate -d -V
17+
./tests/e2e/wait-for-redis.sh localhost 12000 && \
18+
19+
# run tests
20+
COMMON_URL=$(tail -n 1 apppath)/resources/app.asar/dist/renderer/index.html \
21+
ELECTRON_PATH=$(tail -n 1 apppath)/redisinsight \
22+
RI_SOCKETS_CORS=true \
23+
yarn --cwd tests/e2e dotenv -e .desktop.env yarn --cwd tests/e2e test:desktop:ci

0 commit comments

Comments
 (0)