Skip to content

Commit c0f242a

Browse files
Merge branch 'main' into sync-eng/common-stop-using-apikey-13235
2 parents a8c58f1 + bc6b026 commit c0f242a

File tree

187 files changed

+8656
-701
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+8656
-701
lines changed

eng/common/instructions/azsdk-tools/check-package-readiness.instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Check the release readiness of an SDK package by collecting the required informa
1515
- Go
1616

1717
2. **Execute Readiness Check**:
18-
- Use the `azsdk_check_package_release_readiness` tool with the provided package name and selected language
18+
- Use the `azsdk_release_sdk` tool with the provided package name, selected language, and set checkReady to true.
1919
- Do not check for existing pull requests to run this step.
2020
- Do not ask the user to create a release plan to run this step.
2121

eng/common/instructions/azsdk-tools/verify-setup.instructions.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: 'Verify Setup'
55
## Goal
66
This tool verifies the developer's environment for SDK development and release tasks. It returns what requirements are missing for the specified languages and repo, or success if all requirements are satisfied.
77

8-
Your goal is to identify the project repo root, and pass in the `packagePath` to the Verify Setup tool. For a language repo, pass in the language of the repo.
8+
Your goal is to identify the project repo root, and pass in the `packagePath` to the Verify Setup tool. For a language repo, pass in the language of the repo.
99

1010
## Examples
1111
- in `azure-sdk-for-js`, run `azsdk_verify_setup` with `(langs=javascript, packagePath=<path>/azure-sdk-for-js)`.
@@ -14,6 +14,8 @@ Your goal is to identify the project repo root, and pass in the `packagePath` to
1414
The user can specify multiple languages to check. If the user wants to check all languages, pass in ALL supported languages. Passing in no languages will only check the core requirements.
1515

1616
## Output
17-
Display results in a user-friendly and concise format, highlighting any missing dependencies that need to be addressed and how to resolve them.
17+
Display clear, step-by-step instructions on how to resolve any missing requirements identified. Explain why the requirement is necessary if it has a `reason` field. Organize requirements into categorical sections.
18+
19+
Based on the user's shell environment, enhance the tool instructions with shell-specific commands for resolving missing dependencies.
1820

1921
When Python tool requirements fail, inform the user about the `AZSDKTOOLS_PYTHON_VENV_PATH` environment variable if they have setup issues. The verify-setup tool can only check Python requirements within the virtual environment specified by this environment variable.

eng/common/pipelines/templates/steps/set-test-pipeline-version.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ parameters:
1414
- name: TestPipeline
1515
type: boolean
1616
default: false
17-
- name: ArtifactsJson
18-
type: string
19-
default: ''
17+
- name: Artifacts
18+
type: object
19+
default: []
2020

2121
steps:
2222
- ${{ if eq(parameters.TestPipeline, true) }}:
@@ -31,5 +31,5 @@ steps:
3131
-PackageNames '${{ coalesce(parameters.PackageName, parameters.PackageNames) }}'
3232
-ServiceDirectory '${{ parameters.ServiceDirectory }}'
3333
-TagSeparator '${{ parameters.TagSeparator }}'
34-
-ArtifactsJson '${{ parameters.ArtifactsJson }}'
34+
-Artifacts @('${{ replace(convertToJson(parameters.Artifacts), '''', '`''') }}' | ConvertFrom-Json)
3535
pwsh: true

eng/common/scripts/Helpers/DevOps-WorkItem-Helpers.ps1

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -215,16 +215,17 @@ function FindParentWorkItem($serviceName, $packageDisplayName, $outputCommand =
215215
$packageWorkItems = @{}
216216
$packageWorkItemWithoutKeyFields = @{}
217217

218-
function FindLatestPackageWorkItem($lang, $packageName, $outputCommand = $true, $ignoreReleasePlannerTests = $true, $tag = $null)
218+
function FindLatestPackageWorkItem($lang, $packageName, $groupId = $null, $outputCommand = $true, $ignoreReleasePlannerTests = $true, $tag = $null)
219219
{
220220
# Cache all the versions of this package and language work items
221-
$null = FindPackageWorkItem $lang $packageName -includeClosed $true -outputCommand $outputCommand -ignoreReleasePlannerTests $ignoreReleasePlannerTests -tag $tag
221+
$null = FindPackageWorkItem $lang $packageName -includeClosed $true -outputCommand $outputCommand -ignoreReleasePlannerTests $ignoreReleasePlannerTests -tag $tag -groupId $groupId
222222

223223
$latestWI = $null
224224
foreach ($wi in $packageWorkItems.Values)
225225
{
226226
if ($wi.fields["Custom.Language"] -ne $lang) { continue }
227227
if ($wi.fields["Custom.Package"] -ne $packageName) { continue }
228+
if ($groupId -and $wi.fields["Custom.GroupId"] -ne $groupId) { continue }
228229

229230
if (!$latestWI) {
230231
$latestWI = $wi
@@ -238,9 +239,9 @@ function FindLatestPackageWorkItem($lang, $packageName, $outputCommand = $true,
238239
return $latestWI
239240
}
240241

241-
function FindPackageWorkItem($lang, $packageName, $version, $outputCommand = $true, $includeClosed = $false, $ignoreReleasePlannerTests = $true, $tag = $null)
242+
function FindPackageWorkItem($lang, $packageName, $version, $groupId = $null, $outputCommand = $true, $includeClosed = $false, $ignoreReleasePlannerTests = $true, $tag = $null)
242243
{
243-
$key = BuildHashKeyNoNull $lang $packageName $version
244+
$key = BuildHashKey $lang $packageName $version $groupId
244245
if ($key -and $packageWorkItems.ContainsKey($key)) {
245246
return $packageWorkItems[$key]
246247
}
@@ -253,6 +254,7 @@ function FindPackageWorkItem($lang, $packageName, $version, $outputCommand = $tr
253254
$fields += "System.Tags"
254255
$fields += "Custom.Language"
255256
$fields += "Custom.Package"
257+
$fields += "Custom.GroupId"
256258
$fields += "Custom.PackageDisplayName"
257259
$fields += "System.Title"
258260
$fields += "Custom.PackageType"
@@ -282,6 +284,9 @@ function FindPackageWorkItem($lang, $packageName, $version, $outputCommand = $tr
282284
if ($packageName) {
283285
$query += " AND [Package] = '${packageName}'"
284286
}
287+
if ($groupId) {
288+
$query += " AND [GroupId] = '${groupId}'"
289+
}
285290
if ($version) {
286291
$query += " AND [PackageVersionMajorMinor] = '${version}'"
287292
}
@@ -295,7 +300,7 @@ function FindPackageWorkItem($lang, $packageName, $version, $outputCommand = $tr
295300

296301
foreach ($wi in $workItems)
297302
{
298-
$localKey = BuildHashKeyNoNull $wi.fields["Custom.Language"] $wi.fields["Custom.Package"] $wi.fields["Custom.PackageVersionMajorMinor"]
303+
$localKey = BuildHashKey $wi.fields["Custom.Language"] $wi.fields["Custom.Package"] $wi.fields["Custom.PackageVersionMajorMinor"] $wi.fields["Custom.GroupId"]
299304
if (!$localKey) {
300305
$packageWorkItemWithoutKeyFields[$wi.id] = $wi
301306
Write-Host "Skipping package [$($wi.id)]$($wi.fields['System.Title']) which is missing required fields language, package, or version."
@@ -461,10 +466,10 @@ function UpdatePackageWorkItemReleaseState($id, $state, $releaseType, $outputCom
461466

462467
function FindOrCreateClonePackageWorkItem($lang, $pkg, $verMajorMinor, $allowPrompt = $false, $outputCommand = $false, $relatedId = $null, $tag= $null, $ignoreReleasePlannerTests = $true)
463468
{
464-
$workItem = FindPackageWorkItem -lang $lang -packageName $pkg.Package -version $verMajorMinor -includeClosed $true -outputCommand $outputCommand -tag $tag -ignoreReleasePlannerTests $ignoreReleasePlannerTests
469+
$workItem = FindPackageWorkItem -lang $lang -packageName $pkg.Package -version $verMajorMinor -includeClosed $true -outputCommand $outputCommand -tag $tag -ignoreReleasePlannerTests $ignoreReleasePlannerTests -groupId $pkg.GroupId
465470

466471
if (!$workItem) {
467-
$latestVersionItem = FindLatestPackageWorkItem -lang $lang -packageName $pkg.Package -outputCommand $outputCommand -tag $tag -ignoreReleasePlannerTests $ignoreReleasePlannerTests
472+
$latestVersionItem = FindLatestPackageWorkItem -lang $lang -packageName $pkg.Package -outputCommand $outputCommand -tag $tag -ignoreReleasePlannerTests $ignoreReleasePlannerTests -groupId $pkg.GroupId
468473
$assignedTo = "me"
469474
$extraFields = @()
470475
if ($latestVersionItem) {
@@ -512,6 +517,13 @@ function CreateOrUpdatePackageWorkItem($lang, $pkg, $verMajorMinor, $existingIte
512517
Write-Host "Cannot create or update because one of lang, pkg or verMajorMinor aren't set. [$lang|$($pkg.Package)|$verMajorMinor]"
513518
return
514519
}
520+
521+
# PackageProp object uses Group, while other places use GroupId, such as in work item fields and package csv files.
522+
$pkgGroupId = if ($pkg.PSObject.Properties.Name -contains "GroupId") {
523+
$pkg.GroupId
524+
} else {
525+
$null
526+
}
515527
$pkgName = $pkg.Package
516528
$pkgDisplayName = $pkg.DisplayName
517529
$pkgType = $pkg.Type
@@ -523,6 +535,7 @@ function CreateOrUpdatePackageWorkItem($lang, $pkg, $verMajorMinor, $existingIte
523535
$fields = @()
524536
$fields += "`"Language=${lang}`""
525537
$fields += "`"Package=${pkgName}`""
538+
$fields += "`"GroupId=${pkgGroupId}`""
526539
$fields += "`"PackageDisplayName=${pkgDisplayName}`""
527540
$fields += "`"PackageType=${pkgType}`""
528541
$fields += "`"PackageTypeNewLibrary=${pkgNewLibrary}`""
@@ -540,6 +553,7 @@ function CreateOrUpdatePackageWorkItem($lang, $pkg, $verMajorMinor, $existingIte
540553

541554
if ($lang -ne $existingItem.fields["Custom.Language"]) { $changedField = "Custom.Language" }
542555
if ($pkgName -ne $existingItem.fields["Custom.Package"]) { $changedField = "Custom.Package" }
556+
if ($pkgGroupId -ne $existingItem.fields["Custom.GroupId"]) { $changedField = "Custom.GroupId" }
543557
if ($verMajorMinor -ne $existingItem.fields["Custom.PackageVersionMajorMinor"]) { $changedField = "Custom.PackageVersionMajorMinor" }
544558
if ($pkgDisplayName -ne $existingItem.fields["Custom.PackageDisplayName"]) { $changedField = "Custom.PackageDisplayName" }
545559
if ($pkgType -ne [string]$existingItem.fields["Custom.PackageType"]) { $changedField = "Custom.PackageType" }
@@ -1029,15 +1043,16 @@ function UpdatePackageVersions($pkgWorkItem, $plannedVersions, $shippedVersions)
10291043
function UpdateValidationStatus($pkgvalidationDetails, $BuildDefinition, $PipelineUrl)
10301044
{
10311045
$pkgName = $pkgValidationDetails.Name
1046+
$groupId = $pkgValidationDetails.GroupId
10321047
$versionString = $pkgValidationDetails.Version
10331048

10341049
$parsedNewVersion = [AzureEngSemanticVersion]::new($versionString)
10351050
$versionMajorMinor = "" + $parsedNewVersion.Major + "." + $parsedNewVersion.Minor
1036-
$workItem = FindPackageWorkItem -lang $LanguageDisplayName -packageName $pkgName -version $versionMajorMinor -includeClosed $true -outputCommand $false
1051+
$workItem = FindPackageWorkItem -lang $LanguageDisplayName -packageName $pkgName -groupId $groupId -version $versionMajorMinor -includeClosed $true -outputCommand $false
10371052

10381053
if (!$workItem)
10391054
{
1040-
Write-Host"No work item found for package [$pkgName]."
1055+
Write-Host "No work item found for package [$pkgName] with groupId [$groupId]."
10411056
return $false
10421057
}
10431058

@@ -1250,6 +1265,7 @@ function Update-DevOpsReleaseWorkItem {
12501265
[Parameter(Mandatory=$true)]
12511266
[string]$version,
12521267
[string]$plannedDate,
1268+
[string]$groupId = $null,
12531269
[string]$serviceName = $null,
12541270
[string]$packageDisplayName = $null,
12551271
[string]$packageRepoPath = "NA",
@@ -1277,6 +1293,7 @@ function Update-DevOpsReleaseWorkItem {
12771293

12781294
$packageInfo = [PSCustomObject][ordered]@{
12791295
Package = $packageName
1296+
GroupId = $groupId
12801297
DisplayName = $packageDisplayName
12811298
ServiceName = $serviceName
12821299
RepoPath = $packageRepoPath

eng/common/scripts/Package-Properties.ps1

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,30 @@ class PackageProps {
230230
# Returns important properties of the package relative to the language repo
231231
# Returns a PS Object with properties @ { pkgName, pkgVersion, pkgDirectoryPath, pkgReadMePath, pkgChangeLogPath }
232232
# Note: python is required for parsing python package properties.
233+
# GroupId is optional and is used to filter packages for languages that support group identifiers (e.g., Java).
234+
# When GroupId is provided, the function will match both the package name and the group ID.
233235
function Get-PkgProperties {
234236
Param
235237
(
236238
[Parameter(Mandatory = $true)]
237239
[string]$PackageName,
238-
[string]$ServiceDirectory
240+
[string]$ServiceDirectory,
241+
[string]$GroupId
239242
)
240243

244+
Write-Host "Get-PkgProperties called with PackageName: [$PackageName], ServiceDirectory: [$ServiceDirectory], GroupId: [$GroupId]"
245+
241246
$allPkgProps = Get-AllPkgProperties -ServiceDirectory $ServiceDirectory
242-
$pkgProps = $allPkgProps.Where({ $_.Name -eq $PackageName -or $_.ArtifactName -eq $PackageName });
247+
248+
if ([string]::IsNullOrEmpty($GroupId)) {
249+
$pkgProps = $allPkgProps.Where({ $_.Name -eq $PackageName -or $_.ArtifactName -eq $PackageName });
250+
}
251+
else {
252+
$pkgProps = $allPkgProps.Where({
253+
($_.Name -eq $PackageName -or $_.ArtifactName -eq $PackageName) -and
254+
($_.PSObject.Properties.Name -contains "Group" -and $_.Group -eq $GroupId)
255+
});
256+
}
243257

244258
if ($pkgProps.Count -ge 1) {
245259
if ($pkgProps.Count -gt 1) {
@@ -248,7 +262,12 @@ function Get-PkgProperties {
248262
return $pkgProps[0]
249263
}
250264

251-
LogError "Failed to retrieve Properties for [$PackageName]"
265+
if ([string]::IsNullOrEmpty($GroupId)) {
266+
LogError "Failed to retrieve Properties for [$PackageName]"
267+
}
268+
else {
269+
LogError "Failed to retrieve Properties for [$PackageName] with GroupId [$GroupId]. Ensure the package has a Group property matching the specified GroupId."
270+
}
252271
return $null
253272
}
254273

@@ -568,3 +587,25 @@ function Get-PkgPropsForEntireService ($serviceDirectoryPath) {
568587

569588
return $projectProps
570589
}
590+
591+
# Get the full package name based on packageInfo properties
592+
# Returns Group+ArtifactName if Group exists and has a value, otherwise returns Name
593+
# If UseColonSeparator switch is enabled, returns Group:ArtifactName format (colon separator)
594+
function Get-FullPackageName {
595+
param (
596+
[Parameter(Mandatory=$true)]
597+
[PSCustomObject]$PackageInfo,
598+
[switch]$UseColonSeparator
599+
)
600+
601+
if ($PackageInfo.PSObject.Members.Name -contains "Group") {
602+
$groupId = $PackageInfo.Group
603+
if ($groupId) {
604+
if ($UseColonSeparator) {
605+
return "${groupId}:$($PackageInfo.Name)"
606+
}
607+
return "${groupId}+$($PackageInfo.Name)"
608+
}
609+
}
610+
return $PackageInfo.Name
611+
}

eng/common/scripts/Prepare-Release.ps1

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ If one isn't provided, then it will compute the next ship date or today's date i
3030
.PARAMETER ReleaseTrackingOnly
3131
Optional: If this switch is passed then the script will only update the release work items and not update the versions in the local repo or validate the changelog.
3232
33+
.PARAMETER GroupId
34+
Optional: The group ID for the package. For Java packages, if not provided, the script will prompt for input with 'com.azure' as the default.
35+
3336
.EXAMPLE
3437
PS> ./eng/common/scripts/Prepare-Release.ps1 <PackageName>
3538
@@ -49,14 +52,27 @@ param(
4952
[string]$PackageName,
5053
[string]$ServiceDirectory,
5154
[string]$ReleaseDate, # Pass Date in the form MM/dd/yyyy"
52-
[switch]$ReleaseTrackingOnly = $false
55+
[switch]$ReleaseTrackingOnly = $false,
56+
[string]$GroupId
5357
)
5458
Set-StrictMode -Version 3
5559

5660
. ${PSScriptRoot}\common.ps1
5761
. ${PSScriptRoot}\Helpers\ApiView-Helpers.ps1
5862
. ${PSScriptRoot}\Helpers\DevOps-WorkItem-Helpers.ps1
5963

64+
# Prompt for GroupId if language is Java and GroupId is not provided
65+
if ($Language -eq 'java' -and [string]::IsNullOrEmpty($GroupId)) {
66+
$userInput = Read-Host "Input the group id, or press Enter to use 'com.azure' as the group id"
67+
if ([string]::IsNullOrWhiteSpace($userInput)) {
68+
$GroupId = "com.azure"
69+
}
70+
else {
71+
$GroupId = $userInput.Trim()
72+
}
73+
Write-Host "Using GroupId: $GroupId" -ForegroundColor Green
74+
}
75+
6076
function Get-ReleaseDay($baseDate)
6177
{
6278
# Find first friday
@@ -74,7 +90,7 @@ function Get-ReleaseDay($baseDate)
7490
$ErrorPreference = 'Stop'
7591

7692
$packageProperties = $null
77-
$packageProperties = Get-PkgProperties -PackageName $PackageName -ServiceDirectory $ServiceDirectory
93+
$packageProperties = Get-PkgProperties -PackageName $PackageName -ServiceDirectory $ServiceDirectory -GroupId $GroupId
7894

7995
if (!$packageProperties)
8096
{
@@ -128,7 +144,7 @@ if (Test-Path "Function:GetExistingPackageVersions")
128144
}
129145

130146
$currentProjectVersion = $packageProperties.Version
131-
$newVersion = Read-Host -Prompt "Input the new version, or press Enter to use use current project version '$currentProjectVersion'"
147+
$newVersion = Read-Host -Prompt "Input the new version, or press Enter to use current project version '$currentProjectVersion'"
132148

133149
if (!$newVersion)
134150
{
@@ -144,6 +160,7 @@ if ($null -eq $newVersionParsed)
144160

145161
$result = Update-DevOpsReleaseWorkItem -language $LanguageDisplayName `
146162
-packageName $packageProperties.Name `
163+
-groupId $packageProperties.Group `
147164
-version $newVersion `
148165
-plannedDate $releaseDateString `
149166
-packageRepoPath $packageProperties.serviceDirectory `
@@ -166,7 +183,8 @@ try
166183
}
167184
$url = az keyvault secret show --name "APIURL" --vault-name "AzureSDKPrepRelease-KV" --query "value" --output "tsv"
168185
$apiKey = az keyvault secret show --name "APIKEY" --vault-name "AzureSDKPrepRelease-KV" --query "value" --output "tsv"
169-
Check-ApiReviewStatus -PackageName $packageProperties.Name -packageVersion $newVersion -Language $LanguageDisplayName -url $url -apiKey $apiKey
186+
$fullPackageNameInApiView = Get-FullPackageName -PackageInfo $packageProperties -UseColonSeparator
187+
Check-ApiReviewStatus -PackageName $fullPackageNameInApiView -packageVersion $newVersion -Language $LanguageDisplayName -url $url -apiKey $apiKey
170188
}
171189
catch
172190
{
@@ -194,7 +212,7 @@ if (Test-Path "Function:SetPackageVersion")
194212
}
195213
SetPackageVersion -PackageName $packageProperties.Name -Version $newVersion `
196214
-ServiceDirectory $packageProperties.ServiceDirectory -ReleaseDate $releaseDateString `
197-
-PackageProperties $packageProperties -ReplaceLatestEntryTitle $replaceLatestEntryTitle
215+
-PackageProperties $packageProperties -ReplaceLatestEntryTitle $replaceLatestEntryTitle -GroupId $packageProperties.Group
198216
}
199217
else
200218
{

0 commit comments

Comments
 (0)