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

Organization merge suggestion improvements #1649

Merged
merged 10 commits into from
Oct 10, 2023

Conversation

epipav
Copy link
Collaborator

@epipav epipav commented Oct 9, 2023

…dge case fixes

Changes proposed ✍️

What

🤖 Generated by Copilot at 280a61c

This pull request improves the performance and accuracy of the getMergeSuggestions method for finding duplicate identities in organizations. It also adds more logging information to the generateMergeSuggestions method for debugging purposes. The changes affect the files organizationRepository.ts and organizationService.ts in the backend.

🤖 Generated by Copilot at 280a61c

Sing, O Muse, of the skillful coder who refined
The getMergeSuggestions method, with a keen mind
He found the prefix length of each identity
And sorted them by uuid, with great dexterity

Why

How

🤖 Generated by Copilot at 280a61c

  • Improve the accuracy and performance of the merge suggestions for organizations (link, link, link, link, link, link)
  • Add a helper function prefixLength to OrganizationRepository to calculate the optimal prefix length for a given string (link)
  • Modify the query body for getMergeSuggestions to sort and collapse by uuid and avoid duplicates (link)
  • Update the pagination logic for getMergeSuggestions to use the last uuid as a filter and avoid missing or repeating results (link, link)
  • Remove the http or https prefix from the identity name before performing the fuzzy, wildcard and prefix searches (link)
  • Replace the hardcoded value of 5 with the prefixLength function call for the prefix search (link)
  • Add more visibility and feedback for the merge suggestions generation process (link, link, link)
    • Add a log trace statement to generateMergeSuggestions in OrganizationService to log the tenant id (link)
    • Add a boolean variable hasSuggestions to generateMergeSuggestions to keep track of whether the tenant has any suggestions or not (link)
    • Add a conditional block to generateMergeSuggestions to log different messages based on the value of mergeSuggestions and hasSuggestions (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.

@epipav epipav self-assigned this Oct 9, 2023
@epipav epipav added the Improvement Created by Linear-GitHub Sync label Oct 9, 2023
@epipav epipav marked this pull request as ready for review October 9, 2023 15:43
…github.com:CrowdDotDev/crowd.dev into improvement/organization-merge-suggestions-scripts
@epipav epipav requested a review from themarolt October 10, 2023 05:57
@epipav epipav merged commit fbcb6e7 into main Oct 10, 2023
7 checks passed
@epipav epipav deleted the improvement/organization-merge-suggestions-scripts branch October 10, 2023 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants