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

Update PatchPropertiesCorrespondToPutProperties to run in stagingOnly #596

Conversation

AkhilaIlla
Copy link
Collaborator

@AkhilaIlla AkhilaIlla commented Sep 21, 2023

The LintDiff pipeline is failing with

{
  "pluginName": "spectral",
  "extensionName": "@microsoft.azure/openapi-validator",
  "level": "fatal",
  "message": "spectralPluginFunc: Failed validating: 'file:///mnt/vss/_work/1/azure-rest-api-specs pr/specification/resources/resource-manager/Microsoft.Resources/moboBrokers/preview/2023-06-01-preview/moboBrokers.json', error encountered: Error: Error running Nimma"
}

https://teams.microsoft.com/l/message/19:[email protected]/1695277014925?tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47&groupId=0cab4ce9-7691-42ae-82e3-460d4346a710&parentMessageId=1692914350538&teamName=ARM%20API%20Reviewers&channelName=ARM%20linter%20rules&createdTime=1695277014925
and hence the faulty rule is updated to run only in staging

@AkhilaIlla AkhilaIlla changed the title Udpate PatchPropertiesCorrespondToPutProperties to run in stagingOnly Update PatchPropertiesCorrespondToPutProperties to run in stagingOnly Sep 21, 2023
@konrad-jamrozik konrad-jamrozik self-requested a review September 21, 2023 21:09
Copy link
Contributor

@konrad-jamrozik konrad-jamrozik left a comment

Choose a reason for hiding this comment

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

@AkhilaIlla I think you should bump the ruleset package version. I am not blocking the PR as I will be away for few hours now, but please don't merge until you bump the package version.

https://github.com/Azure/azure-openapi-validator/blob/main/CONTRIBUTING.md#deploy-to-prod-lintdiff

@@ -1,6 +1,6 @@
{
"name": "@microsoft.azure/openapi-validator",
"version": "2.1.5",
"version": "2.1.6",
Copy link
Contributor

@konrad-jamrozik konrad-jamrozik Sep 22, 2023

Choose a reason for hiding this comment

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

This shouldn't be changed in this PR: the only changes are in packages/rulesets dir.

@AkhilaIlla Observe the dir layout:

image

And the names of the packages in the dirs:

image

You can also explore information about the published package versions on npm, e.g.:

https://www.npmjs.com/package/@microsoft.azure/openapi-validator-rulesets

This includes package dependencies. It helps to build a mental model.

Can you update the contributing guide to make the instructions clearer? Please add me as a reviewer.
#Resolved

Copy link
Member

Choose a reason for hiding this comment

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

Yup lets improve the doc so even first timers can cruise thru this.

@@ -64,7 +64,7 @@
"@stoplight/types": "^13.5.0",
"dependency-graph": "^0.11.0",
"@microsoft.azure/openapi-validator-core": "~1.0.0",
"@microsoft.azure/openapi-validator-rulesets": "^1.1.1",
"@microsoft.azure/openapi-validator-rulesets": "^1.1.2",
Copy link
Contributor

@konrad-jamrozik konrad-jamrozik Sep 22, 2023

Choose a reason for hiding this comment

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

This won't hurt, but strictly speaking there is no need for that, because of ^. https://semver.npmjs.com/

image
#Resolved

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You mean there isnt any necessity for ^ here right?
Also the latest version is 1.2.0 and now will be 1.2.1 and should this still be 1.1.*?

Copy link
Contributor

Choose a reason for hiding this comment

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

Observe the version is ^1.1.1. Which means it will accept anything of form 1.X.Y where X >= 1 and Y >= 1. So given you are changing ruleset from 1.2.0 to 1.2.1, it will pick it up. Also observe you are bumping it here from 1.1.1 to 1.1.2 but you changed the ruleset from 1.2.0 to 1.2.1.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

that makes sense. thanks so much!

@@ -0,0 +1,10 @@
{
Copy link
Contributor

@konrad-jamrozik konrad-jamrozik Sep 22, 2023

Choose a reason for hiding this comment

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

This file change shouldn't be in this PR. #Resolved

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Builds fail without this file

Copy link
Contributor

@konrad-jamrozik konrad-jamrozik Sep 22, 2023

Choose a reason for hiding this comment

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

It fails because there are changes to azure-openapi-validator/autorest/package.json. If you revert them (please do that) then it will pass.

Copy link
Member

@rkmanda rkmanda left a comment

Choose a reason for hiding this comment

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

🕐

@@ -3371,6 +3372,7 @@ const ruleset = {
description: "Extension resources are always considered to be proxy and must not be of the type tracked.",
message: "{{error}}",
severity: "error",
stagingOnly: true,
Copy link
Contributor

@konrad-jamrozik konrad-jamrozik Sep 22, 2023

Choose a reason for hiding this comment

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

I am curious, is this some leftover from previous change that was not generated into the .js file from .ts file? (that is, someone forgot to run all the steps from rush prep from step 4. here). Also, btw. rule name is lower-cased: trackedExtensionResourcesAreNotAllowed. Should be upper-cased. But we can fix it in another PR.

Copy link
Contributor

@konrad-jamrozik konrad-jamrozik left a comment

Choose a reason for hiding this comment

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

Left one non-blocking comment. Also would be nice to add some context in the PR description. Besides, looks good. Thx!

@konrad-jamrozik konrad-jamrozik dismissed rkmanda’s stale review September 22, 2023 22:13

I verified the PR is good to go.

@konrad-jamrozik konrad-jamrozik merged commit d7f9446 into main Sep 22, 2023
4 checks passed
@konrad-jamrozik konrad-jamrozik deleted the akhilailla/make_PatchPropertiesCorrespondToPutProperties_to_staging_only branch September 22, 2023 22:13
Copy link
Member

@rkmanda rkmanda left a comment

Choose a reason for hiding this comment

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

:shipit:

@konrad-jamrozik
Copy link
Contributor

konrad-jamrozik commented Sep 22, 2023

@AkhilaIlla now that the PR is merged, please follow the instructions here:

I think at some point you will have to ping me to approve your prod release:

Once the build is complete, schedule a Prod npm release from that build. You may need to get an approval for the release from the appropriate Azure SDK EngSys team members.

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.

3 participants