Skip to content

Resource type not found error cleanup#11849

Open
officialasishkumar wants to merge 2 commits into
radius-project:mainfrom
officialasishkumar:fix/resource-type-not-found-message
Open

Resource type not found error cleanup#11849
officialasishkumar wants to merge 2 commits into
radius-project:mainfrom
officialasishkumar:fix/resource-type-not-found-message

Conversation

@officialasishkumar
Copy link
Copy Markdown
Contributor

Description

rad resource-type show returned 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 show command tests.

Type of change

  • This pull request fixes a bug in Radius and has an approved issue (issue link required).

Fixes: #9897
Fixes: #9755

Contributor checklist

Please verify that the PR meets the following requirements, where applicable:

  • An overview of proposed schema changes is included in a linked GitHub issue.
    • Yes
    • Not applicable
  • A design document is added or updated under eng/design-notes/ in this repository, if new APIs are being introduced.
    • Yes
    • Not applicable
  • The design document has been reviewed and approved by Radius maintainers/approvers.
    • Yes
    • Not applicable
  • A PR for resource-types-contrib is created, if resource types or recipes are affected by the changes in this PR.
    • Yes
    • Not applicable
  • A PR for dashboard is created, if the Radius Dashboard is affected by the changes in this PR.
    • Yes
    • Not applicable
  • A PR for the documentation repository is created, if the changes in this PR affect the documentation or any user facing updates are made.
    • Yes
    • Not applicable

Copilot AI review requested due to automatic review settings May 11, 2026 18:43
@officialasishkumar officialasishkumar requested review from a team as code owners May 11, 2026 18:43
@officialasishkumar officialasishkumar requested a deployment to external-contributor-approval May 11, 2026 18:44 — with GitHub Actions Waiting
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 GetResourceTypeDetails to return a consistent “resource type does not exist” message for both provider-404 and type-missing cases.
  • Updated rad resource-type show command 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.

Comment thread pkg/cli/cmd/resourcetype/common/resourcetype.go
@brooke-hamilton brooke-hamilton requested a deployment to external-contributor-approval May 12, 2026 01:05 — with GitHub Actions Waiting
@brooke-hamilton
Copy link
Copy Markdown
Member

@officialasishkumar thank you for the PR. Please address the small feedback item from the copilot review and we can merge this. 🚀

Copy link
Copy Markdown
Member

@brooke-hamilton brooke-hamilton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the minor copilot feedback mentioned above.

@officialasishkumar officialasishkumar requested a deployment to external-contributor-approval May 12, 2026 04:30 — with GitHub Actions Waiting
@officialasishkumar officialasishkumar force-pushed the fix/resource-type-not-found-message branch from 50b7d13 to 43542fa Compare May 12, 2026 05:22
@officialasishkumar officialasishkumar requested a deployment to external-contributor-approval May 12, 2026 05:22 — with GitHub Actions Waiting
@brooke-hamilton brooke-hamilton requested a review from Copilot May 13, 2026 12:25
@brooke-hamilton brooke-hamilton deployed to external-contributor-approval May 13, 2026 12:25 — with GitHub Actions Active
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@radius-functional-tests
Copy link
Copy Markdown

radius-functional-tests Bot commented May 13, 2026

Radius functional test overview

🔍 Go to test action run

Click here to see the test run details
Name Value
Repository officialasishkumar/radius
Commit ref 68d92aa
Unique ID func515dc92453
Image tag pr-func515dc92453
  • gotestsum 1.13.0
  • KinD: v0.29.0
  • Dapr: 1.14.4
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func515dc92453
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func515dc92453
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func515dc92453
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func515dc92453
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func515dc92453
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.71%. Comparing base (f4234af) to head (68d92aa).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@brooke-hamilton
Copy link
Copy Markdown
Member

@officialasishkumar

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 git push --force-with-lease. Once the commits show as Verified, we should be good to merge.

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>
@officialasishkumar officialasishkumar force-pushed the fix/resource-type-not-found-message branch from 68d92aa to ce72fe3 Compare May 14, 2026 05:32
@officialasishkumar
Copy link
Copy Markdown
Contributor Author

Rebased the branch onto current main and re-signed the two PR commits with my uploaded GPG key:

  • a7b475f
  • ce72fe3

Validation passed: go test ./pkg/cli/cmd/resourcetype/....

@officialasishkumar officialasishkumar requested a deployment to external-contributor-approval May 14, 2026 05:32 — with GitHub Actions Waiting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rad resource-type show says resource provider not found instead of resource type not found Incorrect error message on rad resource-type show

3 participants