Repository navigation
fix: keep the lfx member as primary when merging orgs with llm - #5042
Merged
Merged
Conversation
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused change matches backend merge constraints and preserves downstream pair handling, with no identified blocking issues.
No open issues 🎉
What changed in this PR
Fixes LLM-driven organization merges by keeping the LFX member as primary, regardless of the onlyLFXMembers flag.
Changes:
- Checks current memberships for every nonempty suggestion batch.
- Replaces per-pair membership queries with one batch lookup.
- Swaps pairs only when the secondary alone is an LFX member.
| File | Description |
|---|---|
| services/apps/merge_suggestions_worker/src/activities/organizationMergeSuggestions.ts | Normalizes pair order using batched LFX membership data. |
Review effort: Balanced
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The LLM organization merge workflow fails when the secondary org in a pair is an LFX member, because the merge API never merges an LFX member away.
Pair order is fixed when a pair is first queued, but LFX memberships can change later. The worker only corrected the order when
onlyLFXMemberswas set, which the scheduled run doesn't pass.Changes
getRawOrganizationMergeSuggestions, regardless ofonlyLFXMembers.Type of change
Related issue
None.