Search in sources :

Example 66 with RestApiException

use of com.google.gerrit.extensions.restapi.RestApiException in project gerrit by GerritCodeReview.

the class RemoveFromAttentionSetOp method updateChange.

@Override
public boolean updateChange(ChangeContext ctx) throws RestApiException {
    ChangeData changeData = changeDataFactory.create(ctx.getNotes());
    Optional<AttentionSetUpdate> existingEntry = changeData.attentionSet().stream().filter(u -> u.account().equals(attentionUserId)).findAny();
    if (!existingEntry.isPresent() || existingEntry.get().operation() == Operation.REMOVE) {
        // We still need to perform this update to ensure that we don't add the user in a follow-up
        // operation, but no need to send an email about it.
        notify = false;
    }
    change = ctx.getChange();
    ChangeUpdate update = ctx.getUpdate(ctx.getChange().currentPatchSetId());
    update.addToPlannedAttentionSetUpdates(AttentionSetUpdate.createForWrite(attentionUserId, Operation.REMOVE, reason));
    return true;
}
Also used : Operation(com.google.gerrit.entities.AttentionSetUpdate.Operation) Inject(com.google.inject.Inject) Account(com.google.gerrit.entities.Account) IOException(java.io.IOException) Assisted(com.google.inject.assistedinject.Assisted) MessageIdGenerator(com.google.gerrit.server.mail.send.MessageIdGenerator) RemoveFromAttentionSetSender(com.google.gerrit.server.mail.send.RemoveFromAttentionSetSender) ChangeData(com.google.gerrit.server.query.change.ChangeData) ChangeUpdate(com.google.gerrit.server.notedb.ChangeUpdate) PostUpdateContext(com.google.gerrit.server.update.PostUpdateContext) AttentionSetEmail(com.google.gerrit.server.util.AttentionSetEmail) Objects.requireNonNull(java.util.Objects.requireNonNull) AttentionSetUpdate(com.google.gerrit.entities.AttentionSetUpdate) Optional(java.util.Optional) Change(com.google.gerrit.entities.Change) RestApiException(com.google.gerrit.extensions.restapi.RestApiException) BatchUpdateOp(com.google.gerrit.server.update.BatchUpdateOp) ChangeContext(com.google.gerrit.server.update.ChangeContext) FluentLogger(com.google.common.flogger.FluentLogger) AttentionSetUpdate(com.google.gerrit.entities.AttentionSetUpdate) ChangeData(com.google.gerrit.server.query.change.ChangeData) ChangeUpdate(com.google.gerrit.server.notedb.ChangeUpdate)

Example 67 with RestApiException

use of com.google.gerrit.extensions.restapi.RestApiException in project gerrit by GerritCodeReview.

the class MailReceiver method dispatchMailProcessor.

protected void dispatchMailProcessor(List<MailMessage> messages, boolean async) {
    for (MailMessage m : messages) {
        if (async) {
            @SuppressWarnings("unused") Future<?> possiblyIgnoredError = workQueue.getDefaultQueue().submit(() -> {
                try {
                    mailProcessor.process(m);
                    requestDeletion(m.id());
                } catch (RestApiException | UpdateException e) {
                    logger.atSevere().withCause(e).log("Mail: Can't process message %s . Won't delete.", m.id());
                }
            });
        } else {
            // Synchronous processing is used only in tests.
            try {
                mailProcessor.process(m);
                requestDeletion(m.id());
            } catch (RestApiException | UpdateException e) {
                logger.atSevere().withCause(e).log("Mail: Can't process messages. Won't delete.");
            }
        }
    }
}
Also used : MailMessage(com.google.gerrit.mail.MailMessage) UpdateException(com.google.gerrit.server.update.UpdateException) RestApiException(com.google.gerrit.extensions.restapi.RestApiException)

Example 68 with RestApiException

use of com.google.gerrit.extensions.restapi.RestApiException in project gerrit by GerritCodeReview.

the class MailProcessor method persistComments.

private void persistComments(BatchUpdate.Factory buf, MailMessage message, MailMetadata metadata, Account.Id sender) throws UpdateException, RestApiException {
    try (ManualRequestContext ctx = oneOffRequestContext.openAs(sender)) {
        List<ChangeData> changeDataList = queryProvider.get().enforceVisibility(true).byLegacyChangeId(Change.id(metadata.changeNumber));
        if (changeDataList.isEmpty()) {
            sendRejectionEmail(message, InboundEmailError.CHANGE_NOT_FOUND);
            return;
        }
        if (changeDataList.size() != 1) {
            logger.atSevere().log("Message %s references unique change %s," + " but there are %d matching changes in the index." + " Will delete message.", message.id(), metadata.changeNumber, changeDataList.size());
            sendRejectionEmail(message, InboundEmailError.INTERNAL_EXCEPTION);
            return;
        }
        ChangeData cd = Iterables.getOnlyElement(changeDataList);
        if (existingMessageIds(cd).contains(message.id())) {
            logger.atInfo().log("Message %s was already processed. Will delete message.", message.id());
            return;
        }
        // Get all comments; filter and sort them to get the original list of
        // comments from the outbound email.
        // TODO(hiesel) Also filter by original comment author.
        Collection<HumanComment> comments = cd.publishedComments().stream().filter(c -> (c.writtenOn.getTime() / 1000) == (metadata.timestamp.getTime() / 1000)).sorted(CommentsUtil.COMMENT_ORDER).collect(toList());
        Project.NameKey project = cd.project();
        // If URL is not defined, we won't be able to parse line comments. We still attempt to get the
        // other ones.
        String changeUrl = urlFormatter.get().getChangeViewUrl(cd.project(), cd.getId()).orElse("http://gerrit.invalid/");
        List<MailComment> parsedComments;
        if (useHtmlParser(message)) {
            parsedComments = HtmlParser.parse(message, comments, changeUrl);
        } else {
            parsedComments = TextParser.parse(message, comments, changeUrl);
        }
        if (parsedComments.isEmpty()) {
            logger.atWarning().log("Could not parse any comments from %s. Will delete message.", message.id());
            sendRejectionEmail(message, InboundEmailError.PARSING_ERROR);
            return;
        }
        ImmutableList<CommentForValidation> parsedCommentsForValidation = parsedComments.stream().map(comment -> CommentForValidation.create(CommentForValidation.CommentSource.HUMAN, MAIL_COMMENT_TYPE_TO_VALIDATION_TYPE.get(comment.getType()), comment.getMessage(), comment.getMessage().length())).collect(ImmutableList.toImmutableList());
        CommentValidationContext commentValidationCtx = CommentValidationContext.create(cd.change().getChangeId(), cd.change().getProject().get(), cd.change().getDest().branch());
        ImmutableList<CommentValidationFailure> commentValidationFailures = PublishCommentUtil.findInvalidComments(commentValidationCtx, commentValidators, parsedCommentsForValidation);
        if (!commentValidationFailures.isEmpty()) {
            sendRejectionEmail(message, InboundEmailError.COMMENT_REJECTED);
            return;
        }
        Op o = new Op(PatchSet.id(cd.getId(), metadata.patchSet), parsedComments, message.id());
        BatchUpdate batchUpdate = buf.create(project, ctx.getUser(), TimeUtil.now());
        batchUpdate.addOp(cd.getId(), o);
        batchUpdate.execute();
    }
}
Also used : DynamicItem(com.google.gerrit.extensions.registration.DynamicItem) Inject(com.google.inject.Inject) HumanComment(com.google.gerrit.entities.HumanComment) UpdateException(com.google.gerrit.server.update.UpdateException) BatchUpdate(com.google.gerrit.server.update.BatchUpdate) Map(java.util.Map) RetryHelper(com.google.gerrit.server.update.RetryHelper) UrlFormatter(com.google.gerrit.server.config.UrlFormatter) Side(com.google.gerrit.extensions.client.Side) OneOffRequestContext(com.google.gerrit.server.util.OneOffRequestContext) ImmutableMap(com.google.common.collect.ImmutableMap) Collection(java.util.Collection) Account(com.google.gerrit.entities.Account) MailFilter(com.google.gerrit.server.mail.MailFilter) Set(java.util.Set) ApprovalsUtil(com.google.gerrit.server.approval.ApprovalsUtil) ChangeData(com.google.gerrit.server.query.change.ChangeData) List(java.util.List) HtmlParser(com.google.gerrit.mail.HtmlParser) Emails(com.google.gerrit.server.account.Emails) CommentAdded(com.google.gerrit.server.extensions.events.CommentAdded) PluginSetContext(com.google.gerrit.server.plugincontext.PluginSetContext) InternalChangeQuery(com.google.gerrit.server.query.change.InternalChangeQuery) Optional(java.util.Optional) MailMetadata(com.google.gerrit.mail.MailMetadata) BatchUpdateOp(com.google.gerrit.server.update.BatchUpdateOp) FluentLogger(com.google.common.flogger.FluentLogger) ChangeMessagesUtil(com.google.gerrit.server.ChangeMessagesUtil) Singleton(com.google.inject.Singleton) AccountCache(com.google.gerrit.server.account.AccountCache) Iterables(com.google.common.collect.Iterables) CommentValidationContext(com.google.gerrit.extensions.validators.CommentValidationContext) TextParser(com.google.gerrit.mail.TextParser) PublishCommentUtil(com.google.gerrit.server.PublishCommentUtil) UnprocessableEntityException(com.google.gerrit.extensions.restapi.UnprocessableEntityException) CommentsUtil(com.google.gerrit.server.CommentsUtil) CommentForValidation(com.google.gerrit.extensions.validators.CommentForValidation) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) PATCHSET_LEVEL(com.google.gerrit.entities.Patch.PATCHSET_LEVEL) Strings(com.google.common.base.Strings) MessageIdGenerator(com.google.gerrit.server.mail.send.MessageIdGenerator) ImmutableList(com.google.common.collect.ImmutableList) PostUpdateContext(com.google.gerrit.server.update.PostUpdateContext) Change(com.google.gerrit.entities.Change) PatchSet(com.google.gerrit.entities.PatchSet) RestApiException(com.google.gerrit.extensions.restapi.RestApiException) MailComment(com.google.gerrit.mail.MailComment) ChangeContext(com.google.gerrit.server.update.ChangeContext) Extension(com.google.gerrit.extensions.registration.Extension) InboundEmailError(com.google.gerrit.server.mail.send.InboundEmailRejectionSender.InboundEmailError) MailMessage(com.google.gerrit.mail.MailMessage) MailHeaderParser(com.google.gerrit.mail.MailHeaderParser) StorageException(com.google.gerrit.exceptions.StorageException) CommentValidationFailure(com.google.gerrit.extensions.validators.CommentValidationFailure) ChangeNotes(com.google.gerrit.server.notedb.ChangeNotes) IOException(java.io.IOException) ManualRequestContext(com.google.gerrit.server.util.ManualRequestContext) Collectors.toList(java.util.stream.Collectors.toList) Provider(com.google.inject.Provider) DynamicMap(com.google.gerrit.extensions.registration.DynamicMap) Project(com.google.gerrit.entities.Project) TimeUtil(com.google.gerrit.server.util.time.TimeUtil) CommentValidator(com.google.gerrit.extensions.validators.CommentValidator) AccountState(com.google.gerrit.server.account.AccountState) PatchSetUtil(com.google.gerrit.server.PatchSetUtil) EmailReviewComments(com.google.gerrit.server.change.EmailReviewComments) InboundEmailRejectionSender(com.google.gerrit.server.mail.send.InboundEmailRejectionSender) BatchUpdateOp(com.google.gerrit.server.update.BatchUpdateOp) MailComment(com.google.gerrit.mail.MailComment) CommentForValidation(com.google.gerrit.extensions.validators.CommentForValidation) CommentValidationContext(com.google.gerrit.extensions.validators.CommentValidationContext) ChangeData(com.google.gerrit.server.query.change.ChangeData) BatchUpdate(com.google.gerrit.server.update.BatchUpdate) Project(com.google.gerrit.entities.Project) CommentValidationFailure(com.google.gerrit.extensions.validators.CommentValidationFailure) ManualRequestContext(com.google.gerrit.server.util.ManualRequestContext) HumanComment(com.google.gerrit.entities.HumanComment)

Example 69 with RestApiException

use of com.google.gerrit.extensions.restapi.RestApiException in project gerrit by GerritCodeReview.

the class RevertSubmission method revertSubmission.

private RevertSubmissionInfo revertSubmission(List<ChangeData> changeData, RevertInput revertInput) throws RestApiException, IOException, UpdateException, ConfigInvalidException, StorageException, PermissionBackendException {
    Multimap<BranchNameKey, ChangeData> changesPerProjectAndBranch = ArrayListMultimap.create();
    changeData.stream().forEach(c -> changesPerProjectAndBranch.put(c.change().getDest(), c));
    cherryPickInput = createCherryPickInput(revertInput);
    Instant timestamp = TimeUtil.now();
    for (BranchNameKey projectAndBranch : changesPerProjectAndBranch.keySet()) {
        cherryPickInput.base = null;
        Project.NameKey project = projectAndBranch.project();
        cherryPickInput.destination = projectAndBranch.branch();
        if (revertInput.workInProgress) {
            cherryPickInput.notify = firstNonNull(cherryPickInput.notify, NotifyHandling.OWNER);
        }
        Collection<ChangeData> changesInProjectAndBranch = changesPerProjectAndBranch.get(projectAndBranch);
        // Sort the changes topologically.
        Iterator<PatchSetData> sortedChangesInProjectAndBranch = sorter.sort(changesInProjectAndBranch).iterator();
        Set<ObjectId> commitIdsInProjectAndBranch = changesInProjectAndBranch.stream().map(c -> c.currentPatchSet().commitId()).collect(Collectors.toSet());
        revertAllChangesInProjectAndBranch(revertInput, project, sortedChangesInProjectAndBranch, commitIdsInProjectAndBranch, timestamp);
    }
    results.sort(Comparator.comparing(c -> c.revertOf));
    RevertSubmissionInfo revertSubmissionInfo = new RevertSubmissionInfo();
    revertSubmissionInfo.revertChanges = results;
    return revertSubmissionInfo;
}
Also used : ArrayListMultimap(com.google.common.collect.ArrayListMultimap) Arrays(java.util.Arrays) CommitMessageUtil(com.google.gerrit.server.util.CommitMessageUtil) ObjectInserter(org.eclipse.jgit.lib.ObjectInserter) ProjectCache(com.google.gerrit.server.project.ProjectCache) Inject(com.google.inject.Inject) BooleanCondition.and(com.google.gerrit.extensions.conditions.BooleanCondition.and) PermissionBackend(com.google.gerrit.server.permissions.PermissionBackend) UpdateException(com.google.gerrit.server.update.UpdateException) RestModifyView(com.google.gerrit.extensions.restapi.RestModifyView) RevWalk(org.eclipse.jgit.revwalk.RevWalk) BatchUpdate(com.google.gerrit.server.update.BatchUpdate) Matcher(java.util.regex.Matcher) RefNames(com.google.gerrit.entities.RefNames) AuthException(com.google.gerrit.extensions.restapi.AuthException) UiAction(com.google.gerrit.extensions.webui.UiAction) CREATE_CHANGE(com.google.gerrit.server.permissions.RefPermission.CREATE_CHANGE) REVERT(com.google.gerrit.server.permissions.ChangePermission.REVERT) RevertSubmissionInfo(com.google.gerrit.extensions.common.RevertSubmissionInfo) Collection(java.util.Collection) ChangeMessages(com.google.gerrit.server.change.ChangeMessages) Set(java.util.Set) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) BranchNameKey(com.google.gerrit.entities.BranchNameKey) CommitUtil(com.google.gerrit.server.git.CommitUtil) NotifyHandling(com.google.gerrit.extensions.api.changes.NotifyHandling) ChangeData(com.google.gerrit.server.query.change.ChangeData) List(java.util.List) ChangeReverted(com.google.gerrit.server.extensions.events.ChangeReverted) InternalChangeQuery(com.google.gerrit.server.query.change.InternalChangeQuery) ChangeJson(com.google.gerrit.server.change.ChangeJson) MoreObjects.firstNonNull(com.google.common.base.MoreObjects.firstNonNull) RandomStringUtils(org.apache.commons.lang3.RandomStringUtils) BatchUpdateOp(com.google.gerrit.server.update.BatchUpdateOp) Pattern(java.util.regex.Pattern) FluentLogger(com.google.common.flogger.FluentLogger) ChangeMessagesUtil(com.google.gerrit.server.ChangeMessagesUtil) Iterables(com.google.common.collect.Iterables) PermissionBackendException(com.google.gerrit.server.permissions.PermissionBackendException) WalkSorter(com.google.gerrit.server.change.WalkSorter) ConfigInvalidException(org.eclipse.jgit.errors.ConfigInvalidException) RevCommit(org.eclipse.jgit.revwalk.RevCommit) ChangePermission(com.google.gerrit.server.permissions.ChangePermission) Multimap(com.google.common.collect.Multimap) Response(com.google.gerrit.extensions.restapi.Response) MessageFormat(java.text.MessageFormat) ArrayList(java.util.ArrayList) Strings(com.google.common.base.Strings) MessageIdGenerator(com.google.gerrit.server.mail.send.MessageIdGenerator) ChangeResource(com.google.gerrit.server.change.ChangeResource) PostUpdateContext(com.google.gerrit.server.update.PostUpdateContext) Objects.requireNonNull(java.util.Objects.requireNonNull) ChangeInfo(com.google.gerrit.extensions.common.ChangeInfo) RevertedSender(com.google.gerrit.server.mail.send.RevertedSender) Change(com.google.gerrit.entities.Change) ContributorAgreementsChecker(com.google.gerrit.server.project.ContributorAgreementsChecker) RestApiException(com.google.gerrit.extensions.restapi.RestApiException) ChangeUtil(com.google.gerrit.server.ChangeUtil) ChangeContext(com.google.gerrit.server.update.ChangeContext) PatchSetData(com.google.gerrit.server.change.WalkSorter.PatchSetData) ProjectCache.illegalState(com.google.gerrit.server.project.ProjectCache.illegalState) CurrentUser(com.google.gerrit.server.CurrentUser) RevertInput(com.google.gerrit.extensions.api.changes.RevertInput) NotifyResolver(com.google.gerrit.server.change.NotifyResolver) Sequences(com.google.gerrit.server.notedb.Sequences) Iterator(java.util.Iterator) StorageException(com.google.gerrit.exceptions.StorageException) ProjectState(com.google.gerrit.server.project.ProjectState) NoSuchProjectException(com.google.gerrit.server.project.NoSuchProjectException) ChangeNotes(com.google.gerrit.server.notedb.ChangeNotes) IOException(java.io.IOException) ObjectId(org.eclipse.jgit.lib.ObjectId) Provider(com.google.inject.Provider) GitRepositoryManager(com.google.gerrit.server.git.GitRepositoryManager) ResourceConflictException(com.google.gerrit.extensions.restapi.ResourceConflictException) RevisionResource(com.google.gerrit.server.change.RevisionResource) Project(com.google.gerrit.entities.Project) CherryPickInput(com.google.gerrit.extensions.api.changes.CherryPickInput) TimeUtil(com.google.gerrit.server.util.time.TimeUtil) Result(com.google.gerrit.server.restapi.change.CherryPickChange.Result) Comparator(java.util.Comparator) PatchSetUtil(com.google.gerrit.server.PatchSetUtil) ObjectReader(org.eclipse.jgit.lib.ObjectReader) Repository(org.eclipse.jgit.lib.Repository) PatchSetData(com.google.gerrit.server.change.WalkSorter.PatchSetData) ObjectId(org.eclipse.jgit.lib.ObjectId) Instant(java.time.Instant) ChangeData(com.google.gerrit.server.query.change.ChangeData) Project(com.google.gerrit.entities.Project) RevertSubmissionInfo(com.google.gerrit.extensions.common.RevertSubmissionInfo) BranchNameKey(com.google.gerrit.entities.BranchNameKey)

Example 70 with RestApiException

use of com.google.gerrit.extensions.restapi.RestApiException in project gerrit by GerritCodeReview.

the class ListTags method apply.

@Override
public Response<ImmutableList<TagInfo>> apply(ProjectResource resource) throws IOException, ResourceNotFoundException, RestApiException, PermissionBackendException {
    resource.getProjectState().checkStatePermitsRead();
    List<TagInfo> tags = new ArrayList<>();
    PermissionBackend.ForProject perm = permissionBackend.currentUser().project(resource.getNameKey());
    try (Repository repo = getRepository(resource.getNameKey());
        RevWalk rw = new RevWalk(repo)) {
        Collection<Ref> all = visibleTags(resource.getNameKey(), repo, repo.getRefDatabase().getRefsByPrefix(Constants.R_TAGS));
        for (Ref ref : all) {
            tags.add(createTagInfo(perm.ref(ref.getName()), ref, rw, resource.getProjectState(), links));
        }
    }
    tags.sort(comparing(t -> t.ref));
    return Response.ok(new RefFilter<TagInfo>(Constants.R_TAGS).start(start).limit(limit).subString(matchSubstring).regex(matchRegex).filter(tags));
}
Also used : ResourceNotFoundException(com.google.gerrit.extensions.restapi.ResourceNotFoundException) PermissionBackendException(com.google.gerrit.server.permissions.PermissionBackendException) RefPermission(com.google.gerrit.server.permissions.RefPermission) RevCommit(org.eclipse.jgit.revwalk.RevCommit) IdString(com.google.gerrit.extensions.restapi.IdString) RepositoryNotFoundException(org.eclipse.jgit.errors.RepositoryNotFoundException) Inject(com.google.inject.Inject) RevObject(org.eclipse.jgit.revwalk.RevObject) Response(com.google.gerrit.extensions.restapi.Response) PermissionBackend(com.google.gerrit.server.permissions.PermissionBackend) TagInfo(com.google.gerrit.extensions.api.projects.TagInfo) ArrayList(java.util.ArrayList) RevWalk(org.eclipse.jgit.revwalk.RevWalk) RevTag(org.eclipse.jgit.revwalk.RevTag) ImmutableList(com.google.common.collect.ImmutableList) Comparator.comparing(java.util.Comparator.comparing) RestApiException(com.google.gerrit.extensions.restapi.RestApiException) RestReadView(com.google.gerrit.extensions.restapi.RestReadView) RefFilter(com.google.gerrit.server.project.RefFilter) Collection(java.util.Collection) RefFilterOptions(com.google.gerrit.server.permissions.PermissionBackend.RefFilterOptions) ProjectState(com.google.gerrit.server.project.ProjectState) ProjectResource(com.google.gerrit.server.project.ProjectResource) IOException(java.io.IOException) Constants(org.eclipse.jgit.lib.Constants) Option(org.kohsuke.args4j.Option) CommonConverters(com.google.gerrit.server.CommonConverters) Instant(java.time.Instant) WebLinks(com.google.gerrit.server.WebLinks) PersonIdent(org.eclipse.jgit.lib.PersonIdent) WebLinkInfo(com.google.gerrit.extensions.common.WebLinkInfo) List(java.util.List) GitRepositoryManager(com.google.gerrit.server.git.GitRepositoryManager) ListRefsRequest(com.google.gerrit.extensions.api.projects.ProjectApi.ListRefsRequest) Ref(org.eclipse.jgit.lib.Ref) Project(com.google.gerrit.entities.Project) RefNames.isConfigRef(com.google.gerrit.entities.RefNames.isConfigRef) Repository(org.eclipse.jgit.lib.Repository) RefFilter(com.google.gerrit.server.project.RefFilter) Repository(org.eclipse.jgit.lib.Repository) Ref(org.eclipse.jgit.lib.Ref) RefNames.isConfigRef(com.google.gerrit.entities.RefNames.isConfigRef) PermissionBackend(com.google.gerrit.server.permissions.PermissionBackend) TagInfo(com.google.gerrit.extensions.api.projects.TagInfo) ArrayList(java.util.ArrayList) RevWalk(org.eclipse.jgit.revwalk.RevWalk)

Aggregations

RestApiException (com.google.gerrit.extensions.restapi.RestApiException)93 ApiUtil.asRestApiException (com.google.gerrit.server.api.ApiUtil.asRestApiException)38 IOException (java.io.IOException)31 BadRequestException (com.google.gerrit.extensions.restapi.BadRequestException)24 UpdateException (com.google.gerrit.server.update.UpdateException)23 BatchUpdate (com.google.gerrit.server.update.BatchUpdate)22 ResourceConflictException (com.google.gerrit.extensions.restapi.ResourceConflictException)20 PermissionBackendException (com.google.gerrit.server.permissions.PermissionBackendException)19 AuthException (com.google.gerrit.extensions.restapi.AuthException)18 StorageException (com.google.gerrit.exceptions.StorageException)17 List (java.util.List)17 BatchUpdateOp (com.google.gerrit.server.update.BatchUpdateOp)16 Inject (com.google.inject.Inject)15 ArrayList (java.util.ArrayList)15 ResourceNotFoundException (com.google.gerrit.extensions.restapi.ResourceNotFoundException)14 ChangeNotes (com.google.gerrit.server.notedb.ChangeNotes)14 ChangeContext (com.google.gerrit.server.update.ChangeContext)14 ConfigInvalidException (org.eclipse.jgit.errors.ConfigInvalidException)14 Provider (com.google.inject.Provider)12 Change (com.google.gerrit.entities.Change)11