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

Clean up backend tests #1980

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c894429
init temporal search attribute (#1943)
Dec 11, 2023
8e4120e
Support incident status in public status endpoint (#1945)
joanagmaia Dec 11, 2023
61d8302
Cube MVs tenant indexes (#1946)
sausage-todd Dec 11, 2023
54aff56
Prevent overwrite of dynamic attributes on member merge (#1937)
skwowet Dec 11, 2023
b43a1f6
Bugfix/manual org changes overridden by enrichment c 2903 (#1944)
Dec 12, 2023
61c0a6f
Essential free plan cancelation banner (#1950)
gaspergrom Dec 12, 2023
ddb1143
Enhancement/queue prioritization c 2633 (#1900)
Dec 12, 2023
ef8d10c
quick fix
Dec 12, 2023
9bef427
fix deploy action
Dec 12, 2023
6c232bc
lfx and staging deploys fixed
Dec 12, 2023
7fc3d06
Improvement/test member enrichment with logs (#1953)
Dec 12, 2023
5103703
fix query error when checking for delayed results (#1956)
Dec 13, 2023
b002104
bugfix
Dec 13, 2023
2173c50
receive and delete from a specific queue
Dec 13, 2023
2059853
removed info log on every message
Dec 13, 2023
ee1fb0c
use true for default value for onboarding when runId is null for inte…
Dec 13, 2023
53642dc
Missing awaits on merging roles (#1958)
epipav Dec 13, 2023
2e67f83
Add checks for paid Discord integrations (#1961)
garrrikkotua Dec 13, 2023
78e6ea1
Better organization existence checks and organizations without activi…
epipav Dec 13, 2023
01d7d62
Update script path for trigger-all-webhooks (#1965)
garrrikkotua Dec 13, 2023
3e54b47
bugfix
Dec 14, 2023
5087654
Fix member add handler in discord-ws (#1967)
garrrikkotua Dec 14, 2023
005a79e
fixed ci deploy (#1968)
Dec 14, 2023
32847a9
Fix member copy and banner validation (#1966)
joanagmaia Dec 15, 2023
c66ceeb
Fix identity display name in merge dialog (#1969)
joanagmaia Dec 15, 2023
0b4fa7d
Fix pre-selected remote filters (#1972)
joanagmaia Dec 15, 2023
8577e4d
Fix contacts query search in organization profile (#1975)
joanagmaia Dec 18, 2023
f0407c3
Increase Cube timeouts for emails
loicsaintroch Dec 18, 2023
900d69a
Increase Cube timeouts for emails
loicsaintroch Dec 18, 2023
e113d7e
Serve organization profiles from OpenSearch (#1952)
skwowet Dec 18, 2023
0d9dc01
Serve contact profiles from OpenSearch (#1954)
skwowet Dec 18, 2023
60ad41b
Remove all test cases
sausage-todd Dec 19, 2023
d513098
Remove remnants of test environment
sausage-todd Dec 19, 2023
bd30287
Update pnpm-lock.yaml
sausage-todd Dec 19, 2023
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
40 changes: 39 additions & 1 deletion .github/actions/deploy-service/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ inputs:
description: To which cloud cluster to deploy
required: true

prioritized:
description: Is the service listening on prioritized queues?
required: false
default: 'false'

cloud_env:
description: Which cloud environment are we deploying to?
required: false
default: 'default'

runs:
using: composite
steps:
Expand All @@ -25,10 +35,38 @@ runs:
AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ env.AWS_REGION }}

- name: Deploy image
- name: Deploy image (non prioritized)
if: inputs.prioritized == 'false'
shell: bash
run: kubectl set image deployments/${{ inputs.service }}-dpl ${{ inputs.service }}=${{ inputs.image }}

- name: Deploy image (prioritized - production)
if: inputs.prioritized == 'true' && inputs.cloud_env == 'prod'
shell: bash
run: |
kubectl set image deployments/${{ inputs.service }}-system-dpl ${{ inputs.service }}-system=${{ inputs.image }}
kubectl set image deployments/${{ inputs.service }}-normal-dpl ${{ inputs.service }}-normal=${{ inputs.image }}
kubectl set image deployments/${{ inputs.service }}-high-dpl ${{ inputs.service }}-high=${{ inputs.image }}
kubectl set image deployments/${{ inputs.service }}-urgent-dpl ${{ inputs.service }}-urgent=${{ inputs.image }}

- name: Deploy image (prioritized - lfx production)
if: inputs.prioritized == 'true' && inputs.cloud_env == 'lfx_prod'
shell: bash
run: |
kubectl set image deployments/${{ inputs.service }}-system-dpl ${{ inputs.service }}-system=${{ inputs.image }}
kubectl set image deployments/${{ inputs.service }}-normal-dpl ${{ inputs.service }}-normal=${{ inputs.image }}
kubectl set image deployments/${{ inputs.service }}-high-dpl ${{ inputs.service }}-high=${{ inputs.image }}

- name: Deploy image (prioritized - staging)
if: inputs.prioritized == 'true' && inputs.cloud_env == 'staging'
shell: bash
run: kubectl set image deployments/${{ inputs.service }}-normal-dpl ${{ inputs.service }}-normal=${{ inputs.image }}

- name: Deploy image (prioritized - lfx staging)
if: inputs.prioritized == 'true' && inputs.cloud_env == 'lfx_staging'
shell: bash
run: kubectl set image deployments/${{ inputs.service }}-normal-dpl ${{ inputs.service }}-normal=${{ inputs.image }}

- uses: ./.github/actions/slack-notify
with:
message: 'Service *${{ inputs.service }}* was just deployed using docker image `${{ inputs.image }}`'
47 changes: 0 additions & 47 deletions .github/workflows/CI-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,50 +59,3 @@ jobs:
- name: Check app linting, format and typescript
run: ./scripts/lint_apps.sh

tests-main:
needs: lint-format
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./backend

steps:
- name: Check out repository code
uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies
run: cd .. && corepack enable && pnpm i --frozen-lockfile

- name: Run tests
working-directory: ./backend
run: SERVICE=test pnpm test -- --testPathIgnorePatterns=serverless

tests-serverless:
needs: lint-format
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./backend

steps:
- name: Check out repository code
uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies
run: cd .. && corepack enable && pnpm i --frozen-lockfile

- name: Run tests
working-directory: ./backend
run: SERVICE=test pnpm test -- --testPathPattern="serverless\/"
12 changes: 8 additions & 4 deletions .github/workflows/lf-production-deploy-new.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:
required: true
type: boolean
deploy_search_sync_api:
description: Deploy search-sync-api service?
required: true
type: boolean
description: Deploy search-sync-api service?
required: true
type: boolean
deploy_integration_sync_worker:
description: Deploy integration-sync-worker service?
required: true
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Set docker image output
id: image
run: echo "IMAGE=${{ steps.image-builder.outputs.image }}" >> $GITHUB_OUTPUT

build-and-push-search-sync-api:
runs-on: ubuntu-latest
if: ${{ inputs.deploy_search_sync_api }}
Expand Down Expand Up @@ -208,6 +208,8 @@ jobs:
service: search-sync-worker
image: ${{ needs.build-and-push-search-sync-worker.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: lfx_prod
prioritized: true

deploy-search-sync-api:
needs: build-and-push-search-sync-api
Expand Down Expand Up @@ -244,6 +246,8 @@ jobs:
service: integration-sync-worker
image: ${{ needs.build-and-push-integration-sync-worker.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: lfx_prod
prioritized: true

deploy-webhook-api:
needs: build-and-push-webhook-api
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/lf-production-deploy-original.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ jobs:
service: nodejs-worker
image: ${{ needs.build-and-push-backend.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: lfx_prod
prioritized: true

deploy-discord-ws:
needs: build-and-push-backend
Expand Down Expand Up @@ -291,6 +293,8 @@ jobs:
service: integration-run-worker
image: ${{ needs.build-and-push-integration-run-worker.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: lfx_prod
prioritized: true

deploy-integration-stream-worker:
needs: build-and-push-integration-stream-worker
Expand All @@ -309,6 +313,8 @@ jobs:
service: integration-stream-worker
image: ${{ needs.build-and-push-integration-stream-worker.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: lfx_prod
prioritized: true

deploy-integration-data-worker:
needs: build-and-push-integration-data-worker
Expand All @@ -327,6 +333,8 @@ jobs:
service: integration-data-worker
image: ${{ needs.build-and-push-integration-data-worker.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: lfx_prod
prioritized: true

deploy-data-sink-worker:
needs: build-and-push-data-sink-worker
Expand All @@ -345,6 +353,8 @@ jobs:
service: data-sink-worker
image: ${{ needs.build-and-push-data-sink-worker.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: lfx_prod
prioritized: true

deploy-frontend:
needs: build-and-push-frontend
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lf-staging-deploy-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ jobs:
service: nodejs-worker
image: ${{ needs.build-and-push.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: lfx_staging
prioritized: true

deploy-job-generator:
needs: build-and-push
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lf-staging-deploy-data-sink-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ jobs:
service: data-sink-worker
image: ${{ needs.build-and-push.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: lfx_staging
prioritized: true
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ jobs:
service: integration-data-worker
image: ${{ needs.build-and-push.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: lfx_staging
prioritized: true
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ jobs:
service: integration-run-worker
image: ${{ needs.build-and-push.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: lfx_staging
prioritized: true
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ jobs:
service: integration-stream-worker
image: ${{ needs.build-and-push.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: lfx_staging
prioritized: true
2 changes: 2 additions & 0 deletions .github/workflows/lf-staging-deploy-search-sync-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ jobs:
service: search-sync-worker
image: ${{ needs.build-and-push.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: lfx_staging
prioritized: true
6 changes: 5 additions & 1 deletion .github/workflows/production-deploy-new.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Set docker image output
id: image
run: echo "IMAGE=${{ steps.image-builder.outputs.image }}" >> $GITHUB_OUTPUT

build-and-push-search-sync-api:
runs-on: ubuntu-latest
if: ${{ inputs.deploy_search_sync_api }}
Expand Down Expand Up @@ -208,6 +208,8 @@ jobs:
service: search-sync-worker
image: ${{ needs.build-and-push-search-sync-worker.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: prod
prioritized: true

deploy-search-sync-api:
needs: build-and-push-search-sync-api
Expand Down Expand Up @@ -244,6 +246,8 @@ jobs:
service: integration-sync-worker
image: ${{ needs.build-and-push-integration-sync-worker.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: prod
prioritized: true

deploy-webhook-api:
needs: build-and-push-webhook-api
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/production-deploy-original.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ jobs:
service: nodejs-worker
image: ${{ needs.build-and-push-backend.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: prod
prioritized: true

deploy-discord-ws:
needs: build-and-push-backend
Expand Down Expand Up @@ -291,6 +293,8 @@ jobs:
service: integration-run-worker
image: ${{ needs.build-and-push-integration-run-worker.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: prod
prioritized: true

deploy-integration-stream-worker:
needs: build-and-push-integration-stream-worker
Expand All @@ -309,6 +313,8 @@ jobs:
service: integration-stream-worker
image: ${{ needs.build-and-push-integration-stream-worker.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: prod
prioritized: true

deploy-integration-data-worker:
needs: build-and-push-integration-data-worker
Expand All @@ -327,6 +333,8 @@ jobs:
service: integration-data-worker
image: ${{ needs.build-and-push-integration-data-worker.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: prod
prioritized: true

deploy-data-sink-worker:
needs: build-and-push-data-sink-worker
Expand All @@ -345,6 +353,8 @@ jobs:
service: data-sink-worker
image: ${{ needs.build-and-push-data-sink-worker.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: prod
prioritized: true

deploy-frontend:
needs: build-and-push-frontend
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/staging-deploy-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ jobs:
service: nodejs-worker
image: ${{ needs.build-and-push.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
prioritized: true
cloud_env: staging

deploy-job-generator:
needs: build-and-push
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/staging-deploy-data-sink-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ jobs:
service: data-sink-worker
image: ${{ needs.build-and-push.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: staging
prioritized: true
2 changes: 2 additions & 0 deletions .github/workflows/staging-deploy-integration-data-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ jobs:
service: integration-data-worker
image: ${{ needs.build-and-push.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: staging
prioritized: true
2 changes: 2 additions & 0 deletions .github/workflows/staging-deploy-integration-run-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ jobs:
service: integration-run-worker
image: ${{ needs.build-and-push.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: staging
prioritized: true
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ jobs:
service: integration-stream-worker
image: ${{ needs.build-and-push.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: staging
prioritized: true
2 changes: 2 additions & 0 deletions .github/workflows/staging-deploy-integration-sync-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ jobs:
service: integration-sync-worker
image: ${{ needs.build-and-push.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: staging
prioritized: true
2 changes: 2 additions & 0 deletions .github/workflows/staging-deploy-search-sync-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ jobs:
service: search-sync-worker
image: ${{ needs.build-and-push.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cloud_env: staging
prioritized: true
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ docker/volume

services/libs/*/dist

**/.cubestore
**/.cubestore
3 changes: 1 addition & 2 deletions backend/.env.dist.composed
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# SQS settings
CROWD_SQS_HOST="sqs"
CROWD_SQS_ENDPOINT=http://sqs:9324
CROWD_SQS_NODEJS_WORKER_QUEUE="http://sqs:9324/000000000000/nodejs-worker.fifo"
CROWD_SQS_NODEJS_WORKER_DELAYABLE_QUEUE=http://sqs:9324/000000000000/nodejs-worker
CROWD_SQS_NODEJS_WORKER_QUEUE="http://sqs:9324/000000000000/nodejs-worker-normal.fifo"
CROWD_SQS_PYTHON_WORKER_QUEUE="http://sqs:9324/000000000000/python-worker.fifo"

# Redis settings
Expand Down
3 changes: 2 additions & 1 deletion backend/.env.dist.local
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
KUBE_MODE=1
CROWD_EDITION=community
TENANT_MODE=multi
QUEUE_PRIORITY_LEVEL=normal

# API settings
CROWD_API_URL=https://localhost/api
Expand All @@ -15,7 +16,7 @@ CROWD_SQS_HOST=localhost
CROWD_SQS_PORT=9324
CROWD_SQS_ENDPOINT=http://localhost:9324
CROWD_SQS_NODEJS_WORKER_QUEUE=http://localhost:9324/000000000000/nodejs-worker.fifo
CROWD_SQS_NODEJS_WORKER_DELAYABLE_QUEUE=http://localhost:9324/000000000000/nodejs-worker
CROWD_SQS_NODEJS_WORKER_PRIORITY_QUEUE=http://localhost:9324/000000000000/nodejs-worker-normal.fifo
CROWD_SQS_PYTHON_WORKER_QUEUE=http://localhost:9324/000000000000/python-worker.fifo
CROWD_SQS_AWS_ACCOUNT_ID=000000000000
CROWD_SQS_AWS_ACCESS_KEY_ID=x
Expand Down
2 changes: 1 addition & 1 deletion backend/config/custom-environment-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"host": "CROWD_SQS_HOST",
"port": "CROWD_SQS_PORT",
"nodejsWorkerQueue": "CROWD_SQS_NODEJS_WORKER_QUEUE",
"nodejsWorkerDelayableQueue": "CROWD_SQS_NODEJS_WORKER_DELAYABLE_QUEUE",
"nodejsWorkerPriorityQueue": "CROWD_SQS_NODEJS_WORKER_PRIORITY_QUEUE",
"integrationRunWorkerQueue": "CROWD_SQS_INTEGRATION_RUN_WORKER_QUEUE",
"pythonWorkerQueue": "CROWD_SQS_PYTHON_WORKER_QUEUE",
"aws": {
Expand Down
Loading
Loading