Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ default boolean isConfigRequest() {
return false;
}


int getConfToken();

default int getType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -82,7 +81,7 @@ public Enumeration getParameters() {
}

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

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


public enum Method {
GET,
HEAD,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

/**
* table Resp {
* id:uint32;
* action:Action;
* id:uint32;
* action:Action;
* }
*/
@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

/**
* table Stop {
* status:uint16;
* headers:[TextEntry];
* body:[ubyte];
* status:uint16;
* headers:[TextEntry];
* body:[ubyte];
* }
*/
@Deprecated
Expand Down
15 changes: 15 additions & 0 deletions runner-starter/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down