Skip to content

Brought merge suggestions to Node.js#797

Merged
joanreyero merged 20 commits intomainfrom
feature/better-merge-suggestions
Apr 24, 2023
Merged

Brought merge suggestions to Node.js#797
joanreyero merged 20 commits intomainfrom
feature/better-merge-suggestions

Conversation

@joanreyero
Copy link
Copy Markdown
Contributor

@joanreyero joanreyero commented Apr 21, 2023

Changes proposed ✍️

Improve merge suggestions and bring them to Node.js in a more optimized way. It also adds a confidence score which is displayed in the frontend.

Screenshot 2023-04-23 at 17 55 40

What

🤖 Generated by Copilot at 29aea0c

This pull request adds a new feature to find and process merge suggestions for members based on similarity scores. It modifies the memberRepository, memberService, and memberTypes modules, and adds a new mergeSuggestionsWorker function. It also updates the test suites and the database migrations accordingly.

🤖 Generated by Copilot at 29aea0c

Sing, O Muse, of the skillful code reviewers
Who scrutinized the changes of the pull request
That added the feature of merging members by similarity
And altered the schema and the methods of the memberService.

How

🤖 Generated by Copilot at 29aea0c

  • Add a new feature to find merge suggestions based on similarity scores across platforms (link, link, link, link, link, link, link, link)
  • Update the addToMerge method in the memberService and memberRepository files to accept an array of suggestions instead of a single pair of member ids (link, link, link, link, link)
  • Update the test cases in the memberService.test, memberRepository.test, and tenantService.test files to use the new addToMerge method and the findById method instead of the deprecated find method (link, link, link, link, link)
  • Revert the previous schema changes that added the 'similarity' column to the memberToMerge table, as they were not compatible with the existing code logic (link)
  • Remove an empty line from the workerFactory file to improve the code formatting and readability (link)

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screehshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

@joanreyero joanreyero force-pushed the feature/better-merge-suggestions branch from 29aea0c to be7addb Compare April 22, 2023 08:10
@joanreyero joanreyero added the Feature Created by Linear-GitHub Sync label Apr 22, 2023
Joan Reyero added 2 commits April 23, 2023 17:56
Comment thread backend/src/bin/jobs/mergeSuggestions.ts
Comment thread backend/src/database/repositories/memberRepository.ts Outdated
Comment thread backend/src/database/repositories/memberRepository.ts
WITH new_members AS (
SELECT id, "tenantId", emails
FROM members
WHERE "createdAt" >= now() - INTERVAL :numberOfHours
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here for the interval.

Comment thread backend/src/database/repositories/memberRepository.ts
:member="member"
:compare-member="membersToMerge[(mi + 1) % membersToMerge.length]"
:compare-member="
membersToMerge[(mi + 1) % membersToMerge.members.length]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you updated membersToMerge from an array to the following structure:

{
   members: [],
   similarity: number
}

Doesn't this need to be membersToMerge.members[(mi + 1) % membersToMerge.members.length]?

@joanreyero joanreyero merged commit ca08071 into main Apr 24, 2023
@joanreyero joanreyero deleted the feature/better-merge-suggestions branch April 24, 2023 18:02
joanreyero pushed a commit that referenced this pull request Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Created by Linear-GitHub Sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants