Search in sources :

Example 71 with ProjectState

use of com.google.gerrit.server.project.ProjectState in project gerrit by GerritCodeReview.

the class EqualsLabelPredicate method match.

@Override
public boolean match(ChangeData object) {
    Change c = object.change();
    if (c == null) {
        // 
        return false;
    }
    if (Integer.valueOf(0).equals(count)) {
        // is computationally expensive.
        return false;
    }
    Optional<ProjectState> project = projectCache.get(c.getDest().project());
    if (!project.isPresent()) {
        // 
        return false;
    }
    LabelType labelType = type(project.get().getLabelTypes(), label);
    if (labelType == null) {
        // Label is not defined by this project.
        return false;
    }
    boolean hasVote = false;
    int matchingVotes = 0;
    StorageConstraint currentStorageConstraint = object.getStorageConstraint();
    object.setStorageConstraint(ChangeData.StorageConstraint.INDEX_PRIMARY_NOTEDB_SECONDARY);
    for (PatchSetApproval p : object.currentApprovals()) {
        if (labelType.matches(p)) {
            hasVote = true;
            if (match(object, p.value(), p.accountId())) {
                matchingVotes += 1;
            }
        }
    }
    object.setStorageConstraint(currentStorageConstraint);
    if (!hasVote && expVal == 0) {
        return true;
    }
    return count == null ? matchingVotes >= 1 : matchingVotes == count;
}
Also used : LabelType(com.google.gerrit.entities.LabelType) ProjectState(com.google.gerrit.server.project.ProjectState) Change(com.google.gerrit.entities.Change) StorageConstraint(com.google.gerrit.server.query.change.ChangeData.StorageConstraint) PatchSetApproval(com.google.gerrit.entities.PatchSetApproval) StorageConstraint(com.google.gerrit.server.query.change.ChangeData.StorageConstraint)

Example 72 with ProjectState

use of com.google.gerrit.server.project.ProjectState in project gerrit by GerritCodeReview.

the class EqualsLabelPredicate method match.

protected boolean match(ChangeData cd, short value, Account.Id approver) {
    if (value != expVal) {
        return false;
    }
    if (account != null) {
        // case when account in query is numeric
        if (!account.equals(approver) && !isMagicUser()) {
            return false;
        }
        // case when account in query = owner
        if (account.equals(ChangeQueryBuilder.OWNER_ACCOUNT_ID) && !cd.change().getOwner().equals(approver)) {
            return false;
        }
        // case when account in query = non_uploader
        if (account.equals(ChangeQueryBuilder.NON_UPLOADER_ACCOUNT_ID) && cd.currentPatchSet().uploader().equals(approver)) {
            return false;
        }
    }
    IdentifiedUser reviewer = userFactory.create(approver);
    if (group != null && !reviewer.getEffectiveGroups().contains(group)) {
        return false;
    }
    // Check the user has 'READ' permission.
    try {
        PermissionBackend.ForChange perm = permissionBackend.absentUser(approver).change(cd);
        if (!projectCache.get(cd.project()).map(ProjectState::statePermitsRead).orElse(false)) {
            return false;
        }
        perm.check(ChangePermission.READ);
        return true;
    } catch (PermissionBackendException | AuthException e) {
        return false;
    }
}
Also used : PermissionBackend(com.google.gerrit.server.permissions.PermissionBackend) AuthException(com.google.gerrit.extensions.restapi.AuthException) ProjectState(com.google.gerrit.server.project.ProjectState) PermissionBackendException(com.google.gerrit.server.permissions.PermissionBackendException) IdentifiedUser(com.google.gerrit.server.IdentifiedUser)

Example 73 with ProjectState

use of com.google.gerrit.server.project.ProjectState in project gerrit by GerritCodeReview.

the class ChangeIsVisibleToPredicate method match.

@Override
public boolean match(ChangeData cd) {
    if (cd.fastIsVisibleTo(user)) {
        return true;
    }
    Change change = cd.change();
    if (change == null) {
        return false;
    }
    Optional<ProjectState> projectState = projectCache.get(cd.project());
    if (!projectState.isPresent()) {
        logger.atFine().log("Filter out change %s of non-existing project %s", cd, cd.project());
        return false;
    }
    if (!projectState.get().statePermitsRead()) {
        logger.atFine().log("Filter out change %s of non-reabable project %s", cd, cd.project());
        return false;
    }
    PermissionBackend.WithUser withUser = user.isIdentifiedUser() ? permissionBackend.absentUser(user.getAccountId()) : permissionBackend.user(Optional.of(user).filter(u -> u instanceof GroupBackedUser || u instanceof InternalUser).orElseGet(anonymousUserProvider::get));
    try {
        if (!withUser.change(cd).test(ChangePermission.READ)) {
            logger.atFine().log("Filter out non-visisble change: %s", cd);
            return false;
        }
    } catch (PermissionBackendException e) {
        Throwable cause = e.getCause();
        if (cause instanceof RepositoryNotFoundException) {
            logger.atWarning().withCause(e).log("Filter out change %s because the corresponding repository %s was not found", cd, cd.project());
            return false;
        }
        throw new StorageException("unable to check permissions on change " + cd.getId(), e);
    }
    cd.cacheVisibleTo(user);
    return true;
}
Also used : IsVisibleToPredicate(com.google.gerrit.index.query.IsVisibleToPredicate) PermissionBackendException(com.google.gerrit.server.permissions.PermissionBackendException) CurrentUser(com.google.gerrit.server.CurrentUser) IndexUtils(com.google.gerrit.server.index.IndexUtils) ProjectCache(com.google.gerrit.server.project.ProjectCache) RepositoryNotFoundException(org.eclipse.jgit.errors.RepositoryNotFoundException) StorageException(com.google.gerrit.exceptions.StorageException) InternalUser(com.google.gerrit.server.InternalUser) Inject(com.google.inject.Inject) ChangePermission(com.google.gerrit.server.permissions.ChangePermission) ProjectState(com.google.gerrit.server.project.ProjectState) PermissionBackend(com.google.gerrit.server.permissions.PermissionBackend) Assisted(com.google.inject.assistedinject.Assisted) Provider(com.google.inject.Provider) Optional(java.util.Optional) Change(com.google.gerrit.entities.Change) AnonymousUser(com.google.gerrit.server.AnonymousUser) FluentLogger(com.google.common.flogger.FluentLogger) PermissionBackend(com.google.gerrit.server.permissions.PermissionBackend) PermissionBackendException(com.google.gerrit.server.permissions.PermissionBackendException) Change(com.google.gerrit.entities.Change) RepositoryNotFoundException(org.eclipse.jgit.errors.RepositoryNotFoundException) InternalUser(com.google.gerrit.server.InternalUser) ProjectState(com.google.gerrit.server.project.ProjectState) StorageException(com.google.gerrit.exceptions.StorageException)

Example 74 with ProjectState

use of com.google.gerrit.server.project.ProjectState in project gerrit by GerritCodeReview.

the class ParentProjectPredicate method predicates.

protected static ImmutableList<Predicate<ChangeData>> predicates(ProjectCache projectCache, ChildProjects childProjects, String value) {
    Optional<ProjectState> projectState = projectCache.get(Project.nameKey(value));
    if (!projectState.isPresent()) {
        return ImmutableList.of();
    }
    ImmutableList.Builder<Predicate<ChangeData>> r = ImmutableList.builder();
    r.add(ChangePredicates.project(projectState.get().getNameKey()));
    try {
        for (ProjectInfo p : childProjects.list(projectState.get().getNameKey())) {
            r.add(ChangePredicates.project(Project.nameKey(p.name)));
        }
    } catch (PermissionBackendException e) {
        logger.atWarning().withCause(e).log("cannot check permissions to expand child projects");
    }
    return r.build();
}
Also used : ImmutableList(com.google.common.collect.ImmutableList) ProjectInfo(com.google.gerrit.extensions.common.ProjectInfo) ProjectState(com.google.gerrit.server.project.ProjectState) PermissionBackendException(com.google.gerrit.server.permissions.PermissionBackendException) Predicate(com.google.gerrit.index.query.Predicate) OrPredicate(com.google.gerrit.index.query.OrPredicate)

Example 75 with ProjectState

use of com.google.gerrit.server.project.ProjectState in project gerrit by GerritCodeReview.

the class PostReview method apply.

public Response<ReviewResult> apply(RevisionResource revision, ReviewInput input, Instant ts) throws RestApiException, UpdateException, IOException, PermissionBackendException, ConfigInvalidException, PatchListNotAvailableException {
    // Respect timestamp, but truncate at change created-on time.
    ts = Ordering.natural().max(ts, revision.getChange().getCreatedOn());
    if (revision.getEdit().isPresent()) {
        throw new ResourceConflictException("cannot post review on edit");
    }
    ProjectState projectState = projectCache.get(revision.getProject()).orElseThrow(illegalState(revision.getProject()));
    LabelTypes labelTypes = projectState.getLabelTypes(revision.getNotes());
    logger.atFine().log("strict label checking is %s", (strictLabels ? "enabled" : "disabled"));
    metrics.draftHandling.increment(input.drafts == null ? "N/A" : input.drafts.name());
    input.drafts = firstNonNull(input.drafts, DraftHandling.KEEP);
    logger.atFine().log("draft handling = %s", input.drafts);
    if (input.onBehalfOf != null) {
        revision = onBehalfOf(revision, labelTypes, input);
    }
    if (input.labels != null) {
        checkLabels(revision, labelTypes, input.labels);
    }
    if (input.comments != null) {
        input.comments = cleanUpComments(input.comments);
        checkComments(revision, input.comments);
    }
    if (input.draftIdsToPublish != null) {
        checkDraftIds(revision, input.draftIdsToPublish, input.drafts);
    }
    if (input.robotComments != null) {
        input.robotComments = cleanUpComments(input.robotComments);
        checkRobotComments(revision, input.robotComments);
    }
    if (input.notify == null) {
        input.notify = defaultNotify(revision.getChange(), input);
    }
    logger.atFine().log("notify handling = %s", input.notify);
    Map<String, ReviewerResult> reviewerJsonResults = null;
    List<ReviewerModification> reviewerResults = Lists.newArrayList();
    boolean hasError = false;
    boolean confirm = false;
    if (input.reviewers != null) {
        reviewerJsonResults = Maps.newHashMap();
        for (ReviewerInput reviewerInput : input.reviewers) {
            ReviewerModification result = reviewerModifier.prepare(revision.getNotes(), revision.getUser(), reviewerInput, true);
            reviewerJsonResults.put(reviewerInput.reviewer, result.result);
            if (result.result.error != null) {
                logger.atFine().log("Adding %s as reviewer failed: %s", reviewerInput.reviewer, result.result.error);
                hasError = true;
                continue;
            }
            if (result.result.confirm != null) {
                logger.atFine().log("Adding %s as reviewer requires confirmation", reviewerInput.reviewer);
                confirm = true;
                continue;
            }
            logger.atFine().log("Adding %s as reviewer was prepared", reviewerInput.reviewer);
            reviewerResults.add(result);
        }
    }
    ReviewResult output = new ReviewResult();
    output.reviewers = reviewerJsonResults;
    if (hasError || confirm) {
        output.error = ERROR_ADDING_REVIEWER;
        return Response.withStatusCode(SC_BAD_REQUEST, output);
    }
    output.labels = input.labels;
    try (BatchUpdate bu = updateFactory.create(revision.getChange().getProject(), revision.getUser(), ts)) {
        Account account = revision.getUser().asIdentifiedUser().getAccount();
        boolean ccOrReviewer = false;
        if (input.labels != null && !input.labels.isEmpty()) {
            ccOrReviewer = input.labels.values().stream().anyMatch(v -> v != 0);
            if (ccOrReviewer) {
                logger.atFine().log("calling user is cc/reviewer on the change due to voting on a label");
            }
        }
        if (!ccOrReviewer) {
            // Check if user was already CCed or reviewing prior to this review.
            ReviewerSet currentReviewers = approvalsUtil.getReviewers(revision.getChangeResource().getNotes());
            ccOrReviewer = currentReviewers.all().contains(account.id());
            if (ccOrReviewer) {
                logger.atFine().log("calling user is already cc/reviewer on the change");
            }
        }
        // Apply reviewer changes first. Revision emails should be sent to the
        // updated set of reviewers. Also keep track of whether the user added
        // themselves as a reviewer or to the CC list.
        logger.atFine().log("adding reviewer additions");
        for (ReviewerModification reviewerResult : reviewerResults) {
            // Send a single batch email below.
            reviewerResult.op.suppressEmail();
            // Send events below, if possible as batch.
            reviewerResult.op.suppressEvent();
            bu.addOp(revision.getChange().getId(), reviewerResult.op);
            if (!ccOrReviewer && reviewerResult.reviewers.contains(account)) {
                logger.atFine().log("calling user is explicitly added as reviewer or CC");
                ccOrReviewer = true;
            }
        }
        if (!ccOrReviewer) {
            // User posting this review isn't currently in the reviewer or CC list,
            // isn't being explicitly added, and isn't voting on any label.
            // Automatically CC them on this change so they receive replies.
            logger.atFine().log("CCing calling user");
            ReviewerModification selfAddition = reviewerModifier.ccCurrentUser(revision.getUser(), revision);
            selfAddition.op.suppressEmail();
            selfAddition.op.suppressEvent();
            bu.addOp(revision.getChange().getId(), selfAddition.op);
        }
        // Add WorkInProgressOp if requested.
        if ((input.ready || input.workInProgress) && didWorkInProgressChange(revision.getChange().isWorkInProgress(), input)) {
            if (input.ready && input.workInProgress) {
                output.error = ERROR_WIP_READY_MUTUALLY_EXCLUSIVE;
                return Response.withStatusCode(SC_BAD_REQUEST, output);
            }
            revision.getChangeResource().permissions().check(ChangePermission.TOGGLE_WORK_IN_PROGRESS_STATE);
            if (input.ready) {
                output.ready = true;
            }
            logger.atFine().log("setting work-in-progress to %s", input.workInProgress);
            WorkInProgressOp wipOp = workInProgressOpFactory.create(input.workInProgress, new WorkInProgressOp.Input());
            wipOp.suppressEmail();
            bu.addOp(revision.getChange().getId(), wipOp);
        }
        // Add the review op.
        logger.atFine().log("posting review");
        bu.addOp(revision.getChange().getId(), new Op(projectState, revision.getPatchSet().id(), input));
        // Notify based on ReviewInput, ignoring the notify settings from any ReviewerInputs.
        NotifyResolver.Result notify = notifyResolver.resolve(input.notify, input.notifyDetails);
        bu.setNotify(notify);
        // Adjust the attention set based on the input
        replyAttentionSetUpdates.updateAttentionSet(bu, revision.getNotes(), input, revision.getUser());
        bu.execute();
        // Re-read change to take into account results of the update.
        ChangeData cd = changeDataFactory.create(revision.getProject(), revision.getChange().getId());
        for (ReviewerModification reviewerResult : reviewerResults) {
            reviewerResult.gatherResults(cd);
        }
        // Sending emails and events from ReviewersOps was suppressed so we can send a single batch
        // email/event here.
        batchEmailReviewers(revision.getUser(), revision.getChange(), reviewerResults, notify);
        batchReviewerEvents(revision.getUser(), cd, revision.getPatchSet(), reviewerResults, ts);
    }
    return Response.ok(output);
}
Also used : ON_BEHALF_OF(com.google.gerrit.server.permissions.LabelPermission.ForUser.ON_BEHALF_OF) Whitespace(com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace) ProjectCache(com.google.gerrit.server.project.ProjectCache) Comment(com.google.gerrit.entities.Comment) FixSuggestion(com.google.gerrit.entities.FixSuggestion) BadRequestException(com.google.gerrit.extensions.restapi.BadRequestException) PermissionBackend(com.google.gerrit.server.permissions.PermissionBackend) ReviewResult(com.google.gerrit.extensions.api.changes.ReviewResult) ReviewerSet(com.google.gerrit.server.ReviewerSet) DiffSummaryKey(com.google.gerrit.server.patch.DiffSummaryKey) Config(org.eclipse.jgit.lib.Config) Map(java.util.Map) FixReplacement(com.google.gerrit.entities.FixReplacement) DraftHandling(com.google.gerrit.extensions.api.changes.ReviewInput.DraftHandling) Side(com.google.gerrit.extensions.client.Side) Metadata(com.google.gerrit.server.logging.Metadata) GerritServerConfig(com.google.gerrit.server.config.GerritServerConfig) TraceContext(com.google.gerrit.server.logging.TraceContext) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) Set(java.util.Set) Collectors.joining(java.util.stream.Collectors.joining) NotifyHandling(com.google.gerrit.extensions.api.changes.NotifyHandling) Stream(java.util.stream.Stream) CommentAdded(com.google.gerrit.server.extensions.events.CommentAdded) AutoValue(com.google.auto.value.AutoValue) DiffSummary(com.google.gerrit.server.patch.DiffSummary) PluginSetContext(com.google.gerrit.server.plugincontext.PluginSetContext) Counter1(com.google.gerrit.metrics.Counter1) MetricMaker(com.google.gerrit.metrics.MetricMaker) PatchListKey(com.google.gerrit.server.patch.PatchListKey) FluentLogger(com.google.common.flogger.FluentLogger) Joiner(com.google.common.base.Joiner) ChangeMessagesUtil(com.google.gerrit.server.ChangeMessagesUtil) Singleton(com.google.inject.Singleton) AccountCache(com.google.gerrit.server.account.AccountCache) PermissionBackendException(com.google.gerrit.server.permissions.PermissionBackendException) ConfigInvalidException(org.eclipse.jgit.errors.ConfigInvalidException) ReviewerResult(com.google.gerrit.extensions.api.changes.ReviewerResult) UnprocessableEntityException(com.google.gerrit.extensions.restapi.UnprocessableEntityException) Collectors.groupingBy(java.util.stream.Collectors.groupingBy) CommentsUtil(com.google.gerrit.server.CommentsUtil) CommentForValidation(com.google.gerrit.extensions.validators.CommentForValidation) Response(com.google.gerrit.extensions.restapi.Response) ArrayList(java.util.ArrayList) PATCHSET_LEVEL(com.google.gerrit.entities.Patch.PATCHSET_LEVEL) Strings(com.google.common.base.Strings) ReviewerInput(com.google.gerrit.extensions.api.changes.ReviewerInput) Lists(com.google.common.collect.Lists) ReviewerModification(com.google.gerrit.server.change.ReviewerModifier.ReviewerModification) Description(com.google.gerrit.metrics.Description) ImmutableSet.toImmutableSet(com.google.common.collect.ImmutableSet.toImmutableSet) PatchSet(com.google.gerrit.entities.PatchSet) RestApiException(com.google.gerrit.extensions.restapi.RestApiException) Address(com.google.gerrit.entities.Address) REVIEWER(com.google.gerrit.server.notedb.ReviewerStateInternal.REVIEWER) ProjectCache.illegalState(com.google.gerrit.server.project.ProjectCache.illegalState) NotifyResolver(com.google.gerrit.server.change.NotifyResolver) HashCode(com.google.common.hash.HashCode) Result(com.google.gerrit.server.change.ReviewerOp.Result) PatchListCache(com.google.gerrit.server.patch.PatchListCache) StorageException(com.google.gerrit.exceptions.StorageException) CommentValidationFailure(com.google.gerrit.extensions.validators.CommentValidationFailure) ChangeNotes(com.google.gerrit.server.notedb.ChangeNotes) IOException(java.io.IOException) RobotCommentInput(com.google.gerrit.extensions.api.changes.ReviewInput.RobotCommentInput) ChangeUpdate(com.google.gerrit.server.notedb.ChangeUpdate) IdentifiedUser(com.google.gerrit.server.IdentifiedUser) ReviewInput(com.google.gerrit.extensions.api.changes.ReviewInput) LabelVote(com.google.gerrit.server.util.LabelVote) SC_BAD_REQUEST(javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST) TimeUtil(com.google.gerrit.server.util.time.TimeUtil) CommentValidator(com.google.gerrit.extensions.validators.CommentValidator) AccountState(com.google.gerrit.server.account.AccountState) Patch(com.google.gerrit.entities.Patch) Inject(com.google.inject.Inject) HumanComment(com.google.gerrit.entities.HumanComment) UpdateException(com.google.gerrit.server.update.UpdateException) RestModifyView(com.google.gerrit.extensions.restapi.RestModifyView) PatchSetApproval(com.google.gerrit.entities.PatchSetApproval) LabelTypes(com.google.gerrit.entities.LabelTypes) BatchUpdate(com.google.gerrit.server.update.BatchUpdate) LabelType(com.google.gerrit.entities.LabelType) AuthException(com.google.gerrit.extensions.restapi.AuthException) ReviewerModifier(com.google.gerrit.server.change.ReviewerModifier) Collectors.toSet(java.util.stream.Collectors.toSet) Timestamp(java.sql.Timestamp) Collection(java.util.Collection) Account(com.google.gerrit.entities.Account) Streams(com.google.common.collect.Streams) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) ApprovalsUtil(com.google.gerrit.server.approval.ApprovalsUtil) Objects(java.util.Objects) ChangeData(com.google.gerrit.server.query.change.ChangeData) List(java.util.List) Nullable(com.google.gerrit.common.Nullable) FixSuggestionInfo(com.google.gerrit.extensions.common.FixSuggestionInfo) Url(com.google.gerrit.extensions.restapi.Url) Optional(java.util.Optional) MoreObjects.firstNonNull(com.google.common.base.MoreObjects.firstNonNull) BatchUpdateOp(com.google.gerrit.server.update.BatchUpdateOp) LabelPermission(com.google.gerrit.server.permissions.LabelPermission) PatchListNotAvailableException(com.google.gerrit.server.patch.PatchListNotAvailableException) WorkInProgressOp(com.google.gerrit.server.change.WorkInProgressOp) CommentValidationContext(com.google.gerrit.extensions.validators.CommentValidationContext) PublishCommentUtil(com.google.gerrit.server.PublishCommentUtil) ChangePermission(com.google.gerrit.server.permissions.ChangePermission) Hashing(com.google.common.hash.Hashing) ReviewerState(com.google.gerrit.extensions.client.ReviewerState) HashMap(java.util.HashMap) HashSet(java.util.HashSet) CommentsRejectedException(com.google.gerrit.server.update.CommentsRejectedException) ImmutableList(com.google.common.collect.ImmutableList) ChangeResource(com.google.gerrit.server.change.ChangeResource) PostUpdateContext(com.google.gerrit.server.update.PostUpdateContext) CommentInput(com.google.gerrit.extensions.api.changes.ReviewInput.CommentInput) Range(com.google.gerrit.extensions.client.Comment.Range) RobotComment(com.google.gerrit.entities.RobotComment) Field(com.google.gerrit.metrics.Field) Change(com.google.gerrit.entities.Change) ChangeUtil(com.google.gerrit.server.ChangeUtil) ChangeContext(com.google.gerrit.server.update.ChangeContext) ModifyReviewersEmail(com.google.gerrit.server.change.ModifyReviewersEmail) FixReplacementInfo(com.google.gerrit.extensions.common.FixReplacementInfo) CurrentUser(com.google.gerrit.server.CurrentUser) AccountResolver(com.google.gerrit.server.account.AccountResolver) Iterator(java.util.Iterator) UTF_8(java.nio.charset.StandardCharsets.UTF_8) ReviewerAdded(com.google.gerrit.server.extensions.events.ReviewerAdded) ProjectState(com.google.gerrit.server.project.ProjectState) Maps(com.google.common.collect.Maps) ObjectId(org.eclipse.jgit.lib.ObjectId) Collectors.toList(java.util.stream.Collectors.toList) Ordering(com.google.common.collect.Ordering) ResourceConflictException(com.google.gerrit.extensions.restapi.ResourceConflictException) RevisionResource(com.google.gerrit.server.change.RevisionResource) PatchSetUtil(com.google.gerrit.server.PatchSetUtil) EmailReviewComments(com.google.gerrit.server.change.EmailReviewComments) Collections(java.util.Collections) Account(com.google.gerrit.entities.Account) BatchUpdateOp(com.google.gerrit.server.update.BatchUpdateOp) WorkInProgressOp(com.google.gerrit.server.change.WorkInProgressOp) LabelTypes(com.google.gerrit.entities.LabelTypes) NotifyResolver(com.google.gerrit.server.change.NotifyResolver) ReviewerResult(com.google.gerrit.extensions.api.changes.ReviewerResult) ReviewResult(com.google.gerrit.extensions.api.changes.ReviewResult) WorkInProgressOp(com.google.gerrit.server.change.WorkInProgressOp) ChangeData(com.google.gerrit.server.query.change.ChangeData) BatchUpdate(com.google.gerrit.server.update.BatchUpdate) ResourceConflictException(com.google.gerrit.extensions.restapi.ResourceConflictException) ReviewerSet(com.google.gerrit.server.ReviewerSet) ProjectState(com.google.gerrit.server.project.ProjectState) ReviewerModification(com.google.gerrit.server.change.ReviewerModifier.ReviewerModification) ReviewerInput(com.google.gerrit.extensions.api.changes.ReviewerInput)

Aggregations

ProjectState (com.google.gerrit.server.project.ProjectState)86 Project (com.google.gerrit.entities.Project)20 ResourceConflictException (com.google.gerrit.extensions.restapi.ResourceConflictException)19 IOException (java.io.IOException)18 Repository (org.eclipse.jgit.lib.Repository)18 AuthException (com.google.gerrit.extensions.restapi.AuthException)16 ResourceNotFoundException (com.google.gerrit.extensions.restapi.ResourceNotFoundException)14 PermissionBackendException (com.google.gerrit.server.permissions.PermissionBackendException)14 AbstractDaemonTest (com.google.gerrit.acceptance.AbstractDaemonTest)13 Change (com.google.gerrit.entities.Change)13 ObjectId (org.eclipse.jgit.lib.ObjectId)13 Test (org.junit.Test)13 BadRequestException (com.google.gerrit.extensions.restapi.BadRequestException)12 ChangeData (com.google.gerrit.server.query.change.ChangeData)11 Inject (com.google.inject.Inject)10 ConfigInvalidException (org.eclipse.jgit.errors.ConfigInvalidException)10 RepositoryNotFoundException (org.eclipse.jgit.errors.RepositoryNotFoundException)10 StorageException (com.google.gerrit.exceptions.StorageException)9 ProjectInfo (com.google.gerrit.extensions.common.ProjectInfo)9 ProjectResource (com.google.gerrit.server.project.ProjectResource)9