You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/03/27 11:08:47 UTC
[GitHub] [incubator-apisix] moonming opened a new pull request #1351:
feature: remove `lua` dir.
moonming opened a new pull request #1351: feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351
discuss thread: https://lists.apache.org/thread.html/r10155c0ba784c25de54bd8e19355e5f517cade98af006ed2ef69dd25%40%3Cdev.apisix.apache.org%3E
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] membphis commented on a change in pull request
#1351: feature: remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #1351: feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#discussion_r400594294
##########
File path: t/admin/balancer.t
##########
@@ -25,7 +25,7 @@ add_block_preprocessor(sub {
my $init_by_lua_block = <<_EOC_;
require "resty.core"
- apisix = require("apisix")
+ apisix = require("init")
Review comment:
This is wrong, we should use the original name "apisix".
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] chnliyong commented on a change in pull request
#1351: [WIP]feature: remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
chnliyong commented on a change in pull request #1351: [WIP]feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#discussion_r399613129
##########
File path: Contributing.md
##########
@@ -98,15 +98,15 @@ Once we've discussed your changes and you've got your code ready, make sure that
$ make lint
luacheck -q lua
Total: 0 warnings / 0 errors in 74 files
- ./utils/lj-releng lua/*.lua \
- lua/apisix/*.lua \
- lua/apisix/admin/*.lua \
- lua/apisix/core/*.lua \
- lua/apisix/http/*.lua \
- lua/apisix/http/router/*.lua \
- lua/apisix/plugins/*.lua \
- lua/apisix/plugins/grpc-transcode/*.lua \
- lua/apisix/plugins/limit-count/*.lua > \
+ ./utils/lj-releng \
Review comment:
We need add `apisix.lua` in project root directory.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] membphis commented on a change in pull request
#1351: feature: remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #1351: feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#discussion_r400903642
##########
File path: doc/plugin-develop-cn.md
##########
@@ -48,14 +48,14 @@
插件本身提供了 init 方法。方便插件加载后做初始化动作。
-注:如果部分插件的功能实现,需要在 Nginx 初始化启动,则可能需要在 __lua/apisix.lua__ 文件的初始化方法 http_init 中添加逻辑,并且
+注:如果部分插件的功能实现,需要在 Nginx 初始化启动,则可能需要在 __apisix.lua__ 文件的初始化方法 http_init 中添加逻辑,并且
Review comment:
`__lua/apisix.lua__` to `__apisix/init.lua__`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] membphis commented on a change in pull request
#1351: [WIP]feature: remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #1351: [WIP]feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#discussion_r399598171
##########
File path: bin/apisix
##########
@@ -113,9 +113,8 @@ env APISIX_PROFILE;
{% if stream_proxy then %}
stream {
- lua_package_path "$prefix/deps/share/lua/5.1/?.lua;/usr/share/lua/5.1/apisix/lua/?.lua;]=]
- .. [=[/usr/local/share/lua/5.1/apisix/lua/?.lua;]=]
- .. [=[$prefix/deps/share/lua/5.1/apisix/lua/?.lua;]=]
+ lua_package_path "$prefix/deps/share/lua/5.1/?.lua;]=]
+ .. [=[$prefix/deps/share/lua/5.1/apisix/?.lua;]=]
Review comment:
`$prefix/deps/share/lua/5.1/apisix/?.lua;`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] membphis commented on a change in pull request
#1351: [WIP]feature: remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #1351: [WIP]feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#discussion_r399626651
##########
File path: Makefile
##########
@@ -117,47 +117,47 @@ install:
$(INSTALL) conf/config.yaml /usr/local/apisix/conf/config.yaml
$(INSTALL) conf/cert/apisix.* /usr/local/apisix/conf/cert/
- $(INSTALL) -d $(INST_LUADIR)/apisix/lua
- $(INSTALL) lua/*.lua $(INST_LUADIR)/apisix/lua/
+ $(INSTALL) -d $(INST_LUADIR)/apisix
+ $(INSTALL) *.lua $(INST_LUADIR)/apisix/
- $(INSTALL) -d $(INST_LUADIR)/apisix/lua/apisix
- $(INSTALL) lua/apisix/*.lua $(INST_LUADIR)/apisix/lua/apisix/
+ $(INSTALL) -d $(INST_LUADIR)/apisix/apisix
+ $(INSTALL) apisix/*.lua $(INST_LUADIR)/apisix/apisix/
Review comment:
we should install source code to `$(INST_LUADIR)/apisix/`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] membphis commented on issue #1351: feature:
remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
membphis commented on issue #1351: feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#issuecomment-606424584
@moonming you can make a try with this patch:
```diff
diff --git a/bin/apisix b/bin/apisix
index e00e9af6..871de12d 100755
--- a/bin/apisix
+++ b/bin/apisix
@@ -39,9 +39,7 @@ local pkg_path_org = package.path
local apisix_home = "/usr/local/apisix"
local pkg_cpath = apisix_home .. "/deps/lib64/lua/5.1/?.so;"
.. apisix_home .. "/deps/lib/lua/5.1/?.so;;"
-local pkg_path = apisix_home .. "/deps/share/lua/5.1/apisix/?.lua;"
- .. "/usr/local/share/lua/5.1/apisix/?.lua;"
- .. apisix_home .. "/deps/share/lua/5.1/?.lua;;"
+local pkg_path = apisix_home .. "/deps/share/lua/5.1/?.lua;;"
-- only for developer, use current folder as working space
local is_root_path = false
@@ -58,7 +56,7 @@ if script_path:sub(1, 2) == './' then
pkg_cpath = apisix_home .. "/deps/lib64/lua/5.1/?.so;"
.. apisix_home .. "/deps/lib/lua/5.1/?.so;"
- pkg_path = apisix_home .. "/apisix/?.lua;"
+ pkg_path = apisix_home .. "/?/init.lua;"
.. apisix_home .. "/deps/share/lua/5.1/?.lua;;"
end
-- print("apisix_home: ", apisix_home)
@@ -114,7 +112,7 @@ env APISIX_PROFILE;
{% if stream_proxy then %}
stream {
lua_package_path "$prefix/deps/share/lua/5.1/?.lua;]=]
- .. [=[{*apisix_lua_home*}/apisix/?.lua;;{*lua_path*};";
+ .. [=[{*apisix_lua_home*}/?.lua;;{*lua_path*};";
lua_package_cpath "$prefix/deps/lib64/lua/5.1/?.so;]=]
.. [=[$prefix/deps/lib/lua/5.1/?.so;;]=]
.. [=[{*lua_cpath*};";
@@ -167,7 +165,7 @@ stream {
http {
lua_package_path "$prefix/deps/share/lua/5.1/?.lua;]=]
- .. [=[{*apisix_lua_home*}/apisix/?.lua;;{*lua_path*};";
+ .. [=[{*apisix_lua_home*}/?.lua;;{*lua_path*};";
lua_package_cpath "$prefix/deps/lib64/lua/5.1/?.so;]=]
.. [=[$prefix/deps/lib/lua/5.1/?.so;;]=]
.. [=[{*lua_cpath*};";
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] chnliyong commented on a change in pull request
#1351: [WIP]feature: remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
chnliyong commented on a change in pull request #1351: [WIP]feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#discussion_r399612564
##########
File path: bin/apisix
##########
@@ -39,8 +39,8 @@ local pkg_path_org = package.path
local apisix_home = "/usr/local/apisix"
local pkg_cpath = apisix_home .. "/deps/lib64/lua/5.1/?.so;"
.. apisix_home .. "/deps/lib/lua/5.1/?.so;;"
-local pkg_path = apisix_home .. "/deps/share/lua/5.1/apisix/lua/?.lua;"
- .. "/usr/local/share/lua/5.1/apisix/lua/?.lua;"
+local pkg_path = apisix_home .. "/deps/share/lua/5.1/apisix/?.lua;"
+ .. "/usr/local/share/lua/5.1/apisix/?.lua;"
Review comment:
All packages begin at `apisix_home`, this line looks redundant.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] moonming commented on issue #1351: [WIP]feature:
remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
moonming commented on issue #1351: [WIP]feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#issuecomment-605397350
Will this conflict with other luarocks libraries?
YuanSheng Wang <no...@github.com>于2020年3月28日 周六下午12:58写道:
> I prefer treat apisix as a regular rocks lib and the target to be
> installed in $PKG_ROOT:
>
> I agree with you ^_^
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/incubator-apisix/pull/1351#issuecomment-605395249>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AGJZBK55QXMASGQJBYRL4SDRJV7V5ANCNFSM4LU5SKRQ>
> .
>
--
Thanks,
Ming Wen
Twitter: _WenMing
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] membphis commented on issue #1351: [WIP]feature:
remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
membphis commented on issue #1351: [WIP]feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#issuecomment-605395249
> I prefer treat `apisix` as a regular rocks lib and the target to be installed in `$PKG_ROOT`:
I agree with you ^_^
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] chnliyong commented on a change in pull request
#1351: [WIP]feature: remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
chnliyong commented on a change in pull request #1351: [WIP]feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#discussion_r399628666
##########
File path: bin/apisix
##########
@@ -113,9 +113,8 @@ env APISIX_PROFILE;
{% if stream_proxy then %}
stream {
- lua_package_path "$prefix/deps/share/lua/5.1/?.lua;/usr/share/lua/5.1/apisix/lua/?.lua;]=]
- .. [=[/usr/local/share/lua/5.1/apisix/lua/?.lua;]=]
- .. [=[$prefix/deps/share/lua/5.1/apisix/lua/?.lua;]=]
+ lua_package_path "$prefix/deps/share/lua/5.1/?.lua;]=]
+ .. [=[$prefix/deps/share/lua/5.1/apisix/?.lua;]=]
Review comment:
line 61 `pkg_path = apisix_home .. "/lua/?.lua;"` also need to change to `pkg_path = apisix_home .. "/?.lua;"`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] membphis commented on a change in pull request
#1351: feature: remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #1351: feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#discussion_r400903722
##########
File path: doc/plugin-develop-cn.md
##########
@@ -48,14 +48,14 @@
插件本身提供了 init 方法。方便插件加载后做初始化动作。
-注:如果部分插件的功能实现,需要在 Nginx 初始化启动,则可能需要在 __lua/apisix.lua__ 文件的初始化方法 http_init 中添加逻辑,并且
+注:如果部分插件的功能实现,需要在 Nginx 初始化启动,则可能需要在 __apisix.lua__ 文件的初始化方法 http_init 中添加逻辑,并且
可能需要在 __bin/apisix__ 文件中,对 Nginx 配置文件生成的部分,添加一些你需要的处理。但是这样容易对全局产生影响,根据现有的
插件机制,我们不建议这样做,除非你已经对代码完全掌握。
## 插件命名与配置
给插件取一个很棒的名字,确定插件的加载优先级,然后在 __conf/config.yaml__ 文件中添加上你的插件名。例如 key-auth 这个插件,
-需要在代码里指定插件名称(名称是插件的唯一标识,不可重名),在 __lua/apisix/plugins/key-auth.lua__ 文件中可以看到:
+需要在代码里指定插件名称(名称是插件的唯一标识,不可重名),在 __apisix/plugins/key-auth.lua__ 文件中可以看到:
Review comment:
ditoo
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] moonming merged pull request #1351: feature:
remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
moonming merged pull request #1351: feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] membphis commented on issue #1351: [WIP]feature:
remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
membphis commented on issue #1351: [WIP]feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#issuecomment-605421029
> `lua/apisix.lua → apisix.lua `
How about `lua/apisix.lua → apisix/init.lua` ?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] dabue commented on issue #1351: feature: remove
`lua` dir.
Posted by GitBox <gi...@apache.org>.
dabue commented on issue #1351: feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#issuecomment-605643900
that's good.
88786912@qq.com
From: Wen Ming
Date: 2020-03-29 10:08
To: apache/incubator-apisix
CC: Subscribed
Subject: Re: [apache/incubator-apisix] [WIP]feature: remove `lua` dir. (#1351)
lua/apisix.lua → apisix.lua
How about lua/apisix.lua → apisix/init.lua ?
good idea
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] moonming commented on issue #1351: [WIP]feature:
remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
moonming commented on issue #1351: [WIP]feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#issuecomment-605546703
> > `lua/apisix.lua → apisix.lua `
>
> How about `lua/apisix.lua → apisix/init.lua` ?
good idea
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] membphis commented on a change in pull request
#1351: [WIP]feature: remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #1351: [WIP]feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#discussion_r399266366
##########
File path: bin/apisix
##########
@@ -113,9 +113,8 @@ env APISIX_PROFILE;
{% if stream_proxy then %}
stream {
- lua_package_path "$prefix/deps/share/lua/5.1/?.lua;/usr/share/lua/5.1/apisix/lua/?.lua;]=]
- .. [=[/usr/local/share/lua/5.1/apisix/lua/?.lua;]=]
- .. [=[$prefix/deps/share/lua/5.1/apisix/lua/?.lua;]=]
+ lua_package_path "$prefix/deps/share/lua/5.1/?.lua;]=]
+ .. [=[$prefix/deps/share/lua/5.1/apisix/?.lua;]=]
Review comment:
I think we can delete this line
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] membphis commented on issue #1351: [WIP]feature:
remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
membphis commented on issue #1351: [WIP]feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#issuecomment-605403364
> Will this conflict with other luarocks libraries?
No conflict.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] membphis commented on a change in pull request
#1351: feature: remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #1351: feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#discussion_r400903722
##########
File path: doc/plugin-develop-cn.md
##########
@@ -48,14 +48,14 @@
插件本身提供了 init 方法。方便插件加载后做初始化动作。
-注:如果部分插件的功能实现,需要在 Nginx 初始化启动,则可能需要在 __lua/apisix.lua__ 文件的初始化方法 http_init 中添加逻辑,并且
+注:如果部分插件的功能实现,需要在 Nginx 初始化启动,则可能需要在 __apisix.lua__ 文件的初始化方法 http_init 中添加逻辑,并且
可能需要在 __bin/apisix__ 文件中,对 Nginx 配置文件生成的部分,添加一些你需要的处理。但是这样容易对全局产生影响,根据现有的
插件机制,我们不建议这样做,除非你已经对代码完全掌握。
## 插件命名与配置
给插件取一个很棒的名字,确定插件的加载优先级,然后在 __conf/config.yaml__ 文件中添加上你的插件名。例如 key-auth 这个插件,
-需要在代码里指定插件名称(名称是插件的唯一标识,不可重名),在 __lua/apisix/plugins/key-auth.lua__ 文件中可以看到:
+需要在代码里指定插件名称(名称是插件的唯一标识,不可重名),在 __apisix/plugins/key-auth.lua__ 文件中可以看到:
Review comment:
ditoo
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] moonming commented on a change in pull request
#1351: [WIP]feature: remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
moonming commented on a change in pull request #1351: [WIP]feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#discussion_r399734871
##########
File path: Contributing.md
##########
@@ -98,15 +98,15 @@ Once we've discussed your changes and you've got your code ready, make sure that
$ make lint
luacheck -q lua
Total: 0 warnings / 0 errors in 74 files
- ./utils/lj-releng lua/*.lua \
- lua/apisix/*.lua \
- lua/apisix/admin/*.lua \
- lua/apisix/core/*.lua \
- lua/apisix/http/*.lua \
- lua/apisix/http/router/*.lua \
- lua/apisix/plugins/*.lua \
- lua/apisix/plugins/grpc-transcode/*.lua \
- lua/apisix/plugins/limit-count/*.lua > \
+ ./utils/lj-releng \
Review comment:
moved `apisix.lua` to `apisix/init.lua`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] membphis commented on a change in pull request
#1351: feature: remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #1351: feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#discussion_r400903822
##########
File path: doc/plugin-develop.md
##########
@@ -50,15 +50,15 @@ The plugin itself provides the init method. It is convenient for plugins to perf
the plugin is loaded.
Note : if the dependency of some plugin needs to be initialized when Nginx start, you may need to add logic to the initialization
- method "http_init" in the file __lua/apisix.lua__, And you may need to add some processing on generated part of Nginx
+ method "http_init" in the file __apisix.lua__, And you may need to add some processing on generated part of Nginx
Review comment:
ditoo
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] membphis commented on a change in pull request
#1351: feature: remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
membphis commented on a change in pull request #1351: feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#discussion_r400596368
##########
File path: t/admin/balancer.t
##########
@@ -25,7 +25,7 @@ add_block_preprocessor(sub {
my $init_by_lua_block = <<_EOC_;
require "resty.core"
- apisix = require("apisix")
+ apisix = require("init")
Review comment:
`./?/init.lua;` is the standard Lua source code search path.
please take a look at this:
```diff
$ cat ../mm.patch
diff --git a/bin/apisix b/bin/apisix
index e27da893..c393536e 100755
--- a/bin/apisix
+++ b/bin/apisix
@@ -132,7 +132,7 @@ stream {
init_by_lua_block {
require "resty.core"
- apisix = require("init")
+ apisix = require("apisix")
apisix.stream_init()
}
@@ -261,7 +261,7 @@ http {
init_by_lua_block {
require "resty.core"
- apisix = require("init")
+ apisix = require("apisix")
local dns_resolver = { {% for _, dns_addr in ipairs(dns_resolver or {}) do %} "{*dns_addr*}", {% end %} }
local args = {
diff --git a/dashboard b/dashboard
index cfb3ee7b..5ce7c37c 160000
--- a/dashboard
+++ b/dashboard
@@ -1 +1 @@
-Subproject commit cfb3ee7b8721076975c1deaff3e52da3ea4a312a
+Subproject commit 5ce7c37c758f6365da042333d7909c12c0ab6714-dirty
diff --git a/t/APISIX.pm b/t/APISIX.pm
index e1a336a8..6b191524 100644
--- a/t/APISIX.pm
+++ b/t/APISIX.pm
@@ -107,7 +107,7 @@ _EOC_
my $stream_enable = $block->stream_enable;
my $stream_config = $block->stream_config // <<_EOC_;
- lua_package_path "$apisix_home/deps/share/lua/5.1/?.lua;$apisix_home/apisix/?.lua;$apisix_home/t/?.lua;./?.lua;;";
+ lua_package_path "$apisix_home/deps/share/lua/5.1/?.lua;$apisix_home/apisix/?.lua;$apisix_home/t/?.lua;./?.lua;./?/init.lua;;";
lua_package_cpath "$apisix_home/deps/lib/lua/5.1/?.so;$apisix_home/deps/lib64/lua/5.1/?.so;./?.so;;";
lua_socket_log_errors off;
@@ -127,7 +127,7 @@ _EOC_
require "resty.core"
- apisix = require("init")
+ apisix = require("apisix")
apisix.stream_init()
}
@@ -177,7 +177,7 @@ _EOC_
require "resty.core"
- apisix = require("init")
+ apisix = require("apisix")
local args = {
dns_resolver = $dns_addrs_tbl_str,
}
@@ -186,7 +186,7 @@ _EOC_
my $http_config = $block->http_config // '';
$http_config .= <<_EOC_;
- lua_package_path "$apisix_home/deps/share/lua/5.1/?.lua;$apisix_home/apisix/?.lua;$apisix_home/t/?.lua;./?.lua;;";
+ lua_package_path "$apisix_home/deps/share/lua/5.1/?.lua;$apisix_home/apisix/?.lua;$apisix_home/t/?.lua;./?.lua;./?/init.lua;;";
lua_package_cpath "$apisix_home/deps/lib/lua/5.1/?.so;$apisix_home/deps/lib64/lua/5.1/?.so;./?.so;;";
lua_shared_dict plugin-limit-req 10m;
@@ -216,7 +216,7 @@ _EOC_
}
init_worker_by_lua_block {
- require("init").http_init_worker()
+ require("apisix").http_init_worker()
}
# fake server, only for test
diff --git a/t/admin/balancer.t b/t/admin/balancer.t
index d88f19bf..0be70dbd 100644
--- a/t/admin/balancer.t
+++ b/t/admin/balancer.t
@@ -25,7 +25,7 @@ add_block_preprocessor(sub {
my $init_by_lua_block = <<_EOC_;
require "resty.core"
- apisix = require("init")
+ apisix = require("apisix")
apisix.http_init()
function test(route, ctx, count)
diff --git a/t/admin/health-check.t b/t/admin/health-check.t
index 1020a30d..8680768e 100644
--- a/t/admin/health-check.t
+++ b/t/admin/health-check.t
@@ -27,7 +27,7 @@ add_block_preprocessor(sub {
my $init_by_lua_block = <<_EOC_;
require "resty.core"
- apisix = require("init")
+ apisix = require("apisix")
apisix.http_init()
json = require("cjson.safe")
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-apisix] moonming commented on a change in pull request
#1351: [WIP]feature: remove `lua` dir.
Posted by GitBox <gi...@apache.org>.
moonming commented on a change in pull request #1351: [WIP]feature: remove `lua` dir.
URL: https://github.com/apache/incubator-apisix/pull/1351#discussion_r399596776
##########
File path: bin/apisix
##########
@@ -113,9 +113,8 @@ env APISIX_PROFILE;
{% if stream_proxy then %}
stream {
- lua_package_path "$prefix/deps/share/lua/5.1/?.lua;/usr/share/lua/5.1/apisix/lua/?.lua;]=]
- .. [=[/usr/local/share/lua/5.1/apisix/lua/?.lua;]=]
- .. [=[$prefix/deps/share/lua/5.1/apisix/lua/?.lua;]=]
+ lua_package_path "$prefix/deps/share/lua/5.1/?.lua;]=]
+ .. [=[$prefix/deps/share/lua/5.1/apisix/?.lua;]=]
Review comment:
which line?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services