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
[ACHIEVEMENT] helping hand #35
Conversation
ortichon
commented
Jan 26, 2017
- added new achievement - any reviewer who committed to PR which he's reviewing will get it.
- fixed minor typos in other achievements
Not sure if you're up for it, but it might be a good opportunity to make two achievements that connect to each other. We can have the reviewer getting the one of them gets an and you can write the reviewers who committed in the creator's description, and the creator in the reviewer's who committed description what do you think? ofc you can think of whatever quote or idea you want |
you can grant both achievements in the same file. |
loved the princess bride reference :-)
|
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.
waiting for @ortichon answer before approving. everything looks good so far! ❤️
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.
good thing you told me you didn't test this :-)
var committedReviewers = []; | ||
|
||
_.forEach(pullRequest.commits, function(commit) { | ||
if (_.includes(pullRequest.reviewers, commit.creator.username)) { |
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.
commit.creator.username
should be commit.author.username
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.
Also, _.includes
won't work here since it checks if a value is included in a collection. might work with _.includes(pullRequest.reviewers, commit.author)
omitting the username
. but I'm not sure you should compare the entire object.
I think _.find
can be better used here like so:
if( _.find(pullRequest.reviewers, {username: commit.author.username}) ) {}
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.
so who is the creator? I've seen it in other achievements so I copied.
can you please add an API for the commits object as well? the PR one is great.
👍
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.
Sure. added to PullRequestExample.MD
. also, if you test things locally, everything is written really nicely (that's where I copy things to PullReuqestExample.MD
) at <local_url>/logs
The creator
you see everywhere is the pullRequest.creator
. for commits, there's a commit.author
, which is the person who wrote the commit, and a commit.committer
, which is the person who pushed the commit.
|
||
_.forEach(pullRequest.commits, function(commit) { | ||
if (_.includes(pullRequest.reviewers, commit.creator.username)) { | ||
committedReviewers.push(commit.creator); |
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.
same here
…ment-helping-hand
@thatkookooguy |
@ortichon If you want I can quickly test it for you since everything is already set up on my computer |
@thatkookooguy |
- don't give the creator the reviewer's achievement - remove the brackets for `isMultipleCommittedReviewers` - fix usernames in each other's achievements
@ortichon I made some changes (some were corrections, and others were more opinion base (like changing tell me if you don't like the naked |
LGTM |
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.
cool. go ahead and merge this