Skip to content
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

getAllResourceProvidersFromPath doesn't work when people put a leading '/' in front of a resource scope parameter (extension scenario) #589

Open
TimLovellSmith opened this issue Sep 14, 2023 · 0 comments

Comments

@TimLovellSmith
Copy link
Member

Describe the bug

In PRs, people are adding suppressions because getAllResourceProvidersFromPath treats the following path declarations differently:

/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default
{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default

with difference in leading slash.

leading to (possibly misleading) suppressions like:

directive:
  - suppress: R3020
    from:
	@@ -64,14 +64,30 @@ suppressions:
    reason: The linter is mistakenly thinking that paths for a singular resource that is always named default, like "/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default," is for a collection of resources.

To Reproduce
Test with both
/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default
{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default

Expected behavior
getAllResourceProvidersFromPath needs to see the provider name is Microsoft.AzureStackHCI but apparently its confused about that

Screenshots

Desktop (please complete the following information):
N/A

Additional context
See e.g. PR
https://github.com/Azure/azure-rest-api-specs/pull/25555/files#diff-252e313698c479b4ea491ad65d7bb1f75ccfe83aab3f773ee5bf100b1bb0a0c9
if more context on the specific API is needed

@TimLovellSmith TimLovellSmith changed the title getAllResourceProvidersFromPath doesn't work when people put a leading '/' in front of the resource scope parameter getAllResourceProvidersFromPath doesn't work when people put a leading '/' in front of a resource scope parameter (extension scenario) Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant