-
Notifications
You must be signed in to change notification settings - Fork 325
chore : validate no duplicate team members #1918 #2032
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
Dry-run check results |
|
Aah, lol, I didn't realize that |
|
@marcoieni might need some git knowledge , no the code is properly running in my system(i meant the new code) , but i guess everything messed up in the pr. |
|
@Kobzol this is the part i got a bit confused , and endedup checking the already hashed set, that gave no results, so now i tried to take the member directly and that worked |
|
if anyone wants to try this is the code just change the function on line 223 or some thing with this function : |
|
I would be able to test in 30 minutes |
|
Yes, it's working as expected By the way, I had also considered a solution for this issue (before this PR), which involved creating a new function (and a new check, accordingly). That approach worked too, so I'm not sure which one is better from a code design perspective (in fact, neither mine or their solution checks alumni lists for duplication, I'm not sure, do we want to check only member lists?) |
|
@Kivooeo I had the same doubt while writing a check for only members 😅, but I only stick to the pr as I just got here 😂 |
|
I think we should check alumni. Also a separate function seems more clean! Great suggestions Kivooeo, thanks! |
|
Here is the best I could came up with, feel free to reuse for this PR https://github.com/rust-lang/team/compare/master...Kivooeo:add-check?expand=1 Works well except one case leads = ["carols10cents", "carols10cents", "chriskrycho"]
members = [
"carols10cents",
"chriskrycho",
"chriskrycho",
]in this case it will report only leads, because it's not checking further and I don't want to ruin code expressiveness to make it work, it has a good vibe [ERROR rust_team::validate] validation error: team `book` has duplicate leads: carols10cents
[ERROR rust_team::validate] validation error: team `compiler-fcp` has duplicate leads: cjgillot
[ERROR rust_team::validate] validation error: team `wg-compiler-performance` has duplicate members: nnethercote, panstromek, Zoxc
[ERROR rust_team::validate] validation error: team `wg-mir-opt` has duplicate alumni: spastorinoerror looks like this (the reason I ended up with adding new |

Added HashSet to track members in validate_team_members. Validation now fails if duplicate found in same team like rylev in mods-venue.toml. Fixes #1918