[Bug]: Incremental PR build reuses an older baseline app than the previous release
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 506
- Forks
- 203
- Avg merge
- 4d 22h
- Merged PRs (30d)
- 6
Description
AL-Go version
9.2
Describe the issue
An incremental PR build using modifiedApps can reuse an app from the baseline CI/CD run that is older than the same app in the latest release.
This can happen when the latest release was created from a release branch while the last successful CI/CD run on main still contains an older version of the app.
Example:
| Source | Branch | App version |
|---|---|---|
| Last successful CI/CD | main |
1.0.100.0 |
| Release CI/CD | release branch | 1.0.101.0 |
| Latest release | release branch | 1.0.101.0 |
When a PR against main does not modify this app, the incremental build restores version 1.0.100.0 from the baseline CI/CD run and treats it as a prebuilt app.
At the same time, version 1.0.101.0 from the latest release is used as previousApps.
The effective sequence in Run-AlPipeline is:
1.0.101.0frompreviousAppsis published, synchronized and installed.1.0.100.0from the baseline CI/CD run is published afterwards as a prebuilt app.- Synchronizing
1.0.100.0fails because1.0.101.0has already been synchronized.
The resulting error is:
Cannot synchronize extension App because a newer version has already been synchronized with app ID ...
So the incremental build effectively combines:
Previous release:
1.0.101.0
Prebuilt app from baseline CI/CD:1.0.100.0
The problem is that the older baseline artifact is reused as a prebuilt app even though the selected previous release already contains a newer version of the same App ID.
Expected behavior
The incremental build should not attempt to publish or synchronize an app version that is older than the version of the same App ID already selected as previousApps.
The build should not end up with:
previousApps = 1.0.101.0
prebuilt app = 1.0.100.0
followed by an attempt to synchronize 1.0.100.0 after 1.0.101.0 has already been synchronized.
Steps to reproduce
- Run CI/CD on
mainso the Apps artifact contains an app with version1.0.100.0. - Create a release branch.
- Run CI/CD on the release branch so the same app has version
1.0.101.0. - Create a release from that release branch containing version
1.0.101.0. - Do not run another CI/CD on
main. - Create a PR targeting
mainwhich does not modify this app. - Run the PR build with incremental builds using
modifiedApps.
The PR build retrieves the unchanged app from the baseline workflow run on main:
Get unmodified apps from baseline workflow run
Branch for workflow run ... is main
Found artifact ...-main-Apps-1.0.100.0
Downloading artifact ...-main-Apps-1.0.100.0
Copy ..._App_1.0.100.0.app to build folders
It is later detected as a prebuilt app:
Using prebuilt app ...\.buildartifacts\Apps\...\App_1.0.100.0.app
The build then installs the newer previous release first and afterwards tries to publish the older prebuilt app.
Additional context (logs, screenshots, etc.)
The following sanitized excerpts are from the same failing PR build and show the sequence that leads to the failure.
1. The unchanged app is restored from the main baseline
Get unmodified apps from baseline workflow run
Branch for workflow run ... is main
Found artifact ...-main-Apps-1.0.100.0
Downloading artifact ...-main-Apps-1.0.100.0
Copy ..._App_1.0.100.0.app to build folders
Run-AlPipeline later recognizes the restored app as a prebuilt app:
Using prebuilt app ...\.buildartifacts\Apps\...\App_1.0.100.0.app
2. The newer version from the latest release is installed first
The selected previousApps contain version 1.0.101.0:
Installing previous apps
Publishing ..._App_1.0.101.0.app
Synchronizing App on tenant default
Installing App on tenant default
App ..._App_1.0.101.0.app successfully published
At this point 1.0.101.0 has been successfully synchronized and installed.
3. The older prebuilt app is published afterwards
The pipeline then enters Publishing apps and tries to publish the older baseline version:
Publishing apps
Publishing ..._App_1.0.100.0.app
Synchronizing App on tenant default
Cannot synchronize extension App because a newer version has already been synchronized with app ID ...
The relevant sequence is therefore:
latest release / previousApps
1.0.101.0
|
v
synchronized + installed
baseline CI/CD / prebuilt app
1.0.100.0
|
v
published afterwards
|
v
synchronization fails
Current workaround
Deleting the outdated Apps artifact from the baseline CI/CD run on main prevents AL-Go from restoring the older app as a prebuilt app. The PR build then succeeds.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at Run-AlPipeline and trace the incremental-build flow for modifiedApps, including how previousApps and baseline Apps artifacts become prebuilt apps. Compare app versions by App ID before publishing or synchronizing. Done means an older baseline app is not processed when a newer version is already selected from the latest release, and the described PR build succeeds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- ci-cd, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100