Revert "restapi: add an alternative CreateChange endpoint"

This reverts commit 44c724e185.

Reason for revert: this did not fix our slowness problem, which
was slow CreateChange calls on Android's platform/frameworks/base
when specifying a merge. On closer inspection, generating the merge
reads too much data.

Change-Id: I9fb9a074bc7ae9da13ef262a5a9a7a2596ec0387
This commit is contained in:
Han-Wen Nienhuys
2019-10-30 17:15:39 +00:00
committed by David Pursehouse
parent e2be01cde7
commit fccb35cf19
6 changed files with 8 additions and 185 deletions

View File

@@ -69,7 +69,6 @@ public class ProjectsRestApiBindingsIT extends AbstractDaemonTest {
RestCall.get("/projects/%s/statistics.git"),
RestCall.post("/projects/%s/index"),
RestCall.post("/projects/%s/gc"),
RestCall.post("/projects/%s/create.change"),
RestCall.get("/projects/%s/children"),
RestCall.get("/projects/%s/branches"),
RestCall.post("/projects/%s/branches:delete"),

View File

@@ -1,46 +0,0 @@
// Copyright (C) 2019 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.acceptance.rest.project;
import static com.google.common.truth.Truth8.assertThat;
import static com.google.gerrit.entities.RefNames.REFS_HEADS;
import com.google.gerrit.acceptance.AbstractDaemonTest;
import com.google.gerrit.acceptance.RestResponse;
import com.google.gerrit.extensions.api.projects.BranchInput;
import com.google.gerrit.extensions.common.ChangeInput;
import org.junit.Test;
public class CreateChangeIT extends AbstractDaemonTest {
// Just a basic test. The real functionality is tested under the restapi.change acceptance tests.
@Test
public void basic() throws Exception {
BranchInput branchInput = new BranchInput();
branchInput.ref = "foo";
assertThat(gApi.projects().name(project.get()).branches().get().stream().map(i -> i.ref))
.doesNotContain(REFS_HEADS + branchInput.ref);
RestResponse r =
adminRestSession.put(
"/projects/" + project.get() + "/branches/" + branchInput.ref, branchInput);
r.assertCreated();
ChangeInput input = new ChangeInput();
input.branch = "foo";
input.subject = "subject";
RestResponse cr = adminRestSession.post("/projects/" + project.get() + "/create.change", input);
cr.assertCreated();
}
}