Skip to content

Commit

Permalink
Enhancement/org enrichment with temporal c 2905 (#2035)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uros Marolt committed Jan 9, 2024
1 parent 46009da commit 9e8af11
Show file tree
Hide file tree
Showing 68 changed files with 3,169 additions and 6,090 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lf-production-deploy-new.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -491,4 +491,4 @@ jobs:
with:
service: script-executor
image: ${{ needs.build-and-push-script-executor.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
cluster: ${{ env.CROWD_CLUSTER }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: LF Staging Deploy Organizations Enrichment Worker

on:
push:
branches:
- 'lf-staging/**'
- 'lf-staging-**'
paths:
- 'services/libs/**'
- 'services/apps/premium/organizations_enrichment_worker/**'

env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
CROWD_CLUSTER: ${{ secrets.LF_STAGING_CLUSTER_NAME }}
CROWD_ROLE_ARN: ${{ secrets.LF_STAGING_CLUSTER_ROLE_ARN }}
AWS_ACCESS_KEY_ID: ${{ secrets.LF_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.LF_AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.LF_AWS_REGION }}
SLACK_CHANNEL: deploys-lf-staging
SLACK_WEBHOOK: ${{ secrets.LF_STAGING_SLACK_CHANNEL_HOOK }}

jobs:
build-and-push:
runs-on: ubuntu-latest
outputs:
image: ${{ steps.image.outputs.IMAGE }}
defaults:
run:
shell: bash

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

- uses: ./.github/actions/build-docker-image
id: image-builder
with:
image: organizations-enrichment-worker

- name: Set docker image output
id: image
run: echo "IMAGE=${{ steps.image-builder.outputs.image }}" >> $GITHUB_OUTPUT

deploy-organizations-enrichment-worker:
needs: build-and-push
runs-on: ubuntu-latest
defaults:
run:
shell: bash

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

- uses: ./.github/actions/deploy-service
with:
service: organizations-enrichment-worker
image: ${{ needs.build-and-push.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Staging Deploy Organizations Enrichment Worker

on:
push:
branches:
- 'staging/**'
- 'staging-**'
paths:
- 'services/libs/**'
- 'services/apps/premium/organizations_enrichment_worker/**'

env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
CROWD_CLUSTER: ${{ secrets.STAGING_CLUSTER_NAME }}
CROWD_ROLE_ARN: ${{ secrets.STAGING_CLUSTER_ROLE_ARN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
SLACK_CHANNEL: deploys-staging
SLACK_WEBHOOK: ${{ secrets.STAGING_SLACK_CHANNEL_HOOK }}

jobs:
build-and-push:
runs-on: ubuntu-latest
outputs:
image: ${{ steps.image.outputs.IMAGE }}
defaults:
run:
shell: bash

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

- uses: ./.github/actions/build-docker-image
id: image-builder
with:
image: organizations-enrichment-worker

- name: Set docker image output
id: image
run: echo "IMAGE=${{ steps.image-builder.outputs.image }}" >> $GITHUB_OUTPUT

deploy-organizations-enrichment-worker:
needs: build-and-push
runs-on: ubuntu-latest
defaults:
run:
shell: bash

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

- uses: ./.github/actions/deploy-service
with:
service: organizations-enrichment-worker
image: ${{ needs.build-and-push.outputs.image }}
cluster: ${{ env.CROWD_CLUSTER }}
3 changes: 2 additions & 1 deletion backend/src/api/plan/stripe/checkout.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Error400, Error403 } from '@crowd/common'
import { TenantPlans } from '@crowd/types'
import { PLANS_CONFIG } from '../../../conf'
import Plans from '../../../security/plans'
import TenantService from '../../../services/tenantService'
Expand All @@ -19,7 +20,7 @@ export default async (req, res) => {
}

if (
currentTenant.plan !== Plans.values.essential &&
currentTenant.plan !== TenantPlans.Essential &&
currentTenant.planStatus !== 'cancel_at_period_end' &&
currentTenant.planUserId !== currentUser.id
) {
Expand Down
4 changes: 2 additions & 2 deletions backend/src/api/plan/stripe/portal.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Error400, Error403 } from '@crowd/common'
import { TenantPlans } from '@crowd/types'
import { PLANS_CONFIG } from '../../../conf'
import Plans from '../../../security/plans'
import TenantService from '../../../services/tenantService'
import { tenantSubdomain } from '../../../services/tenantSubdomain'

Expand All @@ -19,7 +19,7 @@ export default async (req, res) => {
}

if (
currentTenant.plan !== Plans.values.essential &&
currentTenant.plan !== TenantPlans.Essential &&
currentTenant.planStatus !== 'cancel_at_period_end' &&
currentTenant.planUserId !== currentUser.id
) {
Expand Down
3 changes: 1 addition & 2 deletions backend/src/api/premium/enrichment/memberEnrichBulk.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { RedisCache } from '@crowd/redis'
import { getServiceLogger } from '@crowd/logging'
import { Error403 } from '@crowd/common'
import { FeatureFlag, FeatureFlagRedisKey } from '@crowd/types'
import { FeatureFlag, FeatureFlagRedisKey, PLAN_LIMITS } from '@crowd/types'
import { getSecondsTillEndOfMonth } from '../../../utils/timing'
import Permissions from '../../../security/permissions'
import identifyTenant from '../../../segment/identifyTenant'
import PermissionChecker from '../../../services/user/permissionChecker'
import track from '../../../segment/track'
import { PLAN_LIMITS } from '../../../feature-flags/isFeatureEnabled'
import SequelizeRepository from '../../../database/repositories/sequelizeRepository'
import { getNodejsWorkerEmitter } from '@/serverless/utils/serviceSQS'

Expand Down
Loading

0 comments on commit 9e8af11

Please sign in to comment.