Allow to specify a message when the private flag on a change is set/unset

This allows users to explain why the private flag on a change was
set/unset.

Since the requests to set/unset the private flags can have a request
body now, POST is more appropriate than PUT. Changing this is okay,
since the support for private flags was not released yet.

Since some proxies prohibit request bodies for DELETE requests offer
deletion of the private flag also as POST request on
/changes/<id>/private.delete.

The setPrivate method in ChangeApi is changed, which is okay since it
wasn't included into any release yet.

The UI doesn't offer to specify a message yet when the private flag is
set/unset but this may be implemented in a follow-up change.

Change-Id: Ib201114ffa397a313bca565d7fb52767b4c9197c
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2017-04-27 12:34:00 +02:00
parent 75c9189fc2
commit 364a86bafa
11 changed files with 127 additions and 38 deletions

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.extensions.api.changes;
import com.google.gerrit.common.Nullable;
import com.google.gerrit.extensions.client.ListChangesOption;
import com.google.gerrit.extensions.common.AccountInfo;
import com.google.gerrit.extensions.common.ChangeInfo;
@@ -85,7 +86,7 @@ public interface ChangeApi {
void move(MoveInput in) throws RestApiException;
void setPrivate(boolean value) throws RestApiException;
void setPrivate(boolean value, @Nullable String message) throws RestApiException;
void setWorkInProgress(String message) throws RestApiException;
@@ -335,7 +336,7 @@ public interface ChangeApi {
}
@Override
public void setPrivate(boolean value) {
public void setPrivate(boolean value, @Nullable String message) {
throw new NotImplementedException();
}