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

[pull] main from Azure:main #440

Merged
merged 14 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@
/sdk/communication/sdk/communication/azure-communication-chat/ @ankitarorabit @minnieliu @Azure/azure-sdk-communication-code-reviewers

# PRLabel: %Communication - Identity
/sdk/communication/azure-communication-identity/ @Azure/acs-identity-sdk @petrsvihlik @AikoBB @maximrytych-ms @ostoliarova-msft @mjafferi-msft
/sdk/communication/azure-communication-identity/ @Azure/acs-identity-sdk @AikoBB @maximrytych-ms @ostoliarova-msft @mjafferi-msft

# PRLabel: %Communication - Common
/sdk/communication/azure-communication-common/ @Azure/acs-identity-sdk @petrsvihlik @AikoBB @maximrytych-ms @ostoliarova-msft @mjafferi-msft
/sdk/communication/azure-communication-common/ @Azure/acs-identity-sdk @AikoBB @maximrytych-ms @ostoliarova-msft @mjafferi-msft

# PRLabel: %Communication - Network Traversal
/sdk/communication/sdk/communication/azure-communication-networktraversal/ @ankitarorabit @minnieliu @Azure/azure-sdk-communication-code-reviewers
Expand Down
2 changes: 2 additions & 0 deletions eng/common/scripts/stress-testing/deploy-stress-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ param(
# Renders chart templates locally without deployment
[Parameter(Mandatory=$False)][switch]$Template,

[Parameter(Mandatory=$False)][switch]$RetryFailedTests,

# Matrix generation parameters
[Parameter(Mandatory=$False)][string]$MatrixFileName,
[Parameter(Mandatory=$False)][string]$MatrixSelection,
Expand Down
97 changes: 86 additions & 11 deletions eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ function DeployStressTests(
})]
[System.IO.FileInfo]$LocalAddonsPath,
[Parameter(Mandatory=$False)][switch]$Template,
[Parameter(Mandatory=$False)][switch]$RetryFailedTests,
[Parameter(Mandatory=$False)][string]$MatrixFileName,
[Parameter(Mandatory=$False)][string]$MatrixSelection = "sparse",
[Parameter(Mandatory=$False)][string]$MatrixDisplayNameFilter,
Expand Down Expand Up @@ -215,11 +216,16 @@ function DeployStressPackage(
if ($LASTEXITCODE) {exit $LASTEXITCODE}

$dockerBuildConfigs = @()

$genValFile = Join-Path $pkg.Directory "generatedValues.yaml"
$genVal = Get-Content $genValFile -Raw | ConvertFrom-Yaml -Ordered
if (Test-Path $genValFile) {
$scenarios = $genVal.Scenarios

$generatedHelmValuesFilePath = Join-Path $pkg.Directory "generatedValues.yaml"
$generatedHelmValues = Get-Content $generatedHelmValuesFilePath -Raw | ConvertFrom-Yaml -Ordered
$releaseName = $pkg.ReleaseName
if ($RetryFailedTests) {
$releaseName, $generatedHelmValues = generateRetryTestsHelmValues $pkg $releaseName $generatedHelmValues
}

if (Test-Path $generatedHelmValuesFilePath) {
$scenarios = $generatedHelmValues.Scenarios
foreach ($scenario in $scenarios) {
if ("image" -in $scenario.keys) {
$dockerFilePath = Join-Path $pkg.Directory $scenario.image
Expand Down Expand Up @@ -286,7 +292,7 @@ function DeployStressPackage(
}
}
}
$genVal.scenarios = @( foreach ($scenario in $genVal.scenarios) {
$generatedHelmValues.scenarios = @( foreach ($scenario in $generatedHelmValues.scenarios) {
$dockerPath = if ("image" -notin $scenario) {
$dockerFilePath
} else {
Expand All @@ -298,15 +304,15 @@ function DeployStressPackage(
$scenario
} )

$genVal | ConvertTo-Yaml | Out-File -FilePath $genValFile
$generatedHelmValues | ConvertTo-Yaml | Out-File -FilePath $generatedHelmValuesFilePath
}

Write-Host "Installing or upgrading stress test $($pkg.ReleaseName) from $($pkg.Directory)"
Write-Host "Installing or upgrading stress test $releaseName from $($pkg.Directory)"

$generatedConfigPath = Join-Path $pkg.Directory generatedValues.yaml
$subCommand = $Template ? "template" : "upgrade"
$installFlag = $Template ? "" : "--install"
$helmCommandArg = "helm", $subCommand, $pkg.ReleaseName, $pkg.Directory, "-n", $pkg.Namespace, $installFlag, "--set", "stress-test-addons.env=$environment", "--values", $generatedConfigPath
$helmCommandArg = "helm", $subCommand, $releaseName, $pkg.Directory, "-n", $pkg.Namespace, $installFlag, "--set", "stress-test-addons.env=$environment", "--values", $generatedConfigPath

$result = (Run @helmCommandArg) 2>&1 | Write-Host

Expand All @@ -322,7 +328,7 @@ function DeployStressPackage(
# Issues like 'UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress'
# can be the result of cancelled `upgrade` operations (e.g. ctrl-c).
# See https://github.com/helm/helm/issues/4558
Write-Warning "The issue may be fixable by first running 'helm rollback -n $($pkg.Namespace) $($pkg.ReleaseName)'"
Write-Warning "The issue may be fixable by first running 'helm rollback -n $($pkg.Namespace) $releaseName'"
return
}
}
Expand All @@ -333,7 +339,7 @@ function DeployStressPackage(
if(!$Template) {
$helmReleaseConfig = RunOrExitOnFailure kubectl get secrets `
-n $pkg.Namespace `
-l "status=deployed,name=$($pkg.ReleaseName)" `
-l "status=deployed,name=$releaseName" `
-o jsonpath='{.items[0].metadata.name}'
Run kubectl label secret -n $pkg.Namespace --overwrite $helmReleaseConfig deployId=$deployId
}
Expand Down Expand Up @@ -375,3 +381,72 @@ function CheckDependencies()
}

}

function generateRetryTestsHelmValues ($pkg, $releaseName, $generatedHelmValues) {
$podOutput = RunOrExitOnFailure kubectl get pods -n $pkg.namespace -o json
$pods = $podOutput | ConvertFrom-Json

# Get all jobs within this helm release

$helmStatusOutput = RunOrExitOnFailure helm status -n $pkg.Namespace $pkg.ReleaseName --show-resources
# -----Example output-----
# NAME: <Release Name>
# LAST DEPLOYED: Mon Jan 01 12:12:12 2020
# NAMESPACE: <namespace>
# STATUS: deployed
# REVISION: 10
# RESOURCES:
# ==> v1alpha1/Schedule
# NAME AGE
# <schedule resource name 1> 5h5m
# <schedule resource name 2> 5h5m

# ==> v1/SecretProviderClass
# <secret provider name 1> 7d4h

# ==> v1/Job
# NAME COMPLETIONS DURATION AGE
# <job name 1> 0/1 5h5m 5h5m
# <job name 2> 0/1 5h5m 5h5m
$discoveredJob = $False
$jobs = @()
foreach ($line in $helmStatusOutput) {
if ($discoveredJob -and $line -match "==>") {break}
if ($discoveredJob) {
$jobs += ($line -split '\s+')[0] | Where-Object {($_ -ne "NAME") -and ($_)}
}
if ($line -match "==> v1/Job") {
$discoveredJob = $True
}
}

$failedJobsScenario = @()
$revision = 0
foreach ($job in $jobs) {
$jobRevision = [int]$job.split('-')[-1]
if ($jobRevision -gt $revision) {
$revision = $jobRevision
}

$jobOutput = RunOrExitOnFailure kubectl describe jobs -n $pkg.Namespace $job
$podPhase = $jobOutput | Select-String "0 Failed"
if ([System.String]::IsNullOrEmpty($podPhase)) {
$failedJobsScenario += $job.split("-$($pkg.ReleaseName)")[0]
}
}

$releaseName = "$($pkg.ReleaseName)-$revision-retry"

$retryTestsHelmVal = @{"scenarios"=@()}
foreach ($failedScenario in $failedJobsScenario) {
$failedScenarioObject = $generatedHelmValues.scenarios | Where {$_.Scenario -eq $failedScenario}
$retryTestsHelmVal.scenarios += $failedScenarioObject
}

if (!$retryTestsHelmVal.scenarios.length) {
Write-Host "There are no failed pods to retry."
return
}
$generatedHelmValues = $retryTestsHelmVal
return $releaseName, $generatedHelmValues
}
4 changes: 2 additions & 2 deletions eng/jacoco-test-coverage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-communication-common</artifactId>
<version>2.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-communication-common;current} -->
<version>2.0.0-beta.2</version> <!-- {x-version-update;com.azure:azure-communication-common;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
Expand All @@ -93,7 +93,7 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-communication-phonenumbers</artifactId>
<version>1.1.0-beta.16</version> <!-- {x-version-update;com.azure:azure-communication-phonenumbers;current} -->
<version>1.1.0</version> <!-- {x-version-update;com.azure:azure-communication-phonenumbers;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
Expand Down
2 changes: 1 addition & 1 deletion eng/mgmt/automation/generate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def sdk_automation_cadl(config: dict) -> List[dict]:
'eng/versioning',
'pom.xml'
],
'typeSpecProject': [cadl_project],
'typespecProject': [cadl_project],
'packageFolder': sdk_folder,
'artifacts': artifacts,
'apiViewArtifact': next(iter(glob.glob('{0}/target/*-sources.jar'.format(sdk_folder))), None),
Expand Down
7 changes: 4 additions & 3 deletions eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ com.azure:azure-aot-graalvm-perf;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-communication-chat;1.3.6;1.4.0-beta.1
com.azure:azure-communication-callingserver;1.0.0-beta.4;1.0.0-beta.5
com.azure:azure-communication-callautomation;1.0.0-beta.1;1.0.0-beta.2
com.azure:azure-communication-common;1.2.6;2.0.0-beta.1
com.azure:azure-communication-common;1.2.6;2.0.0-beta.2
com.azure:azure-communication-common-perf;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-communication-sms;1.1.11;1.2.0-beta.1
com.azure:azure-communication-identity;1.4.4;1.5.0-beta.1
com.azure:azure-communication-phonenumbers;1.0.20;1.1.0-beta.16
com.azure:azure-communication-phonenumbers;1.0.20;1.1.0
com.azure:azure-communication-networktraversal;1.1.0-beta.2;1.1.0-beta.3
com.azure:azure-communication-jobrouter;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-communication-rooms;1.0.0-beta.2;1.0.0-beta.3
Expand Down Expand Up @@ -98,6 +98,7 @@ com.azure.cosmos.spark:azure-cosmos-spark_3-2_2-12;4.17.2;4.18.0-beta.1
com.azure.cosmos.spark:azure-cosmos-spark_3-3_2-12;4.17.2;4.18.0-beta.1
com.azure:azure-cosmos-encryption;1.12.0;1.13.0-beta.1
com.azure:azure-cosmos-test;1.0.0-beta.1;1.0.0-beta.2
com.azure:azure-cosmos-tests;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-data-appconfiguration;1.4.3;1.5.0-beta.1
com.azure:azure-data-appconfiguration-perf;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-data-schemaregistry;1.3.4;1.4.0-beta.3
Expand Down Expand Up @@ -410,7 +411,7 @@ com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2
# note: The unreleased dependencies will not be manipulated with the automatic PR creation code.
# In the pom, the version update tag after the version should name the unreleased package and the dependency version:
# <!-- {x-version-update;unreleased_com.azure:azure-core;dependency} -->

unreleased_com.azure:azure-core;1.38.0-beta.1

# Released Beta dependencies: Copy the entry from above, prepend "beta_", remove the current
# version and set the version to the released beta. Released beta dependencies are only valid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
### Breaking Changes

### Bugs Fixed

- Fixed the bug that multiple authentications coexist per builder. App Configuration client builder should only
support single authentication per builder instance.
- Moved the validation of authentication to client builder's build method.

### Other Changes

## 1.4.3 (2023-03-16)
Expand Down
Loading