[TT-10104] JS middleware + ignore auth test and fix for panic#6180
Conversation
|
API Changes --- prev.txt 2024-03-26 10:14:31.813098767 +0000
+++ current.txt 2024-03-26 10:14:28.801073492 +0000
@@ -11352,6 +11352,8 @@
manipulate
func MyPluginReturningError(rw http.ResponseWriter, r *http.Request)
+# Package: ./tests/regression
+
# Package: ./trace
package trace // import "github.com/TykTechnologies/tyk/trace" |
|
PR Description updated to latest commit (af880fd) |
PR Review
Code feedback:
✨ Review tool usage guide:Overview: With a configuration file, use the following template:
See the review usage page for a comprehensive guide on using this tool. |
PR Code Suggestions
✨ Improve tool usage guide:Overview: With a configuration file, use the following template:
See the improve usage page for a more comprehensive guide on using this tool. |
f576f81 to
070c917
Compare
070c917 to
2d7ce18
Compare
💥 CI tests failed 🙈git-stateall okPlease look at the run or in the Checks tab. |
|
|
/release to release-5.3 |
|
Working on it! Note that it can take a few minutes. |
## **User description** - add regression test suite to replicate panic with supplied apidef/scripts - fixes panic due to missing session data in JS middleware https://tyktech.atlassian.net/browse/TT-10104 ___ ## **Type** bug_fix, tests ___ ## **Description** - Fixed a panic issue in the JS middleware by adding a nil check for the session object. - Added a comprehensive regression test suite for issue TT-10104 to prevent future occurrences. - Introduced utility functions and documentation to aid in the setup and understanding of regression tests. - Included a Taskfile for streamlined execution of regression tests. ___ ## **Changes walkthrough** <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>mw_js_plugin.go</strong><dd><code>Fix panic due to nil session in JS middleware</code> </dd></summary> <hr> gateway/mw_js_plugin.go <li>Added a nil check for session before accessing session.MetaData to <br>prevent panic.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-78cd278aba997558b7daa7897051a794ef860076d45c93be792791db39381ca0">+1/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>issue_10104_test.go</strong><dd><code>Add regression test for issue TT-10104</code> </dd></summary> <hr> tests/regression/issue_10104_test.go <li>Introduced a regression test for issue TT-10104 to ensure no panic <br>occurs with JS middleware.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-fc9eecfe93848b08071a184af53473165b641230bccba931e8abbed89ac03d82">+22/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>regression_test.go</strong><dd><code>Utility functions for regression tests setup</code> </dd></summary> <hr> tests/regression/regression_test.go <li>Added utility functions for loading API specifications and files <br>within regression tests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-24d0ac1f4eb4bb6e33d0db26aca8ef96aef2b67fd2730fcde6e952ce3d894696">+40/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>issue-10104-script.js</strong><dd><code>JS script for replicating panic scenario in tests</code> </dd></summary> <hr> tests/regression/testdata/issue-10104-script.js <li>Added a JS script to replicate the scenario causing the panic for <br>testing purposes.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-651e25aaab23d941e1c4153852448530cc72876f62332a4d46ef619a85dc4bbb">+7/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>issue-10104-apidef.json</strong><dd><code>API definition for regression test of issue TT-10104</code> </dd></summary> <hr> tests/regression/testdata/issue-10104-apidef.json <li>Included an API definition JSON file used by the regression test for <br>issue TT-10104.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-7e34a83291fc3017307d4734f586656cc80364a1d89cf286e9acd8d34e9c738e">+469/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Documentation</strong></td><td><table> <tr> <td> <details> <summary><strong>README.md</strong><dd><code>Documentation for regression tests structure and conventions</code></dd></summary> <hr> tests/regression/README.md <li>Provided documentation on the structure and conventions for adding <br>regression tests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-ca1649dd4084b45ff660ae7552d4fcd49f45a52e0e3c96991751e63452020a8f">+10/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Configuration changes</strong></td><td><table> <tr> <td> <details> <summary><strong>Taskfile.yml</strong><dd><code>Taskfile for managing regression tests execution</code> </dd></summary> <hr> tests/regression/Taskfile.yml <li>Added a Taskfile for running regression tests with specific commands <br>and environment variables.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-32da89368e3551ec281e80af08b54c3410bcea3257e75af6bac113a51d822a55">+42/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > ✨ **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions --------- Co-authored-by: Tit Petric <[email protected]> (cherry picked from commit e723d10)
…nd fix for panic (#6180) [TT-10104] JS middleware + ignore auth test and fix for panic (#6180) ## **User description** - add regression test suite to replicate panic with supplied apidef/scripts - fixes panic due to missing session data in JS middleware https://tyktech.atlassian.net/browse/TT-10104 ___ ## **Type** bug_fix, tests ___ ## **Description** - Fixed a panic issue in the JS middleware by adding a nil check for the session object. - Added a comprehensive regression test suite for issue TT-10104 to prevent future occurrences. - Introduced utility functions and documentation to aid in the setup and understanding of regression tests. - Included a Taskfile for streamlined execution of regression tests. ___ ## **Changes walkthrough** <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>mw_js_plugin.go</strong><dd><code>Fix panic due to nil session in JS middleware</code> </dd></summary> <hr> gateway/mw_js_plugin.go <li>Added a nil check for session before accessing session.MetaData to <br>prevent panic.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-78cd278aba997558b7daa7897051a794ef860076d45c93be792791db39381ca0">+1/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>issue_10104_test.go</strong><dd><code>Add regression test for issue TT-10104</code> </dd></summary> <hr> tests/regression/issue_10104_test.go <li>Introduced a regression test for issue TT-10104 to ensure no panic <br>occurs with JS middleware.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-fc9eecfe93848b08071a184af53473165b641230bccba931e8abbed89ac03d82">+22/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>regression_test.go</strong><dd><code>Utility functions for regression tests setup</code> </dd></summary> <hr> tests/regression/regression_test.go <li>Added utility functions for loading API specifications and files <br>within regression tests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-24d0ac1f4eb4bb6e33d0db26aca8ef96aef2b67fd2730fcde6e952ce3d894696">+40/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>issue-10104-script.js</strong><dd><code>JS script for replicating panic scenario in tests</code> </dd></summary> <hr> tests/regression/testdata/issue-10104-script.js <li>Added a JS script to replicate the scenario causing the panic for <br>testing purposes.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-651e25aaab23d941e1c4153852448530cc72876f62332a4d46ef619a85dc4bbb">+7/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>issue-10104-apidef.json</strong><dd><code>API definition for regression test of issue TT-10104</code> </dd></summary> <hr> tests/regression/testdata/issue-10104-apidef.json <li>Included an API definition JSON file used by the regression test for <br>issue TT-10104.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-7e34a83291fc3017307d4734f586656cc80364a1d89cf286e9acd8d34e9c738e">+469/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Documentation</strong></td><td><table> <tr> <td> <details> <summary><strong>README.md</strong><dd><code>Documentation for regression tests structure and conventions</code></dd></summary> <hr> tests/regression/README.md <li>Provided documentation on the structure and conventions for adding <br>regression tests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-ca1649dd4084b45ff660ae7552d4fcd49f45a52e0e3c96991751e63452020a8f">+10/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Configuration changes</strong></td><td><table> <tr> <td> <details> <summary><strong>Taskfile.yml</strong><dd><code>Taskfile for managing regression tests execution</code> </dd></summary> <hr> tests/regression/Taskfile.yml <li>Added a Taskfile for running regression tests with specific commands <br>and environment variables.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-32da89368e3551ec281e80af08b54c3410bcea3257e75af6bac113a51d822a55">+42/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > ✨ **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions --------- Co-authored-by: Tit Petric <[email protected]>
|
@titpetric Succesfully merged PR |
|
/release to release-5-lts |
|
Working on it! Note that it can take a few minutes. |
## **User description** - add regression test suite to replicate panic with supplied apidef/scripts - fixes panic due to missing session data in JS middleware https://tyktech.atlassian.net/browse/TT-10104 ___ ## **Type** bug_fix, tests ___ ## **Description** - Fixed a panic issue in the JS middleware by adding a nil check for the session object. - Added a comprehensive regression test suite for issue TT-10104 to prevent future occurrences. - Introduced utility functions and documentation to aid in the setup and understanding of regression tests. - Included a Taskfile for streamlined execution of regression tests. ___ ## **Changes walkthrough** <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>mw_js_plugin.go</strong><dd><code>Fix panic due to nil session in JS middleware</code> </dd></summary> <hr> gateway/mw_js_plugin.go <li>Added a nil check for session before accessing session.MetaData to <br>prevent panic.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-78cd278aba997558b7daa7897051a794ef860076d45c93be792791db39381ca0">+1/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>issue_10104_test.go</strong><dd><code>Add regression test for issue TT-10104</code> </dd></summary> <hr> tests/regression/issue_10104_test.go <li>Introduced a regression test for issue TT-10104 to ensure no panic <br>occurs with JS middleware.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-fc9eecfe93848b08071a184af53473165b641230bccba931e8abbed89ac03d82">+22/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>regression_test.go</strong><dd><code>Utility functions for regression tests setup</code> </dd></summary> <hr> tests/regression/regression_test.go <li>Added utility functions for loading API specifications and files <br>within regression tests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-24d0ac1f4eb4bb6e33d0db26aca8ef96aef2b67fd2730fcde6e952ce3d894696">+40/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>issue-10104-script.js</strong><dd><code>JS script for replicating panic scenario in tests</code> </dd></summary> <hr> tests/regression/testdata/issue-10104-script.js <li>Added a JS script to replicate the scenario causing the panic for <br>testing purposes.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-651e25aaab23d941e1c4153852448530cc72876f62332a4d46ef619a85dc4bbb">+7/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>issue-10104-apidef.json</strong><dd><code>API definition for regression test of issue TT-10104</code> </dd></summary> <hr> tests/regression/testdata/issue-10104-apidef.json <li>Included an API definition JSON file used by the regression test for <br>issue TT-10104.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-7e34a83291fc3017307d4734f586656cc80364a1d89cf286e9acd8d34e9c738e">+469/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Documentation</strong></td><td><table> <tr> <td> <details> <summary><strong>README.md</strong><dd><code>Documentation for regression tests structure and conventions</code></dd></summary> <hr> tests/regression/README.md <li>Provided documentation on the structure and conventions for adding <br>regression tests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-ca1649dd4084b45ff660ae7552d4fcd49f45a52e0e3c96991751e63452020a8f">+10/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Configuration changes</strong></td><td><table> <tr> <td> <details> <summary><strong>Taskfile.yml</strong><dd><code>Taskfile for managing regression tests execution</code> </dd></summary> <hr> tests/regression/Taskfile.yml <li>Added a Taskfile for running regression tests with specific commands <br>and environment variables.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-32da89368e3551ec281e80af08b54c3410bcea3257e75af6bac113a51d822a55">+42/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > ✨ **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions --------- Co-authored-by: Tit Petric <[email protected]> (cherry picked from commit e723d10)
|
@titpetric Succesfully merged PR |
… and fix for panic (#6180) [TT-10104] JS middleware + ignore auth test and fix for panic (#6180) ## **User description** - add regression test suite to replicate panic with supplied apidef/scripts - fixes panic due to missing session data in JS middleware https://tyktech.atlassian.net/browse/TT-10104 ___ ## **Type** bug_fix, tests ___ ## **Description** - Fixed a panic issue in the JS middleware by adding a nil check for the session object. - Added a comprehensive regression test suite for issue TT-10104 to prevent future occurrences. - Introduced utility functions and documentation to aid in the setup and understanding of regression tests. - Included a Taskfile for streamlined execution of regression tests. ___ ## **Changes walkthrough** <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>mw_js_plugin.go</strong><dd><code>Fix panic due to nil session in JS middleware</code> </dd></summary> <hr> gateway/mw_js_plugin.go <li>Added a nil check for session before accessing session.MetaData to <br>prevent panic.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-78cd278aba997558b7daa7897051a794ef860076d45c93be792791db39381ca0">+1/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>issue_10104_test.go</strong><dd><code>Add regression test for issue TT-10104</code> </dd></summary> <hr> tests/regression/issue_10104_test.go <li>Introduced a regression test for issue TT-10104 to ensure no panic <br>occurs with JS middleware.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-fc9eecfe93848b08071a184af53473165b641230bccba931e8abbed89ac03d82">+22/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>regression_test.go</strong><dd><code>Utility functions for regression tests setup</code> </dd></summary> <hr> tests/regression/regression_test.go <li>Added utility functions for loading API specifications and files <br>within regression tests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-24d0ac1f4eb4bb6e33d0db26aca8ef96aef2b67fd2730fcde6e952ce3d894696">+40/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>issue-10104-script.js</strong><dd><code>JS script for replicating panic scenario in tests</code> </dd></summary> <hr> tests/regression/testdata/issue-10104-script.js <li>Added a JS script to replicate the scenario causing the panic for <br>testing purposes.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-651e25aaab23d941e1c4153852448530cc72876f62332a4d46ef619a85dc4bbb">+7/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>issue-10104-apidef.json</strong><dd><code>API definition for regression test of issue TT-10104</code> </dd></summary> <hr> tests/regression/testdata/issue-10104-apidef.json <li>Included an API definition JSON file used by the regression test for <br>issue TT-10104.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-7e34a83291fc3017307d4734f586656cc80364a1d89cf286e9acd8d34e9c738e">+469/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Documentation</strong></td><td><table> <tr> <td> <details> <summary><strong>README.md</strong><dd><code>Documentation for regression tests structure and conventions</code></dd></summary> <hr> tests/regression/README.md <li>Provided documentation on the structure and conventions for adding <br>regression tests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-ca1649dd4084b45ff660ae7552d4fcd49f45a52e0e3c96991751e63452020a8f">+10/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Configuration changes</strong></td><td><table> <tr> <td> <details> <summary><strong>Taskfile.yml</strong><dd><code>Taskfile for managing regression tests execution</code> </dd></summary> <hr> tests/regression/Taskfile.yml <li>Added a Taskfile for running regression tests with specific commands <br>and environment variables.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6180/files#diff-32da89368e3551ec281e80af08b54c3410bcea3257e75af6bac113a51d822a55">+42/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > ✨ **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions --------- Co-authored-by: Tit Petric <[email protected]>



User description
https://tyktech.atlassian.net/browse/TT-10104
Type
bug_fix, tests
Description
Changes walkthrough
mw_js_plugin.go
Fix panic due to nil session in JS middlewaregateway/mw_js_plugin.go
prevent panic.
issue_10104_test.go
Add regression test for issue TT-10104tests/regression/issue_10104_test.go
occurs with JS middleware.
regression_test.go
Utility functions for regression tests setuptests/regression/regression_test.go
within regression tests.
issue-10104-script.js
JS script for replicating panic scenario in teststests/regression/testdata/issue-10104-script.js
testing purposes.
issue-10104-apidef.json
API definition for regression test of issue TT-10104tests/regression/testdata/issue-10104-apidef.json
issue TT-10104.
README.md
Documentation for regression tests structure and conventionstests/regression/README.md
regression tests.
Taskfile.yml
Taskfile for managing regression tests executiontests/regression/Taskfile.yml
and environment variables.