From 468d0286c4a043dffe681e44f6abf805cc103ef6 Mon Sep 17 00:00:00 2001 From: Scott Beddall Date: Fri, 13 Sep 2024 14:57:23 -0700 Subject: [PATCH 1/3] updating package properties with direct/indirect (if named differently) as well as pulling BuildDocs from ci.yml artifact list if it exists --- eng/common/scripts/Package-Properties.ps1 | 43 +++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/eng/common/scripts/Package-Properties.ps1 b/eng/common/scripts/Package-Properties.ps1 index e3cea7d392e..aa4fa27e9d8 100644 --- a/eng/common/scripts/Package-Properties.ps1 +++ b/eng/common/scripts/Package-Properties.ps1 @@ -15,6 +15,10 @@ class PackageProps [boolean]$IsNewSdk [string]$ArtifactName [string]$ReleaseStatus + [boolean]$BuildDocs + # was this package purely included because other packages included it as an AdditionalValidationPackage? + [boolean]$IncludedForValidation + # does this package include other packages that we should trigger validation for? [string[]]$AdditionalValidationPackages PackageProps([string]$name, [string]$version, [string]$directoryPath, [string]$serviceDirectory) @@ -38,6 +42,7 @@ class PackageProps $this.Version = $version $this.DirectoryPath = $directoryPath $this.ServiceDirectory = $serviceDirectory + $this.IncludedForValidation = $false if (Test-Path (Join-Path $directoryPath "README.md")) { @@ -62,6 +67,8 @@ class PackageProps { $this.ChangeLogPath = $null } + + $this.InitializeBuildDocs($ServiceDirectory) } hidden [void]Initialize( @@ -75,6 +82,41 @@ class PackageProps $this.Initialize($name, $version, $directoryPath, $serviceDirectory) $this.Group = $group } + + hidden [void]InitializeBuildDocs( + [string]$ServiceDirectory + ) + { + # parse the relevant ci.yml file to determine if the package should build docs + $ciYmlPath = Join-Path $ServiceDirectory ".ci.yml" + + if (Test-Path $ciYmlPath) + { + $ciYml = ConvertFrom-Yaml (Get-Content $ciYmlPath -Raw) + + if ($ciYml.extends -and $ciYml.extends.parameters -and $ciYml.extends.parameters.Artifacts) { + $packagesBuildingDocs = $ciYml.extends.parameters.Artifacts ` + | Where-Object { + if ($_.PSObject.Properties["skipPublishDocsMs"]) { + $false + } + else { + $true + } + } ` + | Select-Object -ExpandProperty name + + if ($packagesBuildingDocs -contains $this.Name) + { + $this.BuildDocs = $true + } + } + } + else + { + $this.BuildDocs = $false + } + } } # Takes package name and service Name @@ -143,6 +185,7 @@ function Get-PrPkgProperties([string]$InputDiffJson) { $key = $addition.Replace($RepoRoot, "").TrimStart('\/') if ($lookup[$key]) { + $lookup[$key].IncludedForValidation = $true $packagesWithChanges += $lookup[$key] } } From 3cdb5864d8c8d198a879c98c16359ae719a71350 Mon Sep 17 00:00:00 2001 From: Scott Beddall Date: Fri, 13 Sep 2024 15:15:13 -0700 Subject: [PATCH 2/3] eliminate the addition of buildDocs property. it requires powershell-yaml to be present on our base function. not good --- eng/common/scripts/Package-Properties.ps1 | 36 ----------------------- 1 file changed, 36 deletions(-) diff --git a/eng/common/scripts/Package-Properties.ps1 b/eng/common/scripts/Package-Properties.ps1 index aa4fa27e9d8..58c5713cc60 100644 --- a/eng/common/scripts/Package-Properties.ps1 +++ b/eng/common/scripts/Package-Properties.ps1 @@ -15,7 +15,6 @@ class PackageProps [boolean]$IsNewSdk [string]$ArtifactName [string]$ReleaseStatus - [boolean]$BuildDocs # was this package purely included because other packages included it as an AdditionalValidationPackage? [boolean]$IncludedForValidation # does this package include other packages that we should trigger validation for? @@ -82,41 +81,6 @@ class PackageProps $this.Initialize($name, $version, $directoryPath, $serviceDirectory) $this.Group = $group } - - hidden [void]InitializeBuildDocs( - [string]$ServiceDirectory - ) - { - # parse the relevant ci.yml file to determine if the package should build docs - $ciYmlPath = Join-Path $ServiceDirectory ".ci.yml" - - if (Test-Path $ciYmlPath) - { - $ciYml = ConvertFrom-Yaml (Get-Content $ciYmlPath -Raw) - - if ($ciYml.extends -and $ciYml.extends.parameters -and $ciYml.extends.parameters.Artifacts) { - $packagesBuildingDocs = $ciYml.extends.parameters.Artifacts ` - | Where-Object { - if ($_.PSObject.Properties["skipPublishDocsMs"]) { - $false - } - else { - $true - } - } ` - | Select-Object -ExpandProperty name - - if ($packagesBuildingDocs -contains $this.Name) - { - $this.BuildDocs = $true - } - } - } - else - { - $this.BuildDocs = $false - } - } } # Takes package name and service Name From 2a5ec8ace4c19e4631a3723365a60d9a063c086f Mon Sep 17 00:00:00 2001 From: Scott Beddall Date: Fri, 13 Sep 2024 15:16:01 -0700 Subject: [PATCH 3/3] remove call to InitializeBuildDocs --- eng/common/scripts/Package-Properties.ps1 | 2 -- 1 file changed, 2 deletions(-) diff --git a/eng/common/scripts/Package-Properties.ps1 b/eng/common/scripts/Package-Properties.ps1 index 58c5713cc60..fabe342388e 100644 --- a/eng/common/scripts/Package-Properties.ps1 +++ b/eng/common/scripts/Package-Properties.ps1 @@ -66,8 +66,6 @@ class PackageProps { $this.ChangeLogPath = $null } - - $this.InitializeBuildDocs($ServiceDirectory) } hidden [void]Initialize(