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

github comment_character_limit #56

Merged
merged 3 commits into from
Dec 5, 2016
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lib/thumbs/pull_request_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,10 @@ def create_build_status_comment

<%= status[:command] %>

<%= status[:output] %>
<% output=status[:output] %>
<% allowed_length=10000 %>
<%= output.slice!(output.length-allowed_length, output.length) %>
Copy link

Choose a reason for hiding this comment

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

ellipses = status[:output].length > allowed_length ? ' ...' : '' or something of the like should be computed then appended to the output so it is clear that the content was clipped. NOTE: the slice would also need to subtract out the ellipses length, so output.slice!(output.length - ellipses.length - allowed_length, output.length) .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yeh, thats why added the thumbot wait lock (not implemented yet :) I'm tweaking it now to show "..snipped N lines.."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

regarding the slice, the intent is that it slices the preceding characters of the amount that is over the limit, so it always shows the tail.



```

Expand All @@ -719,7 +722,11 @@ def create_build_status_comment
comment_message = compose_build_status_comment_title(:completed)
comment_message << "\n#{@status_title}"
comment_message << build_comment
update_pull_request_comment(comment_id, comment_message)
if comment_message.length > 65000
debug_message "comment_message too large : #{comment_message.length} unable to post"
else
update_pull_request_comment(comment_id, comment_message)
end
end

def render_reviewers_comment_template
Expand Down