Skip to content

Commit 509f30c

Browse files
Merge branch 'main' into changjian-wang/sample-advanced-contentsource-grouding
2 parents eef7700 + 9e9170b commit 509f30c

26 files changed

Lines changed: 2616 additions & 721 deletions

File tree

.github/workflows/post-apiview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111
jobs:
1212
post-apiview:
1313
name: After APIView
14-
runs-on: ["self-hosted", "1ES.Pool=azsdk-pool-github-runners"]
14+
runs-on: ["self-hosted", "1ES.Pool=azsdk-pool-github-runners", "JobId=azsdk-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}"]
1515
if: |
1616
toJson(github.event.check_run.pull_requests) != '[]' &&
1717
github.event.check_run.check_suite.app.name == 'Azure Pipelines' && (

eng/pipelines/templates/jobs/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ jobs:
100100
os: linux
101101

102102
steps:
103+
# Fail fast if this is a manual release build but no packages were selected.
104+
# When manually triggering the pipeline, at least one release_* parameter must be checked.
105+
- ${{ if and(eq(variables['System.TeamProject'], 'internal'), eq(variables['Build.Reason'], 'Manual'), eq(length(parameters.ReleaseArtifacts), 0)) }}:
106+
- pwsh: |
107+
Write-Host "##vso[task.logissue type=error]No packages selected for release. When manually queuing this pipeline, please select at least one package by checking the appropriate package-name parameter(s)."
108+
exit 1
109+
displayName: 'Validate: at least one package is selected for release'
110+
103111
# Skip sparse checkout for the `azure-sdk-for-<lang>-pr` private mirrored repositories
104112
# as we require the GitHub service connection to be loaded.
105113
- ${{ if not(contains(variables['Build.DefinitionName'], 'java-pr')) }}:
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
<#
5+
.SYNOPSIS
6+
Updates parent-level and root-level pom.xml files, and ci.yml for a Java SDK package.
7+
8+
.DESCRIPTION
9+
This script handles two cases:
10+
Case 1 - Service exists, new resourcemanager package:
11+
- Skips root pom (service already listed)
12+
- Updates service-level pom.xml with new module
13+
- Updates ci.yml with new artifact entry
14+
Case 2 - Brand new service:
15+
- Updates root pom.xml with new service module
16+
- Creates service-level pom.xml from template
17+
- Creates ci.yml from template with new artifact entry
18+
19+
.PARAMETER PackagePath
20+
Absolute path to the root folder of the local SDK project (containing pom.xml).
21+
22+
.PARAMETER SdkRepoPath
23+
Absolute path to the root folder of the local SDK repository.
24+
25+
.EXAMPLE
26+
.\Automation-Sdk-UpdateMetadata.ps1 -PackagePath "C:\repos\azure-sdk-for-java\sdk\network\azure-resourcemanager-network" -SdkRepoPath "C:\repos\azure-sdk-for-java"
27+
#>
28+
29+
param(
30+
[Parameter(Mandatory = $true)]
31+
[ValidateScript({Test-Path $_})]
32+
[string]$PackagePath,
33+
34+
[Parameter(Mandatory = $true)]
35+
[ValidateScript({Test-Path $_})]
36+
[string]$SdkRepoPath
37+
)
38+
39+
$ErrorActionPreference = "Stop"
40+
41+
# Import common scripts for logging functions
42+
$commonScriptPath = Join-Path $PSScriptRoot ".." "common" "scripts" "common.ps1"
43+
. $commonScriptPath
44+
45+
# Import metadata helper functions
46+
$helperPath = Join-Path $PSScriptRoot "helpers" "Metadata-Helpers.ps1"
47+
. $helperPath
48+
49+
try {
50+
LogInfo "========================================"
51+
LogInfo "Azure SDK Metadata Update Tool"
52+
LogInfo "========================================"
53+
LogInfo ""
54+
55+
LogInfo "Step 1: Deriving service and module from package path..."
56+
$pathInfo = Get-ServiceAndModuleFromPath -PackagePath $PackagePath -SdkRepoPath $SdkRepoPath
57+
$service = $pathInfo.Service
58+
$module = $pathInfo.Module
59+
LogInfo " Service: $service"
60+
LogInfo " Module: $module"
61+
LogInfo ""
62+
63+
LogInfo "Step 2: Updating root pom.xml..."
64+
Update-RootPom -SdkRepoPath $SdkRepoPath -Service $service
65+
LogInfo ""
66+
67+
LogInfo "Step 3: Updating service-level pom.xml..."
68+
Update-ServicePom -SdkRepoPath $SdkRepoPath -Service $service -Module $module
69+
LogInfo ""
70+
71+
LogInfo "Step 4: Updating ci.yml..."
72+
$packagePomPath = Join-Path $PackagePath "pom.xml"
73+
if (Test-Path $packagePomPath) {
74+
$groupId = Get-GroupIdFromPom -PomPath $packagePomPath
75+
LogInfo " GroupId: $groupId"
76+
77+
$supportedGroupIds = @("com.azure", "com.azure.resourcemanager")
78+
if ($groupId -notin $supportedGroupIds) {
79+
LogError "Unsupported SDK type with groupId '$groupId' at '$PackagePath'. This script only supports: $($supportedGroupIds -join ', ')."
80+
exit 1
81+
}
82+
83+
Update-CiYml -SdkRepoPath $SdkRepoPath -Service $service -Module $module -GroupId $groupId
84+
}
85+
else {
86+
LogError "No pom.xml found at '$packagePomPath'. Cannot determine groupId for ci.yml update."
87+
}
88+
LogInfo ""
89+
90+
LogInfo "✅ Metadata updated successfully!"
91+
exit 0
92+
}
93+
catch {
94+
LogError "An error occurred: $_"
95+
LogError "Stack trace: $($_.ScriptStackTrace)"
96+
exit 1
97+
}

0 commit comments

Comments
 (0)