Allow to remove specific scores while leaving the reviewer listed

Currently only removal of reviewers is supported. This change implements
removal of specific scores while leaving the reviewer still listed on
the change.

Reviewer API is added for listing and deleting votes.

Bug: Issue 3035
Change-Id: Ie4f05fafb73a32835708a76eb86cfacf8ff5c670
This commit is contained in:
David Ostrovsky
2014-12-13 00:24:29 +01:00
committed by Edwin Kempin
parent 6f7ccf5409
commit beb0b84af8
17 changed files with 669 additions and 25 deletions

View File

@@ -58,6 +58,19 @@ public interface ChangeApi {
*/
RevisionApi revision(String id) throws RestApiException;
/**
* Look up the reviewer of the change.
* <p>
* @param id ID of the account, can be a string of the format
* "Full Name <mail@example.com>", just the email address, a full name
* if it is unique, an account ID, a user name or 'self' for the
* calling user.
* @return API for accessing the reviewer.
* @throws RestApiException if id is not account ID or is a user that isn't
* known to be a reviewer for this change.
*/
ReviewerApi reviewer(String id) throws RestApiException;
void abandon() throws RestApiException;
void abandon(AbandonInput in) throws RestApiException;
@@ -176,6 +189,11 @@ public interface ChangeApi {
throw new NotImplementedException();
}
@Override
public ReviewerApi reviewer(String id) throws RestApiException {
throw new NotImplementedException();
}
@Override
public RevisionApi revision(String id) throws RestApiException {
throw new NotImplementedException();

View File

@@ -0,0 +1,25 @@
// Copyright (C) 2014 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.extensions.api.changes;
import com.google.gerrit.extensions.restapi.RestApiException;
import java.util.Map;
public interface ReviewerApi {
Map<String, Short> votes() throws RestApiException;
void deleteVote(String label) throws RestApiException;
}