-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/add-scheduled-digest
- Loading branch information
Showing
793 changed files
with
19,343 additions
and
5,808 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,13 @@ jobs: | |
- uses: actions/labeler@v4 | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
- uses: microsoft/[email protected] | ||
name: PR Metrics | ||
env: | ||
PR_METRICS_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
base-size: 200 | ||
growth-rate: 2.0 | ||
test-factor: 0.5 | ||
continue-on-error: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: "Pull Request Manager" | ||
on: | ||
schedule: | ||
- cron: '0 * * * *' | ||
|
||
jobs: | ||
stale: | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Process stale PRs | ||
uses: Sonia-corporation/[email protected] | ||
with: | ||
issue-processing: false | ||
pull-request-days-before-stale: 14 | ||
pull-request-days-before-close: 180 | ||
pull-request-ignore-draft: true | ||
pull-request-ignore-all-milestones: true | ||
pull-request-stale-label: 'stale' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Release Helm Chart | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: stefanprodan/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
charts_dir: "docker/kubernetes" | ||
branch: charts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
cff-version: 1.2.0 | ||
message: "If you use this software in your academic work, please use the citation below." | ||
- family-names: "Grossman" | ||
given-names: "Dima" | ||
orcid: "https://github.com/scopsy" | ||
- family-names: "Barnea" | ||
given-names: "Tomer" | ||
orcid: "https://github.com/ComBarnea" | ||
title: "Novu" | ||
version: <your version> | ||
date-released: 2021-08-25 | ||
url: "https://github.com/novuhq/novu" | ||
|
135 changes: 135 additions & 0 deletions
135
apps/api/migrations/integration-scheme-update/add-integration-identifier-migration.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
import { expect } from 'chai'; | ||
import { UserSession } from '@novu/testing'; | ||
|
||
import { IntegrationRepository, EnvironmentRepository } from '@novu/dal'; | ||
import { ChannelTypeEnum, EmailProviderIdEnum, InAppProviderIdEnum, SmsProviderIdEnum } from '@novu/shared'; | ||
|
||
import { | ||
addIntegrationIdentifierMigration, | ||
addIntegrationIdentifierMigrationBatched, | ||
genIntegrationIdentificationDetails, | ||
} from './add-integration-identifier-migration'; | ||
|
||
describe('Add default identifier and name to integration entity', function () { | ||
let session: UserSession; | ||
const integrationRepository = new IntegrationRepository(); | ||
const environmentRepository = new EnvironmentRepository(); | ||
|
||
beforeEach(async () => { | ||
session = new UserSession(); | ||
await session.initialize(); | ||
await pruneIntegration(integrationRepository); | ||
}); | ||
|
||
it('should identifier and name to integration entity', async function () { | ||
await integrationRepository.create({ | ||
_environmentId: session.environment._id, | ||
_organizationId: session.organization._id, | ||
channel: ChannelTypeEnum.EMAIL, | ||
providerId: EmailProviderIdEnum.SendGrid, | ||
active: true, | ||
}); | ||
|
||
await integrationRepository.create({ | ||
_environmentId: session.environment._id, | ||
_organizationId: session.organization._id, | ||
channel: ChannelTypeEnum.SMS, | ||
providerId: SmsProviderIdEnum.SNS, | ||
active: true, | ||
}); | ||
|
||
await integrationRepository.create({ | ||
_environmentId: session.environment._id, | ||
_organizationId: session.organization._id, | ||
channel: ChannelTypeEnum.IN_APP, | ||
providerId: InAppProviderIdEnum.Novu, | ||
active: true, | ||
}); | ||
|
||
const createdIntegrations = await integrationRepository.find({ | ||
_environmentId: session.environment._id, | ||
_organizationId: session.organization._id, | ||
} as any); | ||
|
||
expect(createdIntegrations.length).to.equal(3); | ||
|
||
for (const integration of createdIntegrations) { | ||
expect(integration.name).to.not.exist; | ||
expect(integration.identifier).to.not.exist; | ||
} | ||
|
||
await addIntegrationIdentifierMigration(); | ||
|
||
const updatedIntegration = await integrationRepository.find({ | ||
_environmentId: session.environment._id, | ||
_organizationId: session.organization._id, | ||
} as any); | ||
|
||
for (const integration of updatedIntegration) { | ||
const { name, identifier } = genIntegrationIdentificationDetails({ providerId: integration.providerId }); | ||
|
||
expect(integration.name).to.equal(name); | ||
expect(integration.identifier).to.contain(identifier.split('-')[0]); | ||
} | ||
}); | ||
|
||
it('should identifier and name to integration entity (batched)', async function () { | ||
await integrationRepository.create({ | ||
_environmentId: session.environment._id, | ||
_organizationId: session.organization._id, | ||
channel: ChannelTypeEnum.EMAIL, | ||
providerId: EmailProviderIdEnum.SendGrid, | ||
active: true, | ||
}); | ||
|
||
await integrationRepository.create({ | ||
_environmentId: session.environment._id, | ||
_organizationId: session.organization._id, | ||
channel: ChannelTypeEnum.SMS, | ||
providerId: SmsProviderIdEnum.SNS, | ||
active: true, | ||
}); | ||
|
||
await integrationRepository.create({ | ||
_environmentId: session.environment._id, | ||
_organizationId: session.organization._id, | ||
channel: ChannelTypeEnum.IN_APP, | ||
providerId: InAppProviderIdEnum.Novu, | ||
active: true, | ||
}); | ||
|
||
const createdIntegrations = await integrationRepository.find({ | ||
_environmentId: session.environment._id, | ||
_organizationId: session.organization._id, | ||
} as any); | ||
|
||
expect(createdIntegrations.length).to.equal(3); | ||
|
||
for (const integration of createdIntegrations) { | ||
expect(integration.name).to.not.exist; | ||
expect(integration.identifier).to.not.exist; | ||
} | ||
|
||
await addIntegrationIdentifierMigrationBatched(); | ||
|
||
const updatedIntegration = await integrationRepository.find({ | ||
_environmentId: session.environment._id, | ||
_organizationId: session.organization._id, | ||
} as any); | ||
|
||
for (const integration of updatedIntegration) { | ||
const { name, identifier } = genIntegrationIdentificationDetails({ providerId: integration.providerId }); | ||
|
||
expect(integration.name).to.equal(name); | ||
expect(integration.identifier).to.contain(identifier.split('-')[0]); | ||
} | ||
}); | ||
}); | ||
|
||
async function pruneIntegration(integrationRepository) { | ||
const old = await integrationRepository.find({}); | ||
|
||
for (const integration of old) { | ||
await integrationRepository.delete({ _id: integration._id, _environmentId: integration._environmentId }); | ||
} | ||
} |
Oops, something went wrong.