Skip to content

Commit

Permalink
work
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Weatherford authored and Stephen Weatherford committed May 29, 2024
1 parent 5589723 commit 4033bdb
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ public void SingleMinorVersionBehind()
result.Diagnostics.Where(d => d.Code == UseRecentModuleVersionsRule.Code)
.Should()
.HaveDiagnostics([
("use-recent-module-versions", DiagnosticLevel.Warning, "Use a more recent version of module 'avm/res/network/public-ip-address'. Acceptable versions: 0.5.0, 1.0.1") //asdfg - also, allow this to be configured
("use-recent-module-versions", DiagnosticLevel.Warning, "Use a more recent version of module 'avm/res/network/public-ip-address'. The most recent version is 1.0.1.") //asdfg - also, allow this to be configured
]);
}

Expand All @@ -329,7 +329,7 @@ public void SingleMajorVersionBehind()
result.Diagnostics.Where(d => d.Code == UseRecentModuleVersionsRule.Code)
.Should()
.HaveDiagnostics([
("use-recent-module-versions", DiagnosticLevel.Warning, "Use a more recent version of module 'avm/res/network/public-ip-address'. Acceptable versions: 1.0.0") //asdfg - also, allow this to be configured
("use-recent-module-versions", DiagnosticLevel.Warning, "Use a more recent version of module 'avm/res/network/public-ip-address'. The most recent version is 1.0.0.") //asdfg - also, allow this to be configured
]);
}

Expand All @@ -346,7 +346,7 @@ public void SinglePatchVersionBehind()
result.Diagnostics.Where(d => d.Code == UseRecentModuleVersionsRule.Code)
.Should()
.HaveDiagnostics([
("use-recent-module-versions", DiagnosticLevel.Warning, "Use a more recent version of module 'avm/res/network/public-ip-address'. Acceptable versions: 0.4.2, 0.5.0") //asdfg - also, allow this to be configured
("use-recent-module-versions", DiagnosticLevel.Warning, "Use a more recent version of module 'avm/res/network/public-ip-address'. The most recent version is 0.5.0.") //asdfg - also, allow this to be configured
]);
}
}
Expand Down Expand Up @@ -1489,10 +1489,10 @@ public class GetAcceptableModuleVersionsTests
// FakeResourceTypes.ResourceScopeTypes,
// "2422-07-04",
// new string[] {
// "[4] Use more recent API version for 'fake.ServiceBus/namespaces'. '2418-01-01-preview' is 1645 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2421-06-01-preview, 2421-01-01-preview, 2417-04-01",
// "[18] Use more recent API version for 'fake.ServiceBus/namespaces/queues/authorizationRules'. '2415-08-01' is 2529 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2421-06-01-preview, 2421-01-01-preview, 2417-04-01",
// "[29] Use more recent API version for 'fake.ServiceBus/namespaces/queues/authorizationRules'. '2418-01-01-preview' is 1645 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2421-06-01-preview, 2421-01-01-preview, 2417-04-01",
// "[35] Could not find apiVersion 4017-04-01 for fake.ServiceBus/namespaces/queues/authorizationRules. Acceptable versions: 2421-06-01-preview, 2421-01-01-preview, 2417-04-01",
// "[4] Use more recent API version for 'fake.ServiceBus/namespaces'. '2418-01-01-preview' is 1645 days old, should be no more than 730 days old, or the most recent. The most recent version is 2421-06-01-preview, 2421-01-01-preview, 2417-04-01",
// "[18] Use more recent API version for 'fake.ServiceBus/namespaces/queues/authorizationRules'. '2415-08-01' is 2529 days old, should be no more than 730 days old, or the most recent. The most recent version is 2421-06-01-preview, 2421-01-01-preview, 2417-04-01",
// "[29] Use more recent API version for 'fake.ServiceBus/namespaces/queues/authorizationRules'. '2418-01-01-preview' is 1645 days old, should be no more than 730 days old, or the most recent. The most recent version is 2421-06-01-preview, 2421-01-01-preview, 2417-04-01",
// "[35] Could not find apiVersion 4017-04-01 for fake.ServiceBus/namespaces/queues/authorizationRules. The most recent version is 2421-06-01-preview, 2421-01-01-preview, 2417-04-01",
// });
// }

Expand Down Expand Up @@ -1534,11 +1534,11 @@ public class GetAcceptableModuleVersionsTests
// FakeResourceTypes.ResourceScopeTypes,
// "2422-07-04",
// new[] {
// "[5] Use more recent API version for 'fake.ServiceBus/namespaces'. '2418-01-01-preview' is 1645 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2421-06-01-preview, 2421-01-01-preview, 2417-04-01",
// "[9] Use more recent API version for 'fake.ServiceBus/namespaces/queues'. '2415-08-01' is 2529 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2421-06-01-preview, 2421-01-01-preview, 2417-04-01",
// "[13] Use more recent API version for 'fake.ServiceBus/namespaces/queues/authorizationRules'. '2418-01-01-preview' is 1645 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2421-06-01-preview, 2421-01-01-preview, 2417-04-01",
// "[20] Use more recent API version for 'fake.ServiceBus/namespaces/queues/authorizationRules'. '2415-08-01' is 2529 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2421-06-01-preview, 2421-01-01-preview, 2417-04-01",
// "[25] Use more recent API version for 'fake.ServiceBus/namespaces/queues/authorizationRules'. '2415-08-01' is 2529 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2421-06-01-preview, 2421-01-01-preview, 2417-04-01",
// "[5] Use more recent API version for 'fake.ServiceBus/namespaces'. '2418-01-01-preview' is 1645 days old, should be no more than 730 days old, or the most recent. The most recent version is 2421-06-01-preview, 2421-01-01-preview, 2417-04-01",
// "[9] Use more recent API version for 'fake.ServiceBus/namespaces/queues'. '2415-08-01' is 2529 days old, should be no more than 730 days old, or the most recent. The most recent version is 2421-06-01-preview, 2421-01-01-preview, 2417-04-01",
// "[13] Use more recent API version for 'fake.ServiceBus/namespaces/queues/authorizationRules'. '2418-01-01-preview' is 1645 days old, should be no more than 730 days old, or the most recent. The most recent version is 2421-06-01-preview, 2421-01-01-preview, 2417-04-01",
// "[20] Use more recent API version for 'fake.ServiceBus/namespaces/queues/authorizationRules'. '2415-08-01' is 2529 days old, should be no more than 730 days old, or the most recent. The most recent version is 2421-06-01-preview, 2421-01-01-preview, 2417-04-01",
// "[25] Use more recent API version for 'fake.ServiceBus/namespaces/queues/authorizationRules'. '2415-08-01' is 2529 days old, should be no more than 730 days old, or the most recent. The most recent version is 2421-06-01-preview, 2421-01-01-preview, 2417-04-01",
// });
// }

Expand Down Expand Up @@ -1596,7 +1596,7 @@ public class GetAcceptableModuleVersionsTests
// },
// fakeToday: "2422-07-04",
// new[] {
// "[2] Use more recent API version for 'fake.DBforMySQL/servers'. '2417-12-01-preview' is 1676 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2417-12-01",
// "[2] Use more recent API version for 'fake.DBforMySQL/servers'. '2417-12-01-preview' is 1676 days old, should be no more than 730 days old, or the most recent. The most recent version is 2417-12-01",
// });
// }

Expand Down Expand Up @@ -1627,7 +1627,7 @@ public class GetAcceptableModuleVersionsTests
// },
// fakeToday: "2422-07-04",
// new[] {
// "[2] Use more recent API version for 'fake.DBforMySQL/servers'. '2417-12-01-preview' is 1676 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2417-12-02",
// "[2] Use more recent API version for 'fake.DBforMySQL/servers'. '2417-12-01-preview' is 1676 days old, should be no more than 730 days old, or the most recent. The most recent version is 2417-12-02",
// });
// }

Expand Down Expand Up @@ -1658,7 +1658,7 @@ public class GetAcceptableModuleVersionsTests
// },
// fakeToday: "2422-07-04",
// new[] {
// "[2] Use more recent API version for 'fake.DBforMySQL/servers'. '2417-12-01-preview' is 1676 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2417-11-30",
// "[2] Use more recent API version for 'fake.DBforMySQL/servers'. '2417-12-01-preview' is 1676 days old, should be no more than 730 days old, or the most recent. The most recent version is 2417-11-30",
// });
// }

Expand Down Expand Up @@ -1704,7 +1704,7 @@ public class GetAcceptableModuleVersionsTests
// },
// fakeToday: "2422-07-04",
// new[] {
// "[2] Use more recent API version for 'Fake.MachineLearningCompute/operationalizationClusters'. '2417-06-01-preview' is 1859 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2417-08-01-preview",
// "[2] Use more recent API version for 'Fake.MachineLearningCompute/operationalizationClusters'. '2417-06-01-preview' is 1859 days old, should be no more than 730 days old, or the most recent. The most recent version is 2417-08-01-preview",
// });
// }

Expand Down Expand Up @@ -1754,7 +1754,7 @@ public class GetAcceptableModuleVersionsTests
// FakeResourceTypes.SubscriptionScopeTypes,
// fakeToday: "2422-07-04",
// new String[] {
// "[21] Use more recent API version for 'fake.Authorization/roleAssignments'. '2420-04-01-preview' is 824 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2420-10-01-preview, 2420-08-01-preview, 2417-09-01"
// "[21] Use more recent API version for 'fake.Authorization/roleAssignments'. '2420-04-01-preview' is 824 days old, should be no more than 730 days old, or the most recent. The most recent version is 2420-10-01-preview, 2420-08-01-preview, 2417-09-01"
// });
// }

Expand Down Expand Up @@ -1849,7 +1849,7 @@ public class GetAcceptableModuleVersionsTests
// FakeResourceTypes.SubscriptionScopeTypes,
// "2422-07-04",
// new[] {
// "[21] Use more recent API version for 'fake.Authorization/roleAssignments'. '2417-10-01-preview' is 1737 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2420-10-01-preview, 2420-08-01-preview, 2417-09-01",
// "[21] Use more recent API version for 'fake.Authorization/roleAssignments'. '2417-10-01-preview' is 1737 days old, should be no more than 730 days old, or the most recent. The most recent version is 2420-10-01-preview, 2420-08-01-preview, 2417-09-01",
// }
// );
// }
Expand Down Expand Up @@ -1904,8 +1904,8 @@ public class GetAcceptableModuleVersionsTests
// FakeResourceTypes.ResourceScopeTypes,
// "2422-07-04",
// new[] {
// "[24] Use more recent API version for 'fake.Storage/storageAccounts'. '2420-08-01-preview' is a preview version and there is a more recent non-preview version available. Acceptable versions: 2421-06-01, 2421-04-01, 2421-02-01, 2421-01-01",
// "[35] Use more recent API version for 'fake.Authorization/roleAssignments'. '2420-04-01-preview' is 824 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2420-10-01-preview, 2420-08-01-preview, 2415-07-01",
// "[24] Use more recent API version for 'fake.Storage/storageAccounts'. '2420-08-01-preview' is a preview version and there is a more recent non-preview version available. The most recent version is 2421-06-01, 2421-04-01, 2421-02-01, 2421-01-01",
// "[35] Use more recent API version for 'fake.Authorization/roleAssignments'. '2420-04-01-preview' is 824 days old, should be no more than 730 days old, or the most recent. The most recent version is 2420-10-01-preview, 2420-08-01-preview, 2415-07-01",
// });
// }

Expand All @@ -1930,7 +1930,7 @@ public class GetAcceptableModuleVersionsTests
// FakeResourceTypes.ResourceScopeTypes,
// "2422-07-04",
// new[] {
// "[6] Use more recent API version for 'fake.Authorization/locks'. '2416-09-01' is 2132 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2420-05-01",
// "[6] Use more recent API version for 'fake.Authorization/locks'. '2416-09-01' is 2132 days old, should be no more than 730 days old, or the most recent. The most recent version is 2420-05-01",
// });
// }

Expand All @@ -1951,7 +1951,7 @@ public class GetAcceptableModuleVersionsTests
// FakeResourceTypes.SubscriptionScopeTypes,
// "2422-07-04",
// new[] {
// "[7] Use more recent API version for 'fake.Resources/resourceGroups'. '2419-05-10' is 1151 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2421-05-01, 2421-04-01, 2421-01-01, 2420-10-01, 2420-08-01"
// "[7] Use more recent API version for 'fake.Resources/resourceGroups'. '2419-05-10' is 1151 days old, should be no more than 730 days old, or the most recent. The most recent version is 2421-05-01, 2421-04-01, 2421-01-01, 2420-10-01, 2420-08-01"
// });
// }

Expand Down Expand Up @@ -2008,7 +2008,7 @@ public class GetAcceptableModuleVersionsTests
// FakeResourceTypes.ResourceScopeTypes,
// "2422-07-04",
// new string[] {
// "[2] Could not find apiVersion 2417-06-01-beta for Fake.MachineLearningCompute/operationalizationClusters. Acceptable versions: 2417-08-01-preview"
// "[2] Could not find apiVersion 2417-06-01-beta for Fake.MachineLearningCompute/operationalizationClusters. The most recent version is 2417-08-01-preview"
// });
// }

Expand All @@ -2030,7 +2030,7 @@ public class GetAcceptableModuleVersionsTests
// "2422-07-04",
// new[] {
// new DiagnosticAndFixes(
// "Use more recent API version for 'fake.Resources/resourceGroups'. '2419-05-10' is 1151 days old, should be no more than 730 days old, or the most recent. Acceptable versions: 2421-05-01, 2421-04-01, 2421-01-01, 2420-10-01, 2420-08-01",
// "Use more recent API version for 'fake.Resources/resourceGroups'. '2419-05-10' is 1151 days old, should be no more than 730 days old, or the most recent. The most recent version is 2421-05-01, 2421-04-01, 2421-01-01, 2420-10-01, 2420-08-01",
// "Replace with 2421-05-01",
// "resource newRG 'fake.Resources/resourceGroups@2421-05-01'"
// )
Expand All @@ -2056,7 +2056,7 @@ public class GetAcceptableModuleVersionsTests
// "2422-07-04",
// new[] {
// new DiagnosticAndFixes(
// "Use more recent API version for 'fake.Resources/resourceGroups'. '2419-05-10' is 1151 days old, should be no more than 459 days old, or the most recent. Acceptable versions: 2421-05-01, 2421-04-01",
// "Use more recent API version for 'fake.Resources/resourceGroups'. '2419-05-10' is 1151 days old, should be no more than 459 days old, or the most recent. The most recent version is 2421-05-01, 2421-04-01",
// "Replace with 2421-05-01",
// "resource newRG 'fake.Resources/resourceGroups@2421-05-01'"
// )
Expand All @@ -2081,7 +2081,7 @@ public class GetAcceptableModuleVersionsTests
// "2422-07-04",
// new[] {
// new DiagnosticAndFixes(
// "Use more recent API version for 'fake.Resources/resourceGroups'. '2419-05-10' is 1151 days old, should be no more than 458 days old, or the most recent. Acceptable versions: 2421-05-01",
// "Use more recent API version for 'fake.Resources/resourceGroups'. '2419-05-10' is 1151 days old, should be no more than 458 days old, or the most recent. The most recent version is 2421-05-01",
// "Replace with 2421-05-01",
// "resource newRG 'fake.Resources/resourceGroups@2421-05-01'"
// )
Expand Down Expand Up @@ -2131,7 +2131,7 @@ public class GetAcceptableModuleVersionsTests
// "2422-07-04",
// [
// new DiagnosticAndFixes(
// "Use more recent API version for 'fake.Resources/resourceGroups'. '2419-05-10' is 1151 days old, should be no more than 0 days old, or the most recent. Acceptable versions: 2421-05-01",
// "Use more recent API version for 'fake.Resources/resourceGroups'. '2419-05-10' is 1151 days old, should be no more than 0 days old, or the most recent. The most recent version is 2421-05-01",
// "Replace with 2421-05-01",
// "resource newRG 'fake.Resources/resourceGroups@2421-05-01'"
// )
Expand Down
Loading

0 comments on commit 4033bdb

Please sign in to comment.