This is an automated email from the ASF dual-hosted git repository. liubao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git
commit 670f7f6a3a985a9a978fd39b22a7606fee283d3e Author: liubao <[email protected]> AuthorDate: Mon Feb 6 10:29:08 2023 +0800 [SCB-2767]fix rat and ci problems --- .github/workflows/maven.yml | 2 +- .github/workflows/rat_check.yml | 2 +- README.md | 4 +- README_ZH.md | 4 +- demo/README.md | 2 +- .../filterEdge/RetryClientSchema.yaml | 16 ++++++++ .../filter-tests/src/main/resources/registry.yaml | 16 ++++++++ demo/pom.xml | 46 ---------------------- .../edge/core/DefaultEdgeDispatcher.java | 5 +-- .../edge/core/TestURLMappedEdgeDispatcher.java | 21 ++++++---- 10 files changed, 53 insertions(+), 65 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index fd6adc769..9f1c41409 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -45,6 +45,6 @@ jobs: restore-keys: | ${{ runner.os }}-maven- - name: Compilation and Installation - run: mvn clean install -Dcheckstyle.skip -Dspotbugs.skip=true -B -Pdocker -Pdemo-run-release -Pjacoco -Pit -Pcoverage + run: mvn clean install -Dcheckstyle.skip -Dspotbugs.skip=true -B -Pdocker -Pjacoco -Pit -Pcoverage - name: publish coverage report run: bash <(curl -s https://codecov.io/bash) diff --git a/.github/workflows/rat_check.yml b/.github/workflows/rat_check.yml index 66107f548..bbdf9066c 100644 --- a/.github/workflows/rat_check.yml +++ b/.github/workflows/rat_check.yml @@ -38,4 +38,4 @@ jobs: java-version: '17' distribution: 'temurin' - name: rat check - run: mvn apache-rat:check -B -Pit,distribution + run: mvn apache-rat:check -B -Pit,release diff --git a/README.md b/README.md index e2e66c434..673d3b007 100644 --- a/README.md +++ b/README.md @@ -77,11 +77,11 @@ The first build may take a longer than expected as Maven downloads all the depen To build the docker image and run the integration tests with docker, you can use maven docker profile - mvn clean install -Pdocker -Pit -Pdemo-run-release + mvn clean install -Pdocker -Pit If you are using docker machine, please use the following command - mvn clean install -Pdocker -Pit -Pdocker-machine -Pdemo-run-release + mvn clean install -Pdocker -Pit -Pdocker-machine # Contact diff --git a/README_ZH.md b/README_ZH.md index 57d6c25e7..19706c5e1 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -79,11 +79,11 @@ public class HelloWorldConsumer { 开发者需要预先安装docker。 - mvn clean install -Pdocker -Pit -Pdemo-run-release + mvn clean install -Pdocker -Pit 使用docker machine。 - mvn clean install -Pdocker -Pit -Pdocker-machine -Pdemo-run-release + mvn clean install -Pdocker -Pit -Pdocker-machine # 联系我们 diff --git a/demo/README.md b/demo/README.md index 02ebd237c..c646b9abd 100644 --- a/demo/README.md +++ b/demo/README.md @@ -1,7 +1,7 @@ This module contains integrated test cases. Running these test cases, should include profile ```shell script --Pdocker -Pdemo-run-release +-Pdocker ``` [java-chassis-samples][java-chassis-samples] project provides a lot of samples. diff --git a/demo/demo-filter/filter-tests/src/main/resources/microservices/filterEdge/RetryClientSchema.yaml b/demo/demo-filter/filter-tests/src/main/resources/microservices/filterEdge/RetryClientSchema.yaml index 0c59267ce..95b4d5e0f 100644 --- a/demo/demo-filter/filter-tests/src/main/resources/microservices/filterEdge/RetryClientSchema.yaml +++ b/demo/demo-filter/filter-tests/src/main/resources/microservices/filterEdge/RetryClientSchema.yaml @@ -1,3 +1,19 @@ +## --------------------------------------------------------------------------- +## 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. +## --------------------------------------------------------------------------- --- swagger: "2.0" info: diff --git a/demo/demo-filter/filter-tests/src/main/resources/registry.yaml b/demo/demo-filter/filter-tests/src/main/resources/registry.yaml index 122fbd346..caad02223 100644 --- a/demo/demo-filter/filter-tests/src/main/resources/registry.yaml +++ b/demo/demo-filter/filter-tests/src/main/resources/registry.yaml @@ -1,3 +1,19 @@ +## --------------------------------------------------------------------------- +## 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. +## --------------------------------------------------------------------------- filterEdge: - id: "001" version: "1.0" diff --git a/demo/pom.xml b/demo/pom.xml index 3fd07ddae..34237e68b 100644 --- a/demo/pom.xml +++ b/demo/pom.xml @@ -188,50 +188,4 @@ </plugins> </pluginManagement> </build> - - <profiles> - <profile> - <id>demo-run-release</id> - <build> - <pluginManagement> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <configuration> - <outputDirectory>${project.build.directory}</outputDirectory> - <archive> - <manifest> - <addClasspath>true</addClasspath> - <classpathPrefix>./lib/</classpathPrefix> - <mainClass>${demo.main}</mainClass> - </manifest> - <manifestEntries> - <Class-Path>. ..</Class-Path> - </manifestEntries> - </archive> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>copy-dependencies</id> - <phase>package</phase> - <goals> - <goal>copy-dependencies</goal> - </goals> - <configuration> - <outputDirectory>${project.build.directory}/lib</outputDirectory> - <silent>true</silent> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </pluginManagement> - </build> - </profile> - </profiles> </project> diff --git a/edge/edge-core/src/main/java/org/apache/servicecomb/edge/core/DefaultEdgeDispatcher.java b/edge/edge-core/src/main/java/org/apache/servicecomb/edge/core/DefaultEdgeDispatcher.java index dde4dc8a6..0362e39b0 100644 --- a/edge/edge-core/src/main/java/org/apache/servicecomb/edge/core/DefaultEdgeDispatcher.java +++ b/edge/edge-core/src/main/java/org/apache/servicecomb/edge/core/DefaultEdgeDispatcher.java @@ -18,7 +18,6 @@ package org.apache.servicecomb.edge.core; import org.apache.servicecomb.common.rest.RestProducerInvocationFlow; -import org.apache.servicecomb.core.SCBEngine; import org.apache.servicecomb.core.invocation.InvocationCreator; import org.apache.servicecomb.foundation.vertx.http.HttpServletRequestEx; import org.apache.servicecomb.foundation.vertx.http.HttpServletResponseEx; @@ -54,8 +53,6 @@ public class DefaultEdgeDispatcher extends AbstractEdgeDispatcher { private final CompatiblePathVersionMapper versionMapper = new CompatiblePathVersionMapper(); - private String prefix; - private boolean withVersion; private int prefixSegmentCount; @@ -72,7 +69,7 @@ public class DefaultEdgeDispatcher extends AbstractEdgeDispatcher { @Override public void init(Router router) { - prefix = DynamicPropertyFactory.getInstance().getStringProperty(KEY_PREFIX, "api").get(); + String prefix = DynamicPropertyFactory.getInstance().getStringProperty(KEY_PREFIX, "api").get(); withVersion = DynamicPropertyFactory.getInstance().getBooleanProperty(KEY_WITH_VERSION, true).get(); prefixSegmentCount = DynamicPropertyFactory.getInstance().getIntProperty(KEY_PREFIX_SEGMENT_COUNT, 1).get(); String regex = generateRouteRegex(prefix, withVersion); diff --git a/edge/edge-core/src/test/java/org/apache/servicecomb/edge/core/TestURLMappedEdgeDispatcher.java b/edge/edge-core/src/test/java/org/apache/servicecomb/edge/core/TestURLMappedEdgeDispatcher.java index 78057915f..228fe6c30 100644 --- a/edge/edge-core/src/test/java/org/apache/servicecomb/edge/core/TestURLMappedEdgeDispatcher.java +++ b/edge/edge-core/src/test/java/org/apache/servicecomb/edge/core/TestURLMappedEdgeDispatcher.java @@ -19,15 +19,8 @@ package org.apache.servicecomb.edge.core; import java.util.Map; -import io.vertx.core.Context; -import io.vertx.core.Vertx; -import io.vertx.core.buffer.Buffer; -import io.vertx.ext.web.RequestBody; import org.apache.servicecomb.foundation.test.scaffolding.config.ArchaiusUtils; import org.apache.servicecomb.transport.rest.vertx.RestBodyHandler; - -import io.vertx.core.http.HttpServerRequest; -import io.vertx.ext.web.RoutingContext; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; @@ -35,6 +28,13 @@ import org.junit.jupiter.api.Test; import org.mockito.MockedStatic; import org.mockito.Mockito; +import io.vertx.core.Context; +import io.vertx.core.Vertx; +import io.vertx.core.buffer.Buffer; +import io.vertx.core.http.HttpServerRequest; +import io.vertx.ext.web.RequestBody; +import io.vertx.ext.web.RoutingContext; + public class TestURLMappedEdgeDispatcher { @BeforeEach public void setUp() throws Exception { @@ -49,7 +49,12 @@ public class TestURLMappedEdgeDispatcher { public void testConfigurations() { ArchaiusUtils.setProperty("servicecomb.http.dispatcher.edge.url.enabled", true); - URLMappedEdgeDispatcher dispatcher = new URLMappedEdgeDispatcher(); + URLMappedEdgeDispatcher dispatcher = new URLMappedEdgeDispatcher() { + @Override + protected boolean isFilterChainEnabled() { + return false; + } + }; Map<String, URLMappedConfigurationItem> items = dispatcher.getConfigurations(); Assertions.assertEquals(items.size(), 0);
