Skip to content

Commit

Permalink
Merge branch 'master' into edge_queries_optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
msgui authored Nov 28, 2023
2 parents 89b34b3 + 197e8a0 commit 43d024a
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 16 deletions.
58 changes: 58 additions & 0 deletions .github/configs/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>github</id>
<username>${env.GITHUB_ACTOR}</username>
<password>${env.GITHUB_TOKEN}</password>
</server>
</servers>

<profiles>
<profile>
<id>local-repo</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>staged-releases</id>
<url>https://repository.apache.org/content/groups/staging/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>staged-releases</id>
<url>https://repository.apache.org/content/groups/staging/</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>

<activeProfiles>
<activeProfile>local-repo</activeProfile>
</activeProfiles>
</settings>
8 changes: 8 additions & 0 deletions .github/workflows/check-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
dependency-check:
runs-on: ubuntu-latest
env:
USE_STAGE: 'true' # Whether to include the stage repository.
SCRIPT_DEPENDENCY: hugegraph-server/hugegraph-dist/scripts/dependency
steps:
- name: Checkout source
Expand All @@ -22,6 +23,13 @@ jobs:
with:
java-version: '11'
distribution: 'adopt'

- name: use staged maven repo settings
if: ${{ env.USE_STAGE == 'true' }}
run: |
cp $HOME/.m2/settings.xml /tmp/settings.xml
mv -vf .github/configs/settings.xml $HOME/.m2/settings.xml
- name: mvn install
run: |
mvn install -DskipTests=true -ntp
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
build:
runs-on: ubuntu-20.04
env:
USE_STAGE: 'true' # Whether to include the stage repository.
TRAVIS_DIR: hugegraph-server/hugegraph-dist/src/assembly/travis
REPORT_DIR: target/site/jacoco
BACKEND: ${{ matrix.BACKEND }}
Expand Down Expand Up @@ -66,6 +67,12 @@ jobs:
java-version: ${{ matrix.JAVA_VERSION }}
distribution: 'zulu'

- name: use staged maven repo settings
if: ${{ env.USE_STAGE == 'true' }}
run: |
cp $HOME/.m2/settings.xml /tmp/settings.xml
mv -vf .github/configs/settings.xml $HOME/.m2/settings.xml
- name: Run unit test
run: |
$TRAVIS_DIR/run-unit-test.sh $BACKEND
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:

jobs:
analyze:
env:
USE_STAGE: 'true' # Whether to include the stage repository.
name: Analyze
runs-on: ubuntu-latest
permissions:
Expand All @@ -33,6 +35,12 @@ jobs:
distribution: 'zulu'
java-version: '11'

- name: use staged maven repo settings
if: ${{ env.USE_STAGE == 'true' }}
run: |
cp $HOME/.m2/settings.xml /tmp/settings.xml
mv -vf .github/configs/settings.xml $HOME/.m2/settings.xml
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/licence-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
check-license:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Check License Header
uses: apache/skywalking-eyes@main
Expand All @@ -22,11 +22,6 @@ jobs:
token: ${{ github.token }}
config: .licenserc.yaml

- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'

- name: License check(RAT)
run: |
mvn apache-rat:check -ntp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public class AuthenticationFilter implements ContainerRequestFilter {

private static final List<String> WHITE_API_LIST = ImmutableList.of(
"auth/login",
"versions"
"versions",
"openapi.json"
);

private static String whiteIpStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,30 @@
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.info.Contact;
import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.security.SecurityScheme;
import jakarta.ws.rs.ApplicationPath;

@SecurityScheme(
name = "basic",
type = SecuritySchemeType.HTTP,
scheme = "basic"
)
@SecurityScheme(
name = "bearer",
type = SecuritySchemeType.HTTP,
scheme = "bearer"
)
@ApplicationPath("/")
@OpenAPIDefinition(
info = @Info(
title = "HugeGraph RESTful API",
version = CoreVersion.DEFAULT_VERSION,
description = "All management API for HugeGraph",
contact = @Contact(url = "https://github.com/apache/hugegraph", name = "HugeGraph")
)
),
security = {@SecurityRequirement(name = "basic"), @SecurityRequirement(name = "bearer")}
)
public class ApplicationConfig extends ResourceConfig {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,14 @@ public final class ApiVersion {
* [0.67] Issue-1065: Support dynamically add/remove graph
* [0.68] Issue-1763: Support adamic-adar & resource-allocation API
* [0.69] Issue-1748: Support Cypher query RESTful API
* [0.70] Issue-2242: Add edge-existence RESTful API
* [0.70] PR-2242: Add edge-existence RESTful API
* [0.71] PR-2286: Support Arthas API & Metric API prometheus format
*/

/**
* The second parameter of Version.of() is for IDE running without JAR
*/
public static final Version VERSION = Version.of(ApiVersion.class, "0.70");
public static final Version VERSION = Version.of(ApiVersion.class, "0.71");

public static void check() {
// Check version of hugegraph-core. Firstly do check from version 0.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ public void testArthasStart() {
public void testArthasApi() {
String body = "{\n" +
" \"action\": \"exec\",\n" +
" \"requestId\": \"req112\",\n" +
" \"consumerId\": \"955dbd1325334a84972b0f3ac19de4f7_2\",\n" +
" \"command\": \"version\",\n" +
" \"execTimeout\": \"10000\"\n" +
" \"command\": \"version\"\n" +
"}";
RestClient arthasApiClient = new RestClient(ARTHAS_API_BASE_URL, false);
// If the request header contains basic auth,
Expand All @@ -52,8 +49,6 @@ public void testArthasApi() {
Response r = arthasApiClient.post(ARTHAS_API_PATH, body);
String result = assertResponseStatus(200, r);
assertJsonContains(result, "state");
assertJsonContains(result, "requestId");
assertJsonContains(result, "sessionId");
assertJsonContains(result, "body");

RestClient arthasApiClientWithAuth = new RestClient(ARTHAS_API_BASE_URL);
Expand Down
11 changes: 11 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -269,5 +269,16 @@
</plugins>
</build>
</profile>

<!-- use mvn -P stage to enable the remote apache-stage repo -->
<profile>
<id>stage</id>
<repositories>
<repository>
<id>staged-releases</id>
<url>https://repository.apache.org/content/groups/staging/</url>
</repository>
</repositories>
</profile>
</profiles>
</project>

0 comments on commit 43d024a

Please sign in to comment.