Resource type not found error cleanup#11849
Conversation
There was a problem hiding this comment.
Pull request overview
This PR standardizes the error returned by rad resource-type show when a requested resource type doesn’t exist, so users always see a resource-type-focused message regardless of whether the provider namespace is missing or the provider exists but the type is absent.
Changes:
- Updated
GetResourceTypeDetailsto return a consistent “resource type does not exist” message for both provider-404 and type-missing cases. - Updated
rad resource-type showcommand tests to assert the new unified error message. - Expanded shared resource type lookup tests to cover the “type missing but provider exists” scenario.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/cli/cmd/resourcetype/show/show_test.go | Updates show-command test expectations to the unified “resource type does not exist” error message. |
| pkg/cli/cmd/resourcetype/common/resourcetype.go | Unifies “not found” handling in GetResourceTypeDetails to return a consistent resource-type-focused error message. |
| pkg/cli/cmd/resourcetype/common/resourcetype_test.go | Updates/adds tests to validate the unified error message for both provider-not-found and type-not-found cases. |
|
@officialasishkumar thank you for the PR. Please address the small feedback item from the copilot review and we can merge this. 🚀 |
brooke-hamilton
left a comment
There was a problem hiding this comment.
Just the minor copilot feedback mentioned above.
50b7d13 to
43542fa
Compare
Radius functional test overviewClick here to see the test run details
Test Status⌛ Building Radius and pushing container images for functional tests... |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11849 +/- ##
==========================================
+ Coverage 51.69% 51.71% +0.01%
==========================================
Files 725 725
Lines 45595 45596 +1
==========================================
+ Hits 23570 23579 +9
+ Misses 19799 19795 -4
+ Partials 2226 2222 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks for the PR — it looks ready to merge. The only remaining blocker is that our repository requires verified commit signatures, which means GitHub needs to show a “Verified” badge on each commit. To fix this, please re-sign your commits with a configured GPG, SSH, or S/MIME signing key and then force-push the updated branch. If helpful, GitHub’s guide for setting up commit signing starts here: https://docs.github.com/en/authentication/managing-commit-signature-verification After signing is set up, you can usually update your commits with an interactive rebase and reword/amend them using signing enabled, then push with |
Return a resource-type-focused not found message from rad resource-type show when either the provider namespace or the specific type is missing. This avoids surfacing provider implementation details to users who are asking about a resource type.\n\nFixes: radius-project#9897\nFixes: radius-project#9755 Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
68d92aa to
ce72fe3
Compare
|
Rebased the branch onto current
Validation passed: |
Description
rad resource-type showreturned provider-focused errors when a user asked for a resource type that did not exist. If the provider namespace was missing, the CLI said the resource provider was not found; if the provider existed but the type was missing, the CLI used a different resource-provider-specific message.This change returns one resource-type-focused message for both cases:
The resource type "<namespace>/<type>" does not exist.The behavior is covered in the shared resource type lookup tests and the
rad resource-type showcommand tests.Type of change
Fixes: #9897
Fixes: #9755
Contributor checklist
Please verify that the PR meets the following requirements, where applicable:
eng/design-notes/in this repository, if new APIs are being introduced.