microsoft / AL-Go

The plug-and-play DevOps solution for Business Central app development on GitHub
MIT License
274 stars 114 forks source link

[Question]: Release does not contain latest Version #1161

Open AlexanderRichter opened 1 month ago

AlexanderRichter commented 1 month ago

Question

Hey there,

i am trying to figure out the difference between a Repository with multiple Apps but no Project and a Repo with one Project and then multiple apps.

To do that i started with a basic scenario where i created a Repo with 2 Apps.

Here is the scenario I want to cover:


Here are my Steps

  1. With my first Pull Request I created a Table in the Schema App and a Page in the other App showing the Data. The CI/CD from PR created 2 Artifacts with Version 1.0.4.0
  2. Create Release 1.0 I created a Release from Main Branch using latest App, incrementing Version and Tag = 1.0.0 The created Release contained the Artrifacts from previous CI/CD, so also showing the 1.0.4.0 Apps
  3. Page Action added (Representing a new Feature in Business Logic App) The CI/CD for this Pull Request created a new Artifact with Version 1.1.6.0.
Run actions/upload-artifact@v4
With the provided path, there will be 2 files uploaded
Artifact name is valid!
Root directory input is valid!
Beginning upload of artifact content to blob storage
Uploaded bytes 6478
Finished uploading artifact content to blob storage!
SHA256 hash of uploaded artifact zip is e543877b5e646b5[28](https://github.com/TestALGODelivery/MultiAppRepository/actions/runs/10248608160/job/28350319816#step:14:29)9f4e4092de552e7410d71aaf24d5ecf58af66de3130821e
Finalizing artifact upload
Artifact MultiAppRepository-main-Apps-1.1.6.0.zip successfully finalized. Artifact ID 17761972[29](https://github.com/TestALGODelivery/MultiAppRepository/actions/runs/10248608160/job/28350319816#step:14:30)
Artifact MultiAppRepository-main-Apps-1.1.6.0 has been successfully uploaded! Final size is 6478 bytes. Artifact ID is 1776197229

Up Until now everything worksd as expected.

  1. Create Release 1.1.0 Basically the very same parameters as before just using Tag =1.1.0. Thats where my confusion is coming from: This Release now contains the Artifact from Version 1.1.5.0 and not the latest ones.
Run $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0
Event name: workflow_dispatch
Inputs:
- appVersion = 'latest'
- createReleaseBranch = 'true'
- directCommit = 'true'
- draft = 'false'
- name = 'Release 1.1'
- prerelease = 'false'
- releaseBranchPrefix = 'release/'
- tag = '1.1.0'
- updateVersionNumber = '+0.1'
- useGhTokenWorkflow = 'true'

A quick look into the release branch 1.1. shows that the Page Action is not present in the branch.

I assume the issue is located in the Analyze Artifatcs Step as this one grabs not really the latest artifacts.

Grab latest
Looking for MultiAppRepository-main-Apps-1.1.5.0 or MultiAppRepository-main-TestApps-1.1.5.0 or MultiAppRepository-main-Dependencies-1.1.5.0 or MultiAppRepository-main-PowerPlatformSolution-1.1.5.0
artifacts={"include":[{"name":"MultiAppRepository-main-Apps-1.1.5.0","url":"https://api.github.com/repos/TestALGODelivery/MultiAppRepository/actions/artifacts/1776154902/zip","atype":"Apps","project":"."}]}
commitish=d4ecf2caf639bc78f5f7d967ddb1d1d6553eda46

I also tried the very same thing in a Repo with a Project and 2 Apps. Here i am not even able to create the first Release

Error when evaluating 'strategy' for job 'UploadArtifacts'. .github/workflows/CreateRelease.yaml (Line: 242, Col: 15): Error parsing fromJson,.github/workflows/CreateRelease.yaml (Line: 242, Col: 15): Error reading JToken from JsonReader. Path '', line 0, position 0.,.github/workflows/CreateRelease.yaml (Line: 242, Col: 15): Unexpected value ''

Am i doing something wrong here or is there a missunderstanding on how Releasing works in AL-Go?

Looking forward for your feedback

freddydk commented 3 weeks ago

On

Create Release 1.1.0 Basically the very same parameters as before just using Tag =1.1.0. Thats where my confusion is coming from: This Release now contains the Artifact from Version 1.1.5.0 and not the latest ones.

This should definitely grab the latest from main (if you run the create release from main).

This page: https://github.com/microsoft/AL-Go/blob/main/Workshop/Releasing.md

in the workshop should describe how releasing works.

If possible - do you have a public repo where I can see this?

AlexanderRichter commented 3 weeks ago

Hey Freddy,

sure. Here is the URL

https://github.com/TestALGODelivery/MultiAppRepository

Thanks for checking