-
Notifications
You must be signed in to change notification settings - Fork 245
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
Consolidate PR comments #154
Conversation
d0a8ea0
to
df91c88
Compare
@doomspork good work! 😄 🙇 @doomspork @kt0 what do you think about a separate runner? |
@mmozuras a separate runner or a configuration option works for me. I'd like to look into the BitBucket runner and see how much of this can be shared. |
@doomspork if you'd find a general solution that works for GitHub/Bitbucket/Gitlab, it would amazing 😄 |
After a quick glance I don't think that should be a problem. What do you think @mmozuras, all new runners or update the existing runners to support a consolidated option? |
@doomspork on the second thought, having a separate runner would be too confusing. Runners should only be about "where/how to show/post". So, do the config option 😄 |
@mmozuras take a peek when you have a moment. I pulled most of the PR code into a separate It doesn't look like GitLab has a PR formatter yet? |
d3d9177
to
4027997
Compare
@@ -0,0 +1,87 @@ | |||
module Pronto | |||
module Formatter | |||
class PullRequestFormatter |
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.
To clear up any confusion maybe this should be something like: PullRequestFormatterBase
or AbstractPullRequestFormatter
.
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.
Since this code can almost entirely be re-used for the commit formatters maybe this would be better as: GitClientFormatterBase
or some variation of that. Thoughts?
I think I can further consolidate GitHub, GitLab, and BitBucket commit formatters and incorporate the consolidation. Want me to go ahead with that @mmozuras? |
def submit_comments(client, comments) | ||
puts comments | ||
comments.each { |comment| client.create_pull_comment(comment) } | ||
rescue Octokit::UnprocessableEntity => e |
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.
Is there a BitBucket client error we should listen for? The BitBucket formatter didn't handle any exceptions.
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.
@doomspork BitbucketClient
uses httparty
. We could listen for HTTParty::Error
.
@mmozuras just a heads up it may be a week or two before I finish up this change, I'm in the process of moving across the country. 😄 |
@doomspork no worries, it's an amazing feature - well worth the wait 😄 |
@mmozuras I'm finally settled in, I'll resume my work on this now 👍 |
22b0e42
to
0e6ec5c
Compare
@mmozuras I've added the consolidation portion to commits and PRs, mind taking a look at these changes now? |
end | ||
|
||
def line_number(message) | ||
message.line.new_linen |
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.
new_linen
- a mistype perchance? 😄
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 catch 👍
@doomspork amazing! 🙇 I've also found a couple of style issues, which revealed that TravisCI no longer runs Pronto successfully (I'll fix that, no worries). Could you run |
ac88bdf
to
b7e0997
Compare
@mmozuras I cleaned up the pieces of feedback you left, ran Rubocop, and resolved the issues with my code. There's still a number of outstanding Rubocop changes but I assume you're not expecting me to fix them all 😀 |
@mmozuras I added a second commit with a number of Rubocop fixes for other pieces of code, I can drop the commit if you'd prefer 😀 |
@mmozuras any other feedback or things you'd like to see changed? |
@@ -6,7 +6,7 @@ class CLI < Thor | |||
require 'pronto/version' | |||
|
|||
class << self | |||
def is_thor_reserved_word?(word, type) | |||
def thor_reserved_word?(word, type) |
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.
@doomspork overrides a method in thor
. Can't be changed, should be reverted 😄
@doomspork only change that one line (the last comment) and it's good to go! 😄 |
@@ -29,6 +29,9 @@ | |||
require 'pronto/formatter/colorizable' | |||
require 'pronto/formatter/text_formatter' | |||
require 'pronto/formatter/json_formatter' | |||
require 'pronto/formatter/git_formatter_base' |
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.
Actually, I suggest removing base
from the name too. Not using that convention anywhere else in this project.
68b44ee
to
2144cfd
Compare
2144cfd
to
2488e6a
Compare
@mmozuras feedback has been incorporated 👍 |
@doomspork the code looks good 👍 Alas, Travis is still failing at |
Thanks @mmozuras! I've been busy preparing for a conference this week so I haven't had a chance to investigate the |
@doomspork no, thanks to you for contributing 😄 What kind of conference? Are you going to speak? |
@mmozuras you're welcome! I'm working on Pronto-as-a-Service for work, once it's ready I'll open-source it and give you a ping. I am speaking and doing a workshop @ http:https://elixircamp.io. If you happen to be in NYC stop by! 😀 |
@doomspork looks like a fun conference! Alas, I won't be in NYC, but good luck on your talk and workshop 😄
Exciting! Will it be free for OSS and paid for everyone else? Looking forward to see it 😄 |
@@ -11,6 +11,10 @@ def initialize(config_hash = ConfigFile.new.to_h) | |||
end | |||
end | |||
|
|||
def consolidate_comments? | |||
!@config_hash['consolidate_comments'].nil? |
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.
This bypasses the ability to set it via an environment variable, right?
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.
@jhass correct, ENVs are not currently supported for: consolidate_comments, verbose, max_warnings, or exclusions.
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 we should consider changing that.
Meanwhile https://github.com/mmozuras/pronto#configuration should be updated I guess, for both, mentioning that there are no overrides as well as this new option.
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.
That's up to @mmozuras to decide. 😀
Happy to contribute the change if it's something he's keen on.
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.
@doomspork @jhass having consistency between config yml and ENV config would be amazing. I'd gladly accept a PR that improves it.
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.
!@config_hash['consolidate_comments'].nil?
I found this a little bit counter intuitive.
My .pronto.yml
config:
consolidate_comments: false
as a result !false.nil?
is truthy.
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 catch @mknapik, I've opened a PR with a fix.
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 see #187
@mmozuras we just opened sourced our Pronto-as-a-Service that I mentioned to you, feel free to take a peek: https://github.com/wombatsecurity/nag Any and all feedback is welcomed 👍 |
@doomspork thanks, I'll try to find the time to try it myself in the next couple of days 😄 |
I need to update the README a bit but feel free to reach out to me via the email in my profile if you need a hand 😀 |
Hi @mmozuras, here are the changes I made regarding #147. I figured a PR was a good way to get and incorporate feedback. You'll see I removed the checkboxes in favor of a bulleted list.