Copilot commented on code in PR #2797:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2797#discussion_r2163524235


##########
hugegraph-server/hugegraph-dist/src/assembly/travis/start-store.sh:
##########
@@ -18,7 +18,18 @@
 set -ev
 
 HOME_DIR=$(pwd)
-STORE_DIR=$HOME_DIR/hugegraph-store/apache-hugegraph-store-incubating-1.5.0
+
+PROPERTIES_FILE="$HOME_DIR/hugegraph-commons/hugegraph-common/src/main/resources/version.properties"
+if [ -f "$PROPERTIES_FILE" ]; then
+    set -a
+    source "$PROPERTIES_FILE"
+    set +a
+else
+    echo "Error: properties file not found at $PROPERTIES_FILE"
+    exit 1
+fi
+
+STORE_DIR=$HOME_DIR/hugegraph-store/apache-hugegraph-store-incubating-$VersionInBash

Review Comment:
   The logic to source and use version.properties is duplicated in both 
start-store.sh and start-pd.sh; consider extracting this into a common shell 
function or script to improve maintainability and reduce redundancy.



##########
hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/server/ApplicationConfig.java:
##########
@@ -95,7 +93,46 @@ public ApplicationConfig(HugeConfig conf, EventHub hub) {
         MetricRegistry registry = MetricManager.INSTANCE.getRegistry();
         register(new InstrumentedResourceMethodApplicationListener(registry));
 
-        // Register OpenApi file to support display on swagger-ui
+        OpenAPI openAPI = new OpenAPI();
+        Info info = new Info()
+            .title("HugeGraph RESTful API")
+            .version(CoreVersion.DEFAULT_VERSION)
+            .description("All management API for HugeGraph")
+            .contact(new io.swagger.v3.oas.models.info.Contact()
+                .name("HugeGraph")
+                .url("https://github.com/apache/hugegraph";)); 
+
+        openAPI.setInfo(info);
+        openAPI.addSecurityItem(new SecurityRequirement().addList("basic"));
+        openAPI.addSecurityItem(new SecurityRequirement().addList("bearer"));
+        
+        SwaggerConfiguration oasConfig = new SwaggerConfiguration()
+                .openAPI(openAPI)
+                .prettyPrint(true);
+        register(new ApplicationEventListener() {

Review Comment:
   [nitpick] The inline implementation of ApplicationEventListener is lengthy; 
consider extracting it into a separate named class to enhance readability and 
simplify the ApplicationConfig constructor.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to