Skip to content

Commit 191763b

Browse files
authored
Use package info json files to figure out what to generate namesapces for (#42344)
* Use package info json files to figure out what to generate namesapces for * Actually remove the Artifacts from the call * Add azure-identity-broker-samples to service level pom * We need to get the dependency modules for the additional modules as well
1 parent 551bb8b commit 191763b

File tree

7 files changed

+33
-34
lines changed

7 files changed

+33
-34
lines changed

eng/pipelines/templates/jobs/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ jobs:
199199
filePath: $(Build.SourcesDirectory)/eng/scripts/Save-Package-Namespaces-Property.ps1
200200
arguments: >
201201
-ArtifactStagingDirectory $(Build.ArtifactStagingDirectory)
202-
-ArtifactsList ('$(ArtifactsJson)' | ConvertFrom-Json)
203202
pwsh: true
204203
workingDirectory: $(Pipeline.Workspace)
205204
displayName: Update package properties with namespaces

eng/scripts/Save-Package-Namespaces-Property.ps1

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,54 +18,48 @@ libraries are com.azure.spring and their javadoc jars will be under that subdire
1818
but azure-spring-data-cosmos' GroupId is com.azure and its javadoc jar will be under
1919
com.azure.
2020
21-
.PARAMETER ArtifactsList
22-
The list of artifacts to gather namespaces for, this is only done for libraries that are
23-
producing docs.
24-
-ArtifactsList ('$(ArtifactsJson)' | ConvertFrom-Json)
21+
The ArtifactStagingDirectory
22+
2523
#>
2624
[CmdletBinding()]
2725
Param (
2826
[Parameter(Mandatory = $True)]
29-
[string] $ArtifactStagingDirectory,
30-
[Parameter(Mandatory=$true)]
31-
[array] $ArtifactsList
27+
[string] $ArtifactStagingDirectory
3228
)
3329

34-
$ArtifactsList = $ArtifactsList | Where-Object -Not "skipPublishDocMs"
35-
3630
. (Join-Path $PSScriptRoot ".." common scripts common.ps1)
3731

38-
if (-not $ArtifactsList) {
39-
Write-Host "ArtifactsList is empty, nothing to process. This can happen if skipPublishDocMs is set to true for all libraries being built."
40-
exit 0
41-
}
42-
4332
Write-Host "ArtifactStagingDirectory=$ArtifactStagingDirectory"
4433
if (-not (Test-Path -Path $ArtifactStagingDirectory)) {
4534
LogError "ArtifactStagingDirectory '$ArtifactStagingDirectory' does not exist."
4635
exit 1
4736
}
4837

49-
Write-Host ""
50-
Write-Host "ArtifactsList:"
51-
$ArtifactsList | Format-Table -Property GroupId, Name, ReleaseInBatch | Out-String | Write-Host
52-
5338
$packageInfoDirectory = Join-Path $ArtifactStagingDirectory "PackageInfo"
5439

5540
$foundError = $false
5641
# At this point the packageInfo files should have been already been created.
57-
# The only thing being done here is adding or updating namespaces for libraries
58-
# that will be producing docs. This ArtifactsList is
59-
foreach($artifact in $ArtifactsList) {
60-
if ($artifact.ReleaseInBatch -eq $false) {
61-
Write-Host "Skipping $($artifact.Name) as it is not being released in this batch."
62-
continue
63-
}
42+
$packageInfoFiles = Get-ChildItem -Path $packageInfoDirectory -File -Filter "*.json"
6443

65-
# Get the version from the packageInfo file
66-
$packageInfoFile = Join-Path $packageInfoDirectory "$($artifact.Name).json"
44+
foreach($packageInfoFile in $packageInfoFiles) {
6745
Write-Host "processing $($packageInfoFile.FullName)"
6846
$packageInfo = ConvertFrom-Json (Get-Content $packageInfoFile -Raw)
47+
48+
# ArtifactDetails will be null for AdditionalModules
49+
if ($packageInfo.ArtifactDetails) {
50+
# If skipPublishDocMs isn't there, then by default docs are being published for that library
51+
if ($packageInfo.ArtifactDetails.PSobject.Properties.Name -contains "skipPublishDocMs") {
52+
# If skipPublishDocMs is there and it's true, then skip publishing
53+
if ($packageInfo.ArtifactDetails.skipPublishDocMs) {
54+
Write-Host "Skipping DocsMS publishing for $($packageInfo.Name). skipPublishDocMs is set to false."
55+
continue
56+
}
57+
}
58+
} else {
59+
Write-Host "Skipping DocsMS publishing for $($packageInfo.Name). ArtifactDetails is null meaning this is an AdditionalModule"
60+
continue
61+
}
62+
6963
$version = $packageInfo.Version
7064
# If the dev version is set, use that. This will be set for nightly builds
7165
if ($packageInfo.DevVersion) {

eng/scripts/generate_from_source_pom.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ def create_from_source_pom(artifacts_list: str, additional_modules_list: str, se
5959
additional_modules_identifiers = []
6060
if additional_modules_list is not None:
6161
additional_modules_identifiers = additional_modules_list.split(',')
62+
# Combine the lists so dependencies are calculated correctly. While there
63+
# should be no duplicates between the artifacts list and additional modules,
64+
# it's better to be safe. This will remove the duplicates
65+
combined_list = artifacts_list_identifiers + additional_modules_identifiers
66+
artifacts_list_identifiers = list(set(combined_list))
6267

6368
# Get the artifact identifiers from client_versions.txt to act as our source of truth.
6469
artifact_identifier_to_version = load_client_artifact_identifiers()
@@ -83,7 +88,6 @@ def create_from_source_pom(artifacts_list: str, additional_modules_list: str, se
8388

8489
# Finally map the project identifiers to projects.
8590
add_source_projects(source_projects, artifacts_list_identifiers, projects)
86-
add_source_projects(source_projects, additional_modules_identifiers, projects)
8791
add_source_projects(source_projects, dependent_modules, projects)
8892
add_source_projects(source_projects, dependency_modules, projects)
8993

sdk/aot/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,5 @@ extends:
5757
AdditionalModules:
5858
- name: azure-aot-graalvm-perf
5959
groupId: com.azure
60+
- name: azure-aot-graalvm-samples
61+
groupId: com.azure

sdk/core/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ extends:
163163
safeName: azurecoretracingopentelemetry
164164
releaseInBatch: ${{ parameters.release_azurecoretracingopentelemetry }}
165165
AdditionalModules:
166+
- name: azure-core-tracing-opentelemetry-samples
167+
groupId: com.azure
166168
- name: azure-core-perf
167169
groupId: com.azure
168170
# required by the above perf library

sdk/identity/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ extends:
6363
safeName: azureidentitybroker
6464
releaseInBatch: ${{ parameters.release_azureidentitybroker }}
6565
AdditionalModules:
66+
- name: azure-identity-broker-samples
67+
groupId: com.azure
6668
- name: azure-identity-perf
6769
groupId: com.azure
6870
# required by the above perf library

sdk/identity/pom.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,11 @@
1515
<!-- Need not change for every release-->
1616

1717
<modules>
18-
1918
<module>azure-identity</module>
20-
2119
<module>azure-identity-perf</module>
22-
2320
<module>azure-identity-extensions</module>
24-
2521
<module>azure-identity-broker</module>
26-
22+
<module>azure-identity-broker-samples</module>
2723
</modules>
2824

2925
</project>

0 commit comments

Comments
 (0)