Skip to content
This repository has been archived by the owner on Dec 31, 2019. It is now read-only.

feat(kong-ngx-build) add lua-kong-nginx-module patch and build suppor… #26

Merged
merged 4 commits into from
Jul 17, 2019

Conversation

dndx
Copy link
Member

@dndx dndx commented Jul 15, 2019

…t and enable

it by default for core >= 1.13.6

…t and enable

it by default for core >= 1.13.6
@dndx dndx requested review from hutchic and thibaultcha July 15, 2019 22:44
@hutchic
Copy link
Contributor

hutchic commented Jul 17, 2019

trying to think what a test could look like for this 🤔

As is this looks fine a test would be nice to ensure future us doesn't break anything without noticing

kong-ngx-build Outdated
@@ -254,6 +283,14 @@ main() {
|| fatal "failed to apply patch: $patch_file"
done

if [ $KONG_NGINX_MODULE != 0 ]; then
for patch_file in $(ls -1 $DOWNLOAD_CACHE/lua-kong-nginx-module/patches/$OPENRESTY_VER/*.patch); do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so when running this with an OpenResty version for which lua-kong-nginx-module does not have yet a patch, the $(ls ...) will return empty and this will be skipped silently.

If the user explicitly gave a --kong-nginx-module argument and an --openresty version, I think this should fail if the patch for that specific OpenResty version does not exist.

In our specific case, what I could see happening is: if an OpenResty bump happens before a patch is produced, then this would cause openresty-build-tools to happily build without the patch even though the patch was requested. (And things would only fail further down the road when the Kong test suite fails due to the lack of features provided by the patch.)

I think this should be changed so that whenever we enter this branch, we ensure the patch was in fact applied.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Actually since we moved everything into openresty-patches anyway, it should be alright to skip this check for now. We maintain the openresty-patches repo so the user wouldn't accidentally forgot to apply the patch for lua-kong-nginx-module.

We have a card that will address this better in the future as well, that will make sure lua-kong-nginx-module throws a compile error if patches are not applied properly (for all the patches, not only those of lua-kong-nginx-module).

kong-ngx-build Outdated Show resolved Hide resolved
@dndx
Copy link
Member Author

dndx commented Jul 17, 2019

@hutchic Tests were added in 46434bd. Thanks @thibaultcha for the hard work getting the test framework started.

@dndx dndx force-pushed the feat/lua-kong-nginx-module branch from 46434bd to 4ede804 Compare July 17, 2019 22:07
@dndx dndx force-pushed the feat/lua-kong-nginx-module branch from 4ede804 to a52e9fd Compare July 17, 2019 22:14
@dndx dndx merged commit 68ef299 into master Jul 17, 2019
@dndx dndx deleted the feat/lua-kong-nginx-module branch July 17, 2019 22:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants