Skip to content

Bug fixes for running a large/complicated solution on AL-Go#2075

Open
freddydk wants to merge 92 commits intomicrosoft:mainfrom
freddydk:bhg
Open

Bug fixes for running a large/complicated solution on AL-Go#2075
freddydk wants to merge 92 commits intomicrosoft:mainfrom
freddydk:bhg

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
Copy link
Contributor Author

@microsoft-github-policy-service agree

@freddydk freddydk requested review from aholstrup1 and mazhelez March 4, 2026 11:08
Copy link
Collaborator

@mazhelez mazhelez left a comment

Choose a reason for hiding this comment

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

Looks good. Just the release notes need to be adjusted.


Now, the workflow will fail with a clear error message if the specified environment doesn't exist. If you intentionally want to deploy to a new environment that hasn't been configured yet, you can check the **Create environment if it does not exist** checkbox when running the workflow.

### New Settings
Copy link
Collaborator

Choose a reason for hiding this comment

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

This part needs to be moved above ## v8.3

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

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.


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

# Pattern 2: project-mask-version.zip (no branch)
$escapedProject = [regex]::Escape($project)
$escapedMask = [regex]::Escape($mask)
$assetPattern1 = "^$escapedProject-[^-]+-$escapedMask-.+\.zip$"
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

The release asset regex ^<project>-[^-]+-<mask>-... assumes the branch segment cannot contain hyphens. Branch names commonly contain - (and artifact naming elsewhere preserves hyphens), so this can prevent matching valid release assets (e.g., feature-test). Suggest loosening the branch part to allow hyphens (e.g., match on -$escapedMask- as the delimiter) rather than restricting it to [^-]+.

Suggested change
$assetPattern1 = "^$escapedProject-[^-]+-$escapedMask-.+\.zip$"
$assetPattern1 = "^$escapedProject-.+-$escapedMask-.+\.zip$"

Copilot uses AI. Check for mistakes.
Remove-Bccontainer $containerName
}
catch {
Write-Host "Pipeline Cleanup failed: $($_.Exception.Message)"
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

The catch block logs cleanup failures with plain Write-Host, which won’t surface as a GitHub Actions warning/notice. To keep the workflow non-fatal but still visible, consider emitting a workflow warning/notice format (e.g., ::Warning::... / ::Notice::...) consistent with OutputWarning in Actions/.Modules/DebugLogHelper.psm1 (writes ::Warning::...).

Suggested change
Write-Host "Pipeline Cleanup failed: $($_.Exception.Message)"
Write-Host "::Warning::Pipeline Cleanup failed: $($_.Exception.Message)"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants