Skip to content

Commit cfe3333

Browse files
authored
chore: bump project version from 1.5.0 to 1.7.0 (#72)
* chore(server): improve log clarity and add null checks in api * chore: bump version from 1.5.0 to 1.7.0 * chore: add todo in common pom.xml
1 parent 86c5f61 commit cfe3333

9 files changed

Lines changed: 28 additions & 16 deletions

File tree

hugegraph-commons/hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestResult.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public class RestResult {
3737

3838
static {
3939
MAPPER.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
40+
// NOTE: jackson will synchronize DateFormat
4041
MAPPER.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"));
4142
}
4243

hugegraph-commons/hugegraph-common/src/main/java/org/apache/hugegraph/util/JsonUtilCommon.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public final class JsonUtilCommon {
4040

4141
static {
4242
MAPPER.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
43+
// NOTE: jackson will synchronize DateFormat
4344
MAPPER.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"));
4445
}
4546

hugegraph-commons/hugegraph-common/src/main/resources/version.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
Version=${revision}
2020
ApiVersion=0.71
2121
ApiCheckBeginVersion=1.0
22-
ApiCheckEndVersion=1.7
23-
VersionInBash=1.5.0
22+
ApiCheckEndVersion=2.0
23+
VersionInBash=1.7.0

hugegraph-commons/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@
9090

9191
<properties>
9292
<!-- Note: We need also update the version in CommonVersion.java & RpcVersion.java now -->
93-
<revision>1.5.0</revision>
93+
<!-- TODO: Remove the revision property below after verifying parent POM inheritance works correctly -->
94+
<revision>1.7.0</revision>
9495
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
9596
<top.level.dir>${project.basedir}/..</top.level.dir>
9697
<compiler.source>1.8</compiler.source>

hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/filter/AuthenticationFilter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ private boolean matchPermission(String required) {
330330
if (!valid &&
331331
!required.equals(HugeAuthenticator.USER_ADMIN)) {
332332
LOG.info(
333+
"Permission denied for user '{}', action '{}', resource '{}'",
333334
user.userId().asString(),
334335
requiredPerm.action().string(),
335336
requiredPerm.resourceObject());

hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/profile/GraphsAPI.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,18 @@ public Object create(@Context GraphManager manager,
186186
HugeGraph graph;
187187
E.checkArgumentNotNull(gs, "Not existed graph space: '%s'", graphSpace);
188188

189+
// Check required parameters for creating graph
190+
if (StringUtils.isEmpty(clone)) {
191+
// Only check required parameters when creating new graph, not when cloning
192+
E.checkArgument(configs != null, "Config parameters cannot be null");
193+
String[] requiredKeys = {"backend", "serializer", "store"};
194+
for (String key : requiredKeys) {
195+
Object value = configs.get(key);
196+
E.checkArgument(value instanceof String && !StringUtils.isEmpty((String) value),
197+
"Required parameter '%s' is missing or empty", key);
198+
}
199+
}
200+
189201
// todo: auth get actual user info
190202
String creator = "admin";
191203

@@ -198,10 +210,6 @@ public Object create(@Context GraphManager manager,
198210
graph = manager.createGraph(graphSpace, name, creator,
199211
convConfig(configs), true);
200212
}
201-
//if (gs.auth()) {
202-
// manager.authManager().createGraphDefaultRole(graphSpace,
203-
// graph.nickname());
204-
//}
205213
String description = (String) configs.get(GRAPH_DESCRIPTION);
206214
if (description == null) {
207215
description = Strings.EMPTY;

hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/space/GraphSpaceAPI.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public String create(@Context GraphManager manager,
103103

104104
jsonGraphSpace.checkCreate(false);
105105

106-
String creator = "test";
106+
String creator = "admin";
107107
GraphSpace exist = manager.graphSpace(jsonGraphSpace.name);
108108
E.checkArgument(exist == null, "The graph space '%s' has existed",
109109
jsonGraphSpace.name);
@@ -370,17 +370,17 @@ public GraphSpace toGraphSpace(String creator) {
370370
graphSpace.computeMemoryLimit(this.computeMemoryLimit);
371371
graphSpace.operatorImagePath(this.operatorImagePath);
372372
graphSpace.internalAlgorithmImageUrl(this.internalAlgorithmImageUrl);
373-
374-
graphSpace.configs(this.configs);
375-
373+
if (this.configs != null) {
374+
graphSpace.configs(this.configs);
375+
}
376376
return graphSpace;
377377
}
378378

379379
public String toString() {
380380
return String.format("JsonGraphSpace{name=%s, description=%s, " +
381381
"cpuLimit=%s, memoryLimit=%s, " +
382-
"storageLimit=%s, oltpNamespace=%s" +
383-
"olapNamespace=%s, storageNamespace=%s" +
382+
"storageLimit=%s, oltpNamespace=%s," +
383+
"olapNamespace=%s, storageNamespace=%s," +
384384
"maxGraphNumber=%s, maxRoleNumber=%s, " +
385385
"configs=%s, operatorImagePath=%s, " +
386386
"internalAlgorithmImageUrl=%s}", this.name,

hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/config/ServerOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ public class ServerOptions extends OptionHolder {
292292
public static final ConfigOption<String> SERVER_K8S_CA =
293293
new ConfigOption<>(
294294
"server.k8s_ca",
295-
"The ca file of ks8 api server.",
295+
"The ca file of k8s api server.",
296296
null,
297297
""
298298
);

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@
8787

8888
<properties>
8989
<fabric8.version>5.6.0</fabric8.version>
90-
<revision>1.5.0</revision>
91-
<hugegraph-commons.version>1.5.0</hugegraph-commons.version>
90+
<revision>1.7.0</revision>
91+
<hugegraph-commons.version>1.7.0</hugegraph-commons.version>
9292
<lombok.version>1.18.30</lombok.version>
9393
<release.name>hugegraph</release.name>
9494
<maven.compiler.source>11</maven.compiler.source>

0 commit comments

Comments
 (0)