-
Notifications
You must be signed in to change notification settings - Fork 480
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1082 from pbendersky/gitlab-inline-comments
Added support for GitLab inline comments
- Loading branch information
Showing
8 changed files
with
542 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<%- @tables.each do |table| -%> | ||
<%- if table[:content].any? -%> | ||
<table data-meta="generated_by_<%= @danger_id %>"> | ||
<tbody> | ||
<%- table[:content].each do |violation| -%> | ||
<tr> | ||
<td>:<%= table[:emoji] %>:</td> | ||
<td width="100%" data-sticky="<%= violation.sticky %>"><%= "<del>" if table[:resolved] %><%= violation.message %><%= "</del>" if table[:resolved] %></td> | ||
</tr> | ||
<%- end -%> | ||
</tbody> | ||
</table> | ||
<%- end -%> | ||
<%- end -%> | ||
<%- @markdowns.each do |current| -%> | ||
<%= current %> | ||
<%# the previous line has to be aligned far to the left, otherwise markdown can break easily %> | ||
<%- end -%> | ||
<%# We need to add the generated_by_ to identify comments from danger. But with inlines %> | ||
<%# it might be a little annoying, so we set on the table, but if we have markdown we add the footer anyway %> | ||
<%- if @markdowns.count > 0 -%> | ||
<p align="right" data-meta="generated_by_<%= @danger_id %>"> | ||
Generated by :no_entry_sign: <a href="http://danger.systems/">Danger</a> | ||
</p> | ||
<%- end -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
spec/fixtures/gitlab_api/merge_request_1_discussions_empty_response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
HTTP/1.1 200 OK | ||
Server: nginx | ||
Date: Thu, 14 Feb 2019 20:13:19 GMT | ||
Content-Type: application/json | ||
Content-Length: 7789 | ||
Cache-Control: max-age=0, private, must-revalidate | ||
Etag: W/"5b77db1f9b56d74e705229cc87b3d5a6" | ||
Link: <https://gitlab.com/api/v4/projects/k0nserv%2Fdanger-test/merge_requests/1/discussions?id=k0nserv%2Fdanger-test¬eable_id=1&page=1&per_page=20>; rel="first", <https://gitlab.com/api/v4/projects/k0nserv%2Fdanger-test/merge_requests/1/discussions?id=k0nserv%2Fdanger-test¬eable_id=1&page=1&per_page=20>; rel="last" | ||
Vary: Origin | ||
X-Content-Type-Options: nosniff | ||
X-Frame-Options: SAMEORIGIN | ||
X-Next-Page: | ||
X-Page: 1 | ||
X-Per-Page: 20 | ||
X-Prev-Page: | ||
X-Request-Id: OCKNUgQKAc3 | ||
X-Runtime: 0.189194 | ||
X-Total: 9 | ||
X-Total-Pages: 1 | ||
Strict-Transport-Security: max-age=31536000 | ||
RateLimit-Limit: 600 | ||
RateLimit-Observed: 1 | ||
RateLimit-Remaining: 599 | ||
RateLimit-Reset: 1550175259 | ||
RateLimit-ResetTime: Fri, 14 Feb 2019 20:14:19 GMT | ||
|
||
[] |
Oops, something went wrong.