2

I would like to have an optional property in the "app.json" of an AL project where we can specify the exact commit ID (will in most cases be the git SHA1) that the package was built from.


This will of course be only relevant in CI scenarios where the build pipeline (or whatever) updates this value to the current commit ID before building the package.


This would be a no-cost solution and very handy for tracking purposes. This would eliminate the need for us to create tags in the repository after each build in order to link the built version to an exact commit, regardless of the used CI/CD backend and to what extent its features are exploited.


Exposing this value then in the Extension Management page (and PowerShell cmdlets) would help debugging and troubleshooting a lot.

Category: Development
STATUS DETAILS
Planned
2023 Release Wave 2
Ideas Administrator

Thank you for this suggestion! 

In 2023 Release Wave 2 we are adding this. The app.json manifest on extensions now contains two new properties, *Source* and *Build*. These can be used to track source location and the build context.

For source we support:
* "resposityUrl", which is the URL of the repository where the source code of the project can be found.
* "commit", which is an ID of the source code for the current version of the project, that allows getting back to the commit that triggered building the extension. This is the ask of this idea

For build we support:
* "by", which is useful for tracking the build agent/system that orchestrated the build, for example AL-Go for GitHub
* "url", which can be used for the URL to the build system invocation where the build can be found.

You can define these values directly in the app.json, but given the dynamic nature, the usual scenario would be to set these as part of build pipelines via command line parameters for the used alc.exe compiler executable. The values passed here will overwrite any values in the app.json source file.

if using "BcContainerHelper", the functions "Compile-AppInBcContainer" and "Compile-AppWithCompilerFolder" now take parameters for "SourceRepositoryUrl", "SourceCommit", "BuildBy",and  "BuildUrl". These are now being set if you use AL:Go for GitHub to build you extensions.

In this release there is not yet any surfacing of these values in Extension Management, TAC or via PowerShell commands like NAV-AppInfo, however, we will still close this idea. If you want to read the values, currently the option is to use the BcContainerHelper "Extract-AppFileToFolder", which will allow getting the app.json with the settings.

Best regards, Business Central Team