[TT-7560] skip loading API when custom middleware bundle fetch fails#6211
Conversation
|
API Changes --- prev.txt 2024-04-08 20:19:20.804391951 +0000
+++ current.txt 2024-04-08 20:19:18.012350648 +0000
@@ -7085,7 +7085,7 @@
func (a APIDefinitionLoader) GetOASFilepath(path string) string
-func (a APIDefinitionLoader) MakeSpec(def *nestedApiDefinition, logger *logrus.Entry) *APISpec
+func (a APIDefinitionLoader) MakeSpec(def *nestedApiDefinition, logger *logrus.Entry) (*APISpec, error)
MakeSpec will generate a flattened URLSpec from and APIDefinitions'
VersionInfo data. paths are keyed to the Api version name, which is
determined during routing to speed up lookups |
|
PR Description updated to latest commit (112c705) |
PR Review
Code feedback:
✨ Review tool usage guide:Overview: The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
See the review usage page for a comprehensive guide on using this tool. |
PR Code Suggestions
✨ Improve tool usage guide:Overview:
See the improve usage page for a comprehensive guide on using this tool. |
💥 CI tests failed 🙈git-stateall okPlease look at the run or in the Checks tab. |
1 similar comment
💥 CI tests failed 🙈git-stateall okPlease look at the run or in the Checks tab. |
112c705 to
b1bdee0
Compare
💥 CI tests failed 🙈git-stateall okPlease look at the run or in the Checks tab. |
1 similar comment
💥 CI tests failed 🙈git-stateall okPlease look at the run or in the Checks tab. |
💥 CI tests failed 🙈git-stateall okPlease look at the run or in the Checks tab. |
|
|
/release to release-5.3 |
|
/release to release-5-lts |
|
Working on it! Note that it can take a few minutes. |
1 similar comment
|
Working on it! Note that it can take a few minutes. |
…6211) ## **User description** <!-- Provide a general summary of your changes in the Title above --> ## Description Skip loading an API when the custom middleware bundle fetch fails. ## 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. --> ## 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 ___ ## **Type** bug_fix, enhancement ___ ## **Description** - Modified `MakeSpec` in `api_definition.go` to return an error along with `*APISpec`, enhancing error handling during API spec creation. - Implemented error handling in various functions and tests that call `MakeSpec`, ensuring that API loading can be skipped if a custom middleware bundle fetch fails. - Added and updated tests to cover new scenarios related to custom middleware bundle fetching and API loading 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>api_definition.go</strong><dd><code>Handle Errors in API Spec Creation and Skip on Bundle Fetch Failures</code></dd></summary> <hr> gateway/api_definition.go <li>Changed <code>MakeSpec</code> to return an error along with <code>*APISpec</code>.<br> <li> Updated <code>prepareSpecs</code> and <code>loadDefFromFilePath</code> to handle errors from <br><code>MakeSpec</code>.<br> <li> Modified API loading to skip APIs when bundle fetch fails. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-0cf80174bbafb36f6d4f4308ebbd971b2833b76a936bad568220aa1a4ba0ee8b">+11/-8</a> </td> </tr> <tr> <td> <details> <summary><strong>tracing.go</strong><dd><code>Improve Error Handling in Trace Handler</code> </dd></summary> <hr> gateway/tracing.go <li>Updated trace handler to handle errors from <code>MakeSpec</code> and return an <br>appropriate response. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-0069987d730b02812808925a17e1434ca7558a4dfc8661beb27ccd11afb8c77d">+6/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>coprocess_bundle_test.go</strong><dd><code>Test Custom Middleware Bundle Fetch Scenarios</code> </dd></summary> <hr> gateway/coprocess_bundle_test.go <li>Added tests to verify API loading behavior with custom middleware <br>bundle fetch scenarios. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-7fded1570c90f7be73d562f3ebcbb32fe4d50548dc5e959d8ecadddef13941fa">+24/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>coprocess_id_extractor_test.go</strong><dd><code>Update Spec Creation in ID Extractor Tests</code> </dd></summary> <hr> gateway/coprocess_id_extractor_test.go - Updated `createSpecTestFrom` to handle errors from `MakeSpec`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-077f3e65a150ce6b3b1c2ebc67e0482f1a5446ff6264754607d86c4691984375">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>gateway_test.go</strong><dd><code>Test API Loading Failure on Bundle Fetch Failure</code> </dd></summary> <hr> gateway/gateway_test.go <li>Added a test case to verify the behavior when API loading fails due to <br>bundle fetch failure. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-d34c7069ce5e81d45082b19eb3e869ee1a086e185dcd6630e75e3ed0d368b546">+13/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>testutil.go</strong><dd><code>Handle Spec Creation Errors in Test Utilities</code> </dd></summary> <hr> gateway/testutil.go <li>Updated <code>CreateDefinitionFromString</code> to handle errors from <code>MakeSpec</code>. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-7aaf6ae49fb8f58a8c99d337fedd15b3e430dd928ed547e425ef429b10d28ce8">+1/-1</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 dc2a7ea)
|
@jeffy-mathew Succesfully merged PR |
|
Still working... |
…6211) ## **User description** <!-- Provide a general summary of your changes in the Title above --> ## Description Skip loading an API when the custom middleware bundle fetch fails. ## 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. --> ## 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 ___ ## **Type** bug_fix, enhancement ___ ## **Description** - Modified `MakeSpec` in `api_definition.go` to return an error along with `*APISpec`, enhancing error handling during API spec creation. - Implemented error handling in various functions and tests that call `MakeSpec`, ensuring that API loading can be skipped if a custom middleware bundle fetch fails. - Added and updated tests to cover new scenarios related to custom middleware bundle fetching and API loading 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>api_definition.go</strong><dd><code>Handle Errors in API Spec Creation and Skip on Bundle Fetch Failures</code></dd></summary> <hr> gateway/api_definition.go <li>Changed <code>MakeSpec</code> to return an error along with <code>*APISpec</code>.<br> <li> Updated <code>prepareSpecs</code> and <code>loadDefFromFilePath</code> to handle errors from <br><code>MakeSpec</code>.<br> <li> Modified API loading to skip APIs when bundle fetch fails. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-0cf80174bbafb36f6d4f4308ebbd971b2833b76a936bad568220aa1a4ba0ee8b">+11/-8</a> </td> </tr> <tr> <td> <details> <summary><strong>tracing.go</strong><dd><code>Improve Error Handling in Trace Handler</code> </dd></summary> <hr> gateway/tracing.go <li>Updated trace handler to handle errors from <code>MakeSpec</code> and return an <br>appropriate response. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-0069987d730b02812808925a17e1434ca7558a4dfc8661beb27ccd11afb8c77d">+6/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>coprocess_bundle_test.go</strong><dd><code>Test Custom Middleware Bundle Fetch Scenarios</code> </dd></summary> <hr> gateway/coprocess_bundle_test.go <li>Added tests to verify API loading behavior with custom middleware <br>bundle fetch scenarios. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-7fded1570c90f7be73d562f3ebcbb32fe4d50548dc5e959d8ecadddef13941fa">+24/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>coprocess_id_extractor_test.go</strong><dd><code>Update Spec Creation in ID Extractor Tests</code> </dd></summary> <hr> gateway/coprocess_id_extractor_test.go - Updated `createSpecTestFrom` to handle errors from `MakeSpec`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-077f3e65a150ce6b3b1c2ebc67e0482f1a5446ff6264754607d86c4691984375">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>gateway_test.go</strong><dd><code>Test API Loading Failure on Bundle Fetch Failure</code> </dd></summary> <hr> gateway/gateway_test.go <li>Added a test case to verify the behavior when API loading fails due to <br>bundle fetch failure. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-d34c7069ce5e81d45082b19eb3e869ee1a086e185dcd6630e75e3ed0d368b546">+13/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>testutil.go</strong><dd><code>Handle Spec Creation Errors in Test Utilities</code> </dd></summary> <hr> gateway/testutil.go <li>Updated <code>CreateDefinitionFromString</code> to handle errors from <code>MakeSpec</code>. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-7aaf6ae49fb8f58a8c99d337fedd15b3e430dd928ed547e425ef429b10d28ce8">+1/-1</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 dc2a7ea)
|
@jeffy-mathew Succesfully merged PR |
…ware bundle fetch fails (#6211) [TT-7560] skip loading API when custom middleware bundle fetch fails (#6211) ## **User description** <!-- Provide a general summary of your changes in the Title above --> ## Description Skip loading an API when the custom middleware bundle fetch fails. ## 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. --> ## 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 ___ ## **Type** bug_fix, enhancement ___ ## **Description** - Modified `MakeSpec` in `api_definition.go` to return an error along with `*APISpec`, enhancing error handling during API spec creation. - Implemented error handling in various functions and tests that call `MakeSpec`, ensuring that API loading can be skipped if a custom middleware bundle fetch fails. - Added and updated tests to cover new scenarios related to custom middleware bundle fetching and API loading 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>api_definition.go</strong><dd><code>Handle Errors in API Spec Creation and Skip on Bundle Fetch Failures</code></dd></summary> <hr> gateway/api_definition.go <li>Changed <code>MakeSpec</code> to return an error along with <code>*APISpec</code>.<br> <li> Updated <code>prepareSpecs</code> and <code>loadDefFromFilePath</code> to handle errors from <br><code>MakeSpec</code>.<br> <li> Modified API loading to skip APIs when bundle fetch fails. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-0cf80174bbafb36f6d4f4308ebbd971b2833b76a936bad568220aa1a4ba0ee8b">+11/-8</a> </td> </tr> <tr> <td> <details> <summary><strong>tracing.go</strong><dd><code>Improve Error Handling in Trace Handler</code> </dd></summary> <hr> gateway/tracing.go <li>Updated trace handler to handle errors from <code>MakeSpec</code> and return an <br>appropriate response. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-0069987d730b02812808925a17e1434ca7558a4dfc8661beb27ccd11afb8c77d">+6/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>coprocess_bundle_test.go</strong><dd><code>Test Custom Middleware Bundle Fetch Scenarios</code> </dd></summary> <hr> gateway/coprocess_bundle_test.go <li>Added tests to verify API loading behavior with custom middleware <br>bundle fetch scenarios. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-7fded1570c90f7be73d562f3ebcbb32fe4d50548dc5e959d8ecadddef13941fa">+24/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>coprocess_id_extractor_test.go</strong><dd><code>Update Spec Creation in ID Extractor Tests</code> </dd></summary> <hr> gateway/coprocess_id_extractor_test.go - Updated `createSpecTestFrom` to handle errors from `MakeSpec`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-077f3e65a150ce6b3b1c2ebc67e0482f1a5446ff6264754607d86c4691984375">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>gateway_test.go</strong><dd><code>Test API Loading Failure on Bundle Fetch Failure</code> </dd></summary> <hr> gateway/gateway_test.go <li>Added a test case to verify the behavior when API loading fails due to <br>bundle fetch failure. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-d34c7069ce5e81d45082b19eb3e869ee1a086e185dcd6630e75e3ed0d368b546">+13/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>testutil.go</strong><dd><code>Handle Spec Creation Errors in Test Utilities</code> </dd></summary> <hr> gateway/testutil.go <li>Updated <code>CreateDefinitionFromString</code> to handle errors from <code>MakeSpec</code>. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-7aaf6ae49fb8f58a8c99d337fedd15b3e430dd928ed547e425ef429b10d28ce8">+1/-1</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
…leware bundle fetch fails (#6211) [TT-7560] skip loading API when custom middleware bundle fetch fails (#6211) ## **User description** <!-- Provide a general summary of your changes in the Title above --> ## Description Skip loading an API when the custom middleware bundle fetch fails. ## 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. --> ## 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 ___ ## **Type** bug_fix, enhancement ___ ## **Description** - Modified `MakeSpec` in `api_definition.go` to return an error along with `*APISpec`, enhancing error handling during API spec creation. - Implemented error handling in various functions and tests that call `MakeSpec`, ensuring that API loading can be skipped if a custom middleware bundle fetch fails. - Added and updated tests to cover new scenarios related to custom middleware bundle fetching and API loading 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>api_definition.go</strong><dd><code>Handle Errors in API Spec Creation and Skip on Bundle Fetch Failures</code></dd></summary> <hr> gateway/api_definition.go <li>Changed <code>MakeSpec</code> to return an error along with <code>*APISpec</code>.<br> <li> Updated <code>prepareSpecs</code> and <code>loadDefFromFilePath</code> to handle errors from <br><code>MakeSpec</code>.<br> <li> Modified API loading to skip APIs when bundle fetch fails. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-0cf80174bbafb36f6d4f4308ebbd971b2833b76a936bad568220aa1a4ba0ee8b">+11/-8</a> </td> </tr> <tr> <td> <details> <summary><strong>tracing.go</strong><dd><code>Improve Error Handling in Trace Handler</code> </dd></summary> <hr> gateway/tracing.go <li>Updated trace handler to handle errors from <code>MakeSpec</code> and return an <br>appropriate response. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-0069987d730b02812808925a17e1434ca7558a4dfc8661beb27ccd11afb8c77d">+6/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>coprocess_bundle_test.go</strong><dd><code>Test Custom Middleware Bundle Fetch Scenarios</code> </dd></summary> <hr> gateway/coprocess_bundle_test.go <li>Added tests to verify API loading behavior with custom middleware <br>bundle fetch scenarios. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-7fded1570c90f7be73d562f3ebcbb32fe4d50548dc5e959d8ecadddef13941fa">+24/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>coprocess_id_extractor_test.go</strong><dd><code>Update Spec Creation in ID Extractor Tests</code> </dd></summary> <hr> gateway/coprocess_id_extractor_test.go - Updated `createSpecTestFrom` to handle errors from `MakeSpec`. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-077f3e65a150ce6b3b1c2ebc67e0482f1a5446ff6264754607d86c4691984375">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>gateway_test.go</strong><dd><code>Test API Loading Failure on Bundle Fetch Failure</code> </dd></summary> <hr> gateway/gateway_test.go <li>Added a test case to verify the behavior when API loading fails due to <br>bundle fetch failure. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-d34c7069ce5e81d45082b19eb3e869ee1a086e185dcd6630e75e3ed0d368b546">+13/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>testutil.go</strong><dd><code>Handle Spec Creation Errors in Test Utilities</code> </dd></summary> <hr> gateway/testutil.go <li>Updated <code>CreateDefinitionFromString</code> to handle errors from <code>MakeSpec</code>. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6211/files#diff-7aaf6ae49fb8f58a8c99d337fedd15b3e430dd928ed547e425ef429b10d28ce8">+1/-1</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




User description
Description
Skip loading an API when the custom middleware bundle fetch fails.
Related Issue
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist
Type
bug_fix, enhancement
Description
MakeSpecinapi_definition.goto return an error along with*APISpec, enhancing error handling during API spec creation.MakeSpec, ensuring that API loading can be skipped if a custom middleware bundle fetch fails.Changes walkthrough
api_definition.go
Handle Errors in API Spec Creation and Skip on Bundle Fetch Failuresgateway/api_definition.go
MakeSpecto return an error along with*APISpec.prepareSpecsandloadDefFromFilePathto handle errors fromMakeSpec.tracing.go
Improve Error Handling in Trace Handlergateway/tracing.go
MakeSpecand return anappropriate response.
coprocess_bundle_test.go
Test Custom Middleware Bundle Fetch Scenariosgateway/coprocess_bundle_test.go
bundle fetch scenarios.
coprocess_id_extractor_test.go
Update Spec Creation in ID Extractor Testsgateway/coprocess_id_extractor_test.go
createSpecTestFromto handle errors fromMakeSpec.gateway_test.go
Test API Loading Failure on Bundle Fetch Failuregateway/gateway_test.go
bundle fetch failure.
testutil.go
Handle Spec Creation Errors in Test Utilitiesgateway/testutil.go
CreateDefinitionFromStringto handle errors fromMakeSpec.