-
Notifications
You must be signed in to change notification settings - Fork 731
Brought merge suggestions to Node.js #797
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
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
adef854
Added worker
be7addb
End-to-end flow
fefca7d
Added email
76e412b
Fixed email suggestion similarity
2347848
Fixing tests
a49a0c8
Getting a confidence score now
6df0e79
Adjust confidence
08409f6
Removed old merge suggestions
b002519
Fix tests?
c2a5a57
More removal of check-merge in Python
702efcc
Added by username
6e88946
Remove log
2b050f3
Comment
f777adb
Fix same usernames
8218012
Frontend fixes
0a7b1c1
Fixes
8478b29
More fixes
72fdcf5
Removed log
3821d39
Format
7f259ae
Improvements
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,27 @@ | ||
| import TenantService from '../../services/tenantService' | ||
| import { CrowdJob } from '../../types/jobTypes' | ||
| import { sendNodeWorkerMessage } from '../../serverless/utils/nodeWorkerSQS' | ||
| import { NodeWorkerMessageType } from '../../serverless/types/workerTypes' | ||
| import { NodeWorkerMessageBase } from '../../types/mq/nodeWorkerMessageBase' | ||
| import { timeout } from '../../utils/timing' | ||
|
|
||
| const job: CrowdJob = { | ||
| name: 'Merge suggestions', | ||
| // every hour | ||
| cronTime: '0 * * * *', | ||
| onTrigger: async () => { | ||
| const tenants = await TenantService._findAndCountAllForEveryUser({}) | ||
| for (const tenant of tenants.rows) { | ||
| await sendNodeWorkerMessage(tenant.id, { | ||
| type: NodeWorkerMessageType.NODE_MICROSERVICE, | ||
| tenant: tenant.id, | ||
| service: 'merge-suggestions', | ||
| } as NodeWorkerMessageBase) | ||
|
|
||
| // Wait 1 second between messages to potentially reduce spike load on cube between each tenant runs | ||
| await timeout(1000) | ||
| } | ||
| }, | ||
| } | ||
|
|
||
| export default job | ||
This file contains hidden or 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 was deleted.
Oops, something went wrong.
Empty file.
2 changes: 2 additions & 0 deletions
2
backend/src/database/migrations/U1682100889__members-to-merge-similarity.sql
This file contains hidden or 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,2 @@ | ||
| -- Remove the 'similarity' column from the memberToMerge table | ||
| ALTER TABLE "memberToMerge" DROP COLUMN similarity; |
1 change: 1 addition & 0 deletions
1
backend/src/database/migrations/V1682098472__fuzzy-postgres.sql
This file contains hidden or 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 @@ | ||
| CREATE EXTENSION IF NOT EXISTS pg_trgm; |
2 changes: 2 additions & 0 deletions
2
backend/src/database/migrations/V1682100889__members-to-merge-similarity.sql
This file contains hidden or 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,2 @@ | ||
| -- Add the 'similarity' column to the memberToMerge table (allow NULL values) | ||
| ALTER TABLE "memberToMerge" ADD COLUMN similarity double precision; |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.