Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
original draft of the adjustments. definitely going to be some discus…
…sion on the serviceInput parameter. probably want to go to a separate script entirely?

add missing line
  • Loading branch information
scbedd committed Jul 10, 2024
commit 6814ae83bd1e6368174b8f5265ec052d6c7e5a62
2 changes: 1 addition & 1 deletion eng/common/scripts/Generate-PR-Diff.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ $changedServices = Get-ChangedServices -ChangedFiles $changedFiles
$result = [PSCustomObject]@{
"ChangedFiles" = $changedFiles
"ChangedServices" = $changedServices
"PRNumber" = $env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER
"PRNumber" = if ($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER) { $env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER } else { "-1" }
}

$result | ConvertTo-Json | Out-File $ArtifactName
14 changes: 14 additions & 0 deletions eng/common/scripts/Package-Properties.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,20 @@ function Get-PkgProperties
return $null
}

function Get-PrPkgProperties([string]$InputDiffJson) {
$pkgPropsResult = @()

Write-Host "In Get-PRPkgProperties function"

if ($GetPRPackageInfoFromRepoFn -and (Test-Path "Function:$GetPRPackageInfoFromRepoFn"))
Comment thread
scbedd marked this conversation as resolved.
Outdated
{
Write-Host "Attempting to invoke the language one"
$pkgPropsResult = &$GetPRPackageInfoFromRepoFn -InputDiffJson $InputDiffJson
}

return $pkgPropsResult
}

# Takes ServiceName and Repo Root Directory
# Returns important properties for each package in the specified service, or entire repo if the serviceName is not specified
# Returns a Table of service key to array values of PS Object with properties @ { pkgName, pkgVersion, pkgDirectoryPath, pkgReadMePath, pkgChangeLogPath }
Expand Down
21 changes: 16 additions & 5 deletions eng/common/scripts/Save-Package-Properties.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ In cases of collisions where track 2 packages (IsNewSdk = true) have the same
filename as track 1 packages (e.g. same artifact name or package name), the
track 2 package properties will be written.

.PARAMETER serviceDirectory
Service directory in which to search for packages
.PARAMETER serviceInput
Service directory in which to search for packages, or file path ending in diff.json.

.PARAMETER outDirectory
Output location (generally a package artifact directory in DevOps) for JSON
Expand All @@ -33,7 +33,7 @@ Verison property in that file.
[CmdletBinding()]
Param (
[Parameter(Mandatory=$True)]
[string] $serviceDirectory,
[string] $serviceInput,
Comment thread
scbedd marked this conversation as resolved.
Outdated
[Parameter(Mandatory=$True)]
[string] $outDirectory,
[switch] $addDevVersion
Expand Down Expand Up @@ -92,7 +92,18 @@ function GetRelativePath($path) {
}

$exportedPaths = @{}
$allPackageProperties = Get-AllPkgProperties $serviceDirectory

$allPackageProperties = @()

if ($serviceInput.endswith("diff.json")) {
$allPackageProperties = Get-PrPkgProperties $serviceInput
}
else {
$allPackageProperties = Get-AllPkgProperties $serviceInput
Comment thread
scbedd marked this conversation as resolved.
Outdated
}

Write-Host $allPackageProperties

if ($allPackageProperties)
{
if (-not (Test-Path -Path $outDirectory))
Expand Down Expand Up @@ -137,6 +148,6 @@ if ($allPackageProperties)
}
else
{
Write-Error "Package properties are not available for service directory $($serviceDirectory)"
Write-Error "Package properties are not available for service directory $($serviceInput)"
Comment thread
scbedd marked this conversation as resolved.
Outdated
exit 1
}
1 change: 1 addition & 0 deletions eng/common/scripts/common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ if (!(Get-Variable -Name "LanguageDisplayName" -ValueOnly -ErrorAction "Ignore")
# Transformed Functions
# Expected to be set in eng/scripts/Language-Settings.ps1
$GetPackageInfoFromRepoFn = "Get-${Language}-PackageInfoFromRepo"
$GetPRPackageInfoFromRepoFn = "Get-${Language}-PRPackageInfoFromRepo"
$GetPackageInfoFromPackageFileFn = "Get-${Language}-PackageInfoFromPackageFile"
$PublishGithubIODocsFn = "Publish-${Language}-GithubIODocs"
$UpdateDocsMsPackagesFn = "Update-${Language}-DocsMsPackages"
Expand Down