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] The label maker achievemt #38
Conversation
Achievement for putting many labels in a pull request
@ortichon will review this so you won't get bored of my style 😉 |
Even better |
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.
Yo,
great work, some nit picks to fix.
I'll check the functionality later today. did you check that the achievement works with the DB?
👍
@@ -0,0 +1,30 @@ | |||
|
|||
|
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.
please remove the new lines above.
var labelBabyJunior = { | ||
name: 'Label Baby Junior', | ||
check: function(pullRequest, shall) { | ||
|
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.
please remove this line too :-)
notice that all(all?) other achievements follow the same design rules, It helps to keep organized and maintainable code.
I hope that someday soon we'll have a Lint process to catch and warn on this issues.
} | ||
}; | ||
|
||
function checkIfManyLabels(pullRequest) { |
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.
Its is a common practice to prefix with is<FunctionName>
functions that return boolean
values.
I think that
if (isManyLabels(pullRequest)) { ...
looks and sounds better ;-)
return labels.length > 3; | ||
} | ||
return false; | ||
} |
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.
wrong indentation 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.
BTW - rows 24-27 can be shorten to a one liner:
return labels && labels.length > 3;
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.
yea
return false; | ||
} | ||
|
||
module.exports = labelBabyJunior; |
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.
please add one empty line at the end of the file.
see this answer
I did. Changes considered and updated. |
func update, and line spacing
@dunaevsky Congratulations!!!!! avatar!!!!! ->this is NOT inline comment ;-) |
Was lookin for something inline with your style ;) |
function isManyLabels(pullRequest) { | ||
var labels = pullRequest.labels; | ||
return labels && labels.length > 3; | ||
|
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.
missing a }
please check that your code is running before you push
to Github :-)
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.
It worked until you made me change it =P
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 did noto made you change it, I suggested... :-)
|
||
function isManyLabels(pullRequest) { | ||
var labels = pullRequest.labels; | ||
return labels && labels.length > 3; |
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 think that 4 labels as a minimum is a bit low.
In Kibibit-Code-editor we have at least 4 PRs with 4 labels each.
maybe we should use labels.length > 5
?
and Kibibit is a small organization with a small team.
Take a look at this PR from AngularJS (Google's Javascript framework) - it has 8(!) labels. They have tons of PRs with 4-5 labels.
LMKWYT
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 agree. 3 is actually just the go to num I use to test multiple stuff.
@dunaevsky |
added brackets, tested, and 6 labels are now minimum
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.
Image
We should use square images.
so please fix the image aspect ratio to be a square.
Annoying Bug
There is some annoying bug that I'm not sure is your fault, so adding @thatkookooguy to the loop.
-
try to create PR, and only after it is already created add 7 labels -> you'll receive the achievement.
-
try to create PR, but before clicking on "create" add 7 labels and only then create it.
you won't get the achievement.
take a look at the logs, there are less labels there than we added.
check: function(pullRequest, shall) { | ||
if (isManyLabels(pullRequest)) { | ||
var achievement = { | ||
avatar : 'images/achievements/theLabelMaker.achievment.jpg', |
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.
typo in the word achievement
- image does not load
function isManyLabels(pullRequest) { | ||
var labels = pullRequest.labels; | ||
return labels && labels.length > 5; | ||
} |
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.
please add a new line separation between the end of the function to the module.exports...
avatar : 'images/achievements/theLabelMaker.achievment.jpg', | ||
name: 'The Label Maker', | ||
short: 'Is this a label maker?', | ||
description: 'You\'ve put many labels, thank you for organizng. You\'re a gift that keeps on re-giving' , |
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.
typo in the word organizing
Well, looks good now. @dunaevsky BTW2 - I've seen that you updated your Github profile with an avatar. If you'll create a Gravatar profile with your Git email, we should see your avatar in Ungit beside your commits too. |
About, the aspect ratio, you're probably right. I did the easier task. About the labels bug, I am able to reproduce it. When creating the pull request it only puts 1 label from the 6 added. But then when I try again, and open another pull request, it does add all the labels. |
@Kibibit/development about the bug - it worked fine for me. look at your webhook and check if github sent us all the events for the labels. Also check that they all got a In any case, I'm going to implement this weekend another merge between the |
I already opened a bug on github about some problems with webhooks. So if you find another one, you can report it to them |
I think other then fixing the aspect ratio of the image, IMO this can go in after @ortichon finishes his review |
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
good work
@dunaevsky go ahead and merge this one :)
Achievement for putting many labels in a pull request.