Skip to content
Permalink
Browse files
add code checker (#2)
  • Loading branch information
dmsolr committed May 19, 2021
1 parent 0018885 commit 4b41047f3c01ad21bfefc0ed7a457445433f967b
Showing 12 changed files with 78 additions and 63 deletions.
@@ -0,0 +1,52 @@
# 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.

name: CI

on:
pull_request:
push:
branches:
- master
tags:
- 'v*'

jobs:
CI:
runs-on: ubuntu-18.04
timeout-minutes: 180
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- name: 'Install & Test'
run: mvn clean install

CI-on-MacOS:
runs-on: macos-latest
timeout-minutes: 180
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- name: 'Install & Test'
run: ./mvnw clean install
@@ -152,8 +152,7 @@
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<!-- disable checkstyle temporary -->
<skip>true</skip>
<skip>false</skip>
<configLocation>${maven.multiModuleProjectDirectory}/src/main/checkstyle/checkstyle.xml</configLocation>
<headerLocation>${maven.multiModuleProjectDirectory}/src/main/checkstyle/HEADER</headerLocation>
<encoding>UTF-8</encoding>
@@ -67,7 +67,7 @@ public int getOrder() {

@Bean
public Dispatcher createDispatcher(A6ConfigHandler configHandler, A6HttpCallHandler httpCallHandler) {
return (request) -> {
return request -> {
A6Response response;
switch (request.getType()) {
case 0:
@@ -17,9 +17,7 @@

package org.apache.apisix.plugin.runner.server.config;

import io.netty.channel.unix.DomainSocketAddress;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import reactor.netty.tcp.TcpServer;
@@ -42,10 +40,5 @@ private TcpServer create(List<TcpServerCustomizer> customizers) {
}
return server;
}
//
// @Bean
// public TcpServerCustomizer configureHandler(@Value("${runner.server.socket.file:/tmp/runner.socks") String socketFile) {
// return tcpServer -> tcpServer.bindAddress(() -> new DomainSocketAddress(socketFile));
// }

}

This file was deleted.

@@ -28,12 +28,10 @@ public class A6HttpCallResponse implements A6Response {

private final Map<String, String> parameters;


public A6HttpCallResponse(int requestId, Map<String, String> parameters, Map<String, String> headers) {
this.requestId = requestId;
this.headers = headers;
this.parameters = parameters;

}

@Override
@@ -23,7 +23,6 @@ default boolean isConfigRequest() {
return false;
}


int getConfToken();

default int getType() {
@@ -18,7 +18,6 @@
package org.apache.apisix.plugin.runner;

import io.github.api7.A6.HTTPReqCall.Req;
import io.netty.buffer.ByteBuf;

import java.nio.ByteBuffer;
import java.util.Enumeration;
@@ -58,15 +57,15 @@ public long getRequestId() {
}

public String getSourceIP() {
return ""; // TODO
return "";
}

public Method getMethod() {
return Method.values()[req.method()];
}

public String getPath() {
return req.path(); // FiXME
return req.path();
}

public String getParameter(String name) {
@@ -82,7 +81,7 @@ public Enumeration getParameters() {
}

public String[] getParameterValues(String name) {
return null; // todo
return null;
}

@Override
@@ -94,7 +93,6 @@ public static HttpRequest from(ByteBuffer buffer) {
return new HttpRequest(Req.getRootAsReq(buffer));
}


public enum Method {
GET,
HEAD,
@@ -26,8 +26,8 @@

/**
* table Resp {
* id:uint32;
* action:Action;
* id:uint32;
* action:Action;
* }
*/
@Data
@@ -19,9 +19,9 @@

/**
* table Stop {
* status:uint16;
* headers:[TextEntry];
* body:[ubyte];
* status:uint16;
* headers:[TextEntry];
* body:[ubyte];
* }
*/
@Deprecated
@@ -1,3 +1,18 @@
# 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.

logging:
level:
root: debug
@@ -96,7 +96,7 @@
<property name="format" value="(^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$)"/>
</module>
<module name="PackageName">
<property name="format" value="^org\.apache\.apisix\.plugin\.runner(\.[a-zA-Z][a-zA-Z0-9]*)+$"/>
<property name="format" value="^org\.apache\.apisix\.plugin\.runner(\.[a-zA-Z][a-zA-Z0-9]*)*$"/>
</module>
<module name="ParameterName"/>
<module name="StaticVariableName">

0 comments on commit 4b41047

Please sign in to comment.