Skip to content

Remove SilentlyContinue from Publish-BcNuGetPackageToContainer#2148

Merged
aholstrup1 merged 3 commits intomainfrom
private/aholstrup/installmissingdep_silent
Mar 2, 2026
Merged

Remove SilentlyContinue from Publish-BcNuGetPackageToContainer#2148
aholstrup1 merged 3 commits intomainfrom
private/aholstrup/installmissingdep_silent

Conversation

@aholstrup1
Copy link
Collaborator

@aholstrup1 aholstrup1 commented Mar 2, 2026

❔What, Why & How

Background
In BC28 there seems to be some issues with PS Remote Session which are used during Invoke-ScriptInBcContainer. If BCContainerHelper fails to create a remote session, it's supposed to fall back to docker exec.

This issue
AL-Go ships with an override to InstallMissingDependencies. The override will call Publish-BcNuGetPackageToContainer -ErrorAction SilentlyContinue. Publish-BcNuGetPackageToContainer will call Get-BcContainerServerConfiguration which relies on Invoke-ScriptInBcContainer

When Invoke-ScriptInBcContainer is called like this, it will silently fail to initialize the management module in the PSSession.

(Partial) Mitigation
A mitigation to this particular problem would be to replace the ErrorAction with a try catch and a warning indicating that the app could not be published. Without the ErrorAction, BCContainerHelper will fall back to docker exec and the workflow will continue.

This should mitigate the impact in the linked issue while we're investigating a fix for the root cause.

Related to issue: #2145

✅ Checklist

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

@aholstrup1 aholstrup1 requested a review from a team as a code owner March 2, 2026 08:33
Copilot AI review requested due to automatic review settings March 2, 2026 08:33
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

Mitigates BC28 dependency publishing issues by avoiding -ErrorAction SilentlyContinue when publishing NuGet dependencies into a BC container, so BCContainerHelper can fall back to docker exec, while keeping the pipeline running with a warning if publishing still fails.

Changes:

  • Replaced -ErrorAction SilentlyContinue with try/catch around Publish-BcNuGetPackageToContainer.
  • Emits an OutputWarning including the exception message when publishing fails.

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

@aholstrup1 aholstrup1 enabled auto-merge (squash) March 2, 2026 10:49
@aholstrup1 aholstrup1 merged commit 91c2f1b into main Mar 2, 2026
8 checks passed
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