-
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
Feature/f2018071301 add option for warnings per pr review #304
Changes from 23 commits
4fab083
486862c
685f61e
48aa23e
8bb2cc4
bec326d
1d039da
60c683f
3f76cb4
dfe7448
cca89f4
c546295
2d36014
8a6e25e
bf284c3
a43ece1
1609117
c561421
90aacc8
9c4573b
f2913c7
7df597e
28a8b04
a622d31
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
module Pronto | ||
class ConfigFile | ||
DEFAULT_MESSAGE_FORMAT = '%{msg}'.freeze | ||
DEFAULT_WARNINGS_PER_REVIEW = 30 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dimitrovv why is the default value 30? What's the GH rate limit? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mmozuras we are using Github Enterprise and with disabled rate limit, but if I try to post about 40 comments per review GHE returns 502. I don't this is smth with the rate limit here, have not tried with Public Github. I suspect the server is not able to serve this request somehow. Thus I can disable the default value here, so the comments will be separated into different reviews only if a default value is specified via config or env var. What do you think? |
||
|
||
EMPTY = { | ||
'all' => { | ||
|
@@ -32,6 +33,7 @@ class ConfigFile | |
'runners' => [], | ||
'formatters' => [], | ||
'max_warnings' => nil, | ||
'warnings_per_review' => DEFAULT_WARNINGS_PER_REVIEW, | ||
'verbose' => false, | ||
'format' => DEFAULT_MESSAGE_FORMAT | ||
}.freeze | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ def pretty_name | |
end | ||
|
||
def submit_comments(client, comments) | ||
client.create_pull_request_review(comments) | ||
client.publish_pull_request_comments(comments) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dimitrovv why limit this feature to GitHub? Just trying to understand :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, I thought about this, but I guess a review could only be submitted when using Github pronto client or I am wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
rescue Octokit::UnprocessableEntity, HTTParty::Error => e | ||
$stderr.puts "Failed to post: #{e.message}" | ||
end | ||
|
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.
@dimitrovv my only feedback is the wording here which is a little confusing to me. We don't mean to say it will create new PRs but will only leave N number of feedback per Pronto run, right?
If I create a PR with 100 errors, Pronto will report the first 30.
If I fix them, and push a new commit to my PR, Pronto will report the next 30.
Is that understanding correct? If so, I think we could rephrase this as such:
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.
Yes, I didn't define it the right way, will fix
Actually, it will post all N comments, but separated into X number of PR reviews (X = N / PRONTO_WARNINGS_PER_REVIEW). So all the comments should be published to Github only with a single pronto run
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.
Thank you @dimitrovv
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, I've just tried to formulate the explanations around the new setting a bit better. Could you take a look when possible?