fix: error on delivery of multiple release artifacts of same project#2321
fix: error on delivery of multiple release artifacts of same project#2321OleWunschmann wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes duplicate NuGet/storage delivery across release artifact matrix jobs.
Changes:
- Determines delivery eligibility per artifact type and configured secret.
- Delivers only the current matrix artifact type.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
Templates/Per Tenant Extension/.github/workflows/CreateRelease.yaml |
Updates PTE release delivery logic. |
Templates/AppSource App/.github/workflows/CreateRelease.yaml |
Mirrors the fix for AppSource releases. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| deliveryTarget: 'NuGet' | ||
| artifacts: ${{ github.event.inputs.buildVersion }} | ||
| atypes: 'Apps,TestApps' | ||
| atypes: ${{ matrix.atype }} |
There was a problem hiding this comment.
@mazhelez @aholstrup1
I'm not sure why this was implemented this way, but I want to keep it as-is.
I reworked my solution so it now delivers only once for artifacts of type Apps, instead of delivering each artifact type separately.
| deliveryTarget: 'Storage' | ||
| artifacts: ${{ github.event.inputs.buildVersion }} | ||
| atypes: 'Apps,TestApps,Dependencies' | ||
| atypes: ${{ matrix.atype }} |
| deliveryTarget: 'NuGet' | ||
| artifacts: ${{ github.event.inputs.buildVersion }} | ||
| atypes: 'Apps,TestApps' | ||
| atypes: ${{ matrix.atype }} |
| deliveryTarget: 'Storage' | ||
| artifacts: ${{ github.event.inputs.buildVersion }} | ||
| atypes: 'Apps,TestApps,Dependencies' | ||
| atypes: ${{ matrix.atype }} |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (4)
Templates/AppSource App/.github/workflows/CreateRelease.yaml:244
- This still runs delivery only from the
Appsmatrix entry, while the unchangedatypes: 'Apps,TestApps'makes that entry deliver both types. It therefore does not make each eligible matrix iteration deliver its own artifact as described. Gate both eligible entries and passmatrix.atypetoDeliver.
if: ${{ matrix.atype == 'Apps' && fromJson(steps.ReadSecrets.outputs.Secrets).nuGetContext != '' }}
Templates/AppSource App/.github/workflows/CreateRelease.yaml:257
- Restricting this step to
Appsleaves the hardcodedApps,TestApps,Dependenciesdelivery grouped in that one matrix job, contrary to the stated per-artifact delivery behavior. Run the step for each storage-supported type and pass only the current type.
if: ${{ matrix.atype == 'Apps' && fromJson(steps.ReadSecrets.outputs.Secrets).storageContext != '' }}
Templates/Per Tenant Extension/.github/workflows/CreateRelease.yaml:244
- This still runs delivery only from the
Appsmatrix entry, while the unchangedatypes: 'Apps,TestApps'makes that entry deliver both types. It therefore does not make each eligible matrix iteration deliver its own artifact as described. Gate both eligible entries and passmatrix.atypetoDeliver.
if: ${{ matrix.atype == 'Apps' && fromJson(steps.ReadSecrets.outputs.Secrets).nuGetContext != '' }}
Templates/Per Tenant Extension/.github/workflows/CreateRelease.yaml:257
- Restricting this step to
Appsleaves the hardcodedApps,TestApps,Dependenciesdelivery grouped in that one matrix job, contrary to the stated per-artifact delivery behavior. Run the step for each storage-supported type and pass only the current type.
if: ${{ matrix.atype == 'Apps' && fromJson(steps.ReadSecrets.outputs.Secrets).storageContext != '' }}
❔What, Why & How
The
UploadArtifactsjob inCreateRelease.yamlruns as a matrix over all artifact types (Apps,TestApps,Dependencies, …). Previously, each matrix iteration called theDeliver to NuGetandDeliver to Storagesteps with the hardcodedatypeslists ('Apps,TestApps'and'Apps,TestApps,Dependencies'). This caused theDeliveraction to be invoked multiple times for the same AL-Go project (once per artifact).ifconditions in bothTemplates/AppSource App/.github/workflows/CreateRelease.yamlandTemplates/Per Tenant Extension/.github/workflows/CreateRelease.yamlto ensure "Deliver to NuGet" and "Deliver to Storage" steps only run whenmatrix.atype == 'Apps', preventing these steps from executing for test apps. [1] [2]Related to issue: #2320
✅ Checklist