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

Sync eng/common directory with azure-sdk-tools for PR 8721 #45262

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions eng/common/testproxy/onboarding/generate-assets-json.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ In that case, the assets.json should live alongside the ci.yml in the sdk/<Servi

Generated assets.json file contents
- AssetsRepo: "Azure/azure-sdk-assets" - This is the assets repository, aka where your recordings will live after this script runs.
- AssetsRepoPrefixPath: "<language>" - this is will be computed from repository it's being run in.
- AssetsRepoPrefixPath: "<language>" - this is will be computed from repository it's being run in.
- TagPrefix: "<language>/<ServiceDirectory>" or "<language>/<ServiceDirectory>/<library>" or deeper if things
are nested in such a manner. All tags created for this assets.json will start with this name.
- Tag: "" - Initially empty, as nothing has yet been pushed.
Expand Down Expand Up @@ -81,6 +81,7 @@ $LangRecordingDirs = @{"cpp" = "recordings";
. (Join-Path $PSScriptRoot "common-asset-functions.ps1")

Test-Exe-In-Path -ExeToLookFor $GitExe

$language = Get-Repo-Language

# If the initial push is being performed, ensure that test-proxy is
Expand All @@ -89,7 +90,7 @@ $language = Get-Repo-Language
if ($InitialPush) {
$proxyPresent = Test-Exe-In-Path -ExeToLookFor $TestProxyExe -ExitOnError $false

# try to fall back
# try to fall back
if (-not $proxyPresent) {
$StandaloneTestProxyExe = "Azure.Sdk.Tools.TestProxy"

Expand All @@ -107,6 +108,17 @@ if ($InitialPush) {
Write-Error "The user has selected option InitialPush to push their assets, neither $TestProxyExe nor standalone executable $StandaloneTestProxyExe are installed on this machine."
exit 1
}

# if we're pushing, we also need to confirm that the necessary git configuration items are set
$result = git config --get user.name
if ($LASTEXITCODE -ne 0 -or !$result){
Write-Error "The git config setting `"user.name`" is unset. Set it to your git user name via 'git config --global user.name `"<setting>`'"
}

$result = git config --get user.email
if ($LASTEXITCODE -ne 0 -or !$result){
Write-Error "The git config setting `"user.email`" is unset. Set it to your git email via 'git config --global user.email `"<setting>`'"
}
}

if ($TestProxyExe -eq "test-proxy" -or $TestProxyExe.StartsWith("Azure.Sdk.Tools.TestProxy")) {
Expand Down