Allow forcing mergeability check through the REST API.
Due to bugs like I8aeb0c87, some changes might end up with incorrect values of the mergeable flag. They should normally correct themselves as the branch advances, but provide an option to the /mergeable endpoint for the impatient. Change-Id: I961f9dccf67373946b153bb99f4fdac73f38cac4
This commit is contained in:
parent
e45a70023b
commit
5d44ddce9f
@ -1852,6 +1852,9 @@ As response a link:#mergeable-info[MergeableInfo] entity is returned.
|
||||
If the `other-branches` parameter is specified, the mergeability will also be
|
||||
checked for all other branches.
|
||||
|
||||
If the `force` parameter is specified, the mergeability against the destination
|
||||
will be rechecked, in case of prior transient failures or bugs.
|
||||
|
||||
.Request
|
||||
----
|
||||
GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable?other-branches HTTP/1.0
|
||||
|
@ -73,6 +73,12 @@ public class Mergeable implements RestReadView<RevisionResource> {
|
||||
usage = "test mergeability for other branches too")
|
||||
private boolean otherBranches;
|
||||
|
||||
@Option(name = "--force", aliases = {"-f"},
|
||||
usage = "force recheck of mergeable field")
|
||||
public void setForce(boolean force) {
|
||||
this.force = force;
|
||||
}
|
||||
|
||||
private final TestSubmitType.Get submitType;
|
||||
private final GitRepositoryManager gitManager;
|
||||
private final ProjectCache projectCache;
|
||||
@ -97,10 +103,6 @@ public class Mergeable implements RestReadView<RevisionResource> {
|
||||
this.indexer = indexer;
|
||||
}
|
||||
|
||||
public void setForce(boolean force) {
|
||||
this.force = force;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MergeableInfo apply(RevisionResource resource) throws AuthException,
|
||||
ResourceConflictException, BadRequestException, OrmException, IOException {
|
||||
|
Loading…
Reference in New Issue
Block a user