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

Validate provisioning state only if azure resource #434

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

laxmankumar12
Copy link
Member

Perform 'Rpaas_ResourceProvisioningState' linter rule only if the value is the given resource is an azure resource (x-ms-azure-resource == true)

@@ -22,14 +22,16 @@ rules.push({
const allResources = utils.getAllResourceNames()
for (const resource of allResources) {
const model = utils.getResourceByName(resource)
const azureResource = swaggerUtil?.getProperty(model!, "x-ms-azure-resource")
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think it is right to read "x-ms-azure-resource" as property here. So an existing test is failing. I'll need some help on figuring this part out so that we can run this provisioningState validation only if it is an ARM resource.

Copy link
Contributor

Choose a reason for hiding this comment

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

We have a strategy to detect if a model indicates an arm resource, see https://github.com/Azure/azure-openapi-validator/blob/main/docs/resources/resource-model-validation.md, so we don't need to check the 'x-ms-azure-resource' again here, if you encounter any false alert, please comment and I will take a look

@raych1 raych1 requested a review from jianyexi January 7, 2023 00:01
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

Successfully merging this pull request may close these issues.

None yet

2 participants