Skip to content

Conversation

@freddydk
Copy link
Contributor

@freddydk freddydk commented Jan 5, 2026

❔What, Why & How

This PR fixes a few minor bugs and 3 major, all changes required for moving Bunker Holding Group to AL-Go for GitHub

[Bug] Fix a small spelling mistake in DownloadProjectDependencies.Action.ps1‎

[Bug] Avoid failing entire workflows due to cleanup issues (f.ex. if no Container is used) in PipelineCleanup.ps1

Fixes #2086 - In AL-Go-Helper.ps1

The sort order is changed from this:
image

to this:
image

Which completes in 2:01, saving 45 minutes from the first run, just by re-ordering and allowing people to see compile errors up-front - fail early!
The key difference here is just the order in which projects are built/tested. In the first run, build3 had to wait 30 minutes until the test run was done before building the next jobs, and 1 hour and 44 until the last build jobs would run.
In the second run - all test jobs are running in parallel at the very end, getting compile errors quicly and postponing test runs until the very last.

Subsequently, when using GitHub hosted Custom runners, we can achieve this:
image

Note that the custom runners are running tests in 40 minutes, where the GitHub hosted runners takes 104 minutes. This is because the GitHub hosted custom runners are using SQL Server Developer edition and no docker.

Saving a full 2 hours, bringing a complete build from 2 hours 46 minutes down to 46 minutes.

Fixes #2085 - In GetDependencies in GitHub-Helper.ps1

When downloading artifacts from projects build earlier in the same workflow, it flags projects as missing if either Apps or TestApps are missing. This means that projects, which only contains TestApps or Apps will be downloaded but also looked for in the last known good build later on. It doesn't fail, because it cannot find the artifacts in that built either.
See https://github.com/Freddy-DK/DependenciesProblems/actions/runs/21079606240/job/60630194330

image

Fixes #2084 in GetArtifactsFromWorkflowRun in GitHub-Helper.ps1

If a build is cancelled during tests or failing due to instability - and you subsequently re-run failed jobs (not all jobs) you will get multiple artifacts for succeeding projects and subsequent jobs cannot locate these artifacts (they get an array of artifacts). The "double" artifacts are not visible in the UI, but found when artifacts are queried. You could see this as a bug in GitHub, but we should fix this in AL-Go in a way that works, even if GitHub fixes their bug.

This build: https://github.com/Freddy-DK/DependenciesProblems/actions/runs/21090442931
Has double artifacts: https://api.github.com/repos/Freddy-DK/DependenciesProblems/actions/runs/21090442931/artifacts

image

When than downloading artifacts from prior builds for incremental builds, it fails with

throw "Multiple artifacts found with mask $artifactMask for project $projectName"

See: https://github.com/Freddy-DK/DependenciesProblems/actions/runs/21090506962/job/60661024240

✅ Checklist

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

@freddydk
Copy link
Contributor Author

freddydk commented Jan 5, 2026

@microsoft-github-policy-service agree

@freddydk freddydk marked this pull request as ready for review January 18, 2026 05:14
@freddydk freddydk requested a review from a team as a code owner January 18, 2026 05:14
Copilot AI review requested due to automatic review settings January 18, 2026 05:14
Copy link
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

This PR addresses several issues to enable moving Bunker Holding Group to AL-Go for GitHub, including bug fixes for dependency resolution, artifact handling for workflow reruns, build order optimization to reduce pipeline execution time, error handling improvements, and spelling corrections.

Changes:

  • Fixed spelling mistakes in variable names (dependecies → dependencies)
  • Added error handling to PipelineCleanup.ps1 to prevent workflow failures when containers aren't used
  • Improved dependency resolution to correctly handle projects with only Apps or only TestApps
  • Fixed artifact retrieval to handle duplicate artifacts from workflow reruns by selecting the latest version
  • Optimized build order to defer projects without dependents to later stages, reducing overall pipeline time

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
Actions/PipelineCleanup/PipelineCleanup.ps1 Added try-catch error handling to prevent failures when containers aren't present
Actions/DownloadProjectDependencies/DownloadProjectDependencies.Action.ps1 Fixed spelling: dependecies → dependencies
Actions/Github-Helper.psm1 Fixed dependency resolution logic and artifact handling for workflow reruns
Actions/AL-Go-Helper.ps1 Optimized build order and changed defaultBcContainerHelperVersion to a specific fork

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@freddydk freddydk changed the title Changes required for moving Bunker Holding Group to AL-Go for GitHub Bug fixes for running a large/complicated solution on AL-Go Jan 18, 2026
@freddydk
Copy link
Contributor Author

@microsoft-github-policy-service agree

@mazhelez
Copy link
Collaborator

Interesting idea on postponing jobs to actually save time overall.
However, if there is a build job with no tests, it will be artificially pushed to the back

E.g., the following build order

flowchart TD
    A[Build apps, Project A] --> B[Build apps, Project B]
    A[Build apps, Project A] --> C[Build apps, Project C]
    B --> D[Test apps, Project A]
    B --> E[Test apps, Project B]
Loading

will become

flowchart TD
    A[Build apps, Project A] --> B[Build apps, Project B]
    B --> D[Test apps, Project A]
    B --> E[Test apps, Project B]
    B --> C[Build apps, Project C]
Loading

That way compilation errors might have been earlier, saving time and compute.

My suggestion is to try out adding project dependencies explicitly.
AL-Go calculates the projects dependencies, the build depth and the build order automagically, based on the apps in each project.
That way "Build apps, Project C" (in my example above) ends up on the second build level. But if you set it to depend on "Build apps, Project B", then it will end up on the next build level.
Not sure how this would look like in code, but seems like a neater way to control the build matrix.

Let me know what you think about this idea.

@freddydk
Copy link
Contributor Author

freddydk commented Jan 20, 2026

Let me know what you think about this idea.

Your example above is wrong, if you had that order of dependencies, the matrix would look like this in the current version of AL-Go:

flowchart TD
    A[Build apps, Project A] --> B[Build apps, Project B]
    A[Build apps, Project A] --> C[Build apps, Project C]
    A[Build apps, Project A] --> D[Test apps, Project A]
    B --> E[Test apps, Project B]
Loading

Causing the test of B to be delayed until the test of A is done, that is exactly what I want to avoid.
But you are right that it would postpone C to later, which actually also is the case at Bunker (see images above)

I would very much warn against explicit project dependency definitions in AL-Go, it complicates things a lot - I think build order needs to be calculated based on dependencies - else adding a dependency to an app.json or a new app will cause you to need to manually re-think build order in some structure.

In Bunker we have many projects and many apps - this could become a nightmare.

What I could add to this PR instead would be to add a project setting called: PostponeProjectInBuildOrder, which you could set to true on projects, which would be allowed to be scheduled later (if possible, i.e. if nobody depends on it). This way, I would set that on all test projects and the build projects would not be deferred, but built at the earliest time, essentially causing the result to be:

flowchart TD
    A[Build apps, Project A] --> B[Build apps, Project B]
    A[Build apps, Project A] --> C[Build apps, Project C]
    B --> D[Test apps, Project A]
    B --> E[Test apps, Project B]
Loading

Which is exactly what we want (and better than my current suggestion)

I have added this property to the PR - can remove again if needed. @mazhelez - what do you think about that property? (default is false causing the build order to be like before)
If we keep this, then I will add a few tests for the property and the impact on the build order.

@freddydk
Copy link
Contributor Author

freddydk commented Jan 22, 2026

Adding the postponeProjectInBuildOrder property and "postponeProjectInBuildOrder": true to my test projects and causes build order to be like:
image

Which is much better than before - and exactly what we want.

@microsoft-github-policy-service

@freddydk please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"
Contributor License Agreement

Contribution License Agreement

This Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
and conveys certain license rights to Microsoft Corporation and its affiliates (“Microsoft”) for Your
contributions to Microsoft open source projects. This Agreement is effective as of the latest signature
date below.

  1. Definitions.
    “Code” means the computer software code, whether in human-readable or machine-executable form,
    that is delivered by You to Microsoft under this Agreement.
    “Project” means any of the projects owned or managed by Microsoft and offered under a license
    approved by the Open Source Initiative (www.opensource.org).
    “Submit” is the act of uploading, submitting, transmitting, or distributing code or other content to any
    Project, including but not limited to communication on electronic mailing lists, source code control
    systems, and issue tracking systems that are managed by, or on behalf of, the Project for the purpose of
    discussing and improving that Project, but excluding communication that is conspicuously marked or
    otherwise designated in writing by You as “Not a Submission.”
    “Submission” means the Code and any other copyrightable material Submitted by You, including any
    associated comments and documentation.
  2. Your Submission. You must agree to the terms of this Agreement before making a Submission to any
    Project. This Agreement covers any and all Submissions that You, now or in the future (except as
    described in Section 4 below), Submit to any Project.
  3. Originality of Work. You represent that each of Your Submissions is entirely Your original work.
    Should You wish to Submit materials that are not Your original work, You may Submit them separately
    to the Project if You (a) retain all copyright and license information that was in the materials as You
    received them, (b) in the description accompanying Your Submission, include the phrase “Submission
    containing materials of a third party:” followed by the names of the third party and any licenses or other
    restrictions of which You are aware, and (c) follow any other instructions in the Project’s written
    guidelines concerning Submissions.
  4. Your Employer. References to “employer” in this Agreement include Your employer or anyone else
    for whom You are acting in making Your Submission, e.g. as a contractor, vendor, or agent. If Your
    Submission is made in the course of Your work for an employer or Your employer has intellectual
    property rights in Your Submission by contract or applicable law, You must secure permission from Your
    employer to make the Submission before signing this Agreement. In that case, the term “You” in this
    Agreement will refer to You and the employer collectively. If You change employers in the future and
    desire to Submit additional Submissions for the new employer, then You agree to sign a new Agreement
    and secure permission from the new employer before Submitting those Submissions.
  5. Licenses.
  • Copyright License. You grant Microsoft, and those who receive the Submission directly or
    indirectly from Microsoft, a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license in the
    Submission to reproduce, prepare derivative works of, publicly display, publicly perform, and distribute
    the Submission and such derivative works, and to sublicense any or all of the foregoing rights to third
    parties.
  • Patent License. You grant Microsoft, and those who receive the Submission directly or
    indirectly from Microsoft, a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license under
    Your patent claims that are necessarily infringed by the Submission or the combination of the
    Submission with the Project to which it was Submitted to make, have made, use, offer to sell, sell and
    import or otherwise dispose of the Submission alone or with the Project.
  • Other Rights Reserved. Each party reserves all rights not expressly granted in this Agreement.
    No additional licenses or rights whatsoever (including, without limitation, any implied licenses) are
    granted by implication, exhaustion, estoppel or otherwise.
  1. Representations and Warranties. You represent that You are legally entitled to grant the above
    licenses. You represent that each of Your Submissions is entirely Your original work (except as You may
    have disclosed under Section 3). You represent that You have secured permission from Your employer to
    make the Submission in cases where Your Submission is made in the course of Your work for Your
    employer or Your employer has intellectual property rights in Your Submission by contract or applicable
    law. If You are signing this Agreement on behalf of Your employer, You represent and warrant that You
    have the necessary authority to bind the listed employer to the obligations contained in this Agreement.
    You are not expected to provide support for Your Submission, unless You choose to do so. UNLESS
    REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, AND EXCEPT FOR THE WARRANTIES
    EXPRESSLY STATED IN SECTIONS 3, 4, AND 6, THE SUBMISSION PROVIDED UNDER THIS AGREEMENT IS
    PROVIDED WITHOUT WARRANTY OF ANY KIND, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY OF
    NONINFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
  2. Notice to Microsoft. You agree to notify Microsoft in writing of any facts or circumstances of which
    You later become aware that would make Your representations in this Agreement inaccurate in any
    respect.
  3. Information about Submissions. You agree that contributions to Projects and information about
    contributions may be maintained indefinitely and disclosed publicly, including Your name and other
    information that You submit with Your Submission.
  4. Governing Law/Jurisdiction. This Agreement is governed by the laws of the State of Washington, and
    the parties consent to exclusive jurisdiction and venue in the federal courts sitting in King County,
    Washington, unless no federal subject matter jurisdiction exists, in which case the parties consent to
    exclusive jurisdiction and venue in the Superior Court of King County, Washington. The parties waive all
    defenses of lack of personal jurisdiction and forum non-conveniens.
  5. Entire Agreement/Assignment. This Agreement is the entire agreement between the parties, and
    supersedes any and all prior agreements, understandings or communications, written or oral, between
    the parties relating to the subject matter hereof. This Agreement may be assigned by Microsoft.

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

Labels

None yet

Projects

None yet

2 participants