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


##########
.github/workflows/docker-build-ci.yml:
##########
@@ -78,3 +86,34 @@ jobs:
             echo "ERROR: no usable socket-table tool (ss/netstat) in ${{ 
matrix.dockerfile }}"
             exit 1
           }
+
+      - name: Server image API versions match source
+        if: ${{ startsWith(matrix.dockerfile, 'hugegraph-server/') }}
+        run: |
+          CHECK_DIR=$(mktemp -d)
+          trap 'rm -rf "$CHECK_DIR"' EXIT
+          docker run --rm --entrypoint bash \
+            -v "$CHECK_DIR:/check" "$IMAGE_ID" -c \
+            'cp /hugegraph-server/lib/hugegraph-api-*.jar \
+                /hugegraph-server/lib/hugegraph-common-*.jar /check/'
+
+          API_JAR=$(find "$CHECK_DIR" -name 'hugegraph-api-*.jar' -print -quit)
+          COMMON_JAR=$(find "$CHECK_DIR" -name 'hugegraph-common-*.jar' -print 
-quit)
+          EXPECTED_MANIFEST=$(sed -n \
+            
's|.*<Implementation-Version>\([^<]*\)</Implementation-Version>.*|\1|p' \
+            hugegraph-server/hugegraph-api/pom.xml)
+          ACTUAL_MANIFEST=$(unzip -p "$API_JAR" META-INF/MANIFEST.MF |
+            sed -n 's/^Implementation-Version: *//p' | tr -d '\r')
+          EXPECTED_PROPERTY=$(sed -n 's/^ApiVersion=//p' \
+            
hugegraph-commons/hugegraph-common/src/main/resources/version.properties)
+          ACTUAL_PROPERTY=$(unzip -p "$COMMON_JAR" version.properties |
+            sed -n 's/^ApiVersion=//p' | tr -d '\r')
+
+          [[ "$ACTUAL_MANIFEST" == "$EXPECTED_MANIFEST" ]] || {

Review Comment:
   Verified on the exact final-head HStore image. Pod imageID is 
`docker-pullable://hugegraph/server@sha256:4111ad8291604de449ff74ec649b3b66eb21cd48c47418e2fc0bc0b4c4c3ce2e`,
 built with revision label `6851b1cd49f1770f6f27152e468a6e58c933af79`. Helm 
test called `/versions` and received `"api":"0.72.0.0"`, then `/graphs` 
returned `hugegraph`; the hook completed successfully.



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