Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
24 changes: 13 additions & 11 deletions Actions/Github-Helper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ function GetDependencies {
$projects = $dependency.projects
$buildMode = $dependency.buildMode

# Use local copies to avoid mutating the outer loop variable
$currentMask = $mask
Comment thread
mazhelez marked this conversation as resolved.
if ($mask -eq 'TestApps') {
$altMask = 'Apps'
}
Expand All @@ -149,24 +151,24 @@ function GetDependencies {
}
# change the mask to include the build mode
Comment thread
mazhelez marked this conversation as resolved.
if($buildMode -ne "Default") {
$mask = "$buildMode$mask"
$currentMask = "$buildMode$currentMask"
$altMask = "$buildMode$altMask"
}

Write-Host "Locating $mask artifacts for projects: $projects"
Write-Host "Locating $currentMask artifacts for projects: $projects"

if ($dependency.release_status -eq "thisBuild") {
$missingProjects = @()
foreach($project in $projects.Split(',')) {
$branchName = $dependency.branch.Replace('\', '_').Replace('/', '_')
$project = $project.Replace('\','_').Replace('/','_') # sanitize project name

$downloadName = Join-Path $saveToPath "$project-$branchName-$mask-*"
$downloadName = Join-Path $saveToPath "$project-$branchName-$currentMask-*"

if (Test-Path $downloadName -PathType Container) {
$folder = Get-Item $downloadName
Get-ChildItem -Path $folder | ForEach-Object {
if ($mask -like '*TestApps') {
if ($currentMask -like '*TestApps') {
$downloadedList += @("($($_.FullName))")
}
else {
Expand All @@ -175,15 +177,15 @@ function GetDependencies {
Write-Host "$($_.FullName) found from previous job"
}
}
elseif ($mask -like '*Apps') {
elseif ($currentMask -like '*Apps') {
# Check whether Apps/TestApps exists before determining that project isn't built
$altDownloadName = Join-Path $saveToPath "$project-$branchName-$altMask-*"
if (!(Test-Path $altDownloadName -PathType Container)) {
Write-Host "$project not built, downloading from artifacts"
$missingProjects += @($project)
}
else {
Write-Host "$project built, but $mask not found"
Write-Host "$project built, but $currentMask not found"
}
}
}
Expand All @@ -197,12 +199,12 @@ function GetDependencies {
$repository = ([uri]$dependency.repo).AbsolutePath.Replace(".git", "").TrimStart("/").TrimEnd("/")
if ($dependency.release_status -eq "latestBuild") {
$token = GetAccessToken -token $dependency.authTokenSecret -repository $repository -permissions @{"contents"="read";"actions"="read";"metadata"="read"}
$artifacts = GetArtifacts -token $token -api_url $api_url -repository $repository -mask $mask -projects $projects -version $dependency.version -branch $dependency.branch -baselineWorkflowID $dependency.baselineWorkflowID
$artifacts = GetArtifacts -token $token -api_url $api_url -repository $repository -mask $currentMask -projects $projects -version $dependency.version -branch $dependency.branch -baselineWorkflowID $dependency.baselineWorkflowID
if ($artifacts) {
$artifacts | ForEach-Object {
$download = DownloadArtifact -path $saveToPath -token $token -artifact $_
if ($download) {
if ($mask -like '*TestApps') {
if ($currentMask -like '*TestApps') {
$downloadedList += @("($download)")
}
else {
Expand All @@ -215,7 +217,7 @@ function GetDependencies {
}
}
else {
Write-Host -ForegroundColor Red "Could not find any $mask artifacts for projects $projects, version $($dependency.version)"
Write-Host -ForegroundColor Red "Could not find any $currentMask artifacts for projects $projects, version $($dependency.version)"
}
}
elseif ($dependency.release_status -ne "thisBuild" -and $dependency.release_status -ne "include") {
Expand All @@ -236,9 +238,9 @@ function GetDependencies {
throw "Could not find a release that matches the criteria."
}

$download = DownloadRelease -token $token -projects $projects -api_url $api_url -repository $repository -path $saveToPath -release $release -mask $mask
$download = DownloadRelease -token $token -projects $projects -api_url $api_url -repository $repository -path $saveToPath -release $release -mask $currentMask
if ($download) {
if ($mask -like '*TestApps') {
if ($currentMask -like '*TestApps') {
$downloadedList += @("($download)")
}
else {
Expand Down
1 change: 1 addition & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ The `DownloadProjectDependencies` action now downloads only artifacts from depen

### Issues

- Issue 2236 - `GetDependencies` `buildMode` prefix leaks across dependency iterations, causing incorrect artifact mask names when multiple `appDependencyProbingPaths` entries use different build modes
- Incremental builds (`modifiedApps` mode) now correctly identify unmodified apps for projects whose `appFolders` reference paths outside the project directory (e.g. using `../`)
- Issue 2204 - Workspace compilation ignores vsixFile setting
- Issue 2211 - Cannot create a release if a project contains only test apps
Expand Down
Loading