Skip to content

Commit

Permalink
Merge staging 12feb (#7993)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Sobolev <[email protected]>
  • Loading branch information
haiodo authored Feb 12, 2025
1 parent 1a76ebc commit db0bbe3
Show file tree
Hide file tree
Showing 71 changed files with 1,603 additions and 353 deletions.
141 changes: 90 additions & 51 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ env:
rush.json
.prettierrc
tools
workers
ws-tests
PublishTempFolder: publish_artifacts
INIT_SCRIPTS_BRANCH: 'unified-init-scripts'

Expand Down Expand Up @@ -81,13 +83,13 @@ jobs:
run: node common/scripts/install-run-rush.js model-version

- name: Building...
run: node common/scripts/install-run-rush.js build -p 20
run: node common/scripts/install-run-rush.js build

- name: Bundle...
run: node common/scripts/install-run-rush.js bundle -p 20
run: node common/scripts/install-run-rush.js bundle

- name: Validate...
run: node common/scripts/install-run-rush.js validate -p 20
run: node common/scripts/install-run-rush.js validate

- name: Cache build results
uses: actions/cache@v4
Expand Down Expand Up @@ -154,7 +156,7 @@ jobs:
[ -z "$(git diff --name-only '*.js' '*.ts' '*.svelte' '*.json' '*.yaml' | cat)" ]
echo '================================================================'
- name: Formatting...
run: node common/scripts/install-run-rush.js fast-format
run: node common/scripts/install-run-rush.js fast-format --branch ${{ github.base_ref }}
- name: Check files formatting
run: |
echo '================================================================'
Expand Down Expand Up @@ -223,7 +225,7 @@ jobs:
run: node common/scripts/install-run-rush.js install

- name: Docker Build
run: node common/scripts/install-run-rush.js docker:build -p 20
run: node common/scripts/install-run-rush.js docker
env:
DOCKER_CLI_HINTS: false
- name: Prepare server
Expand Down Expand Up @@ -260,10 +262,8 @@ jobs:
run: |
cd ./tests/sanity
mkdir logs
docker logs $(docker ps | grep transactor | cut -f 1 -d ' ') > logs/transactor.log
docker logs $(docker ps | grep account | cut -f 1 -d ' ') > logs/account.log
docker logs $(docker ps | grep front | cut -f 1 -d ' ') > logs/front.log
docker logs $(docker ps | grep collaborator | cut -f 1 -d ' ') > logs/collaborator.log
cd logs
docker ps -a --format '{{.Names}}' | xargs -I {} sh -c 'docker logs {} > {}_logs.log 2>&1'
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -340,7 +340,7 @@ jobs:
run: node common/scripts/install-run-rush.js install

- name: Docker Build
run: node common/scripts/install-run-rush.js docker:build -p 20
run: node common/scripts/install-run-rush.js docker
env:
DOCKER_CLI_HINTS: false
- name: Prepare server
Expand All @@ -361,9 +361,8 @@ jobs:
run: |
cd ./tests/sanity
mkdir logs
docker logs $(docker ps | grep transactor | cut -f 1 -d ' ') > logs/transactor.log
docker logs $(docker ps | grep account | cut -f 1 -d ' ') > logs/account.log
docker logs $(docker ps | grep front | cut -f 1 -d ' ') > logs/front.log
cd logs
docker ps -a --format '{{.Names}}' | xargs -I {} sh -c 'docker logs {} > {}_logs.log 2>&1'
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -405,12 +404,12 @@ jobs:
run: node common/scripts/install-run-rush.js install

- name: Docker Build
run: node common/scripts/install-run-rush.js docker:build -p 20
run: node common/scripts/install-run-rush.js docker
env:
DOCKER_CLI_HINTS: false
- name: Configure /etc/hosts
run: |
sudo echo "127.0.0.1 host.docker.internal" | sudo tee -a /etc/hosts
sudo echo "127.0.0.1 host.docker.internal" | sudo tee -a /etc/hosts
- name: Prepare server
run: |
cd ./qms-tests
Expand All @@ -429,50 +428,90 @@ jobs:
run: |
cd ./qms-tests/sanity
mkdir logs
docker logs $(docker ps | grep transactor | cut -f 1 -d ' ') > logs/transactor.log
docker logs $(docker ps | grep account | cut -f 1 -d ' ') > logs/account.log
docker logs $(docker ps | grep front | cut -f 1 -d ' ') > logs/front.log
cd logs
docker ps -a --format '{{.Names}}' | xargs -I {} sh -c 'docker logs {} > {}_logs.log 2>&1'
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-results-qms
path: ./qms-tests/sanity/playwright-report/
# - name: Get Allure history
# uses: actions/checkout@v4
# if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
# continue-on-error: true
# with:
# ref: gh-pages
# path: gh-pages
# - name: Generates Allure Report
# uses: simple-elf/allure-report-action@master
# if: always()
# id: allure-report
# with:
# allure_results: ./qms-tests/sanity/allure-results/
# gh_pages: gh-pages
# allure_report: allure-report
# allure_history: allure-history
# - name: Upload allure test results
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: allure-report-qms
# path: ./allure-report/
# - name: Deploy report to Github Pages
# if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
# uses: peaceiris/actions-gh-pages@v4
# with:
# PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# PUBLISH_BRANCH: gh-pages
# PUBLISH_DIR: allure-history
- name: Upload Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: docker-logs-qms
path: ./qms-tests/sanity/logs
uitest-workspaces:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-platform
with:
path: |
common/temp
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Checking for mis-matching dependencies...
run: node common/scripts/install-run-rush.js check

- name: Installing...
run: node common/scripts/install-run-rush.js install

- name: Build sanity-tests suite
run: node common/scripts/install-run-rush.js build -t @hcengineering/tests-sanity

- name: Docker Build
run: node common/scripts/install-run-rush.js docker
env:
DOCKER_CLI_HINTS: false
- name: Configure /etc/hosts
run: |
sudo echo "127.0.0.1 host.docker.internal" | sudo tee -a /etc/hosts
- name: Prepare server
run: |
cd ./ws-tests
export DO_CLEAN=true
./prepare.sh
- name: Install Playwright
run: |
cd ./ws-tests/sanity
node ../../common/scripts/install-run-rushx.js ci
- name: Run UI tests
run: |
cd ./ws-tests/sanity
node ../../common/scripts/install-run-rushx.js uitest
- name: 'Store docker logs'
if: always()
run: |
cd ./ws-tests/sanity
mkdir logs
cd logs
docker ps -a --format '{{.Names}}' | xargs -I {} sh -c 'docker logs {} > {}_logs.log 2>&1'
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-results-ws
path: ./ws-tests/sanity/playwright-report/
- name: Upload Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: docker-logs-ws
path: ./ws-tests/sanity/logs
docker-build:
needs: [build, test, svelte-check, uitest]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -531,9 +570,9 @@ jobs:
DOCKER_EXTRA: --platform=linux/amd64,linux/arm64
- name: Docker build love-agent
run: |
cd ./services/ai-bot/love-agent
pnpm install && pnpm build
pnpm docker:build -v
cd ./services/ai-bot/love-agent
pnpm install && pnpm build
pnpm docker:build -v
env:
DOCKER_CLI_HINTS: false
DOCKER_EXTRA: --platform=linux/amd64,linux/arm64
Expand Down Expand Up @@ -590,7 +629,7 @@ jobs:
- name: Model version from git tags
run: node common/scripts/install-run-rush.js model-version
- name: Package
run: node common/scripts/install-run-rush.js package --to desktop -p 20 -v
run: node common/scripts/install-run-rush.js package --to desktop -v
- name: Package JSON
run: |
cd desktop-package
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ temp/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
tests/sanity/screenshots
*tests/sanity/screenshots

# Runtime data
*.pid
Expand Down
65 changes: 65 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,38 @@
"cwd": "${workspaceRoot}/pods/server",
"protocol": "inspector"
},
{
"name": "Debug server(Test)",
"type": "node",
"request": "launch",
"args": ["src/__start.ts"],
"env": {
"FULLTEXT_URL": "http://localhost:4710",
// "DB_URL": "mongodb://localhost:27018",
// "DB_URL": "postgresql://postgres:example@localhost:5432",
"DB_URL": "postgresql://[email protected]:26258/defaultdb?sslmode=disable",
// "GREEN_URL": "http://host.docker.internal:6767?token=secret",
"SERVER_PORT": "3335",
"METRICS_CONSOLE": "false",
"METRICS_FILE": "${workspaceRoot}/metrics.txt", // Show metrics in console evert 30 seconds.,
"STORAGE_CONFIG": "minio|localhost?accessKey=minioadmin&secretKey=minioadmin",
"SERVER_SECRET": "secret",
"ENABLE_CONSOLE": "true",
"COLLABORATOR_URL": "ws://localhost:3079",
"FRONT_URL": "http://localhost:8083",
"ACCOUNTS_URL": "http://localhost:3003",
"MODEL_JSON": "${workspaceRoot}/models/all/bundle/model.json",
"MODEL_VERSION": "0.6.435",
"STATS_URL": "http://host.docker.internal:4901"
},
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
"runtimeVersion": "20",
"showAsyncStacks": true,
"outputCapture": "std",
"sourceMaps": true,
"cwd": "${workspaceRoot}/pods/server",
"protocol": "inspector"
},
{
"name": "Debug Fulltext",
"type": "node",
Expand Down Expand Up @@ -132,6 +164,39 @@
"cwd": "${workspaceRoot}/pods/account",
"protocol": "inspector"
},
{
"name": "Debug Account(Staging)",
"type": "node",
"request": "launch",
"args": ["src/__start.ts"],
"env": {
"MONGO_URL": "mongodb://localhost:27018",
"DB_URL": "mongodb://localhost:27018",
// "DB_URL": "postgresql://postgres:example@localhost:5432",
"SERVER_SECRET": "secret",
"REGION_INFO":"|Mongo;pg|Postgres;cockroach|CockroachDB",
"TRANSACTOR_URL": "ws://host.docker.internal:3334;;,ws://host.docker.internal:3335;;europe",
"ACCOUNTS_URL": "http://localhost:3003",
"ACCOUNT_PORT": "3003",
"FRONT_URL": "http://localhost:8083",
"STATS_URL": "http://host.docker.internal:4901",
"SES_URL": "",
// "DB_NS": "account-2",
// "WS_LIVENESS_DAYS": "1",
"MINIO_ACCESS_KEY": "minioadmin",
"MINIO_SECRET_KEY": "minioadmin",
"MINIO_ENDPOINT": "localhost"
// "DISABLE_SIGNUP": "true",
// "INIT_SCRIPT_URL": "https://raw.githubusercontent.com/hcengineering/init/main/script.yaml",
// "INIT_WORKSPACE": "onboarding",
},
"runtimeVersion": "20",
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
"sourceMaps": true,
"outputCapture": "std",
"cwd": "${workspaceRoot}/pods/account",
"protocol": "inspector"
},
{
"name": "Debug Stats",
"type": "node",
Expand Down
12 changes: 11 additions & 1 deletion common/config/rush/command-line.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
"summary": "Format changed projects",
"description": "Format and autofix linting issues in changed projects",
"safeForSimultaneousRushProcesses": true,
"shellCommand": "./common/scripts/each-diff.sh rushx format --force"
"shellCommand": "./common/scripts/fast-format.sh"
},
{
"commandKind": "global",
Expand Down Expand Up @@ -367,6 +367,16 @@
"shortName": "-f",
"description": "Force formatting",
"associatedCommands": ["format"]
},
{
"parameterKind": "string",
"argumentName": "BRANCH",
"required": false,
"associatedPhases": [],
"shortName": "-b",
"longName": "--branch",
"description": "Force formatting of branch",
"associatedCommands": ["fast-format"]
}
// {
// /**
Expand Down
Loading

0 comments on commit db0bbe3

Please sign in to comment.