From 050138fa768e107d9e8cb98de3695766d6d35435 Mon Sep 17 00:00:00 2001 From: Rujun Chen Date: Tue, 9 Jun 2020 16:48:48 +0800 Subject: [PATCH 1/5] Fix KeyVaultOperation blocked problem. Refs: https://github.com/microsoft/azure-spring-boot/issues/853 --- sdk/spring/azure-spring-boot/pom.xml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sdk/spring/azure-spring-boot/pom.xml b/sdk/spring/azure-spring-boot/pom.xml index c632017b8f1c..7c3d3a074850 100644 --- a/sdk/spring/azure-spring-boot/pom.xml +++ b/sdk/spring/azure-spring-boot/pom.xml @@ -117,7 +117,7 @@ spring-data-cosmosdb 2.2.3.FIX1 - + io.micrometer @@ -205,6 +205,13 @@ provided + + + net.minidev + json-smart + 2.3 + + org.springframework.boot @@ -257,6 +264,7 @@ com.azure:* com.fasterxml.jackson.core:jackson-databind:[2.10.1] com.google.code.findbugs:jsr305:[3.0.2] + net.minidev:json-smart:[2.3] com.microsoft.azure:msal4j:[1.3.0] com.microsoft.azure:spring-data-cosmosdb:[2.2.3.FIX1] com.microsoft.spring.data.gremlin:spring-data-gremlin:[2.2.3] From a5ded792358b9957a6f81cb7aa897511925c163c Mon Sep 17 00:00:00 2001 From: Rujun Chen Date: Wed, 10 Jun 2020 13:10:44 +0800 Subject: [PATCH 2/5] Add an item in external_depandencies. --- eng/versioning/external_dependencies.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/versioning/external_dependencies.txt b/eng/versioning/external_dependencies.txt index 79b0aa7e1324..50b9edde2ab3 100644 --- a/eng/versioning/external_dependencies.txt +++ b/eng/versioning/external_dependencies.txt @@ -43,6 +43,7 @@ io.reactivex:rxjava;1.2.4 javax.annotation:javax.annotation-api;1.3.2 javax.servlet:javax.servlet-api;4.0.1 javax.validation:validation-api;2.0.1.Final +net.minidev:json-smart;2.3 org.apache.avro:avro;1.9.2 org.apache.httpcomponents:httpclient;4.3.6 org.apache.logging.log4j:log4j-api;2.11.1 From f6bb63897ef7277734b70fb664864bda6257f597 Mon Sep 17 00:00:00 2001 From: Rujun Chen Date: Wed, 10 Jun 2020 13:17:15 +0800 Subject: [PATCH 3/5] Remote reduantant whitespace. It's removed by Intellij automically. --- eng/versioning/pom_file_version_scanner.ps1 | 72 ++++++++++----------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/eng/versioning/pom_file_version_scanner.ps1 b/eng/versioning/pom_file_version_scanner.ps1 index 400fa5edc663..009730cb9b53 100644 --- a/eng/versioning/pom_file_version_scanner.ps1 +++ b/eng/versioning/pom_file_version_scanner.ps1 @@ -76,7 +76,7 @@ class Dependency { { $this.curVer = $split[2] } - } + } } # The expected format for an external depenency, as found in the eng\versioning\external_dependencies.txt file, is as follows: @@ -96,15 +96,15 @@ class ExternalDependency { } $this.id = $split[0] $this.ver = $split[1] - } + } } function Build-Dependency-Hash-From-File { param( [hashtable]$depHash, - [string]$depFile, + [string]$depFile, [boolean]$extDepHash) - foreach($line in Get-Content $depFile) + foreach($line in Get-Content $depFile) { if (!$line -or $line.Trim() -eq '' -or $line.StartsWith("#")) { @@ -125,8 +125,8 @@ function Build-Dependency-Hash-From-File { catch { Write-Error-With-Color "Invalid dependency line='$($line) in file=$($depFile)" } - } - else + } + else { try { [ExternalDependency]$dep = [ExternalDependency]::new($line) @@ -149,7 +149,7 @@ function Test-Dependency-Tag-And-Version { param( [hashtable]$libHash, [hashtable]$extDepHash, - [string]$versionString, + [string]$versionString, [string]$versionUpdateString) # This is the format of the versionUpdateString and there should be 3 parts: @@ -204,7 +204,7 @@ function Test-Dependency-Tag-And-Version { return "Error: $($depKey)'s is '$($versionString)' but the dependency version is listed as $($libHash[$depKey].depVer)" } } - elseif ($depType -eq $DependencyTypeCurrent) + elseif ($depType -eq $DependencyTypeCurrent) { # Verify that none of the 'current' dependencies are using a groupId that starts with 'unreleased_' or 'beta_' if ($depKey.StartsWith('unreleased_') -or $depKey.StartsWith('beta_')) @@ -217,7 +217,7 @@ function Test-Dependency-Tag-And-Version { } } # At this point the version update string, itself, has an incorrect dependency tag - else + else { return "Error: Invalid dependency type '$($depType)' in version update string $($versionUpdateString). Dependency type must be one of $($DependencyTypeForError)" } @@ -225,7 +225,7 @@ function Test-Dependency-Tag-And-Version { } } -# There are some configurations, like org.apache.maven.plugins:maven-enforcer-plugin, +# There are some configurations, like org.apache.maven.plugins:maven-enforcer-plugin, # that have plugin and dependency configuration entries that are string patterns. This # function will be called if the groupId and artifactId for a given plugin or dependency # are both empty. It'll climb up the parents it finds a configuration entry or there are @@ -277,7 +277,7 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { } else { $xmlPomFile = New-Object xml $xmlPomFile.Load($pomFile) - if ($ValidParents -notcontains $xmlPomFile.project.parent.artifactId) + if ($ValidParents -notcontains $xmlPomFile.project.parent.artifactId) { # This may look odd but ForEach-Object is a cmdlet which means that "continue" # exits the loop altogether and "return" behaves like continue for a particular @@ -298,14 +298,14 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { # Ensure that the project has a version tag with the exception of projects under the eng directory which # aren't releasing libraries but still need to have their dependencies checked - if ($pomFile.Split([IO.Path]::DirectorySeparatorChar) -notcontains "eng") + if ($pomFile.Split([IO.Path]::DirectorySeparatorChar) -notcontains "eng") { $versionNode = $xmlPomFile.SelectSingleNode("/ns:project/ns:version", $xmlNsManager) if ($xmlPomFile.project.version -and $versionNode) { $artifactId = $xmlPomFile.project.artifactId $groupId = $xmlPomFile.project.groupId - if ($versionNode.NextSibling -and $versionNode.NextSibling.NodeType -eq "Comment") + if ($versionNode.NextSibling -and $versionNode.NextSibling.NodeType -eq "Comment") { # the project's version will always be an update type of "current" if ($versionNode.NextSibling.Value.Trim() -ne "{x-version-update;$($groupId):$($artifactId);current}") @@ -325,16 +325,16 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { } } } - else - { + else + { $script:FoundError = $true # # every project string needs to have an update tag and projects version tags are always 'current' Write-Error-With-Color "Error: Missing project/version update tag. The tag should be " } - + } - else + else { # output an error for missing version element $script:FoundError = $true @@ -350,7 +350,7 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { $artifactId = $xmlPomFile.project.parent.artifactId $groupId = $xmlPomFile.project.parent.groupId # versionNode.NextSibling.Value should be the actual XML tag starting with {x-version-update - if ($versionNode.NextSibling -and $versionNode.NextSibling.NodeType -eq "Comment") + if ($versionNode.NextSibling -and $versionNode.NextSibling.NodeType -eq "Comment") { # parent version if ($versionNode.NextSibling.Value.Trim() -ne "{x-version-update;$($groupId):$($artifactId);current}") @@ -369,19 +369,19 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { } } } - else - { + else + { $script:FoundError = $true # every project string needs to have an update tag and projects version tags are always 'current' Write-Error-With-Color "Error: Missing project/parent/version update tag. The tag should be " } } - else + else { # output an error for missing version element $script:FoundError = $true Write-Error-With-Color "Error: Could not find project/parent/version node for $($pomFile)" - } + } } # Verify every dependency as a group, artifact and version @@ -402,18 +402,18 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { Write-Error-With-Color "Error: dependency is missing version element and/or artifactId and groupId elements dependencyNode=$($dependencyNode.OuterXml)" } continue - } + } $versionNode = $dependencyNode.GetElementsByTagName("version")[0] - if (!$versionNode) + if (!$versionNode) { $script:FoundError = $true Write-Error-With-Color "Error: dependency is missing version element for groupId=$($groupId), artifactId=$($artifactId) should be " continue } - if ($versionNode.NextSibling -and $versionNode.NextSibling.NodeType -eq "Comment") + if ($versionNode.NextSibling -and $versionNode.NextSibling.NodeType -eq "Comment") { - # unfortunately because there are POM exceptions we need to wildcard the group which may be + # unfortunately because there are POM exceptions we need to wildcard the group which may be # something like _groupId if ($versionNode.NextSibling.Value.Trim() -notmatch "{x-version-update;(\w+)?$($groupId):$($artifactId);\w+}") { @@ -431,8 +431,8 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { } } } - else - { + else + { $script:FoundError = $true Write-Error-With-Color "Error: Missing dependency version update tag for groupId=$($groupId), artifactId=$($artifactId). The tag should be " } @@ -456,7 +456,7 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { Write-Error-With-Color "Error: plugin is missing version element and/or artifactId and groupId elements pluginNode=$($pluginNode.OuterXml)" } continue - } + } # plugins should always have an artifact but may not have a groupId if (!$groupId) { @@ -465,15 +465,15 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { continue } $versionNode = $pluginNode.GetElementsByTagName("version")[0] - if (!$versionNode) + if (!$versionNode) { $script:FoundError = $true Write-Error-With-Color "Error: plugin is missing version element for groupId=$($groupId), artifactId=$($artifactId) should be " continue } - if ($versionNode.NextSibling -and $versionNode.NextSibling.NodeType -eq "Comment") + if ($versionNode.NextSibling -and $versionNode.NextSibling.NodeType -eq "Comment") { - # unfortunately because there are POM exceptions we need to wildcard the group which may be + # unfortunately because there are POM exceptions we need to wildcard the group which may be # something like _groupId if ($versionNode.NextSibling.Value.Trim() -notmatch "{x-version-update;(\w+)?$($groupId):$($artifactId);\w+}") { @@ -491,8 +491,8 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { } } } - else - { + else + { $script:FoundError = $true Write-Error-With-Color "Error: Missing plugin version update tag for groupId=$($groupId), artifactId=$($artifactId). The tag should be " } @@ -556,7 +556,7 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { $script:FoundError = $true Write-Error-With-Color "Error: the groupId:artifactId entry '$($depKey)' for '$($rawIncludeText)' is not a valid external dependency. Please verify the entry exists in the external_dependencies.txt file. -->" } - } + } else { if ($depType -eq $DependencyTypeDependency) @@ -566,7 +566,7 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { return "Error: $($depKey)'s is '$($versionString)' but the dependency version is listed as $($libHash[$depKey].depVer)" } } - elseif ($depType -eq $DependencyTypeCurrent) + elseif ($depType -eq $DependencyTypeCurrent) { # Verify that none of the 'current' dependencies are using a groupId that starts with 'unreleased_' or 'beta_' if ($depKey.StartsWith('unreleased_') -or $depKey.StartsWith('beta_')) From 1153575080673ef71c8f76d3caaffe51dbe9fcfe Mon Sep 17 00:00:00 2001 From: Rujun Chen Date: Wed, 10 Jun 2020 13:18:13 +0800 Subject: [PATCH 4/5] Fix the order to 'a, b, c, d.' --- eng/versioning/pom_file_version_scanner.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/versioning/pom_file_version_scanner.ps1 b/eng/versioning/pom_file_version_scanner.ps1 index 009730cb9b53..01e532a8d1c4 100644 --- a/eng/versioning/pom_file_version_scanner.ps1 +++ b/eng/versioning/pom_file_version_scanner.ps1 @@ -11,9 +11,9 @@ # 2. There are no duplicate entries in the external_dependencies.txt file # 3. POM file verification across the repo which includes the following: # a. There are no sections -# a. Every and has a , and -# b. Every has the appropriate x-version-update tag -# c. The 's value is the same as the value in the version_*txt file or external_dependency +# b. Every and has a , and +# c. Every has the appropriate x-version-update tag +# d. The 's value is the same as the value in the version_*txt file or external_dependency # # Output: # This script will process the entire repo. If any errors are encountered, it will report them at From 3c1236a0fcd2a9d10660bb2b73b5202d5ff6a56f Mon Sep 17 00:00:00 2001 From: Rujun Chen Date: Wed, 10 Jun 2020 14:29:20 +0800 Subject: [PATCH 5/5] Fix the error in the message. --- eng/versioning/pom_file_version_scanner.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/versioning/pom_file_version_scanner.ps1 b/eng/versioning/pom_file_version_scanner.ps1 index 01e532a8d1c4..32ab28bb0453 100644 --- a/eng/versioning/pom_file_version_scanner.ps1 +++ b/eng/versioning/pom_file_version_scanner.ps1 @@ -609,8 +609,8 @@ Write-Host "Total run time=$($TotalRunTime)" if ($script:FoundError) { - Write-Error-With-Color "There were errors encountered during execution. Please fix any errors and run the script again." - Write-Error-With-Color "This script can be run locally from the root of the repo. .\eng\pom_file_version_scanner.ps1" + Write-Error-With-Color "There were errors encountered during execution. Please fix errors and run the script again." + Write-Error-With-Color "This script can be run locally from the root of the repo. .\eng\versioning\pom_file_version_scanner.ps1" exit(1) }