Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport tests: test mitigation for the segfault of if-match 412 #13283

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d851834
tests(key-auth): deprecate mockbin
samugi Nov 15, 2023
f091b30
feat(bazel): build 2.8 CE on bazel
Water-Melon Nov 21, 2023
9d0bc18
test(cmd): record ngx.time() before generating a cert (#12306)
flrgh Jan 9, 2024
ace7398
chore(release): add changelog automation and verification (#12627)
team-gateway-bot Feb 26, 2024
20df4f8
chore(release): unify changelog PR reference links
outsinre Feb 26, 2024
05141cf
chore(release): do not generate changelogs if there is no yml file in…
outsinre Feb 26, 2024
1f237b9
chore(release): add .gitkeep to empty changelog dir when generating t…
outsinre Feb 26, 2024
2e7f751
tests: remove prefix directory when stop_kong called (#12713)
Water-Melon Mar 12, 2024
99f0c21
chore(CI): fix the workflow that comments the docker image on the com…
ADD-SP Mar 12, 2024
b96fcf3
chore(release): simplify changelog automation (#12765)
team-gateway-bot Mar 21, 2024
34a3c4c
fix(ci): replace "cpio" rpm extraction (#13233) (#13263)
team-gateway-bot Jun 21, 2024
1728936
chore(ci): disable package upload to Pulp (#13241)
Water-Melon Jun 21, 2024
57a8988
chore(release): update version to 2.8.5 (#13271)
AndyZhang0707 Jun 21, 2024
c19039d
perf(LuaJIT): revert optimization for hash (#13251)
team-gateway-bot Jun 21, 2024
a2f0059
chore(ci): fail on do-not-merge label (#9622)
mayocream Oct 27, 2022
8fbebad
chore(tests): fix label-check test (#9717)
fffonion Nov 8, 2022
d4d7a68
chore(ci): notify slack on PRs performing schema changes (#10395)
hbagdi Mar 1, 2023
ac58478
chore(ci): split schema change job (#10408)
hbagdi Mar 1, 2023
03b0e43
chore(actions): do not allow "backport master" labels (#10430)
dndx Mar 6, 2023
9a4cbeb
chore: run label based jobs on other events
hbagdi Mar 6, 2023
4e7bca4
chore(build): remove unrelated patches
Water-Melon Jun 22, 2024
2f9ccee
chore(build): fix docker image version
Water-Melon Jun 22, 2024
e00abd4
tests: fix(patches/openresty): used after free when encountering inva…
chobits Jun 22, 2024
da2b341
tests: remove 412 from test-suite template
chobits Jun 22, 2024
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
37 changes: 37 additions & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# NB: sematics here are not the same as .gitignore
# see https://github.com/bazelbuild/bazel/issues/8106
# Ignore backup files.
*~
# Ignore Vim swap files.
.*.swp
# Ignore files generated by IDEs.
/.aswb/
/.cache/
/.classpath
/.clwb/
/.factorypath
/.idea/
/.ijwb/
/.project
/.settings
/.vscode/
/bazel.iml
# Ignore all bazel-* symlinks. There is no full list since this can change
# based on the name of the directory bazel is cloned into.
/bazel-*
# Ignore outputs generated during Bazel bootstrapping.
/output/
# Ignore jekyll build output.
/production
/.sass-cache
# Bazelisk version file
.bazelversion
# User-specific .bazelrc
user.bazelrc

/t/
/spec/
/spec-ee/
/servroot/
/autodoc/
/.github/
51 changes: 51 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Bazel doesn't need more than 200MB of memory for local build based on memory profiling:
# https://docs.bazel.build/versions/master/skylark/performance.html#memory-profiling
# The default JVM max heapsize is 1/4 of physical memory up to 32GB which could be large
# enough to consume all memory constrained by cgroup in large host.
# Limiting JVM heapsize here to let it do GC more when approaching the limit to
# leave room for compiler/linker.
# The number 3G is chosen heuristically to both support large VM and small VM with RBE.
# Startup options cannot be selected via config.
startup --host_jvm_args=-Xmx512m

run --color=yes

common --color=yes
common --curses=auto

build --experimental_ui_max_stdouterr_bytes=10485760

build --show_progress_rate_limit=0
build --show_timestamps
build --worker_verbose

build --incompatible_strict_action_env

# Enable --platforms API based cpu,compiler,crosstool_top selection; remove this in 7.0.0 as it's enabled by default
build --incompatible_enable_cc_toolchain_resolution

# Pass PATH, CC, CXX variables from the environment.
build --action_env=CC --host_action_env=CC
build --action_env=CXX --host_action_env=CXX
build --action_env=PATH --host_action_env=PATH

build --action_env=BAZEL_BUILD=1

# temporary fix for https://github.com/bazelbuild/bazel/issues/12905 on macOS
build --features=-debug_prefix_map_pwd_is_dot

# Build flags.
build --action_env=BUILD_NAME=kong-dev
build --action_env=INSTALL_DESTDIR=MANAGED
build --strip=never

# Release flags
build:release --//:debug=false
build:release --action_env=BUILD_NAME=kong-dev
build:release --action_env=INSTALL_DESTDIR=/usr/local
build:release --copt="-g"
build:release --strip=never

build --spawn_strategy=local

build --action_env=GITHUB_TOKEN --host_action_env=GITHUB_TOKEN
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.1.0
62 changes: 62 additions & 0 deletions .ci/luacov-stats-aggregator.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
-- Aggregates stats from multiple luacov stat files.
-- Example stats for a 12 lines file `my/file.lua`
-- that received hits on lines 3, 4, 9:
--
-- ["my/file.lua"] = {
-- [3] = 1,
-- [4] = 3,
-- [9] = 2,
-- max = 12,
-- max_hits = 3
-- }
--

local luacov_stats = require "luacov.stats"
local luacov_reporter = require "luacov.reporter"
local luacov_runner = require "luacov.runner"
local lfs = require "lfs"


-- load parameters
local params = {...}
local stats_folders_prefix = params[1] or "luacov-stats-out-"
local file_name = params[2] or "luacov.stats.out"
local strip_prefix = params[3] or ""
local base_path = "."


-- load stats from different folders named using the format:
-- luacov-stats-out-${timestamp}
local loaded_stats = {}
for folder in lfs.dir(base_path) do
if folder:find(stats_folders_prefix, 1, true) then
local stats_file = folder .. "/" .. file_name
local loaded = luacov_stats.load(stats_file)
if loaded then
loaded_stats[#loaded_stats + 1] = loaded
print("loading file: " .. stats_file)
end
end
end


-- aggregate
luacov_runner.load_config()
for _, stat_data in ipairs(loaded_stats) do
-- make all paths relative to ensure file keys have the same format
-- and avoid having separate counters for the same file
local rel_stat_data = {}
for f_name, data in pairs(stat_data) do
if f_name:sub(0, #strip_prefix) == strip_prefix then
f_name = f_name:sub(#strip_prefix + 1)
end
rel_stat_data[f_name] = data
end

luacov_runner.data = rel_stat_data
luacov_runner.save_stats()
end


-- generate report
luacov_reporter.report()
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8000, 8001, "db:5432"],

"postCreateCommand": "make dev",
"postCreateCommand": "make venv-dev",

// Set *default* container specific settings.json values on container create.
// "settings": {},
Expand Down
8 changes: 4 additions & 4 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ services:
- ..:/workspace:cached

# Uncomment the next line to use Docker from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker-compose for details.
- /var/run/docker.sock:/var/run/docker.sock
- /var/run/docker.sock:/var/run/docker.sock

# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust.
cap_add:
- SYS_PTRACE
Expand All @@ -37,12 +37,12 @@ services:
CRYPTO_DIR: /usr/local/kong

# Overrides default command so things don't shut down after the process ends.
command: /bin/sh -c "while sleep 1000; do :; done"
command: /bin/sh -c "while sleep 1000; do :; done"

# Runs app on the same network as the service container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:db

# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)

# Uncomment the next line to use a non-root user for all processes - See https://aka.ms/vscode-remote/containers/non-root for details.
Expand Down
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered. Make sure you upgrade to the latest version of Kong.
description: Please search to see if an issue already exists for the bug you encountered. Make sure you are also using the latest version of Kong.
options:
- label: I have searched the existing issues
required: true
- type: input
attributes:
label: Kong version (`$ kong version`)
description: 'example: Kong 2.5'
placeholder: 'Please put the Kong Gateway version here.'
placeholder: 'Please provide the current Kong Gateway version you are using here.'
validations:
required: true
- type: textarea
Expand Down Expand Up @@ -40,7 +40,6 @@ body:
2. With this config...
3. Run '...'
4. See error...
render: markdown
validations:
required: false
- type: textarea
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
blank_issues_enabled: true
contact_links:
- name: Kong Gateway Open Source Community Pledge
url: https://github.com/Kong/kong/blob/master/COMMUNITY_PLEDGE.md
- name: Feature Request
url: https://github.com/Kong/kong/discussions/categories/ideas
about: Propose your cool ideas and feature requests at the Kong discussion forum
Expand Down
12 changes: 10 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,25 @@
NOTE: Please read the CONTRIBUTING.md guidelines before submitting your patch,
and ensure you followed them all:
https://github.com/Kong/kong/blob/master/CONTRIBUTING.md#contributing

Refer to the Kong Gateway Community Pledge to understand how we work
with the open source community:
https://github.com/Kong/kong/blob/master/COMMUNITY_PLEDGE.md
-->

### Summary

<!--- Why is this change required? What problem does it solve? -->

### Checklist

- [ ] The Pull Request has tests
- [ ] A changelog file has been created under `changelog/unreleased/kong` or `skip-changelog` label added on PR if changelog is unnecessary. [README.md](https://github.com/Kong/gateway-changelog/README.md)
- [ ] There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

### Full changelog

* [Implement ...]
* [Add related tests]
* ...

### Issue reference

Expand Down
62 changes: 62 additions & 0 deletions .github/actions/build-cache-key/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build Cache Key

description: >
Generates a cache key suitable for save/restore of Kong builds.

inputs:
prefix:
description: 'String prefix applied to the build cache key'
required: false
default: 'build'
extra:
description: 'Additional values/file hashes to use in the cache key'
required: false

outputs:
cache-key:
description: 'The generated cache key'
value: ${{ steps.cache-key.outputs.CACHE_KEY }}

runs:
using: composite
steps:
- name: Generate cache key
id: cache-key
shell: bash
env:
PREFIX: ${{ inputs.prefix }}
EXTRA: ${{ inputs.extra }}
run: |
# please keep these sorted
FILE_HASHES=(
${{ hashFiles('.bazelignore') }}
${{ hashFiles('.bazelrc') }}
${{ hashFiles('.bazelversion') }}
${{ hashFiles('.github/actions/build-cache-key/**') }}
${{ hashFiles('.github/workflows/build.yml') }}
${{ hashFiles('.requirements') }}
${{ hashFiles('BUILD.bazel') }}
${{ hashFiles('WORKSPACE') }}
${{ hashFiles('bin/kong') }}
${{ hashFiles('bin/kong-health') }}
${{ hashFiles('build/**') }}
${{ hashFiles('kong-*.rockspec') }}
${{ hashFiles('kong.conf.default') }}
)

if [[ -n ${EXTRA:-} ]]; then
readarray \
-O "${#FILE_HASHES[@]}" \
-t \
FILE_HASHES \
<<< "$EXTRA"
fi

HASH=$(printf '%s\n' "${FILE_HASHES[@]}" \
| grep -vE '^$' \
| sort --stable --unique \
| sha256sum - \
| awk '{print $1}'
)

echo "CACHE_KEY=${PREFIX}::${HASH}" | tee -a $GITHUB_OUTPUT
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
# Check for updates to GitHub Actions every week
interval: "weekly"
Loading
Loading