imbajin commented on code in PR #3322:
URL: https://github.com/apache/hugegraph/pull/3322#discussion_r4250600983


##########
hugegraph-server/hugegraph-dist/docker/docker-entrypoint-test.sh:
##########
@@ -329,5 +329,102 @@ done
 )
 assert_start_timeout 120
 
+# Identity mappings apply on every start and leave mounted config alone when 
unset.
+identity_conf="${TEST_HOME}/conf/rest-server.properties"
+printf 
'\nserver.service_id=mounted-service\nserver.graphspace=mounted_space\n' >> 
"${identity_conf}"
+(cd "${TEST_HOME}"; bash ./docker-entrypoint.sh)
+grep -qx 'server.service_id=mounted-service' "${identity_conf}"
+grep -qx 'server.graphspace=mounted_space' "${identity_conf}"
+(cd "${TEST_HOME}"; HG_SERVER_SERVICE_ID=DEFAULT HG_SERVER_GRAPHSPACE=DEFAULT \
+    bash ./docker-entrypoint.sh)
+grep -qx 'server.service_id=DEFAULT' "${identity_conf}"
+grep -qx 'server.graphspace=DEFAULT' "${identity_conf}"
+(cd "${TEST_HOME}"; HG_SERVER_SERVICE_ID=service-a 
HG_SERVER_GRAPHSPACE=space_a bash ./docker-entrypoint.sh)
+grep -qx 'server.service_id=service-a' "${identity_conf}"
+grep -qx 'server.graphspace=space_a' "${identity_conf}"
+(cd "${TEST_HOME}"; SERVICE_ID=legacy-service GRAPH_SPACE=legacy_space bash 
./docker-entrypoint.sh)
+grep -qx 'server.service_id=legacy-service' "${identity_conf}"
+grep -qx 'server.graphspace=legacy_space' "${identity_conf}"
+(cd "${TEST_HOME}"; SERVICE_ID=legacy-service GRAPH_SPACE=legacy_space \
+    HG_SERVER_SERVICE_ID=service-b HG_SERVER_GRAPHSPACE=space_b bash 
./docker-entrypoint.sh)
+grep -qx 'server.service_id=service-b' "${identity_conf}"
+grep -qx 'server.graphspace=space_b' "${identity_conf}"
+(cd "${TEST_HOME}"; HG_SERVER_SERVICE_ID= HG_SERVER_GRAPHSPACE= bash 
./docker-entrypoint.sh)
+grep -qx 'server.service_id=service-b' "${identity_conf}"
+grep -qx 'server.graphspace=space_b' "${identity_conf}"
+
+# Empty new variables still allow the legacy driver values to apply.
+(cd "${TEST_HOME}"; HG_SERVER_SERVICE_ID= HG_SERVER_GRAPHSPACE= \
+    SERVICE_ID=legacy-empty GRAPH_SPACE=legacy_empty bash 
./docker-entrypoint.sh)
+grep -qx 'server.service_id=legacy-empty' "${identity_conf}"
+grep -qx 'server.graphspace=legacy_empty' "${identity_conf}"
+
+# Service permits spaces; Unicode escapes round-trip through the Server parser.
+(cd "${TEST_HOME}"; HG_SERVER_SERVICE_ID='ops team' bash 
./docker-entrypoint.sh)
+grep -Fxq 'server.service_id=ops\u0020team' "${identity_conf}"

Review Comment:
   ⚠️ Important. Blocking: no. Summary: These assertions only inspect the 
serialized `\u0020` text; please add a readback through the pinned 
`HugeConfig`/Commons Configuration path for interior and edge spaces, including 
a backslash, so CI verifies the service ID the Server loads. Evidence: 
`start-hugegraph.sh` and `wait_for_startup` are stubs in this fixture, and the 
added assertions grep `rest-server.properties` without parsing it.



-- 
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