Skip to content

Commit

Permalink
Merge branch 'main' into feature/java-dpg
Browse files Browse the repository at this point in the history
  • Loading branch information
weidongxu-microsoft committed Jun 22, 2022
2 parents efcbceb + 9352ae6 commit 8b397cc
Show file tree
Hide file tree
Showing 1,583 changed files with 56,398 additions and 14,163 deletions.
4 changes: 2 additions & 2 deletions common/smoke-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-messaging-eventhubs</artifactId>
<version>5.12.0</version> <!-- {x-version-update;com.azure:azure-messaging-eventhubs;dependency} -->
<version>5.12.1</version> <!-- {x-version-update;com.azure:azure-messaging-eventhubs;dependency} -->
</dependency>

<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-messaging-eventhubs-checkpointstore-blob</artifactId>
<version>1.12.2</version> <!-- {x-version-update;com.azure:azure-messaging-eventhubs-checkpointstore-blob;dependency} -->
<version>1.13.0</version> <!-- {x-version-update;com.azure:azure-messaging-eventhubs-checkpointstore-blob;dependency} -->
</dependency>

<dependency>
Expand Down
4 changes: 4 additions & 0 deletions eng/CredScanSuppression.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
"placeholder": "JdppJP5eH1w/CQ0cx4RGYWoC7NmQ0nmDbYR2PYWSDTXojV9bI1ck0Eh0sUIg8xj4KYj7tv+ZPLICu3BgLt6mMz==",
"_justification": "Mocked key used in performance testing."
},
{
"placeholder": "OAuth2ClientCredential",
"_justification": "Javadoc in azure-resourcemanager-datafactory"
},
{
"file":[
"eng/common/testproxy/dotnet-devcert.pfx",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@ the main ServiceBusClientBuilder. -->

<suppress checks="com.azure.tools.checkstyle.checks.GoodLoggingCheck"
files="com.azure.core.test.AzureTestWatcher.java"/>
<suppress checks="com.azure.tools.checkstyle.checks.GoodLoggingCheck"
files="com.azure.core.test.ThreadDumper.java"/>

<!-- This policy is purely an implementation detail and should not be used by customers -->
<suppress checks="com.azure.tools.checkstyle.checks.HttpPipelinePolicyCheck"
Expand Down
25 changes: 6 additions & 19 deletions eng/code-quality-reports/src/main/resources/revapi/revapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,28 +245,10 @@
},
{
"regex": true,
"code": "java\\.annotation\\.added",
"new": "class com\\.azure\\.spring\\.cloud\\.autoconfigure\\.(storage|keyvault)\\..*",
"justification": "To support for storage services and keyvault services to share values of common properties."
},
{
"regex": true,
"code": "java\\.annotation\\.attributeRemoved",
"new": "class com\\.azure\\.spring\\.cloud\\.autoconfigure\\.(storage|keyvault)\\..*",
"justification": "To support for storage services and keyvault services to share values of common properties."
},
{
"regex": true,
"code": "java\\.annotation\\.attributeAdded",
"code": "java\\.annotation\\.(added|removed|attributeValueChanged|attributeAdded|attributeRemoved)",
"new": "class com\\.azure\\.spring\\.cloud\\.autoconfigure\\.(storage|keyvault)\\..*",
"justification": "To support for storage services and keyvault services to share values of common properties."
},
{
"regex": true,
"code": "java\\.annotation\\.removed",
"new": "class com\\.azure\\.spring\\.cloud\\.autoconfigure\\.keyvault\\..*",
"justification": "To support for keyvault services to share values of common properties."
},
{
"code": "java.method.visibilityReduced",
"new": "method com.azure.spring.cloud.autoconfigure.context.AzureTokenCredentialAutoConfiguration.AzureServiceClientBuilderFactoryPostProcessor com.azure.spring.cloud.autoconfigure.context.AzureTokenCredentialAutoConfiguration::builderFactoryBeanPostProcessor()",
Expand All @@ -282,6 +264,11 @@
"new": "class com.azure.spring.cloud.autoconfigure.context.AzureTokenCredentialAutoConfiguration",
"justification": "Fixes a bug."
},
{
"code": "java.annotation.added",
"new": "class com.azure.spring.cloud.autoconfigure.jms.ServiceBusJmsAutoConfiguration",
"justification": "Fixes a bug."
},
{
"code": "java.missing.newSuperType",
"old": "class com.azure.messaging.eventhubs.EventData",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
</Match>

<!-- try-with-resources bug https://github.com/spotbugs/spotbugs/issues/1694 -->
<Match>
<Or>
<Class name="com.azure.core.implementation.util.FileContent"/> <!-- false positive -->
<Method name="getBytes"/>
</Or>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
</Match>

<Match>
<Or>
Expand Down Expand Up @@ -385,7 +393,9 @@
<Match>
<Or>
<Class name="com.azure.core.http.HttpPipelineNextPolicy"/>
<Class name="com.azure.core.http.HttpPipelineNextSyncPolicy"/>
<Class name="com.azure.core.http.HttpRequest"/>
<Class name="com.azure.core.implementation.http.HttpPipelineCallState"/>
</Or>
<Bug pattern="CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE"/>
</Match>
Expand Down Expand Up @@ -2713,7 +2723,7 @@
</Match>
<Match>
<Class name="com.azure.ai.textanalytics.AnalyzeSentimentAsyncClient"/>
<Method name="getAnalyzedSentimentResponse"/>
<Method name="getAnalyzedSentimentResponse"/>
<Bug pattern="BC_UNCONFIRMED_CAST_OF_RETURN_VALUE"/>
</Match>
<Match>
Expand All @@ -2735,7 +2745,7 @@
<Class name="com.azure.ai.textanalytics.RecognizeLinkedEntityAsyncClient"/>
<Method name="getRecognizedLinkedEntitiesResponse"/>
<Bug pattern="BC_UNCONFIRMED_CAST_OF_RETURN_VALUE"/>
</Match>
</Match>
<Match>
<Class name="com.azure.ai.textanalytics.RecognizePiiEntityAsyncClient"/>
<Method name="getRecognizePiiEntitiesResponse"/>
Expand Down
20 changes: 12 additions & 8 deletions eng/common/TestResources/New-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ param (
[ValidateSet('AzureCloud', 'AzureUSGovernment', 'AzureChinaCloud', 'Dogfood')]
[string] $Environment = 'AzureCloud',

[Parameter()]
[ValidateSet('test', 'perf')]
[string] $ResourceType = 'test',

[Parameter()]
[hashtable] $ArmTemplateParameters,

Expand Down Expand Up @@ -223,7 +227,7 @@ function BuildBicepFile([System.IO.FileSystemInfo] $file)
}

$tmp = $env:TEMP ? $env:TEMP : [System.IO.Path]::GetTempPath()
$templateFilePath = Join-Path $tmp "test-resources.$(New-Guid).compiled.json"
$templateFilePath = Join-Path $tmp "$ResourceType-resources.$(New-Guid).compiled.json"

# Az can deploy bicep files natively, but by compiling here it becomes easier to parse the
# outputted json for mismatched parameter declarations.
Expand Down Expand Up @@ -349,7 +353,7 @@ try {
$root = [System.IO.Path]::Combine($repositoryRoot, "sdk", $ServiceDirectory) | Resolve-Path
$templateFiles = @()

'test-resources.json', 'test-resources.bicep' | ForEach-Object {
"$ResourceType-resources.json", "$ResourceType-resources.bicep" | ForEach-Object {
Write-Verbose "Checking for '$_' files under '$root'"
Get-ChildItem -Path $root -Filter "$_" -Recurse | ForEach-Object {
Write-Verbose "Found template '$($_.FullName)'"
Expand Down Expand Up @@ -397,7 +401,7 @@ try {
# string.
if (!$Location) {
$Location = @{
'AzureCloud' = 'westus2';
'AzureCloud' = 'westus';
'AzureUSGovernment' = 'usgovvirginia';
'AzureChinaCloud' = 'chinaeast2';
'Dogfood' = 'westus'
Expand Down Expand Up @@ -586,9 +590,9 @@ try {
# Service principals in the Microsoft AAD tenant must end with an @microsoft.com domain; those in other tenants
# are not permitted to do so. Format the non-MS name so there's an assocation with the Azure SDK.
if ($TenantId -eq '72f988bf-86f1-41af-91ab-2d7cd011db47') {
$displayName = "test-resources-$($baseName)$suffix.microsoft.com"
$displayName = "$ResourceType-resources-$($baseName)$suffix.microsoft.com"
} else {
$displayName = "$($baseName)$suffix.test-resources.azure.sdk"
$displayName = "$($baseName)$suffix.$ResourceType-resources.azure.sdk"
}

$servicePrincipalWrapper = NewServicePrincipalWrapper -subscription $SubscriptionId -resourceGroup $ResourceGroupName -displayName $DisplayName
Expand Down Expand Up @@ -705,7 +709,7 @@ try {
}
}

$preDeploymentScript = $templateFile.originalFilePath | Split-Path | Join-Path -ChildPath 'test-resources-pre.ps1'
$preDeploymentScript = $templateFile.originalFilePath | Split-Path | Join-Path -ChildPath "$ResourceType-resources-pre.ps1"
if (Test-Path $preDeploymentScript) {
Log "Invoking pre-deployment script '$preDeploymentScript'"
&$preDeploymentScript -ResourceGroupName $ResourceGroupName @PSBoundParameters
Expand Down Expand Up @@ -745,7 +749,7 @@ try {

$deploymentOutputs = SetDeploymentOutputs $serviceName $context $deployment $templateFile

$postDeploymentScript = $templateFile.originalFilePath | Split-Path | Join-Path -ChildPath 'test-resources-post.ps1'
$postDeploymentScript = $templateFile.originalFilePath | Split-Path | Join-Path -ChildPath "$ResourceType-resources-post.ps1"
if (Test-Path $postDeploymentScript) {
Log "Invoking post-deployment script '$postDeploymentScript'"
&$postDeploymentScript -ResourceGroupName $ResourceGroupName -DeploymentOutputs $deploymentOutputs @PSBoundParameters
Expand Down Expand Up @@ -903,7 +907,7 @@ This is used for CI automation.
Optional location where resources should be created. If left empty, the default
is based on the cloud to which the template is being deployed:
* AzureCloud -> 'westus2'
* AzureCloud -> 'westus'
* AzureUSGovernment -> 'usgovvirginia'
* AzureChinaCloud -> 'chinaeast2'
* Dogfood -> 'westus'
Expand Down
2 changes: 1 addition & 1 deletion eng/common/TestResources/New-TestResources.ps1.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ Optional location where resources should be created.
If left empty, the default
is based on the cloud to which the template is being deployed:
* AzureCloud -\> 'westus2'
* AzureCloud -\> 'westus'
* AzureUSGovernment -\> 'usgovvirginia'
* AzureChinaCloud -\> 'chinaeast2'
* Dogfood -\> 'westus'
Expand Down
2 changes: 1 addition & 1 deletion eng/common/TestResources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ${env:KEYVAULT_CLIENT_ID} = '<<secret>>'
${env:KEYVAULT_CLIENT_SECRET} = '<<secret>>'
${env:KEYVAULT_SUBSCRIPTION_ID} = 'YOUR SUBSCRIPTION ID'
${env:KEYVAULT_RESOURCE_GROUP} = 'rg-myusername'
${env:KEYVAULT_LOCATION} = 'westus2'
${env:KEYVAULT_LOCATION} = 'westus'
${env:KEYVAULT_SKU} = 'premium'
${env:AZURE_KEYVAULT_URL} = '<<url>>'
```
Expand Down
8 changes: 6 additions & 2 deletions eng/common/TestResources/Remove-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ param (
[Parameter(ParameterSetName = 'ResourceGroup+Provisioner')]
[switch] $CI,

[Parameter()]
[ValidateSet('test', 'perf')]
[string] $ResourceType = 'test',

[Parameter()]
[switch] $Force,

Expand Down Expand Up @@ -198,7 +202,7 @@ Log "Selected subscription '$subscriptionName'"

if ($ServiceDirectory) {
$root = [System.IO.Path]::Combine("$PSScriptRoot/../../../sdk", $ServiceDirectory) | Resolve-Path
$preRemovalScript = Join-Path -Path $root -ChildPath 'remove-test-resources-pre.ps1'
$preRemovalScript = Join-Path -Path $root -ChildPath "remove-$ResourceType-resources-pre.ps1"
if (Test-Path $preRemovalScript) {
Log "Invoking pre resource removal script '$preRemovalScript'"

Expand All @@ -210,7 +214,7 @@ if ($ServiceDirectory) {
}

# Make sure environment files from New-TestResources -OutFile are removed.
Get-ChildItem -Path $root -Filter test-resources.json.env -Recurse | Remove-Item -Force:$Force
Get-ChildItem -Path $root -Filter "$ResourceType-resources.json.env" -Recurse | Remove-Item -Force:$Force
}

$verifyDeleteScript = {
Expand Down
2 changes: 2 additions & 0 deletions eng/common/TestResources/deploy-test-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parameters:
DeleteAfterHours: 8
Location: ''
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources)
ResourceType: test

# SubscriptionConfiguration will be splatted into the parameters of the test
# resources script. It should be JSON in the form:
Expand Down Expand Up @@ -48,6 +49,7 @@ steps:
# pass those in via the ArmTemplateParameters flag, and handle any
# additional parameters from the pipelines via AdditionalParameters
eng/common/TestResources/New-TestResources.ps1 `
-ResourceType '${{ parameters.ResourceType }}' `
-ServiceDirectory '${{ parameters.ServiceDirectory }}' `
-Location '${{ parameters.Location }}' `
-DeleteAfterHours '${{ parameters.DeleteAfterHours }}' `
Expand Down
2 changes: 2 additions & 0 deletions eng/common/TestResources/remove-test-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
parameters:
ServiceDirectory: ''
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources)
ResourceType: test

# SubscriptionConfiguration will be splat into the parameters of the test
# resources script. It should be JSON in the form:
Expand All @@ -29,6 +30,7 @@ steps:
eng/common/TestResources/Remove-TestResources.ps1 `
@subscriptionConfiguration `
-ResourceType '${{ parameters.ResourceType }}' `
-ServiceDirectory "${{ parameters.ServiceDirectory }}" `
-CI `
-Force `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@
</table>
{{/syntax.typeParameters.0}}

{{#remarks}}
<h5 id="{{id}}_remarks"><strong>{{__global.remarks}}</strong></h5>
<div class="markdown level0 remarks">{{{remarks}}}</div>
{{/remarks}}

{{#example.0}}
<h5 id="{{id}}_examples"><strong>{{__global.examples}}</strong></h5>
<h5 id="{{id}}_examples">{{__global.examples}}</h5>
{{/example.0}}
{{#example}}
{{{.}}}
{{/example}}

{{#remarks}}
<h5 id="{{id}}_remarks">{{__global.remarks}}</h5>
<div class="markdown level0 remarks">{{{remarks}}}</div>
{{/remarks}}
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,18 @@
{{/definition}}
{{/implements}}

{{#remarks}}
<h5 id="{{id}}_remarks">{{__global.remarks}}</h5>
<div class="markdown level1 remarks">{{{remarks}}}</div>
{{/remarks}}

{{#example.0}}
<h5 id="{{id}}_examples">{{__global.examples}}</h5>
{{/example.0}}
{{#example}}
{{{.}}}
{{/example}}

{{#remarks}}
<h5 id="{{id}}_remarks">{{__global.remarks}}</h5>
<div class="markdown level1 remarks">{{{remarks}}}</div>
{{/remarks}}

{{#exceptions.0}}
<h5 class="exceptions">{{__global.exceptions}}</h5>
<table>
Expand Down
9 changes: 8 additions & 1 deletion eng/common/pipelines/templates/steps/create-apireview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,11 @@ steps:
pwsh: true
workingDirectory: $(Pipeline.Workspace)
displayName: Create API Review for ${{ artifact.name}}
condition: and(succeededOrFailed(), ne(variables['Skip.CreateApiReview'], 'true') , ne(variables['Build.Reason'],'PullRequest'), eq(variables['System.TeamProject'], 'internal'))
condition: >-
and(
succeededOrFailed(),
ne(variables['Skip.CreateApiReview'], 'true'),
ne(variables['Build.Reason'],'PullRequest'),
eq(variables['System.TeamProject'], 'internal'),
not(endsWith(variables['Build.Repository.Name'], '-pr'))
)
2 changes: 2 additions & 0 deletions eng/common/pipelines/templates/steps/credscan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ steps:
Write-Host "##vso[task.setvariable variable=SKIP_CREDSCAN]true"
}
displayName: CredScan setup
condition: succeededOrFailed()

- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@3
displayName: CredScan running
condition: and(succeededOrFailed(), ne(variables['SKIP_CREDSCAN'], true))
Expand Down
Loading

0 comments on commit 8b397cc

Please sign in to comment.