Skip to content

chore: implement generalized symmetric difference for set comparison #14407

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 6 commits into from
Aug 23, 2024

Conversation

Emyrk
Copy link
Member

@Emyrk Emyrk commented Aug 22, 2024

Symmetric difference in set theory is used to determine which elements need to be added/removed to go from set A to set B. We use this atm when determining which roles are added/removed when changing a user's permissions.

This same logic can be applied to organization sync (WIP) and group sync (WIP). Felt better to just make it a generalized slice function. This code is slightly less efficient since a map was used before for membership, but the slices we are working with are small anyway.

Going to be used in Organization Sync + maybe group sync. Felt
better to reuse, rather than copy
Copy link
Member Author

Emyrk commented Aug 22, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @Emyrk and the rest of your teammates on Graphite Graphite

@Emyrk Emyrk marked this pull request as ready for review August 22, 2024 22:07
@Emyrk Emyrk requested a review from johnstcn August 22, 2024 22:40
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

Nice!

@Emyrk Emyrk merged commit cb6a472 into main Aug 23, 2024
28 checks passed
@Emyrk Emyrk deleted the stevenmasley/symmetric_difference branch August 23, 2024 19:52
@github-actions github-actions bot locked and limited conversation to collaborators Aug 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants