Merge pull request #2 from zaro0508/rename-rest-endpoint
Rename rest endpoint
diff --git a/src/main/java/com/googlesource/gerrit/plugins/zuul/DependencyInfo.java b/src/main/java/com/googlesource/gerrit/plugins/zuul/CrdInfo.java
similarity index 96%
rename from src/main/java/com/googlesource/gerrit/plugins/zuul/DependencyInfo.java
rename to src/main/java/com/googlesource/gerrit/plugins/zuul/CrdInfo.java
index 72c305f..3788684 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/zuul/DependencyInfo.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/zuul/CrdInfo.java
@@ -16,7 +16,7 @@
import java.util.List;
-public class DependencyInfo {
+public class CrdInfo {
public List<String> dependsOn;
public List<String> neededBy;
public boolean cycle;
diff --git a/src/main/java/com/googlesource/gerrit/plugins/zuul/GetDependency.java b/src/main/java/com/googlesource/gerrit/plugins/zuul/GetCrd.java
similarity index 92%
rename from src/main/java/com/googlesource/gerrit/plugins/zuul/GetDependency.java
rename to src/main/java/com/googlesource/gerrit/plugins/zuul/GetCrd.java
index bdfa2bc..cae884c 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/zuul/GetDependency.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/zuul/GetCrd.java
@@ -42,23 +42,23 @@
import java.util.regex.Pattern;
@Singleton
-public class GetDependency implements RestReadView<RevisionResource> {
+public class GetCrd implements RestReadView<RevisionResource> {
private final ChangesCollection changes;
private final GitRepositoryManager repoManager;
@Inject
- GetDependency(ChangesCollection changes, GitRepositoryManager repoManager) {
+ GetCrd(ChangesCollection changes, GitRepositoryManager repoManager) {
this.changes = changes;
this.repoManager = repoManager;
}
@Override
@SuppressWarnings("unchecked")
- public DependencyInfo apply(RevisionResource rsrc)
+ public CrdInfo apply(RevisionResource rsrc)
throws RepositoryNotFoundException, IOException, BadRequestException,
AuthException, OrmException {
- DependencyInfo out = new DependencyInfo();
+ CrdInfo out = new CrdInfo();
out.dependsOn = new ArrayList<>();
out.neededBy = new ArrayList<>();
diff --git a/src/main/java/com/googlesource/gerrit/plugins/zuul/Module.java b/src/main/java/com/googlesource/gerrit/plugins/zuul/Module.java
index fe0f020..ee40f88 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/zuul/Module.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/zuul/Module.java
@@ -26,7 +26,7 @@
install(new RestApiModule() {
@Override
protected void configure() {
- get(REVISION_KIND, "dependency").to(GetDependency.class);
+ get(REVISION_KIND, "crd").to(GetCrd.class);
}
});
}
diff --git a/src/main/java/com/googlesource/gerrit/plugins/zuul/client/LabelPanel.java b/src/main/java/com/googlesource/gerrit/plugins/zuul/client/LabelPanel.java
index aa56c1c..6882003 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/zuul/client/LabelPanel.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/zuul/client/LabelPanel.java
@@ -46,7 +46,7 @@
if (!rev.isEdit()) {
new RestApi("changes").id(change.id()).view("revisions").id(rev.id())
- .view(Plugin.get().getPluginName(), "dependency")
+ .view(Plugin.get().getPluginName(), "crd")
.get(new AsyncCallback<DependencyInfo>() {
@Override
public void onSuccess(DependencyInfo result) {
diff --git a/src/main/resources/Documentation/rest-api-changes.md b/src/main/resources/Documentation/rest-api-changes.md
index b754ac1..4f24231 100644
--- a/src/main/resources/Documentation/rest-api-changes.md
+++ b/src/main/resources/Documentation/rest-api-changes.md
@@ -10,18 +10,18 @@
<a id="plugin-endpoints"> @PLUGIN@ Endpoints
--------------------------------------------
-### <a id="get-dependency"> Get Dependency
+### <a id="get-crd"> Get CRD
-__GET__ /changes/{change-id}/revisions/{revision-id}/@PLUGIN@~dependency
+__GET__ /changes/{change-id}/revisions/{revision-id}/@PLUGIN@~crd
-Gets the zuul [dependency](#dependency-info) for a change. Please refer to the
+Gets the zuul [CRD](#crd-info) for a change. Please refer to the
general [changes rest api](../../../Documentation/rest-api-changes.html#get-review)
for additional info on this request.
#### Request
```
- GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/@PLUGIN@~dependency HTTP/1.0
+ GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/@PLUGIN@~crd HTTP/1.0
```
#### Response
@@ -47,9 +47,9 @@
<a id="json-entities">JSON Entities
-----------------------------------
-### <a id="dependency-info"></a>DependencyInfo
+### <a id="crd-info"></a>CrdInfo
-The `DependencyInfo` entity shows zuul dependencies on a patch set.
+The `CrdInfo` entity shows zuul dependencies on a patch set.
|Field Name |Description|
|:----------|:----------|