-
Notifications
You must be signed in to change notification settings - Fork 37
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
Correctly handle missing WebApps and document the custom resource interface better #3533
Conversation
Does the PR have any schema changes?Looking good! No breaking changes found. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your changes make sense 👍
One question of the existing behaviour which might warrant a new issue to fix at another point.
@@ -52,7 +52,7 @@ func makeWebAppResource(resourceType, path string, crudClientFactory crud.Resour | |||
// the WebApp does not return the SiteConfig. We need to make a separate GET request to | |||
// /config/web and merge the results. #1468 | |||
Read: func(ctx context.Context, id string, inputs resource.PropertyMap) (map[string]any, bool, error) { | |||
// We can reasanably assume that WebApp and WebAppSlot share their API version since they are almost identical. | |||
// We assume that WebApp and WebAppSlot share their API version since they are almost identical. | |||
apiVersion, ok := versionLookup.GetDefaultApiVersionForResource("Web", "WebApp") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A slight aside from your changes ... I think just fetching the default API version here might be incorrect. I think this code is called for explict versions of the WebApp resource too - at which point we should be fetching the version associated to the resource token that the user is using.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3533 +/- ##
==========================================
- Coverage 57.72% 57.68% -0.05%
==========================================
Files 66 66
Lines 8299 8305 +6
==========================================
Hits 4791 4791
- Misses 3063 3069 +6
Partials 445 445 ☔ View full report in Codecov by Sentry. |
2dd7a87
to
01f0623
Compare
This PR has been shipped in release v2.57.1. |
…erface better (#3533) Fixes #3526 The WebApp custom resource currently returns (notFound, error) when the requested app doesn't exist. Although undocumented, the downstream assumes that custom resources return (notFound, nil) in that case. I.e., it's the responsibility of the custom resource to distinguish between "not found" and other kinds of errors.
Fixes #3526
The WebApp custom resource currently returns (notFound, error) when the requested app doesn't exist. Although undocumented, the downstream assumes that custom resources return (notFound, nil) in that case. I.e., it's the responsibility of the custom resource to distinguish between "not found" and other kinds of errors.