fix(storybook): return 404 for unsupported API versions in baseMocks#4736
fix(storybook): return 404 for unsupported API versions in baseMocks#4736kunaldevsahu wants to merge 1 commit intokubernetes-sigs:mainfrom
Conversation
|
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: kunaldevsahu The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @kunaldevsahu! |
| */ | ||
| export const baseMocks = [ | ||
| http.get('http://localhost:4466/wsMultiplexer', () => HttpResponse.error()), | ||
| http.get('http://localhost:4466/wsMultiplexer', () => new HttpResponse(null, { status: 404 })), |
There was a problem hiding this comment.
I think the linked issue #4735 describes a problem with apiextensions.k8s.io/v1beta1/customresourcedefinitions endpoints using HttpResponse.error() to simulate network failures instead of returning 404. However, this PR changes the wsMultiplexer endpoint instead. The wsMultiplexer HTTP mock exists intentionally to suppress MSW "unhandled request" warnings for WebSocket URLs — HttpResponse.error() is the correct behavior there since MSW cannot intercept WebSocket upgrade connections via http.get() handlers.
skoeva
left a comment
There was a problem hiding this comment.
want to echo the last comment, this PR isn't addressing the root issue
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Summary
This PR updates Storybook baseMocks to return a 404 HTTP response
for unsupported API versions instead of throwing a generic network error.
This aligns mock behavior with actual backend responses and improves
error handling consistency.
Related Issue
Fixes #4735
Changes
Steps to Test
Screenshots (if applicable)
N/A
Notes for the Reviewer