Skip to content

Download only relevant project dependencies#2221

Open
spetersenms wants to merge 5 commits intomicrosoft:mainfrom
spetersenms:downloadOnlyRelevantProjectDependencies
Open

Download only relevant project dependencies#2221
spetersenms wants to merge 5 commits intomicrosoft:mainfrom
spetersenms:downloadOnlyRelevantProjectDependencies

Conversation

@spetersenms
Copy link
Copy Markdown
Contributor

@spetersenms spetersenms commented Apr 22, 2026

Currently, when an AL-Go project depends on another AL-Go project, all artifacts from an upstream matrix is downloaded, even if a given project only depends on a subset of the projects in the upstream matrix. For smaller repos with few projects this is not much of an issue, but on larger repos with many projects, this can result in a lot of waster resources spent on downloading things that are not needed.

This features updates the download logic to use glob patterns in the download artifact action, to only download relevant artifacts. This is based on the dependency json we calculate earlier.

✅ Checklist

  • Add tests (E2E, unit tests)
  • Update RELEASENOTES.md
  • Update documentation (e.g. for new settings or scenarios)
  • Add telemetry

# Conflicts:
#	Actions/DownloadProjectDependencies/DownloadProjectDependencies.psm1
#	Tests/DownloadProjectDependencies.Test.ps1
@spetersenms spetersenms marked this pull request as ready for review April 23, 2026 07:11
@spetersenms spetersenms requested a review from a team as a code owner April 23, 2026 07:11
Copilot AI review requested due to automatic review settings April 23, 2026 07:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Optimizes the DownloadProjectDependencies GitHub Action to download only artifacts produced by a project’s dependency projects (instead of downloading all artifacts from the upstream matrix), reducing bandwidth and speeding up dependency resolution in large multi-project AL-Go repositories.

Changes:

  • Add a new helper (Get-DependencyArtifactPattern) to compute an actions/download-artifact minimatch pattern for dependency projects.
  • Update the composite action to compute and use the artifact download pattern before running the dependency resolution script.
  • Add Pester coverage for the new pattern logic and document the behavior in README + release notes.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Tests/DownloadProjectDependencies.Test.ps1 Adds unit tests for dependency artifact pattern generation (branch/project sanitization, multiple dependencies, empty/missing maps).
Actions/DownloadProjectDependencies/action.yaml Computes a dependency-only artifact pattern and uses it with actions/download-artifact to avoid downloading unrelated artifacts.
Actions/DownloadProjectDependencies/DownloadProjectDependencies.psm1 Introduces and exports Get-DependencyArtifactPattern used by the composite action.
Actions/DownloadProjectDependencies/README.md Documents that only dependency-project artifacts are downloaded (pattern-filtered).
RELEASENOTES.md Notes the optimized dependency artifact download behavior.

Comment thread Actions/DownloadProjectDependencies/action.yaml Outdated
mazhelez
mazhelez previously approved these changes Apr 24, 2026
_project: ${{ inputs.project }}
_projectDependenciesJson: ${{ inputs.projectDependenciesJson }}
run: |
. (Join-Path ${{ github.action_path }} "../AL-Go-Helper.ps1" -Resolve)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: place this script in a file of its own.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Script is in it's own file now, though still in the same action. We might want to consider if it should be moved to a separate action though to stay consistent with other AL-Go functionaltiy.

Comment thread Actions/DownloadProjectDependencies/DownloadProjectDependencies.psm1 Outdated
aholstrup1
aholstrup1 previously approved these changes Apr 24, 2026
@spetersenms spetersenms dismissed stale reviews from aholstrup1 and mazhelez via 3b4feb1 April 27, 2026 11:29
Write-Host "No dependency projects found, skipping artifact download"
Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "hasPattern=false"
}
${{ github.action_path }}/ComputeDependencyArtifactPattern.ps1
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider wrapping in Invoke-AlGoAction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants