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

Comments on PR with success message if configured #201

Closed
wants to merge 11 commits into from

Conversation

hstove
Copy link

@hstove hstove commented Apr 13, 2014

Here's the problem: I am an expert programmer who makes 0 mistakes :trollface:. When I create a pull request without any style violations, I get stuck in 'limbo' waiting for comments from Hound. There is no way for me to know whether this is because I don't have Hound setup correctly, or because Hound is down, or because there were no violations.

My proposed solution is the ability for the user to add a special option to .hound.yml, like so:

SuccessNotification:
  Enabled: true

When present, Hound will comment with 'No style issues found! 👍'.

I personally think that this behavior should be the default instead of opt-in, but I will leave that to the maintainers to decide.

Finally, this code base is a joy to work on! ❤️

end
end
context 'when the pull request is not open' do
it "does not comment on the pull request" do

Choose a reason for hiding this comment

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

Prefer single-quoted strings when you don't need string interpolation or special symbols.

@@ -1,5 +1,6 @@
class PullRequest
CONFIG_FILE = '.hound.yml'
SUCCESS_MESSAGE = 'No style issues found! :+1:'
Copy link
Member

Choose a reason for hiding this comment

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

I think saying "No style issues found." is probably enough.

Copy link
Member

Choose a reason for hiding this comment

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

Actually, we've been calling them violations, so "No style violations found."

@gylaz
Copy link
Member

gylaz commented Apr 14, 2014

I'm unsure on this. Many developers tend to push multiple times to an open PR. This solution would cause multiple success comments posted to the PR.

Another alternative that we've thrown around is to use the GitHub status bar, but then we'll be contending for it with TravisCI, CodeClimate, and other services that use it.

@@ -49,6 +49,11 @@
RedundantBegin
Enabled: false

# Enable SuccessMessage if you want Hound to comment when there
# are no style violations.
SuccessMessage
Copy link
Member

Choose a reason for hiding this comment

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

Thoughts on calling it something like NoViolationsFound? (since it's not obvious what success is in the case of Hound).

Copy link
Author

Choose a reason for hiding this comment

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

Yes, I think including violations is more clear. Thoughts on NoViolationsComment?

Copy link
Member

Choose a reason for hiding this comment

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

It's probably a good idea to keep more general, say in case we stop commenting and start displaying something in the GitHub status. So... maybe NoViolationNotification? Though, I'm not a fan of the the negation prefix, I'd love to find a positive way to say this. I don't know if NotifyOfNoViolations is any better.

I'm almost tempted to go back to SuccessNotification or someting.

Copy link
Author

Choose a reason for hiding this comment

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

Hm, this is tough. The negative prefix could indeed be interpreted differently. If I had to vote I'd go for SuccessNotification. Especially if this was integrated with Github status and the fact that Hound performs builds, 'success' seems to make sense to me.

@salbertson
Copy link
Member

Will this solution cause multiple comments if Hound runs multiple times for a single pull request?

@hstove
Copy link
Author

hstove commented Apr 15, 2014

If enabled, yes, this would comment for every push to an open pull request.

@salbertson
Copy link
Member

Is there a way to tell which success comment is for which commit? Do the comments collapse when new commits are pushed to the pull request?

@hstove
Copy link
Author

hstove commented Apr 15, 2014

Is there a way to tell which success comment is for which commit?

I left a 'demo' comment just now. You can see that it includes the commit hash in the comment:

screen shot 2014-04-15 at 9 28 06 am

Do the comments collapse when new commits are pushed to the pull request?

Unfortunately, no. Do you think deleting all previous 'success' comments, if present, would be a decent solution? Then you would only see one 'success' comment for the latest successful push.

@salbertson
Copy link
Member

@hstove I don't think deleting comments is a good idea.

Hound should be running and reporting on violations within seconds unless there is something wrong, like we've hit our rate limit or jobs are backed up.

I appreciate the input and the code but I'm not sure how useful a "success" message is to other users. I'll open an issue to continue the conversation.

@hstove
Copy link
Author

hstove commented Apr 16, 2014

No problem! Thanks for the great code review!

@salbertson
Copy link
Member

Of course, anytime.

@salbertson
Copy link
Member

@hstove we just released something that should help, 7df5587

The GitHub status API is now used to show Hound's progress. It will update the state to "pending" when Hound starts and "success" when Hound is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants