SIGN IN SIGN UP

Fix incremental builds poisoning buildMode-specific artifacts (#2337) (#2342)

### ❔What, Why & How

When incremental builds skip a project, `DetermineBuildProject`
downloads that project's baseline artifacts and re-publishes them for
the current run. It downloaded them using build-mode-agnostic masks
(`Apps`, `TestApps`, `Dependencies`), which only match the **Default**
build mode artifact (`<project>-<branch>-Apps-*`). Every build mode
dimension of a skipped project therefore re-published the Default-mode
apps under its own build-mode-specific artifact name (e.g.
`<project>-<branch>-CleanApps-*`), corrupting the content.

In multi-project repos where a project builds a non-Default mode against
a different Business Central artifact (different runtime), dependent
projects then downloaded the wrong app and failed, e.g.:

```
AL1153 The referenced module 'X' with runtime reference version '17.0'
cannot be loaded by the compiler with version '16.0'.
```

Because each incremental run becomes the baseline for the next, the
corruption propagated until a full build happened.

**How:** `DetermineBuildProject` now receives the `buildMode` and
downloads the artifacts for the same build mode as the current
dimension, using build-mode-prefixed masks (empty prefix for `Default`),
consistent with `CalculateArtifactNames` and the already-correct
`modifiedApps` path in `DetermineProjectsToBuild`.
`PowerPlatformSolution` stays unprefixed, since it is always built in
`Default` mode (matching `GetArtifactsForDeployment`). Downloaded
artifacts are still extracted into the build-mode-agnostic
`.buildartifacts` folders that later build steps read.

Verified end to end on a two-project repro (`Default` = BC28 / runtime
17, custom `BC27` mode = BC27 / runtime 16): before the fix the skipped
project's `BC27Apps` artifact contained the runtime-17 app and the
dependent BC27 build failed with AL1153; after the fix it contains the
runtime-16 app and the build passes.

Related to issue: #2337

### ✅ Checklist

- [x] Add tests (E2E, unit tests)
- [x] Update RELEASENOTES.md
- [ ] Update documentation (e.g. for new settings or scenarios) - N/A
(no user-facing settings or scenarios changed; `buildMode` is an
internal action input)
- [ ] Add telemetry - N/A

Co-authored-by: aholstrup1 <aholstrup1@users.noreply.github.com>
A
Alexander Holstrup committed
93300d797386e3faa2796faf09584b5c9e76494b
Parent: 38f9710
Committed by GitHub <noreply@github.com> on 8/7/2026, 7:33:31 AM