Skip to content

Commit 8cf8207

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents fe7b43d + 318d81c commit 8cf8207

835 files changed

Lines changed: 36198 additions & 16552 deletions

File tree

Some content is hidden

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

.editorconfig

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
# JavaScript files
12+
[*.{js,jsx}]
13+
indent_size = 2
14+
max_line_length = 120
15+
16+
# JSON configuration files (Common/config/*.json)
17+
[*.json]
18+
indent_style = tab
19+
max_line_length = 120
20+
21+
# Package files (use spaces for package.json)
22+
[package*.json]
23+
indent_style = space
24+
indent_size = 2
25+
26+
# GitHub workflow files (.github/workflows/*.yml)
27+
[*.{yml,yaml}]
28+
indent_style = space
29+
indent_size = 2
30+
max_line_length = 120
31+
32+
# SQL schema files (schema/*/)
33+
[*.sql]
34+
indent_style = space
35+
indent_size = 2
36+
max_line_length = 100
37+
38+
# Markdown files (preserve trailing spaces for line breaks)
39+
[*.md]
40+
trim_trailing_whitespace = false
41+
max_line_length = off
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
name: Azure Storage Tests
2+
on:
3+
push:
4+
branches:
5+
- '**'
6+
paths:
7+
- 'tests/integration/withServerInstance/storage.tests.js'
8+
- 'Common/sources/storage/**'
9+
- 'DocService/sources/routes/static.js'
10+
- '.github/workflows/azureStorageTests.yml'
11+
12+
jobs:
13+
azure-storage-tests:
14+
name: Azure Storage Tests
15+
runs-on: ubuntu-latest
16+
env:
17+
AZURITE_CONTAINER: azurite-${{ github.run_id }}-${{ github.run_attempt }}
18+
19+
steps:
20+
- name: Check out repository code
21+
uses: actions/checkout@v3
22+
23+
- name: Pre-run cleanup
24+
run: |
25+
docker rm -f "$AZURITE_CONTAINER" 2>/dev/null || true
26+
27+
- name: Setup and start Azurite
28+
run: |
29+
# Detect network and set network arguments
30+
JOB_NET=$(docker inspect -f '{{range $k,$v := .NetworkSettings.Networks}}{{printf "%s\n" $k}}{{end}}' "$(hostname)" 2>/dev/null | head -n1 || true)
31+
32+
if [ -n "$JOB_NET" ]; then
33+
NETWORK_ARGS="--network $JOB_NET"
34+
else
35+
NETWORK_ARGS=""
36+
fi
37+
38+
# Start Azurite container
39+
docker run --name "$AZURITE_CONTAINER" \
40+
$NETWORK_ARGS \
41+
-p 10000:10000 \
42+
-p 10001:10001 \
43+
-p 10002:10002 \
44+
-d mcr.microsoft.com/azure-storage/azurite \
45+
azurite-blob --blobHost 0.0.0.0 --loose
46+
47+
# Set host based on network configuration
48+
if [ -n "$JOB_NET" ]; then
49+
HOST=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$AZURITE_CONTAINER")
50+
else
51+
HOST=127.0.0.1
52+
fi
53+
54+
# Wait for Azurite to be ready
55+
echo "Waiting for Azurite at $HOST:10000..."
56+
for i in $(seq 1 15); do
57+
if curl -sS "http://$HOST:10000/" >/dev/null 2>&1; then
58+
echo "Azurite ready"
59+
break
60+
fi
61+
sleep 1
62+
done
63+
64+
# Verify Azurite is running
65+
if ! curl -sS "http://$HOST:10000/" >/dev/null 2>&1; then
66+
echo "Azurite failed to start"
67+
docker logs "$AZURITE_CONTAINER" || true
68+
exit 1
69+
fi
70+
71+
# Export host for subsequent steps
72+
echo "AZURITE_HOST=$HOST" >> "$GITHUB_ENV"
73+
74+
- name: Caching dependencies
75+
uses: actions/setup-node@v3
76+
with:
77+
node-version: '20'
78+
cache: 'npm'
79+
cache-dependency-path: |
80+
./npm-shrinkwrap.json
81+
./Common/npm-shrinkwrap.json
82+
./DocService/npm-shrinkwrap.json
83+
84+
- name: Install modules
85+
run: |
86+
npm ci
87+
npm --prefix Common ci
88+
npm --prefix DocService ci
89+
90+
- name: Setup Azure storage environment
91+
run: |
92+
# Create minimal Azure storage configuration
93+
cat > Common/config/local.json << EOF
94+
{
95+
"storage": {
96+
"name": "storage-az",
97+
"region": "",
98+
"endpoint": "http://${AZURITE_HOST:-127.0.0.1}:10000/devstoreaccount1",
99+
"bucketName": "test-container",
100+
"storageFolderName": "files",
101+
"cacheFolderName": "data",
102+
"accessKeyId": "devstoreaccount1",
103+
"secretAccessKey": "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="
104+
},
105+
"persistentStorage": {
106+
"storageFolderName": "files/persistent"
107+
},
108+
"commandOptions": {
109+
"az": {
110+
"uploadData": {},
111+
"uploadStream": {},
112+
"download": {},
113+
"syncCopyFromURL": {},
114+
"listBlobsFlat": {
115+
"maxPageSize": 1000
116+
},
117+
"deleteBlob": {}
118+
}
119+
}
120+
}
121+
EOF
122+
123+
echo "Azure storage configuration created"
124+
125+
- name: Create Azure container using Node.js from Common directory
126+
run: |
127+
# Wait a bit more for Azurite to be fully ready
128+
sleep 10
129+
130+
# Run Node.js script from Common directory where Azure dependencies are installed
131+
cd Common
132+
node -e "
133+
(async () => {
134+
const { BlobServiceClient, StorageSharedKeyCredential } = require('@azure/storage-blob');
135+
const endpoint = 'http://' + (process.env.AZURITE_HOST || '127.0.0.1') + ':10000/devstoreaccount1';
136+
const client = new BlobServiceClient(endpoint, new StorageSharedKeyCredential('devstoreaccount1', 'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=='));
137+
await client.getContainerClient('test-container').createIfNotExists();
138+
console.log('Azure environment ready');
139+
})().catch(console.error);
140+
"
141+
142+
- name: Run storage tests
143+
run: npm run storage-tests
144+
145+
- name: Final cleanup
146+
if: always()
147+
run: docker rm -f "$AZURITE_CONTAINER" || true

.github/workflows/codeql.yaml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "CodeQL"
1+
name: 'CodeQL'
22

33
on:
44
push:
@@ -27,23 +27,22 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
language: [ 'javascript-typescript' ]
30+
language: ['javascript-typescript']
3131

3232
steps:
33-
- name: Checkout repository
34-
uses: actions/checkout@v4
35-
36-
# Initializes the CodeQL tools for scanning.
37-
- name: Initialize CodeQL
38-
uses: github/codeql-action/init@v3
39-
with:
40-
languages: ${{ matrix.language }}
41-
42-
- name: Autobuild
43-
uses: github/codeql-action/autobuild@v3
44-
45-
46-
- name: Perform CodeQL Analysis
47-
uses: github/codeql-action/analyze@v3
48-
with:
49-
category: "/language:${{matrix.language}}"
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
36+
# Initializes the CodeQL tools for scanning.
37+
- name: Initialize CodeQL
38+
uses: github/codeql-action/init@v3
39+
with:
40+
languages: ${{ matrix.language }}
41+
42+
- name: Autobuild
43+
uses: github/codeql-action/autobuild@v3
44+
45+
- name: Perform CodeQL Analysis
46+
uses: github/codeql-action/analyze@v3
47+
with:
48+
category: '/language:${{matrix.language}}'

.github/workflows/damengDatabaseTests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Caching dependencies
2323
uses: actions/setup-node@v3
2424
with:
25-
node-version: '16'
25+
node-version: '20'
2626
cache: 'npm'
2727
cache-dependency-path: |
2828
./npm-shrinkwrap.json
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: fs Storage Tests
2+
on:
3+
push:
4+
branches:
5+
- '**'
6+
paths:
7+
- 'tests/integration/withServerInstance/storage.tests.js'
8+
- 'Common/sources/storage/**'
9+
- 'DocService/sources/routes/static.js'
10+
11+
jobs:
12+
fs-storage-tests:
13+
name: File System Storage
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Check out repository code
18+
uses: actions/checkout@v3
19+
20+
- name: Caching dependencies
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: '20'
24+
cache: 'npm'
25+
cache-dependency-path: |
26+
./npm-shrinkwrap.json
27+
./Common/npm-shrinkwrap.json
28+
./DocService/npm-shrinkwrap.json
29+
30+
- name: Install modules
31+
run: |
32+
npm ci
33+
npm --prefix Common ci
34+
npm --prefix DocService ci
35+
36+
- name: Creating service configuration
37+
run: |
38+
mkdir -p /tmp/storage
39+
mkdir -p Common/config
40+
echo '{
41+
"storage": {
42+
"name": "storage-fs",
43+
"fs": {
44+
"folderPath": "/tmp/storage",
45+
"urlExpires": 900,
46+
"secretString": "verysecretstring"
47+
},
48+
"region": "",
49+
"endpoint": "http://localhost/s3",
50+
"bucketName": "cache",
51+
"storageFolderName": "files",
52+
"cacheFolderName": "data",
53+
"urlExpires": 604800,
54+
"accessKeyId": "",
55+
"secretAccessKey": "",
56+
"sslEnabled": false,
57+
"s3ForcePathStyle": true,
58+
"externalHost": "",
59+
"useDirectStorageUrls": true
60+
},
61+
}' > Common/config/local.json
62+
63+
- name: Run storage tests
64+
run: npm run storage-tests

.github/workflows/lint-format.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Lint & Format
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
8+
jobs:
9+
code-quality:
10+
name: Code Quality Check
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 15
13+
permissions:
14+
contents: read
15+
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
node-version: [20.x]
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Node.js ${{ matrix.node-version }}
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
cache: 'npm'
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Run ESLint
35+
run: npm run lint:check
36+
37+
- name: Check Prettier formatting
38+
run: npm run format:check

.github/workflows/mssqlDatabaseTests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Caching dependencies
2323
uses: actions/setup-node@v3
2424
with:
25-
node-version: '16'
25+
node-version: '20'
2626
cache: 'npm'
2727
cache-dependency-path: |
2828
./npm-shrinkwrap.json

0 commit comments

Comments
 (0)