Merge changes I705bce78,I2d44fb85,I0ba61957

* changes:
  Configure maximum allowed value for the number of context padding lines
  Add the context-padding parameter to the comment context
  Refactor CommentContextLoader to only take the required fields
This commit is contained in:
Youssef Elghareeb
2021-02-09 10:01:54 +00:00
committed by Gerrit Code Review
11 changed files with 293 additions and 41 deletions

View File

@@ -612,6 +612,7 @@ class ChangeApiImpl implements ChangeApi {
try {
ListChangeComments listComments = listCommentsProvider.get();
listComments.setContext(this.getContext());
listComments.setContextPadding(this.getContextPadding());
return listComments.apply(change).value();
} catch (Exception e) {
throw asRestApiException("Cannot get comments", e);
@@ -623,6 +624,7 @@ class ChangeApiImpl implements ChangeApi {
try {
ListChangeComments listComments = listCommentsProvider.get();
listComments.setContext(this.getContext());
listComments.setContextPadding(this.getContextPadding());
return listComments.getComments(change);
} catch (Exception e) {
throw asRestApiException("Cannot get comments", e);