Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions Actions/AL-Go-Helper.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ function CreateDevEnv {
}

if ($settings.versioningStrategy -eq -1) {
if ($kind -eq "cloud") { throw "Versioningstrategy -1 cannot be used on cloud" }
if ($kind -eq "cloud") { throw "versioningStrategy -1 cannot be used on cloud" }
$artifactVersion = [Version]$settings.artifact.Split('/')[4]
$runAlPipelineParams += @{
"appVersion" = "$($artifactVersion.Major).$($artifactVersion.Minor)"
Expand All @@ -1471,13 +1471,24 @@ function CreateDevEnv {
}
}
else {
$appBuild = 0
$appRevision = 0
if (($settings.versioningStrategy -band 16) -eq 16) {
# For versioningStrategy +16, the version number is taken from repoVersion setting
$repoVersion = [System.Version]$settings.repoVersion
if (($settings.versioningStrategy -band 15) -eq 3) {
# For versioning strategy 3, we need to get the build number from repoVersion setting
if ($repoVersion.Build -eq -1) {
Write-Host "WARNING: RepoVersion setting only contains Major.Minor version. When using versioningStrategy 3, it should contain 3 digits"
}
else {
$appBuild = $repoVersion.Build
}
}
$runAlPipelineParams += @{
"appVersion" = $settings.repoVersion
"appVersion" = "$($repoVersion.Major).$($repoVersion.Minor)"
}
}
$appBuild = 0
$appRevision = 0
switch ($settings.versioningStrategy -band 15) {
2 {
# USE DATETIME
Expand Down
4 changes: 2 additions & 2 deletions Actions/IncrementVersionNumber/IncrementVersionNumber.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $settings = $env:Settings | ConvertFrom-Json
if ($versionNumber.StartsWith('+')) {
# Handle incremental version number
$allowedIncrementalVersionNumbers = @('+1', '+0.1')
if ($settings.versioningStrategy -eq 3) {
if (($settings.versioningStrategy -band 15) -eq 3) {
# Allow increment build
$allowedIncrementalVersionNumbers += '+0.0.1'
}
Expand All @@ -38,7 +38,7 @@ else {
# Handle absolute version number
$versionNumberFormat = '^\d+\.\d+$' # Major.Minor
$correctFormatMsg = 'Major.Minor (e.g. 1.0 or 1.2)'
if ($settings.versioningStrategy -eq 3) {
if (($settings.versioningStrategy -band 15) -eq 3) {
$versionNumberFormat = '^\d+\.\d+\.\d+$' # Major.Minor.Build
$correctFormatMsg = 'Major.Minor.Build (e.g. 1.0, 1.2 or 1.2.3)'
}
Expand Down
12 changes: 11 additions & 1 deletion Actions/RunPipeline/RunPipeline.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,18 @@ try {
$appRevision = $artifactVersion.Revision
}
elseif (($settings.versioningStrategy -band 16) -eq 16) {
# For versioningStrategy +16, the version number is taken from repoVersion setting
$repoVersion = [System.Version]$settings.repoVersion
if (($settings.versioningStrategy -band 15) -eq 3) {
# For versioning strategy 3, we need to get the build number from repoVersion setting
$appBuild = $repoVersion.Build
if ($appBuild -eq -1) {
Write-Warning "RepoVersion setting only contains Major.Minor version. When using versioningStrategy 3, it should contain 3 digits"
$appBuild = 0
}
}
$runAlPipelineParams += @{
"appVersion" = $settings.repoVersion
"appVersion" = "$($repoVersion.Major).$($repoVersion.Minor)"
}
}

Expand Down
3 changes: 2 additions & 1 deletion RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
### Issues

- Issue 2055 When using versioningStrategy 3+16, you get an error when building
- AL-Go repositories with large amounts of projects may run into issues with too large environment variables

## AL-Go Telemetry updates
### AL-Go Telemetry updates

AL-Go telemetry now includes test results so you can more easily see how many AL tests, Page Scripting tests and BCPT tests ran in your workflows across all your repositories. Documentation for this can be found on [this article](https://github.com/microsoft/AL-Go/blob/main/Scenarios/EnablingTelemetry.md) on enabling telemetry.

Expand Down
4 changes: 2 additions & 2 deletions Scenarios/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ When running a workflow or a local script, the settings are applied by reading s
| Name | Description | Default value |
| :-- | :-- | :-- |
| <a id="country"></a>country | Specifies which country this app is built against. | us |
| <a id="repoVersion"></a>repoVersion | RepoVersion is the project version number. The Repo Version number consists of \<major>.\<minor> only and is used for naming build artifacts in the CI/CD workflow. Build artifacts are named **\<project>-Apps-\<repoVersion>.\<build>.\<revision>** and can contain multiple apps. The Repo Version number is used as major.minor for individual apps if versioningStrategy is +16. | 1.0 |
| <a id="repoVersion"></a>repoVersion | RepoVersion is the project version number. The Repo Version number consists of \<major>.\<minor> (or \<major>.\<minor>.\<build> when versioningStrategy is 3 or 3+16) and is used for naming build artifacts in the CI/CD workflow. Build artifacts are named **\<project>-Apps-\<repoVersion>.\<build>.\<revision>** and can contain multiple apps. The Repo Version number is used as major.minor for individual apps if versioningStrategy is +16. | 1.0 |
| <a id="projectName"></a>projectName | Friendly name for an AL-Go project to be used in the UI for various workflows (CICD, Pull Request Build, etc.). If not set, the name for the project will be the relative path from the root of the repository. | '' |
| <a id="appFolders"></a>appFolders | appFolders should be an array of folders (relative to project root), which contains apps for this project. Apps in these folders are sorted based on dependencies and built and published in that order.<br />If appFolders are not specified, AL-Go for GitHub will try to locate appFolders in the root of the project. | [ ] |
| <a id="testFolders"></a>testFolders | testFolders should be an array of folders (relative to project root), which contains test apps for this project. Apps in these folders are sorted based on dependencies and built, published and tests are run in that order.<br />If testFolders are not specified, AL-Go for GitHub will try to locate testFolders in the root of the project. | [ ] |
Expand Down Expand Up @@ -95,7 +95,7 @@ The repository settings are only read from the repository settings file (.github
| <a id="updateDependencies"></a>updateDependencies | Setting updateDependencies to true causes AL-Go to build your app against the first compatible Business Central build and set the dependency version numbers in the app.json accordingly during build. All version numbers in the built app will be set to the version number used during compilation. <br />⚠️ **Warning:** When the `updateDependencies` setting is enabled, the application versions from the BC Artifact are stamped into the `app.json`. However, not all app versions available in BC Artifacts are shipped in BC SaaS, which can lead to dependency resolution failures during AppSource validation. Therefore, it is not recommended to use this setting if you intend on deploying the build to AppSource. | false |
| <a id="generateDependencyArtifact"></a>generateDependencyArtifact | When this repository setting is true, CI/CD pipeline generates an artifact with the external dependencies used for building the apps in this repo. | false |
| <a id="companyName"></a>companyName | Company name selected in the database, used for running the CI/CD workflow. Default is to use the default company in the selected Business Central localization. | |
| <a id="versioningStrategy"></a>versioningStrategy | The versioning strategy determines how versioning is performed in this project. The version number of an app consists of 4 segments: **Major**.**Minor**.**Build**.**Revision**. **Major** and **Minor** are read from the app.json file for each app. **Build** and **Revision** are calculated. Currently 3 versioning strategies are supported:<br />**0** = **Build** is the **github [run_number](https://go.microsoft.com/fwlink/?linkid=2217416&clcid=0x409)** for the CI/CD workflow, increased by the **runNumberOffset** setting value (if specified). **Revision** is the **github [run_attempt](https://go.microsoft.com/fwlink/?linkid=2217416&clcid=0x409)** subtracted 1.<br />**2** = **Build** is the current date as **yyyyMMdd**. **Revision** is the current time as **hhmmss**. Date and time are always **UTC** timezone to avoid problems during daylight savings time change. Note that if two CI/CD workflows are started within the same second, this could yield to identical version numbers from two different runs.<br />**3** = **Build** is taken from **app.json** (like Major and Minor) and **Revision** is the **github [run_number](https://go.microsoft.com/fwlink/?linkid=2217416&clcid=0x409)** of the workflow run<br />**15** = **Build** is max value and **Revision** is the **github [run_number](https://go.microsoft.com/fwlink/?linkid=2217416&clcid=0x409)** of the workflow run. **Note**: use this strategy with caution. We recommend using it only when producing non-official artifacts (e.g. from PR builds or test workflows).<br />**+16** use **repoVersion** setting as **appVersion** for all apps | 0 |
| <a id="versioningStrategy"></a>versioningStrategy | The versioning strategy determines how versioning is performed in this project. The version number of an app consists of 4 segments: **Major**.**Minor**.**Build**.**Revision**. **Major** and **Minor** are read from the app.json file for each app. **Build** and **Revision** are calculated. Currently 3 versioning strategies are supported:<br />**0** = **Build** is the **github [run_number](https://go.microsoft.com/fwlink/?linkid=2217416&clcid=0x409)** for the CI/CD workflow, increased by the **runNumberOffset** setting value (if specified). **Revision** is the **github [run_attempt](https://go.microsoft.com/fwlink/?linkid=2217416&clcid=0x409)** subtracted 1.<br />**2** = **Build** is the current date as **yyyyMMdd**. **Revision** is the current time as **hhmmss**. Date and time are always **UTC** timezone to avoid problems during daylight savings time change. Note that if two CI/CD workflows are started within the same second, this could yield to identical version numbers from two different runs.<br />**3** = **Build** is taken from **app.json** (like Major and Minor) and **Revision** is the **github [run_number](https://go.microsoft.com/fwlink/?linkid=2217416&clcid=0x409)** of the workflow run<br />**15** = **Build** is max value and **Revision** is the **github [run_number](https://go.microsoft.com/fwlink/?linkid=2217416&clcid=0x409)** of the workflow run. **Note**: use this strategy with caution. We recommend using it only when producing non-official artifacts (e.g. from PR builds or test workflows).<br /><br />**+16** when adding 16 to the above versioning strategies, all builds will use **repoVersion** setting instead of the *Major.Minor* found inside app.json (and also *build* if versioningStrategy is 3+16) | 0 |
| <a id="additionalCountries"></a>additionalCountries | This property can be set to an additional number of countries to compile, publish and test your app against during workflows. Note that this setting can be different in NextMajor and NextMinor workflows compared to the CI/CD workflow, by specifying a different value in a workflow settings file. | [ ] |
| <a id="keyVaultName"></a>keyVaultName | When using Azure KeyVault for the secrets used in your workflows, the KeyVault name needs to be specified in this setting if it isn't specified in the AZURE_CREDENTIALS secret. Read [this](UseAzureKeyVault.md) for more information. | |
| <a id="licenseFileUrlSecretName"></a>licenseFileUrlSecretName | Specify the name (**NOT the secret**) of the LicenseFileUrl secret. Default is LicenseFileUrl. AL-Go for GitHub will look for a secret with this name in GitHub Secrets or Azure KeyVault to use as LicenseFileUrl. A LicenseFileUrl is required when building AppSource apps for Business Central prior to version 22. Read [this](SetupCiCdForExistingAppSourceApp.md) for more information. | LicenseFileUrl |
Expand Down
Loading