Skip to content

Commit

Permalink
updated types, managedidentity and privatelinks common-types version …
Browse files Browse the repository at this point in the history
…to v6
  • Loading branch information
tejaswiMinnu committed Aug 27, 2024
1 parent 3f5b0c2 commit d0470a3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions packages/rulesets/generated/spectral/az-arm.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ const mutabilityWithReadOnly = (prop, _opts, ctx) => {
};

const LATEST_VERSION_BY_COMMON_TYPES_FILENAME = new Map([
["types.json", "v5"],
["managedidentity.json", "v5"],
["privatelinks.json", "v5"],
["types.json", "v6"],
["managedidentity.json", "v6"],
["privatelinks.json", "v6"],
["customermanagedkeys.json", "v5"],
["managedidentitywithdelegation.json", "v5"],
["networksecurityperimeter.json", "v5"],
Expand Down
6 changes: 3 additions & 3 deletions packages/rulesets/src/spectral/functions/utils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import _ from "lodash"

export const LATEST_VERSION_BY_COMMON_TYPES_FILENAME = new Map([
["types.json", "v5"],
["managedidentity.json", "v5"],
["privatelinks.json", "v5"],
["types.json", "v6"],
["managedidentity.json", "v6"],
["privatelinks.json", "v6"],
["customermanagedkeys.json", "v5"],
["managedidentitywithdelegation.json", "v5"],
["networksecurityperimeter.json", "v5"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ test("LatestVersionOfCommonTypesMustBeUsed should find errors for obsolete versi
expect(results[0].path.join(".")).toBe("paths./foo.get.parameters.0.$ref")
expect(results[0].message).toContain("Use the latest version v5 of customermanagedkeys.json.")
expect(results[1].path.join(".")).toBe("paths./foo.get.parameters.1.$ref")
expect(results[1].message).toContain("Use the latest version v5 of managedidentity.json.")
expect(results[1].message).toContain("Use the latest version v6 of managedidentity.json.")
expect(results[2].path.join(".")).toBe("paths./foo.get.responses.200.$ref")
expect(results[2].message).toContain("Use the latest version v5 of types.json.")
expect(results[2].message).toContain("Use the latest version v6 of types.json.")
})
})

Expand All @@ -73,20 +73,20 @@ test("LatestVersionOfCommonTypesMustBeUsed should find no errors", async () => {
parameters: [
{
$ref: `../../../../../common-types/resource-management/${LATEST_VERSION_BY_COMMON_TYPES_FILENAME.get(
"customermanagedkeys.json"
"customermanagedkeys.json",
)}/customermanagedkeys.json#/parameters/ApiVersionParameter`,
},
{
$ref: `../../../../../common-types/resource-management/${LATEST_VERSION_BY_COMMON_TYPES_FILENAME.get(
"managedidentity.json"
"managedidentity.json",
)}/managedidentity.json#/parameters/ApiVersionParameter`,
},
],
responses: {
200: {
description: "Success",
$ref: `../../../../../common-types/resource-management/${LATEST_VERSION_BY_COMMON_TYPES_FILENAME.get(
"types.json"
"types.json",
)}/types.json#/parameters/ApiVersionParameter`,
},
},
Expand Down

0 comments on commit d0470a3

Please sign in to comment.