-
Notifications
You must be signed in to change notification settings - Fork 81
implement resetting of overview comments #162
base: master
Are you sure you want to change the base?
Conversation
c3fa85a
to
09a70e8
Compare
09a70e8
to
7d50a97
Compare
|
||
stashClient.deletePullRequestComment(pr, comment); | ||
} | ||
// FIXME delete tasks on file-wide comments |
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.
@@ -111,31 +112,29 @@ public void postCommentOnPullRequest(PullRequestRef pr, String report) | |||
postCreate(request, json, MessageFormat.format(COMMENT_POST_ERROR_MESSAGE, pr.repository(), pr.pullRequestId())); | |||
} | |||
|
|||
public Collection<StashComment> getPullRequestOverviewComments(PullRequestRef pr) throws StashClientException { | |||
return getPaged( | |||
MessageFormat.format(API_ONE_PR + "/activities", baseUrl, pr.project(), pr.repository(), pr.pullRequestId()), |
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.
|
||
boolean doneLastPage = false; | ||
int nextPageStart = 0; | ||
// FIXME size/limit support |
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.
stashClient.deletePullRequestComment(pr, comment); | ||
} | ||
// FIXME delete tasks on file-wide comments | ||
// resetComments(diffReport.getComments(), pr, sonarUser, stashClient); |
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.
SonarQube analysis reported 6 issues Watch the comments in this conversation to review them. 1 extra issueNote: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:
|
@@ -51,7 +54,10 @@ public static StashComment extractComment(JsonObject jsonComment, String path, L | |||
JsonObject jsonAuthor = (JsonObject)jsonComment.get(AUTHOR); | |||
StashUser stashUser = extractUser(jsonAuthor); | |||
|
|||
return new StashComment(id, message, path, line, stashUser, version); | |||
StashComment result = new StashComment(id, message, path, line, stashUser, version); | |||
// FIXME do this at some central place |
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.
|
||
while (!doneLastPage) { | ||
if (nextPageStart > 0) { | ||
requestBuilder.addQueryParam("start", String.valueOf(nextPageStart)); |
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 will add an additional parameter "start" and not replace the previous one. With more activities you will end up with link params:
?start=25&start=50&start50&start-50...
which will at the end fail.
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.
@marekjagielski Good point. thanks!
This function should be implemented if it's not 👍 |
The |
See #119