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

Conversation

chobits
Copy link
Contributor

@chobits chobits commented Jun 22, 2024

You don't need to merge this pr, because the original segfault fix(removing 412 from template) has been verified mannually (see KAG-2394).

Summary

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
  • There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

Issue reference

Fix #[issue number]

samugi and others added 22 commits June 21, 2024 15:10
mockbin.com redirects to insomnia official site and triggers a
security policy, which makes tests fail.
Several of these tests contained the following assertion after generating
a certificate with the `kong hybrid gen_cert` command:

```lua
assert(crt:get_not_before() >= ngx.time())
```

This produces failures every now and again when the clock has advanced
_just_ enough for ngx.time() to return `crt:get_not_before() + 1`. To
fix this, we record the time _before_ generating the cert and validate
against the stored timestamp.

(cherry picked from commit b7a8361)
Please check the contained README.md.

(cherry picked from commit f135c70)

Co-authored-by: Zachary Hu <[email protected]>
* chore(test): remove prefix directory when stop_kong called (#12691)

If the prefix is not cleaned up when stop_kong is called,
it could impact subsequent tests, especially when later tests
start Kong by a shell command, the Kong instance might
be started up with the default `servroot` prefix.

KAG-3808

(cherry picked from commit 3dd5bdb)

* remove prefix directory for 2.8
…mit (#12693) (#12711)

Replace `${{ secrets.GHA_COMMENT_TOKEN }}` with `${{ secrets.GITHUB_TOKEN }}`.

The `${{ secrets.GHA_COMMENT_TOKEN }}` needs to be manually rotated,
replacing it by `${{ secrets.GITHUB_TOKEN }}`, which is generated by each
run of the workflow, so we don't need to rotate token anymore.
cherry-pick from Kong/kong-ee#9042

KAG-4775

(cherry picked from commit 8e86dba)

Co-authored-by: Niklaus Schen <[email protected]>
* Create a clean version for 2.8 CE.

* Add back changelog.

---------

Co-authored-by: Zhongwei Yao <[email protected]>
With this patch, CI will notify a Kong Inc internal slack channel on
every PR that performs a schema change.
It seems that if the do not merge label job is skipped then the second
job doesn't run either:
https://github.com/Kong/kong/actions/runs/4307151445/jobs/7511859202

This change splits the job into two and narrows down the events on which
these jobs are triggered since the only meaninful input are the labels
on the PR.
This is a bad practice which could cause merge conflicts and is against our backport policy.
It seems that Github Actions is not running these jobs even once even
though the PRs are labelled at least once. This patch runs these jobs
on other related PR activity.
@chobits chobits added chore Not part of the core functionality of kong, but still needed size/L bug and removed core/docs core/language/python core/language/js plugins/prometheus chore Not part of the core functionality of kong, but still needed changelog autodoc schema-change-noteworthy build/bazel cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee size/M size/XXL labels Jun 22, 2024
@pull-request-size pull-request-size bot added size/M and removed size/L labels Jun 22, 2024
@github-actions github-actions bot removed the chore Not part of the core functionality of kong, but still needed label Jun 22, 2024
@chobits chobits changed the title Cherry pick 2.8.5 fix 412 backport tests: test mitigation for the segfault of if-match 412 Jun 22, 2024
@@ -140,7 +140,7 @@ http {
listen $(entry.listener);
> end

error_page 400 404 408 411 412 413 414 417 494 /kong_error_handler;
error_page 400 404 408 411 413 414 417 494 /kong_error_handler;
Copy link
Contributor Author

@chobits chobits Jun 22, 2024

Choose a reason for hiding this comment

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

For the unmitigated version: if we do not remove 412 from test template, it will cause segfault(signal 11): https://github.com/Kong/kong/actions/runs/9625903064/job/26551305748

Base automatically changed from cherry-pick-2.8.5 to release/2.8.5 June 22, 2024 21:08
@chronolaw
Copy link
Contributor

If it should not be merged, I tend to change it to draft.

@chronolaw chronolaw marked this pull request as draft July 1, 2024 01:43
@chobits
Copy link
Contributor Author

chobits commented Jul 1, 2024

I'm closing it, it was originally used to test if this fix work for 2.8.5's mitigation method.

@chobits chobits closed this Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet