-
Notifications
You must be signed in to change notification settings - Fork 236
Display who can actually release a distribution #2040
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
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.
lgtm
(Re-push only because the commits got mixed up when I tidied.) |
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 great. Just the one change requested.
} | ||
my @releaser | ||
= sort grep { $num_modules_of{$_} == @$modules } keys %num_modules_of; | ||
|
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.
Could we make the above code less succinct? It's not immediately obvious what is going on in lines 22-26. ;)
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.
How? @haarg already reviewed it twice and asked me to make it clearer the first time, so I moved some things around slightly and gave the variables better names. Having done that, I’m not sure how I can make this algorithm any clearer, and I couldn’t think of any algorithm that will be easier to understand. Do you have any suggestion?
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.
I don't know what ++$_
does and slices always confuse me shrug
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.
OK, I added some more variables. I don’t know if that helps…?
Thanks @ap! |
{
'co_maintainers' => [
'DOY',
'DROLSKY',
'ETHER',
'FLORA',
'GRODITI',
'HDP',
'MSTROUT',
'PERIGRIN',
'SARTAK'
],
'module_name' => 'Moose',
'owner' => 'STEVAN'
}; |
Seems that for a module it gets a single entry rather than an array. The API::Permission model seems a bit goofy. |
Might just be a matter of returning an arrayref here: https://github.com/ap/metacpan-web/blob/whocan/lib/MetaCPAN/Web/Model/API/Permission.pm#L26 |
Seems like it will be goofy either way… if you have a mode that always returns only one row, it’s goofy to make it inconsistent with the other modes (by not returning an array), and it’s goofy to make it wrap its result (when that mode on its own terms doesn’t need it). API consumers that look at all modes will want it consistent and API consumers that only ever use that particular mode will want it sensible-on-its-own…
Sorry, I could have caught that. It seemed odd for the Anyway, I put in a skip of the counting code for the |
Thanks @ap! |
Thank you for shipping it! |
Currently to figure out who can upload a new release of a distribution that will actually get indexed properly, you have to intersect the sets of the owner and co-maintainers of each module in your head. This is a job for a computer.
This PR makes the computer do it.