Skip to content

Commit c7bb583

Browse files
authored
Merge branch 'main' into fe/feature/RI-7039-replace-eui
2 parents bd05295 + cbac780 commit c7bb583

File tree

180 files changed

+3438
-1135
lines changed

Some content is hidden

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

180 files changed

+3438
-1135
lines changed

.github/actions/install-all-build-libs/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ runs:
3333
- name: Setup Node
3434
uses: actions/[email protected]
3535
with:
36-
node-version: '20.18.0'
36+
node-version: '22.11.0'
3737
# disable cache for windows
3838
# https://github.com/actions/setup-node/issues/975
3939
cache: ${{ runner.os != 'Windows' && 'yarn' || '' }}

.github/build/release-docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -e
33

44
HELP="Args:
5-
-v - Semver (2.66.0)
5+
-v - Semver (2.70.0)
66
-d - Build image repository (Ex: -d redisinsight)
77
-r - Target repository (Ex: -r redis/redisinsight)
88
"

.github/workflows/aws-upload-enterprise.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,6 @@ jobs:
5353
aws s3 cp release/ s3://${AWS_BUCKET_NAME_PROD}/releases/${APP_VERSION} --recursive
5454
aws s3 cp release/ s3://${AWS_BUCKET_NAME_PROD}/latest --recursive
5555
56-
- name: Download vendor plugins
57-
uses: actions/download-artifact@v4
58-
id: download-vendor
59-
continue-on-error: true
60-
with:
61-
name: 'vendor-plugins'
62-
path: vendor
63-
64-
- name: Upload vendor plugins to s3 bucket
65-
if: steps.download-vendor.outcome == 'success'
66-
run: |
67-
aws s3 cp vendor/ s3://${SELECTED_AWS_BUCKET_NAME}/public/plugins/static/ --recursive
68-
6956
- name: Generate job summary
7057
run: |
7158
node ./.github/generate-build-summary.js

.github/workflows/code-coverage.yml

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
name: 'Code Coverage'
2+
on:
3+
workflow_call:
4+
inputs:
5+
type:
6+
description: Type of report (unit or integration)
7+
type: string
8+
resource_name:
9+
description: Resource name of coverage report
10+
type: string
11+
12+
jobs:
13+
coverage-unit:
14+
runs-on: ubuntu-latest
15+
name: Unit tests coverage
16+
if: ${{ inputs.type == 'unit' }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Download Coverage Report
21+
uses: actions/download-artifact@v4
22+
with:
23+
name: ${{ inputs.resource_name }}
24+
path: report
25+
26+
- uses: jwalton/gh-find-current-pr@v1
27+
id: findPr
28+
29+
- uses: ArtiomTr/jest-coverage-report-action@v2
30+
with:
31+
prnumber: ${{ steps.findPr.outputs.number }}
32+
coverage-file: report/coverage/report.json
33+
base-coverage-file: report/coverage/report.json
34+
github-token: ${{ secrets.GITHUB_TOKEN }}
35+
skip-step: all
36+
custom-title: Code Coverage - ${{ inputs.resource_name == 'report-be' && 'Backend' || 'Frontend' }} unit tests
37+
38+
coverage-integration:
39+
runs-on: ubuntu-latest
40+
name: Integration tests coverage
41+
if: ${{ inputs.type == 'integration' }}
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- name: Download Coverage Report
46+
uses: actions/download-artifact@v4
47+
with:
48+
name: ${{ inputs.resource_name }}
49+
50+
- name: Parse Coverage Summary
51+
id: parse-coverage
52+
run: |
53+
# Extract coverage data from file.
54+
# Example of processed row:
55+
# Statements : 81.75% ( 16130/19730 )
56+
# field '$3' = 81.75%, field '$5' = 16130
57+
extract_coverage_data() {
58+
local keyword=$1
59+
local field=$2
60+
awk "/$keyword/ {print $field}" integration-coverage.txt | tr -d '\n|%'
61+
}
62+
63+
# Determine status based on percentage
64+
get_status() {
65+
if [ "$(echo "$1 < 50" | bc)" -eq 1 ]; then
66+
echo "🔴"
67+
elif [ "$(echo "$1 < 80" | bc)" -eq 1 ]; then
68+
echo "🟡"
69+
else
70+
echo "🟢"
71+
fi
72+
}
73+
74+
# Extract coverage data from the summary
75+
STATEMENTS_PERCENT=$(extract_coverage_data "Statements" '$3')
76+
STATEMENTS_COVERED=$(extract_coverage_data "Statements" '$5')
77+
STATEMENTS_STATUS=$(get_status $STATEMENTS_PERCENT)
78+
79+
BRANCHES_PERCENT=$(extract_coverage_data "Branches" '$3')
80+
BRANCHES_COVERED=$(extract_coverage_data "Branches" '$5')
81+
BRANCHES_STATUS=$(get_status $BRANCHES_PERCENT)
82+
83+
FUNCTIONS_PERCENT=$(extract_coverage_data "Functions" '$3')
84+
FUNCTIONS_COVERED=$(extract_coverage_data "Functions" '$5')
85+
FUNCTIONS_STATUS=$(get_status $FUNCTIONS_PERCENT)
86+
87+
LINES_PERCENT=$(extract_coverage_data "Lines" '$3')
88+
LINES_COVERED=$(extract_coverage_data "Lines" '$5')
89+
LINES_STATUS=$(get_status $LINES_PERCENT)
90+
91+
# Format as a Markdown table
92+
echo "| Status | Category | Percentage | Covered / Total |" > coverage-table.md
93+
echo "|-------------|-------------|-------------|-----------------|" >> coverage-table.md
94+
echo "| $STATEMENTS_STATUS | Statements | ${STATEMENTS_PERCENT}% | ${STATEMENTS_COVERED} |" >> coverage-table.md
95+
echo "| $BRANCHES_STATUS | Branches | ${BRANCHES_PERCENT}% | ${BRANCHES_COVERED} |" >> coverage-table.md
96+
echo "| $FUNCTIONS_STATUS | Functions | ${FUNCTIONS_PERCENT}% | ${FUNCTIONS_COVERED} |" >> coverage-table.md
97+
echo "| $LINES_STATUS | Lines | ${LINES_PERCENT}% | ${LINES_COVERED} |" >> coverage-table.md
98+
99+
- uses: jwalton/gh-find-current-pr@v1
100+
id: findPr
101+
102+
- name: Post or Update Coverage Summary Comment
103+
uses: actions/github-script@v7
104+
with:
105+
script: |
106+
const fs = require('fs');
107+
const table = fs.readFileSync('coverage-table.md', 'utf8');
108+
const commentBody = `### Code Coverage - Integration Tests\n\n${table}`;
109+
110+
// Fetch existing comments on the pull request
111+
const { data: comments } = await github.rest.issues.listComments({
112+
owner: context.repo.owner,
113+
repo: context.repo.repo,
114+
issue_number: process.env.RR_Number,
115+
});
116+
117+
// Check if a comment with the same header already exists
118+
const existingComment = comments.find(comment =>
119+
comment.body.startsWith('### Code Coverage - Integration Tests')
120+
);
121+
122+
if (existingComment) {
123+
// Update the existing comment
124+
await github.rest.issues.updateComment({
125+
owner: context.repo.owner,
126+
repo: context.repo.repo,
127+
comment_id: existingComment.id,
128+
body: commentBody,
129+
});
130+
} else {
131+
// Create a new comment
132+
await github.rest.issues.createComment({
133+
owner: context.repo.owner,
134+
repo: context.repo.repo,
135+
issue_number: process.env.RR_Number,
136+
body: commentBody,
137+
});
138+
}
139+
env:
140+
RR_Number: ${{ steps.findPr.outputs.number }}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Enforce Branch Name Rules
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
enforce-branch-rules:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check branch name
13+
run: |
14+
echo "Source branch: ${{ github.head_ref }}"
15+
if [[ "${{ github.head_ref }}" != feature/* && \
16+
"${{ github.head_ref }}" != bugfix/* && \
17+
"${{ github.head_ref }}" != release/* && \
18+
"${{ github.head_ref }}" != dependabot/* && \
19+
"${{ github.head_ref }}" != latest && \
20+
"${{ github.head_ref }}" != fe && \
21+
"${{ github.head_ref }}" != be && \
22+
"${{ github.head_ref }}" != e2e && \
23+
"${{ github.head_ref }}" != ric/* ]]; then
24+
echo "❌ Pull requests to 'main' are only allowed from 'feature/**', 'bugfix/**', 'release/**', 'dependabot/**', 'latest' or 'ric/**' branches."
25+
exit 1
26+
fi

.github/workflows/manual-build-enterprise.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ on:
3636
type: boolean
3737
required: false
3838

39+
build_linux_rpm_x64:
40+
description: Build Linux rpm x64
41+
type: boolean
42+
required: false
43+
3944
environment:
4045
description: Environment to run build
4146
type: environment

.github/workflows/tests-integration.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,14 @@ jobs:
191191
sudo mkdir -p /usr/src/app
192192
sudo cp -a ./redisinsight/api/. /usr/src/app/
193193
sudo cp -R ./coverages /usr/src/app && sudo chmod 777 -R /usr/src/app
194-
cd /usr/src/app && npx nyc report -t ./coverages -r text -r text-summary
194+
cd /usr/src/app && npx nyc report -t ./coverages -r text -r text-summary > integration-coverage.txt
195+
cp integration-coverage.txt $GITHUB_WORKSPACE/integration-coverage.txt
196+
197+
- name: Upload integration-coverage as artifact
198+
uses: actions/upload-artifact@v4
199+
with:
200+
name: integration-coverage
201+
path: integration-coverage.txt
195202

196203
- name: Delete Artifact
197204
uses: actions/github-script@v7

.github/workflows/tests.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,28 @@ jobs:
9494
uses: ./.github/workflows/tests-frontend.yml
9595
secrets: inherit
9696

97+
frontend-tests-coverage:
98+
needs: frontend-tests
99+
uses: ./.github/workflows/code-coverage.yml
100+
secrets: inherit
101+
with:
102+
resource_name: report-fe
103+
type: unit
104+
97105
backend-tests:
98106
needs: changes
99107
if: inputs.group_tests == 'all' || inputs.group_tests == 'without_e2e' || startsWith(github.ref_name, 'be/') || startsWith(github.ref_name, 'fe-be/') || startsWith(github.ref_name, 'feature/') || startsWith(github.ref_name, 'bugfix/') || startsWith(github.ref_name, 'ric/')
100108
uses: ./.github/workflows/tests-backend.yml
101109
secrets: inherit
102110

111+
backend-tests-coverage:
112+
needs: backend-tests
113+
uses: ./.github/workflows/code-coverage.yml
114+
secrets: inherit
115+
with:
116+
resource_name: report-be
117+
type: unit
118+
103119
integration-tests:
104120
needs: changes
105121
if: inputs.group_tests == 'all' || inputs.group_tests == 'without_e2e' || startsWith(github.ref_name, 'be/') || startsWith(github.ref_name, 'fe-be/') || startsWith(github.ref_name, 'feature/') || startsWith(github.ref_name, 'bugfix/') || startsWith(github.ref_name, 'ric/')
@@ -110,6 +126,14 @@ jobs:
110126
redis_client: ${{ inputs.redis_client || '' }}
111127
debug: ${{ inputs.debug || false }}
112128

129+
integration-tests-coverage:
130+
needs: integration-tests
131+
uses: ./.github/workflows/code-coverage.yml
132+
secrets: inherit
133+
with:
134+
resource_name: integration-coverage
135+
type: integration
136+
113137
# # E2E Approve
114138
e2e-approve:
115139
runs-on: ubuntu-latest

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.11.0

dev.provisionprofile

-361 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)