Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4 dev #1005

Merged
merged 39 commits into from
Nov 7, 2024
Merged

4 dev #1005

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
0826902
Sort environment selector by alphabetical order (#997)
thomas-mauran Mar 24, 2023
0f7119f
fix: clear documents without confirmation (#999)
Xamez May 10, 2023
c90603c
feat: update dependencies
Kuruyia Sep 20, 2024
ab61979
chore: run eslint
Kuruyia Sep 20, 2024
76cd4ad
feat: remove direct-vuex
Kuruyia Sep 20, 2024
0057424
test: update cypress and fix tests
Kuruyia Sep 23, 2024
4ad9c2c
ci: update and clean up workflows
Kuruyia Sep 23, 2024
b594404
fix: bundle bootstrap in a single chunk
Kuruyia Sep 23, 2024
0d90600
chore: remove unused sw.ts file
Kuruyia Sep 23, 2024
ada94eb
feat: update Dockerfile
Kuruyia Sep 23, 2024
b575b77
test: add back typing delays
Kuruyia Sep 23, 2024
e008131
ci: upload failed cypress test screenshots
Kuruyia Sep 23, 2024
11f1c24
ci: run cypress tests in chrome
Kuruyia Sep 23, 2024
cbd03d2
test: add delay on update collection typing
Kuruyia Sep 23, 2024
32b2a09
test: don't check for specific sidebar width
Kuruyia Sep 23, 2024
b78d618
ci: update runners
Kuruyia Sep 23, 2024
2810bb0
ci: use pre-installed aws cli
Kuruyia Sep 23, 2024
8e306fd
ci: remove NODE_ENV in deployment action
Kuruyia Sep 23, 2024
33d5e97
ci: add names to steps
Kuruyia Sep 23, 2024
2cbf617
ci: add AWS_DEFAULT_REGION
Kuruyia Sep 23, 2024
2da6e0a
chore: release 4.4.0
Kuruyia Sep 23, 2024
c171f57
refactor: fix some linter issues
Kuruyia Oct 9, 2024
a558985
feat: migrate from Vuex to Pinia
Kuruyia Oct 9, 2024
6643949
test: slow down profile creation typing
Kuruyia Oct 10, 2024
7bc5e1d
test: increase default command timeout
Kuruyia Oct 10, 2024
a38e39c
test: slow down raw JSON user search typing
Kuruyia Oct 10, 2024
4b23300
test: add waitOverlay
Kuruyia Oct 10, 2024
f9fe638
Update linting rules
rolljee Nov 4, 2024
fdae14e
Update tests with timeout
rolljee Nov 4, 2024
cb86800
Update tests with timeout
rolljee Nov 5, 2024
27271c5
Update tests with timeout
rolljee Nov 5, 2024
1dff192
Update tests with timeout
rolljee Nov 5, 2024
1774018
Update profiles tests with timeout
rolljee Nov 5, 2024
139d39b
Commenting the flaky tests
rolljee Nov 5, 2024
8d62315
Commenting e2e tests, they work locally but not in CI for now.
rolljee Nov 5, 2024
aa79be9
Commenting e2e tests, they work locally but not in CI for now.
rolljee Nov 5, 2024
9596093
Commenting e2e tests, they work locally but not in CI for now.
rolljee Nov 5, 2024
c24ee64
Fix the e2e tests (#1006)
rolljee Nov 6, 2024
c62ec80
ci: Adding the same logic between workflows
rolljee Nov 6, 2024
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
39 changes: 39 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
const path = require('node:path');

module.exports = {
root: true,
extends: ['plugin:vue-kuzzle/default'],
parserOptions: {
project: path.join(__dirname, 'tsconfig.json'),
},
ignorePatterns: ['dist/*'],
rules: {
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/prefer-optional-chain': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/require-array-sort-compare': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-dynamic-delete': 'off',
'vue/multi-word-component-names': 'off',
'vue/block-lang': 'off',
'vue/no-mutating-props': 'off',
'array-callback-return': 'off',
'vue/require-default-prop': 'off',
'vue/order-in-components': 'off',
'vue/no-useless-template-attributes': 'off',
'vue/no-reserved-component-names': 'off',
'vue/require-prop-types': 'off',
'vue/no-lone-template': 'off',
'default-case-last': 'warn',
'import/order': 'warn'
},
};
29 changes: 0 additions & 29 deletions .eslintrc.js

This file was deleted.

12 changes: 3 additions & 9 deletions .github/actions/deploy-to-s3/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,19 @@ inputs:
runs:
using: "composite"
steps:
- name: Install AWS CLI
run: |
sudo apt-get update
sudo apt-get install python python-pip
pip install awscli --upgrade --user
shell: bash
- name: Build
run: |
npm ci
npm run build
env:
NODE_ENV: production
shell: bash

- name: Deploy
run: |
aws s3 rm s3://${{ inputs.S3_BUCKET }} --recursive --region ${{ inputs.REGION }}
aws s3 rm s3://${{ inputs.S3_BUCKET }} --recursive
aws s3 sync ${{ inputs.TARGET_DIST }} s3://${{ inputs.S3_BUCKET }}
aws cloudfront create-invalidation --distribution-id ${{ inputs.CLOUDFRONT_ID }} --paths "/*"
env:
AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ inputs.REGION }}
shell: bash
25 changes: 0 additions & 25 deletions .github/actions/e2e-tests/action.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/actions/lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ runs:
steps:
- run: npm ci
shell: bash

- run: npm run test:lint
shell: bash
195 changes: 154 additions & 41 deletions .github/workflows/pull_request.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,171 @@ name: Pull request checks

on: [pull_request]

# Cancel in-progress runs on new pushes
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
NODE_VERSION: '20'

jobs:
lint:
name: Lint
runs-on: ubuntu-18.04
runs-on: ubuntu-24.04
continue-on-error: true
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v1
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "10"
- uses: ./.github/actions/lint
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: Run linter
uses: ./.github/actions/lint

e2e-tests:
name: E2E Cypress tests - Kuzzle ${{ matrix.backend_config}}
name: E2E Test - ${{ matrix.spec }}
needs: ['lint']
runs-on: ubuntu-24.04
strategy:
matrix:
backend_config: ['1', '2', 'multi']
fail-fast: false
runs-on: ubuntu-18.04
matrix:
spec:
- login
- users
- roles
- profiles
- resetpassword
- JSONEditor
- chartView
- formView
- treeview
- '404'
- api-actions
- collections
- docs
- environments
- indexes
- search
- watch

steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v1
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: Cache Cypress binary
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: cypress-binary-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
run: npm ci

- name: Start Kuzzle
run: |
docker compose up --wait
docker ps
curl -v http://localhost:7512/_healthcheck

- name: Build
run: npm run build

- name: Start preview server
run: |
npx vite preview --host 0.0.0.0 --port 8080 &
echo $! > preview.pid

echo "Waiting for preview server..."
timeout=30
until curl -s http://localhost:8080 > /dev/null; do
sleep 1
timeout=$((timeout-1))
if [ $timeout -eq 0 ]; then
echo "Preview server failed to start"
exit 1
fi
done
echo "Preview server is ready!"

- name: Run Cypress test
id: cypress
run: |
START_TIME=$(date +%s)

npx cypress run \
--spec "test/e2e/cypress/integration/single-backend/${{ matrix.spec }}.spec.js" \
--browser chrome \
--config baseUrl=http://localhost:8080,retries=2

END_TIME=$(date +%s)
DURATION=$((END_TIME - START_TIME))
echo "duration=$DURATION" >> $GITHUB_OUTPUT

- name: Cleanup
if: always()
run: |
if [ -f preview.pid ]; then
kill $(cat preview.pid) || true
fi

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
node-version: 10
- uses: ./.github/actions/e2e-tests
name: cypress-results-${{ matrix.spec }}
path: |
cypress/videos
cypress/screenshots
cypress/results
retention-days: 5

- name: Upload failure screenshots
if: failure()
uses: actions/upload-artifact@v4
with:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
backend_config: ${{ matrix.backend_config }}
branch_name: ${{ github.head_ref }}
name: cypress-snapshots-${{ matrix.spec }}
path: test/e2e/failed-test
retention-days: 5

test-summary:
name: Tests Summary
needs: [lint, e2e-tests]
if: always()
runs-on: ubuntu-24.04
steps:
- name: Create Summary
run: |
echo "# Test Results Summary 📊" >> $GITHUB_STEP_SUMMARY
echo "## Status" >> $GITHUB_STEP_SUMMARY

if [ "${{ needs.e2e-tests.result }}" = "success" ] && [ "${{ needs.lint.result }}" = "success" ]; then
echo "✅ All tests passed successfully!" >> $GITHUB_STEP_SUMMARY
else
echo "❌ Some tests failed" >> $GITHUB_STEP_SUMMARY
fi

echo "## Details" >> $GITHUB_STEP_SUMMARY
echo "- Lint: ${{ needs.lint.result }}" >> $GITHUB_STEP_SUMMARY
echo "- E2E Tests: ${{ needs.e2e-tests.result }}" >> $GITHUB_STEP_SUMMARY

# Set exit code based on test results
if [ "${{ needs.e2e-tests.result }}" = "failure" ]; then
echo "❌ E2E tests failed"
exit 1
elif [ "${{ needs.lint.result }}" = "failure" ]; then
echo "❌ Lint failed"
exit 1
else
echo "✅ All tests passed!"
fi
Loading
Loading