-
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
[TT-14102] fix api level and endpoint level cache migration #6931
Conversation
Let's make that PR title a 💯 shall we? 💪 Your PR title and story title look slightly different. Just checking in to know if it was intentional!
Check out this guide to learn more about PR best-practices. |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
API Changes --- prev.txt 2025-03-13 11:49:42.810654206 +0000
+++ current.txt 2025-03-13 11:49:38.216655683 +0000
@@ -96,6 +96,8 @@
)
const (
ResponseProcessorResponseBodyTransform = "response_body_transform"
+ // DefaultCacheTimeout is the default cache TTL in seconds if not specified for api and endpoint level caching
+ DefaultCacheTimeout int64 = 60
)
VARIABLES |
PR Code Suggestions ✨Explore these optional code suggestions:
|
|
/release to release-5.8 |
Working on it! Note that it can take a few minutes. |
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-14102" title="TT-14102" target="_blank">TT-14102</a></summary> <br /> <table> <tr> <th>Summary</th> <td>[OAS migration] Cache and Advanced Cache combined</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td>-</td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description This PR ensures that `OAS` cache is migrated correctly from the `classic` API. Values are imported from the API-level configuration (lower priority) and/or endpoint-level configurations (higher priority). For timeout, a default value of `60` is used if neither the API-level nor endpoint-level configuration specifies one. <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> https://tyktech.atlassian.net/browse/TT-14102 ## 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** - Enhancement ___ ### **Description** - Added debug logs to trace cache metadata. - Logged response codes and timeout values. - Aided testing of advanced cache behavior. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>mw_redis_cache.go</strong><dd><code>Add debug logs in Redis cache middleware.</code> </dd></summary> <hr> gateway/mw_redis_cache.go <li>Inserted log for <code>cacheMeta</code> details.<br> <li> Logged <code>cacheOnlyResponseCodes</code> value.<br> <li> Logged <code>timeout</code> parameter. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6931/files#diff-6266e0dbd16cef89e6de86a2c893114ba07799c804e2138172f9f94b08cdded8">+5/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details> (cherry picked from commit 44969bb)
@edsonmichaque Seems like there is conflict and it require manual merge. |
…ache migration (#6931) (#6950) ### **User description** [TT-14102] fix api level and endpoint level cache migration (#6931) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-14102" title="TT-14102" target="_blank">TT-14102</a></summary> <br /> <table> <tr> <th>Summary</th> <td>[OAS migration] Cache and Advanced Cache combined</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td>-</td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description This PR ensures that `OAS` cache is migrated correctly from the `classic` API. Values are imported from the API-level configuration (lower priority) and/or endpoint-level configurations (higher priority). For timeout, a default value of `60` is used if neither the API-level nor endpoint-level configuration specifies one. <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> https://tyktech.atlassian.net/browse/TT-14102 ## 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** - Enhancement ___ ### **Description** - Added debug logs to trace cache metadata. - Logged response codes and timeout values. - Aided testing of advanced cache behavior. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>mw_redis_cache.go</strong><dd><code>Add debug logs in Redis cache middleware.</code> </dd></summary> <hr> gateway/mw_redis_cache.go <li>Inserted log for <code>cacheMeta</code> details.<br> <li> Logged <code>cacheOnlyResponseCodes</code> value.<br> <li> Logged <code>timeout</code> parameter. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6931/files#diff-6266e0dbd16cef89e6de86a2c893114ba07799c804e2138172f9f94b08cdded8">+5/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details> [TT-14102]: https://tyktech.atlassian.net/browse/TT-14102?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ ___ ### **PR Type** - Bug fix - Enhancement ___ ### **Description** - Migrate simple cache settings to advanced config. - Introduce helper createAdvancedCacheConfig function. - Update middleware to apply default cache timeout. - Add extensive tests and fixtures for cache migration. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>migration.go</strong><dd><code>Migrate cache config using helper function.</code> </dd></summary> <hr> apidef/migration.go <li>Added DefaultCacheTimeout constant.<br> <li> Replaced basic cache migration with createAdvancedCacheConfig.<br> <li> Appended advanced cache config to preserve existing settings.<br> <li> Cleared old simple cache configuration. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6950/files#diff-e1d9b55a26f9d6225d56d6f0161959217308e5ad4d6934e7d7df4595d9c2a130">+39/-14</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>migration_test.go</strong><dd><code>Enhance cache migration tests.</code> </dd></summary> <hr> apidef/migration_test.go <li>Removed outdated TestAPIDefinition_MigrateCachePlugin.<br> <li> Added new tests for cache migration behavior.<br> <li> Included tests for multiple cache paths and helper function. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6950/files#diff-d79d77f814074b9e483554e36687e22fda759045141c3b094b039428744ff94c">+326/-39</a></td> </tr> <tr> <td> <details> <summary><strong>middleware_test.go</strong><dd><code>Add comprehensive tests for CachePlugin.Fill.</code> </dd></summary> <hr> apidef/oas/middleware_test.go <li>Introduced multiple tests for CachePlugin.Fill.<br> <li> Covered scenarios for default timeout, disabled cache, and regex <br>presence. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6950/files#diff-0af31cb29ae298a6ac3e402b283ab364a6fd793fd04f253ef7c4983234c17bef">+124/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>cache.yml</strong><dd><code>Add cache fixture for integration testing.</code> </dd></summary> <hr> apidef/oas/testdata/fixtures/cache.yml <li>Added new cache test fixture configuration.<br> <li> Included scenarios for classic and advanced cache entries. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6950/files#diff-3938aa8840266a6527f058f3a7682ef6ce5279ddc3cdbef2be8317f3065beeb6">+98/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>middleware.go</strong><dd><code>Update middleware default timeout logic.</code> </dd></summary> <hr> apidef/oas/middleware.go <li>Updated Fill function to set default timeout.<br> <li> Enabled default cache timeout if none provided. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6950/files#diff-992ec7c28d25fd54f6491d295389757705cd114bc869a35cba50d42e548cdc6e">+5/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details> Co-authored-by: Edson Michaque <[email protected]>
/release to release-5.8.0 |
Working on it! Note that it can take a few minutes. |
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-14102" title="TT-14102" target="_blank">TT-14102</a></summary> <br /> <table> <tr> <th>Summary</th> <td>[OAS migration] Cache and Advanced Cache combined</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td>-</td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description This PR ensures that `OAS` cache is migrated correctly from the `classic` API. Values are imported from the API-level configuration (lower priority) and/or endpoint-level configurations (higher priority). For timeout, a default value of `60` is used if neither the API-level nor endpoint-level configuration specifies one. <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> https://tyktech.atlassian.net/browse/TT-14102 ## 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** - Enhancement ___ ### **Description** - Added debug logs to trace cache metadata. - Logged response codes and timeout values. - Aided testing of advanced cache behavior. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>mw_redis_cache.go</strong><dd><code>Add debug logs in Redis cache middleware.</code> </dd></summary> <hr> gateway/mw_redis_cache.go <li>Inserted log for <code>cacheMeta</code> details.<br> <li> Logged <code>cacheOnlyResponseCodes</code> value.<br> <li> Logged <code>timeout</code> parameter. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6931/files#diff-6266e0dbd16cef89e6de86a2c893114ba07799c804e2138172f9f94b08cdded8">+5/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details> (cherry picked from commit 44969bb)
@edsonmichaque Seems like there is conflict and it require manual merge. |
… cache migration (#6931) (#6951) ### **User description** [TT-14102] fix api level and endpoint level cache migration (#6931) ### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-14102" title="TT-14102" target="_blank">TT-14102</a></summary> <br /> <table> <tr> <th>Summary</th> <td>[OAS migration] Cache and Advanced Cache combined</td> </tr> <tr> <th>Type</th> <td> <img alt="Bug" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium" /> Bug </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td>-</td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- <!-- Provide a general summary of your changes in the Title above --> ## Description This PR ensures that `OAS` cache is migrated correctly from the `classic` API. Values are imported from the API-level configuration (lower priority) and/or endpoint-level configurations (higher priority). For timeout, a default value of `60` is used if neither the API-level nor endpoint-level configuration specifies one. <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> https://tyktech.atlassian.net/browse/TT-14102 ## 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** - Enhancement ___ ### **Description** - Added debug logs to trace cache metadata. - Logged response codes and timeout values. - Aided testing of advanced cache behavior. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>mw_redis_cache.go</strong><dd><code>Add debug logs in Redis cache middleware.</code> </dd></summary> <hr> gateway/mw_redis_cache.go <li>Inserted log for <code>cacheMeta</code> details.<br> <li> Logged <code>cacheOnlyResponseCodes</code> value.<br> <li> Logged <code>timeout</code> parameter. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6931/files#diff-6266e0dbd16cef89e6de86a2c893114ba07799c804e2138172f9f94b08cdded8">+5/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details> [TT-14102]: https://tyktech.atlassian.net/browse/TT-14102?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ ___ ### **PR Type** - Enhancement - Tests ___ ### **Description** - Introduce DefaultCacheTimeout constant and helper function. - Refactor MigrateCachePlugin to build advanced cache config. - Enhance CachePlugin.Fill to apply default timeout. - Add comprehensive tests and fixtures for caching. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>migration.go</strong><dd><code>Refactor cache migration logic with helper function.</code> </dd></summary> <hr> apidef/migration.go <li>Add DefaultCacheTimeout constant.<br> <li> Refactor MigrateCachePlugin to use createAdvancedCacheConfig.<br> <li> Introduce createAdvancedCacheConfig helper. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6951/files#diff-e1d9b55a26f9d6225d56d6f0161959217308e5ad4d6934e7d7df4595d9c2a130">+39/-14</a> </td> </tr> <tr> <td> <details> <summary><strong>middleware.go</strong><dd><code>Enhance middleware Fill with default timeout.</code> </dd></summary> <hr> apidef/oas/middleware.go <li>Update CachePlugin.Fill to assign default timeout.<br> <li> Ensure proper handling when caching is enabled. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6951/files#diff-992ec7c28d25fd54f6491d295389757705cd114bc869a35cba50d42e548cdc6e">+5/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>migration_test.go</strong><dd><code>Add tests for advanced cache migration.</code> </dd></summary> <hr> apidef/migration_test.go <li>Add new tests for cache migration.<br> <li> Test multiple methods and configuration scenarios.<br> <li> Introduce TestCreateAdvancedCacheConfig. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6951/files#diff-d79d77f814074b9e483554e36687e22fda759045141c3b094b039428744ff94c">+326/-39</a></td> </tr> <tr> <td> <details> <summary><strong>middleware_test.go</strong><dd><code>Test enhancement for CachePlugin.Fill.</code> </dd></summary> <hr> apidef/oas/middleware_test.go <li>Add tests for CachePlugin.Fill behavior.<br> <li> Validate default timeout and response code handling. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6951/files#diff-0af31cb29ae298a6ac3e402b283ab364a6fd793fd04f253ef7c4983234c17bef">+124/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>cache.yml</strong><dd><code>Add cache configuration fixture.</code> </dd></summary> <hr> apidef/oas/testdata/fixtures/cache.yml <li>Add fixture file for cache configuration tests.<br> <li> Define multiple advanced cache entries scenarios. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6951/files#diff-3938aa8840266a6527f058f3a7682ef6ce5279ddc3cdbef2be8317f3065beeb6">+98/-0</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details> Co-authored-by: Edson Michaque <[email protected]>
User description
TT-14102
Description
This PR ensures that
OAS
cache is migrated correctly from theclassic
API. Values are imported from the API-level configuration (lower priority) and/or endpoint-level configurations (higher priority). For timeout, a default value of60
is used if neither the API-level nor endpoint-level configuration specifies one.Related Issue
https://tyktech.atlassian.net/browse/TT-14102
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist
PR Type
Description
Added debug logs to trace cache metadata.
Logged response codes and timeout values.
Aided testing of advanced cache behavior.
Changes walkthrough 📝
mw_redis_cache.go
Add debug logs in Redis cache middleware.
gateway/mw_redis_cache.go
cacheMeta
details.cacheOnlyResponseCodes
value.timeout
parameter.