The checkout step of these tests was using a secret that is not
available to PRs opened from forks, which made it fail.
This commit removes the token (not needed in CE), which makes the action
fall back to the default github token.
It also adds the workflow to the `paths`, just to make sure it runs when
modified.
Context
-------
The overall goal of this commit is to refactor the external plugins
implementation, with the following goals in mind:
- Make plugin server code more approachable to unfamiliar engineers and
easier to evolve with confidence
- Harden configuration; ensure configuration defects are caught before
Kong is started
- Extend testing coverage
This is related to ongoing work on the Go PDK, with similar goals in
mind.
Summary
-------
This commit implements the following overall changes to plugin server
code:
- Move configuration related code into conf loader, so that configuration
loading and validation happens at startup time, rather than lazily, when
plugin data is loaded or pluginservers are started. Add tests for
current behavior.
- Move process-management code - for starting up plugin servers as well
as querying external plugins info - into the `process.lua` module.
- Introduce a `kong.runloop.plugin_servers.rpc` module that encapsulates
RPC initialization and protocol-specific implementations. This further
simplifies the main plugin server main module.
- Factor exposed API and phase handlers bridging code into a new `plugin`
module, which encapsulates an external plugin representation, including
the expected fields for any Kong plugin, plus external plugin-specific
bits, such as the RPC instance. Part of this external plugin-specific part
is the instance life cycle management. With this structure, the `kong.runloop.plugin_servers`
main module contains only general external plugin code, including a list
of loaded external plugins, and associated start/stop functions for
plugin servers.
Testing
-------
This commit also implements the following improvements to tests:
- Restructure fixtures to accommodate new external plugin servers --
namely, targeting for now in the existing Python and Javascript
- Add new test cases for external plugins:
* External plugin configuration: add test cases for current behavior;
in particular:
- Fail if no `query_cmd` is provided;
- Warn if no `start_cmd` is provided - this is by design, as
external plugins servers can be managed outside of Kong
* Plugin server start / stop - for both Go and Python plugins
* External plugin info querying for both Go and Python plugins
* External plugin execution - for both Go and Python plugins
Internal flow
-------------
`.plugin_servers.init:` loads all external plugins, by calling .plugin_servers.process and `.plugin_servers.plugin`
`.plugin_servers.process`: queries external plugins info with the command specified in `_query_cmd` proeprties
`.plugin_servers.plugin`: with info obtained as described above, `.plugin:new` returns a kong-compatible representation
of an external plugin, with phase handlers, PRIORITY, and wrappers to the PDK. Calls
`.plugin_servers.rpc` to create an RPC through which Kong communicates with the plugin process
`.plugin_servers.rpc`: based on info contained in the plugin (protocol field), creates the correct RPC for the
given external plugin
`.plugin_servers.rpc.pb_rpc`: protobuf rpc implementation - used by Golang
`.plugin_servers.rpc.mp.rpc`: messagepack rpc implementation - used by JS and Python
`.plugin_servers.init`: calls `.plugin_servers.process` to start external plugin servers
`.plugin_servers.process`: optionally starts all external plugin servers (if a `_start_cmd` is found)
uses the resty pipe API to manage the external plugin process
According to the bazelbuild/setup-bazelisk README, the action is superseded by the bazel-contrib/setup-bazel. Please check if we need to migrate to the new action. One of the possible motivation of this migration is that node.js 16 is deprecated soon from github runners.
KAG-5221
add an action to enable executing the `/prdiff <other-pr-url>` command,
to get the diff between the current PR's changes and the other PR's.
This gives a quick overview of the differences between two PRs and is
meant to facilitate the process of reviewing cherry-picks.
When a new minor version is just bumped, the tag x.x.0 doesn't exist
yet. So we change it to use the starting point of the previous branch
instead of the tag x.x.0 of the previous branch.
* fix(plugins/acme): username/password is a valid authentication method
Fixed an issue where username and password were not accepted as a valid
authentication method. This is already accepted as valid authentication
method in other plugins that use the shared Redis library such as the
rate-limiting plugin.
Depends on this PR of lua-resty-acme: https://github.com/fffonion/lua-resty-acme/pull/121
Fix FTI-6143
Test the old version plugin against the latest core code. We only focus on
whether there is any runtime error in the happy path. Because logic
changes from version to version, it is not feasible to test the behavior
of the plugin.
This test is not guaranteed to capture all interface changes, because it may not be able to cover all the dependent interfaces, and even if the interface is covered, it can't detect interface semantic changes or internal logic changes. These kinds of things still rely on the tests of the interfaces themselves to cover.
https://konghq.atlassian.net/browse/FTI-5923
Summary:
* a new conf option `cluster_cjson` to switch between cjson and simdjson
* unit test for cjson compatibility
simdjson requires gcc 7.4+, it may not be compiled successfully on some Linux releases (aws-liunx-2).
lua-resty-simdjson has released the first version [`1.0.0`](https://github.com/Kong/lua-resty-simdjson/releases/tag/1.0.0).
KAG-3647
---------
Co-authored-by: Wangchong Zhou <wangchong@konghq.com>