-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Merging to release-5.5: [TT-12762]respect response plugins contract over responsePlugin.plugins (#6441) #6443
Merging to release-5.5: [TT-12762]respect response plugins contract over responsePlugin.plugins (#6441) #6443
Conversation
…ns (#6441) ### **User description** <!-- Provide a general summary of your changes in the Title above --> ## Description Fix a bug where response plugins are not loaded when using OAS APIs. ## Related Issue https://tyktech.atlassian.net/browse/TT-12762 ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## How This Has Been Tested <!-- Please describe in detail how you tested your changes --> <!-- Include details of your testing environment, and the tests --> <!-- you ran to see how your change affects other areas of the code, etc. --> <!-- This information is helpful for reviewers and QA. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply --> <!-- If there are no documentation updates required, mark the item as checked. --> <!-- Raise up any additional concerns not covered by the checklist. --> - [ ] I ensured that the documentation is up to date - [ ] I explained why this PR updates go.mod in detail with reasoning why it's required - [ ] I would like a code coverage CI quality gate exception and have explained why ___ ### **PR Type** Bug fix, Tests ___ ### **Description** - Fixed a bug where response plugins were not loaded correctly when using OAS APIs by adding a return statement after extracting response plugins. - Added a new test case to verify the correct extraction of response plugins and ensure the regression issue TT-12762 is resolved. ___ ### **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>middleware.go</strong><dd><code>Fix response plugins extraction logic</code> </dd></summary> <hr> apidef/oas/middleware.go <li>Added a return statement after extracting response plugins to ensure <br>correct behavior.<br> <li> Initialized <code>ResponsePlugin</code> if it is nil.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6441/files#diff-992ec7c28d25fd54f6491d295389757705cd114bc869a35cba50d42e548cdc6e">+1/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>middleware_test.go</strong><dd><code>Add test for response plugins extraction</code> </dd></summary> <hr> apidef/oas/middleware_test.go <li>Added a new test case to verify the correct extraction of response <br>plugins.<br> <li> Ensured the test case checks for the regression issue TT-12762.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6441/files#diff-0af31cb29ae298a6ac3e402b283ab364a6fd793fd04f253ef7c4983234c17bef">+56/-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 (cherry picked from commit 5689c82)
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨
|
Quality Gate passedIssues Measures |
User description
TT-12762respect response plugins contract over responsePlugin.plugins (#6441)
User description
Description
Fix a bug where response plugins are not loaded when using OAS APIs.
Related Issue
https://tyktech.atlassian.net/browse/TT-12762
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
functionality to change)
coverage to functionality)
Checklist
why it's required
explained why
PR Type
Bug fix, Tests
Description
using OAS APIs by adding a return statement after extracting response
plugins.
plugins and ensure the regression issue TT-12762 is resolved.
Changes walkthrough 📝
middleware.go
Fix response plugins extraction logic
apidef/oas/middleware.go
correct behavior.
ResponsePlugin
if it is nil.middleware_test.go
Add test for response plugins extraction
apidef/oas/middleware_test.go
plugins.
PR Type
Bug fix, Tests
Description
Changes walkthrough 📝
middleware.go
Ensure response plugins are loaded correctly in OAS APIs
apidef/oas/middleware.go
proper loading.
middleware_test.go
Add test cases for response plugins in middleware
apidef/oas/middleware_test.go