Skip to content
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

Merged
merged 10 commits into from Jan 27, 2017
Merged

Conversation

ortichon
Copy link
Member

  • added new achievement - any reviewer who committed to PR which he's reviewing will get it.
  • fixed minor typos in other achievements

@ortichon ortichon added the achievements issues related to writing or fixing bugs in achievements label Jan 26, 2017
@thatkookooguy
Copy link
Member

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 Hello there. Slow going? quote, and the creator getting the Look, I don't mean to be rude but this is not as easy as it looks quote or something.

one of them gets an Inigo Montoya avatar, and the other one gets the Man in Black avatar.

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

@thatkookooguy
Copy link
Member

you can grant both achievements in the same file.

@thatkookooguy
Copy link
Member

loved the princess bride reference :-)

achievibit's pull requests are so fun :-)

Copy link
Member

@thatkookooguy thatkookooguy left a 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! ❤️

Copy link
Member

@thatkookooguy thatkookooguy left a 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)) {
Copy link
Member

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

Copy link
Member

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}) ) {}

Copy link
Member Author

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.
👍

Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

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

same here

@thatkookooguy thatkookooguy changed the title [ACHIEVEMENT] - helping hand [ACHIEVEMENT] helping hand Jan 26, 2017
@thatkookooguy thatkookooguy removed the request for review from dunaevsky January 26, 2017 12:08
@ortichon
Copy link
Member Author

@thatkookooguy
still can't check it out locally.
I'll figure it out later today

@thatkookooguy
Copy link
Member

@ortichon If you want I can quickly test it for you since everything is already set up on my computer

@ortichon
Copy link
Member Author

@thatkookooguy
sure, go for it

- don't give the creator the reviewer's achievement
- remove the brackets for `isMultipleCommittedReviewers`
- fix usernames in each other's achievements
@thatkookooguy
Copy link
Member

@ortichon I made some changes (some were corrections, and others were more opinion base (like changing (s) to s).

tell me if you don't like the naked s or if you had a specific reason to add the (s)? I'm not familiar with that syntax

@ortichon
Copy link
Member Author

LGTM

Copy link
Member

@thatkookooguy thatkookooguy left a 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

@ortichon ortichon merged commit 89b8492 into master Jan 27, 2017
@ortichon ortichon deleted the feature-new-achievement-helping-hand branch January 27, 2017 00:09
@thatkookooguy thatkookooguy moved this from In Progress to Individual achievements in Get ready for 1st Milestone Jan 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
achievements issues related to writing or fixing bugs in achievements
Projects
Get ready for 1st Milestone
Individual achievements
Development

Successfully merging this pull request may close these issues.

None yet

3 participants