You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds an opt-in setting, failOnAppVersionDowngrade (default false). When it's enabled, the CI/CD deployment fails if an app in the build artifact has a lower version than the app already installed in the environment.
You can set it globally or per environment in DeployTo. The environment value takes precedence.
A new CheckDowngrade action runs before Deploy to Business Central in the PTE and AppSource App CI/CD workflows.
Why
Today, a deployment where the artifact version is lower than the installed version only produces a warning. The workflow still succeeds, so it's easy to miss that the apps were never updated. This setting lets you make that case fail the workflow.
How
The CI/CD workflow works out the effective setting for the environment.
If the setting is true, CheckDowngrade compares each app in the artifact with the installed version in the environment.
If any app would be downgraded, it writes one error per app and fails the deploy job.
Validate test apps using the resolved deployment setting
Actions/CheckDowngrade/CheckDowngrade.ps1:83
This forces test apps out of the pre-check even when the resolved deployment setting enables them. Deploy.ps1 uses the original setting and publishes those test apps, so a downgraded test app can still be attempted after the check passes, allowing the partial-deployment scenario this pre-check is meant to prevent. Preserve includeTestAppsInSandboxEnvironment so every app selected for publishing is validated, and update the test/documentation that currently codifies the exclusion.
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🟢 Approval recommended
The opt-in behavior is implemented consistently and adequately tested, with only a non-blocking release-note clarification identified.
Review effort: Balanced Findings: None
Previously missed (1)
In code that hasn't changed since last review
Reference repository/environment setting instead of action input
RELEASENOTES.md:3
This release note points users to the action input, but the generated CI/CD workflows hard-code that input to true; users opt in through the repository/environment setting instead. Please name the setting here so the configuration guidance matches the workflow and Scenarios/settings.md.
Added details about the new `CheckDowngrade` action and its opt-in configuration for CI/CD workflows. Updated the section on allowing pre-release packages as NuGet dependencies.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
Personally, I'm not a huge fan on PowerShell embedded in the yaml files like this. I'm wondering if we could just check if failOnAppVersionDowngrade is true as the first thing inside the CheckDowngrade action. If it is false, then we just exit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
❔What, Why & How
What
Adds an opt-in setting, failOnAppVersionDowngrade (default false). When it's enabled, the CI/CD deployment fails if an app in the build artifact has a lower version than the app already installed in the environment.
You can set it globally or per environment in DeployTo. The environment value takes precedence.
A new CheckDowngrade action runs before Deploy to Business Central in the PTE and AppSource App CI/CD workflows.
Why
Today, a deployment where the artifact version is lower than the installed version only produces a warning. The workflow still succeeds, so it's easy to miss that the apps were never updated. This setting lets you make that case fail the workflow.
How
The CI/CD workflow works out the effective setting for the environment.
If the setting is true, CheckDowngrade compares each app in the artifact with the installed version in the environment.
If any app would be downgraded, it writes one error per app and fails the deploy job.
Related to issue: #2336
#2336
✅ Checklist