microsoft / AL-Go

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

Deliver To AppSource on finding app.json for the app #344

Closed AskeHolst closed 1 year ago

AskeHolst commented 1 year ago

I'm trying to run the Publish To AppSource workflow, but it fails (see output below, the real appname is replaced with MyAppSourceApp). It is a single project repo, but with external dependencies from another publisher (using installApps) and from another repo (using appDependencyProbingPaths). I do not want it to try to deliver the dependencies.

Any ideas what could be wrong? It's not urgent as I'll just upload using BCContainerHelper, but it would be nice to get running at some point.


Run microsoft/AL-Go-Actions/Deliver@v2.2
Run try { D:\a\_actions\microsoft\AL-Go-Actions\v2.2\Deliver/Deliver.ps1 -actor $ENV:_actor -token $ENV:_token -parentTelemetryScopeJson $ENV:_parentTelemetryScopeJson -projects $ENV:_projects -deliveryTarget $ENV:_deliveryTarget -artifacts $ENV:_artifacts -type $ENV:_type -atypes $ENV:_atypes -goLive ($ENV:_goLive -eq 'Y') } catch { Write-Host "::Error::Unexpected error when running action ($($_.Exception.Message.Replace("`r",'').Replace("`n",' ')))"; exit 1 }
D:\a\_actions\microsoft\AL-Go-Actions\v2.2\Deliver
Downloading BcContainerHelper latest version from CDN
BcContainerHelper version 4.0.9
BC.HelperFunctions emits usage statistics telemetry to Microsoft
Reading .github\AL-Go-Settings.json
Reading .AL-Go\settings.json
Artifacts latest
Projects:
.
Using AppSourceContext
Project 'MyAppSourceApp'
Analyzing artifacts
https://api.github.com/repos/prymeGlobal/MyAppSourceApp/actions/artifacts?per_page=100&page=1
project 'MyAppSourceApp'
Downloading artifact MyAppSourceApp-main-Apps-1.1.28.0
https://api.github.com/repos/prymeGlobal/MyAppSourceApp/actions/artifacts/505215510/zip
D:\a\MyAppSourceApp\MyAppSourceApp\.artifacts\MyAppSourceApp-main-Apps-1.1.28.0.zip
Analyzing artifacts
https://api.github.com/repos/prymeGlobal/MyAppSourceApp/actions/artifacts?per_page=100&page=1
project 'MyAppSourceApp'
WARNING: Could not find any Dependencies artifacts for projects *, version latest
Attempting authentication to *** using clientCredentials...
Authenticated as app ***
AppSource MainAppFolder 
Error: Deliver action failed. Error: Cannot find path 'D:\a\MyAppSourceApp\MyAppSourceApp\app.json' because it does not exist. Stacktrace: at <ScriptBlock>, D:\a\_actions\microsoft\AL-Go-Actions\v2.2\Deliver\Deliver.ps1: line 385 at <ScriptBlock>, D:\a\_actions\microsoft\AL-Go-Actions\v2.2\Deliver\Deliver.ps1: line 72 at <ScriptBlock>, D:\a\_temp\d8bc8ec1-b2e9-49a6-8c44-1f1e8850bdb2.ps1: line 1 at <ScriptBlock>, <No file>: line 1
AL-Go action ran: Deliver Telemetry Correlation Id: c1bd42d3-34c3-49e0-85b3-9da423[87](https://github.com/prymeGlobal/MyAppSourceApp/actions/runs/3884129194/jobs/6626310445#step:6:88)16f8
Removing BcContainerHelper
Error: Process completed with exit code 1.
freddydk commented 1 year ago

I will be releasing a new preview tomorrow, where quite a few fixes has been done in this area. Will let you know when. If you could try to upgrade and see whether this fixes the issue - and if not, then maybe add me to the repo to see what goes wrong?

AskeHolst commented 1 year ago

Thanks, I'll try the preview and if it does not work I'll give you access.

freddydk commented 1 year ago

Do you have more than one app in the repo? Did you set the setting AppSourceMainAppFolder to the app folder containing the main app?

AskeHolst commented 1 year ago

One app and one test app. I did not set AppSourceMainAppFolder as I understod it was not needed with only one app. I do see that appFolders and testFolders are not set, should they be set manually? I'm still a bit uncertain how much is maintained and updated in the settings files by the actions and how much I need to do. E.g. after running the "Add a new app" workflow do I need to manually update the testFolders setting? It seems to have worked without so far.

freddydk commented 1 year ago

With a repo like that, you should not need to set AppSourceMainAppFolder - it should be found.

freddydk commented 1 year ago

have a repro in my own repo: image (after removing appFolders, testFolders and AppSourceMainAppFolder)

freddydk commented 1 year ago

For now, you have to add appFolders in your project settings (.AL-Go/settings.json) to make it work. After the next release - you can remove that again.

AskeHolst commented 1 year ago

Thank you, I'll try that. As always, thank you for an incredible commitment to quick resolution.