From 530663c6ce4a35a5f5393fa9a887ca440b1c27b4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 18 Nov 2025 14:04:55 +0000 Subject: [PATCH 01/16] Initial plan From 8a356a1d2ef41ef4b3ea9ddecd32c454110af4fb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 18 Nov 2025 14:18:39 +0000 Subject: [PATCH 02/16] Extract PowerShell code from E2E.yaml into local actions Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com> --- .github/workflows/E2E.yaml | 358 +++++++----------- Actions/E2EAnalyze/E2EAnalyze.ps1 | 67 ++++ Actions/E2EAnalyze/action.yaml | 47 +++ .../E2ECalculateRepoName.ps1 | 12 + Actions/E2ECalculateRepoName/action.yaml | 30 ++ .../E2ECalculateTestParams.ps1 | 66 ++++ Actions/E2ECalculateTestParams/action.yaml | 71 ++++ Actions/E2ECheckSecrets/E2ECheckSecrets.ps1 | 56 +++ Actions/E2ECheckSecrets/action.yaml | 63 +++ Actions/E2ERunScenario/E2ERunScenario.ps1 | 54 +++ Actions/E2ERunScenario/action.yaml | 70 ++++ Actions/E2ERunTest/E2ERunTest.ps1 | 80 ++++ Actions/E2ERunTest/action.yaml | 90 +++++ .../E2ESetupRepositories.ps1 | 9 + Actions/E2ESetupRepositories/action.yaml | 44 +++ 15 files changed, 891 insertions(+), 226 deletions(-) create mode 100644 Actions/E2EAnalyze/E2EAnalyze.ps1 create mode 100644 Actions/E2EAnalyze/action.yaml create mode 100644 Actions/E2ECalculateRepoName/E2ECalculateRepoName.ps1 create mode 100644 Actions/E2ECalculateRepoName/action.yaml create mode 100644 Actions/E2ECalculateTestParams/E2ECalculateTestParams.ps1 create mode 100644 Actions/E2ECalculateTestParams/action.yaml create mode 100644 Actions/E2ECheckSecrets/E2ECheckSecrets.ps1 create mode 100644 Actions/E2ECheckSecrets/action.yaml create mode 100644 Actions/E2ERunScenario/E2ERunScenario.ps1 create mode 100644 Actions/E2ERunScenario/action.yaml create mode 100644 Actions/E2ERunTest/E2ERunTest.ps1 create mode 100644 Actions/E2ERunTest/action.yaml create mode 100644 Actions/E2ESetupRepositories/E2ESetupRepositories.ps1 create mode 100644 Actions/E2ESetupRepositories/action.yaml diff --git a/.github/workflows/E2E.yaml b/.github/workflows/E2E.yaml index 2f0e9430e..a8a308959 100644 --- a/.github/workflows/E2E.yaml +++ b/.github/workflows/E2E.yaml @@ -61,49 +61,16 @@ jobs: - name: Check secrets id: check - env: + uses: ./Actions/E2ECheckSecrets + with: + shell: pwsh githubOwner: ${{ github.event.inputs.githubOwner }} - run: | - $err = $false - if (('${{ vars.E2E_APP_ID }}' -eq '') -or ('${{ secrets.E2E_PRIVATE_KEY }}' -eq '')){ - Write-Host "::Error::In order to run end to end tests, you need a Secret called E2E_PRIVATE_KEY and a variable called E2E_APP_ID." - $err = $true - } - if ('${{ Secrets.ALGOAUTHAPP }}' -eq '') { - Write-Host "::Error::In order to run end to end tests, you need a Secret called ALGOAUTHAPP" - $err = $true - } - if ('${{ Secrets.adminCenterApiCredentials }}' -eq '') { - Write-Host "::Error::In order to run end to end tests, you need a Secret called adminCenterApiCredentials" - $err = $true - } - if ('${{ Secrets.E2E_GHPackagesPAT }}' -eq '') { - Write-Host "::Error::In order to run end to end tests, you need a secret called E2E_GHPackagesPAT" - $err = $true - } - if ('${{ Secrets.E2EAZURECREDENTIALS }}' -eq '') { - Write-Host "::Error::In order to run end to end tests, you need a secret called E2EAZURECREDENTIALS" - $err = $true - } - if ($err) { - exit 1 - } - $githubOwner = $ENV:githubOwner - $maxParallel = 99 - if (!($githubOwner)) { - $githubOwner = "$ENV:GITHUB_REPOSITORY_OWNER" - } - $orgmap = Get-Content -path (Join-Path "." "e2eTests\orgmap.json") -encoding UTF8 -raw | ConvertFrom-Json - if ($orgmap.PSObject.Properties.Name -eq $githubOwner) { - $githubOwner = $orgmap."$githubOwner" - } - if ($githubOwner -eq $ENV:GITHUB_REPOSITORY_OWNER) { - $maxParallel = 8 - } - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "maxParallel=$maxParallel" - Write-Host "maxParallel=$maxParallel" - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "githubOwner=$githubOwner" - Write-Host "githubOwner=$githubOwner" + e2eAppId: ${{ vars.E2E_APP_ID }} + e2ePrivateKey: ${{ secrets.E2E_PRIVATE_KEY }} + algoAuthApp: ${{ secrets.ALGOAUTHAPP }} + adminCenterApiCredentials: ${{ secrets.adminCenterApiCredentials }} + e2eGHPackagesPAT: ${{ secrets.E2E_GHPackagesPAT }} + e2eAzureCredentials: ${{ secrets.E2EAZURECREDENTIALS }} SetupRepositories: runs-on: [ ubuntu-latest ] @@ -132,12 +99,12 @@ jobs: - name: Setup Repositories id: setup - env: - _bcContainerHelperVersion: ${{ github.event.inputs.bcContainerHelperVersion }} - GH_TOKEN: ${{ steps.app-token.outputs.token }} - run: | - $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 - . (Join-Path "." "e2eTests/SetupRepositories.ps1") -githubOwner '${{ needs.Check.outputs.githubowner }}' -bcContainerHelperVersion $ENV:_bcContainerHelperVersion + uses: ./Actions/E2ESetupRepositories + with: + shell: pwsh + githubOwner: ${{ needs.Check.outputs.githubowner }} + bcContainerHelperVersion: ${{ github.event.inputs.bcContainerHelperVersion }} + token: ${{ steps.app-token.outputs.token }} Analyze: runs-on: [ ubuntu-latest ] @@ -167,70 +134,12 @@ jobs: - name: Analyze id: Analyze - env: - GH_TOKEN: ${{ steps.app-token.outputs.token }} - run: | - $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 - $modulePath = Join-Path "." "e2eTests\e2eTestHelper.psm1" -resolve - Import-Module $modulePath -DisableNameChecking - $maxParallel = [int]'${{ needs.Check.outputs.maxParallel }}' - - $publicTestruns = @{ - "max-parallel" = $maxParallel - "fail-fast" = $false - "matrix" = @{ - "include" = @() - } - } - $privateTestruns = @{ - "max-parallel" = $maxParallel - "fail-fast" = $false - "matrix" = @{ - "include" = @() - } - } - @('appSourceApp','PTE') | ForEach-Object { - $type = $_ - @('linux','windows') | ForEach-Object { - $os = $_ - @('multiProject','singleProject') | ForEach-Object { - $style = $_ - $publicTestruns.matrix.include += @{ "type" = $type; "os" = $os; "style" = $style; "Compiler" = "Container" } - $privateTestruns.matrix.include += @{ "type" = $type; "os" = $os; "style" = $style; "Compiler" = "Container" } - if ($type -eq "PTE") { - # Run end 2 end tests using CompilerFolder with Windows+Linux and single/multiproject - $publicTestruns.matrix.include += @{ "type" = $type; "os" = $os; "style" = $style; "Compiler" = "CompilerFolder" } - } - } - } - } - $publicTestrunsJson = $publicTestruns | ConvertTo-Json -depth 99 -compress - $privateTestrunsJson = $privateTestruns | ConvertTo-Json -depth 99 -compress - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "publictestruns=$publicTestrunsJson" - Write-Host "publictestruns=$publicTestrunsJson" - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "privatetestruns=$privateTestrunsJson" - Write-Host "privatetestruns=$privateTestrunsJson" - - $releases = @(gh release list --repo microsoft/AL-Go | ForEach-Object { $_.split("`t")[0] }) | Where-Object { [Version]($_.trimStart('v')) -ge [Version]("$env:TestUpgradesFromVersion".TrimStart('v')) } - $releasesJson = @{ - "matrix" = @{ - "include" = @($releases | ForEach-Object { @{ "Release" = $_; "type" = 'appSourceApp' }; @{ "Release" = $_; "type" = 'PTE' } } ) - }; - "max-parallel" = $maxParallel - "fail-fast" = $false - } | ConvertTo-Json -depth 99 -compress - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "releases=$releasesJson" - Write-Host "releases=$releasesJson" - - $scenariosJson = @{ - "matrix" = @{ - "include" = @(Get-ChildItem -path (Join-Path $ENV:GITHUB_WORKSPACE "e2eTests/scenarios/*/runtest.ps1") | ForEach-Object { @{ "Scenario" = $_.Directory.Name } } ) - }; - "max-parallel" = $maxParallel - "fail-fast" = $false - } | ConvertTo-Json -depth 99 -compress - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "scenarios=$scenariosJson" - Write-Host "scenarios=$scenariosJson" + uses: ./Actions/E2EAnalyze + with: + shell: pwsh + maxParallel: ${{ needs.Check.outputs.maxParallel }} + testUpgradesFromVersion: ${{ env.TestUpgradesFromVersion }} + token: ${{ steps.app-token.outputs.token }} ScenariosOnWindows: runs-on: [ windows-latest ] @@ -250,24 +159,27 @@ jobs: - name: Calculate parameters id: calculateParams - run: | - $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 - $reponame = [System.IO.Path]::GetFileNameWithoutExtension([System.IO.Path]::GetTempFileName()) - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "repoName=$repoName" - Write-Host "repoName=$repoName" - Write-Host "Repo URL: https://github.com/${{ needs.Check.outputs.githubowner }}/$repoName" + uses: ./Actions/E2ECalculateRepoName + with: + shell: pwsh + githubOwner: ${{ needs.Check.outputs.githubowner }} - name: Run test on Windows - run: | - try { - . (Join-Path "." "e2eTests/scenarios/${{ matrix.scenario }}/runtest.ps1") -github -githubOwner '${{ needs.Check.outputs.githubowner }}' -repoName '${{ steps.calculateParams.outputs.repoName }}' -e2eAppId '${{ vars.E2E_APP_ID }}' -e2eAppKey '${{ secrets.E2E_PRIVATE_KEY }}' -algoauthapp '${{ Secrets.ALGOAUTHAPP }}' -pteTemplate '${{ needs.Check.outputs.githubowner }}/${{ needs.SetupRepositories.outputs.perTenantExtensionRepo }}' -appSourceTemplate '${{ needs.Check.outputs.githubowner }}/${{ needs.SetupRepositories.outputs.appSourceAppRepo }}' -adminCenterApiCredentials '${{ Secrets.adminCenterApiCredentials }}' -azureCredentials '${{ Secrets.E2EAzureCredentials }}' -githubPackagesToken '${{ Secrets.E2E_GHPackagesPAT }}' - } - catch { - Write-Host $_.Exception.Message - Write-Host $_.ScriptStackTrace - Write-Host "::Error::$($_.Exception.Message)" - $host.SetShouldExit(1) - } + uses: ./Actions/E2ERunScenario + with: + shell: pwsh + scenario: ${{ matrix.scenario }} + linux: false + githubOwner: ${{ needs.Check.outputs.githubowner }} + repoName: ${{ steps.calculateParams.outputs.repoName }} + e2eAppId: ${{ vars.E2E_APP_ID }} + e2eAppKey: ${{ secrets.E2E_PRIVATE_KEY }} + algoAuthApp: ${{ secrets.ALGOAUTHAPP }} + pteTemplate: ${{ needs.Check.outputs.githubowner }}/${{ needs.SetupRepositories.outputs.perTenantExtensionRepo }} + appSourceTemplate: ${{ needs.Check.outputs.githubowner }}/${{ needs.SetupRepositories.outputs.appSourceAppRepo }} + adminCenterApiCredentials: ${{ secrets.adminCenterApiCredentials }} + azureCredentials: ${{ secrets.E2EAzureCredentials }} + githubPackagesToken: ${{ secrets.E2E_GHPackagesPAT }} ScenariosOnLinux: runs-on: [ windows-latest ] @@ -287,24 +199,27 @@ jobs: - name: Calculate parameters id: calculateParams - run: | - $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 - $reponame = [System.IO.Path]::GetFileNameWithoutExtension([System.IO.Path]::GetTempFileName()) - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "repoName=$repoName" - Write-Host "repoName=$repoName" - Write-Host "Repo URL: https://github.com/${{ needs.Check.outputs.githubowner }}/$repoName" + uses: ./Actions/E2ECalculateRepoName + with: + shell: pwsh + githubOwner: ${{ needs.Check.outputs.githubowner }} - name: Run tests - run: | - try { - . (Join-Path "." "e2eTests/scenarios/${{ matrix.scenario }}/runtest.ps1") -github -linux -githubOwner '${{ needs.Check.outputs.githubowner }}' -repoName '${{ steps.calculateParams.outputs.repoName }}' -e2eAppId '${{ vars.E2E_APP_ID }}' -e2eAppKey '${{ secrets.E2E_PRIVATE_KEY }}' -algoauthapp '${{ Secrets.ALGOAUTHAPP }}' -pteTemplate '${{ needs.Check.outputs.githubowner }}/${{ needs.SetupRepositories.outputs.perTenantExtensionRepo }}' -appSourceTemplate '${{ needs.Check.outputs.githubowner }}/${{ needs.SetupRepositories.outputs.appSourceAppRepo }}' -adminCenterApiCredentials '${{ Secrets.adminCenterApiCredentials }}' -azureCredentials '${{ Secrets.E2EAzureCredentials }}' -githubPackagesToken '${{ Secrets.E2E_GHPackagesPAT }}' - } - catch { - Write-Host $_.Exception.Message - Write-Host $_.ScriptStackTrace - Write-Host "::Error::$($_.Exception.Message)" - $host.SetShouldExit(1) - } + uses: ./Actions/E2ERunScenario + with: + shell: pwsh + scenario: ${{ matrix.scenario }} + linux: true + githubOwner: ${{ needs.Check.outputs.githubowner }} + repoName: ${{ steps.calculateParams.outputs.repoName }} + e2eAppId: ${{ vars.E2E_APP_ID }} + e2eAppKey: ${{ secrets.E2E_PRIVATE_KEY }} + algoAuthApp: ${{ secrets.ALGOAUTHAPP }} + pteTemplate: ${{ needs.Check.outputs.githubowner }}/${{ needs.SetupRepositories.outputs.perTenantExtensionRepo }} + appSourceTemplate: ${{ needs.Check.outputs.githubowner }}/${{ needs.SetupRepositories.outputs.appSourceAppRepo }} + adminCenterApiCredentials: ${{ secrets.adminCenterApiCredentials }} + azureCredentials: ${{ secrets.E2EAzureCredentials }} + githubPackagesToken: ${{ secrets.E2E_GHPackagesPAT }} TestAlGoPublic: runs-on: [ ubuntu-latest ] @@ -324,36 +239,34 @@ jobs: - name: Calculate parameters id: calculateParams - run: | - $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 - $adminCenterApiCredentials = '' - if ('${{ matrix.type }}' -eq 'PTE' -and '${{ matrix.style }}' -eq 'singleProject' -and '${{ matrix.os }}' -eq 'windows') { - $adminCenterApiCredentials = '${{ Secrets.adminCenterApiCredentials }}' - } - if ('${{ matrix.type }}' -eq 'appSourceApp') { - $template = '${{ needs.Check.outputs.githubowner }}/${{ needs.SetupRepositories.outputs.appSourceAppRepo }}' - } - else { - $template = '${{ needs.Check.outputs.githubowner }}/${{ needs.SetupRepositories.outputs.perTenantExtensionRepo }}' - } - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "adminCenterApiCredentials='$adminCenterApiCredentials'" - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "template='$template'" - $reponame = [System.IO.Path]::GetFileNameWithoutExtension([System.IO.Path]::GetTempFileName()) - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "repoName='$repoName'" - Write-Host "repoName='$repoName'" - Write-Host "Repo URL: https://github.com/${{ needs.Check.outputs.githubowner }}/$repoName" + uses: ./Actions/E2ECalculateTestParams + with: + shell: pwsh + githubOwner: ${{ needs.Check.outputs.githubowner }} + matrixType: ${{ matrix.type }} + matrixStyle: ${{ matrix.style }} + matrixOs: ${{ matrix.os }} + adminCenterApiCredentialsSecret: ${{ secrets.adminCenterApiCredentials }} + appSourceAppRepo: ${{ needs.SetupRepositories.outputs.appSourceAppRepo }} + perTenantExtensionRepo: ${{ needs.SetupRepositories.outputs.perTenantExtensionRepo }} - name: Run tests - run: | - try { - . (Join-Path "." "e2eTests/Test-AL-Go.ps1") -github -githubOwner '${{ needs.Check.outputs.githubowner }}' -repoName ${{ steps.calculateParams.outputs.repoName }} -e2eAppId '${{ vars.E2E_APP_ID }}' -e2eAppKey '${{ secrets.E2E_PRIVATE_KEY }}' -algoauthapp '${{ Secrets.ALGOAUTHAPP }}' -template ${{ steps.calculateParams.outputs.template }} -adminCenterApiCredentials ${{ steps.calculateParams.outputs.adminCenterApiCredentials }} -multiProject:('${{ matrix.style }}' -eq 'multiProject') -appSource:('${{ matrix.type }}' -eq 'appSourceApp') -linux:('${{ matrix.os }}' -eq 'linux') -useCompilerFolder:('${{ matrix.Compiler }}' -eq 'CompilerFolder') - } - catch { - Write-Host $_.Exception.Message - Write-Host $_.ScriptStackTrace - Write-Host "::Error::$($_.Exception.Message)" - $host.SetShouldExit(1) - } + uses: ./Actions/E2ERunTest + with: + shell: pwsh + testType: test + private: false + githubOwner: ${{ needs.Check.outputs.githubowner }} + repoName: ${{ steps.calculateParams.outputs.repoName }} + e2eAppId: ${{ vars.E2E_APP_ID }} + e2eAppKey: ${{ secrets.E2E_PRIVATE_KEY }} + algoAuthApp: ${{ secrets.ALGOAUTHAPP }} + template: ${{ steps.calculateParams.outputs.template }} + adminCenterApiCredentials: ${{ steps.calculateParams.outputs.adminCenterApiCredentials }} + multiProject: ${{ matrix.style == 'multiProject' }} + appSource: ${{ matrix.type == 'appSourceApp' }} + linux: ${{ matrix.os == 'linux' }} + useCompilerFolder: ${{ matrix.Compiler == 'CompilerFolder' }} TestAlGoPrivate: runs-on: [ ubuntu-latest ] @@ -373,36 +286,34 @@ jobs: - name: Calculate parameters id: calculateParams - run: | - $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 - $adminCenterApiCredentials = '' - if ('${{ matrix.type }}' -eq 'PTE' -and '${{ matrix.style }}' -eq 'singleProject' -and '${{ matrix.os }}' -eq 'windows') { - $adminCenterApiCredentials = '${{ Secrets.adminCenterApiCredentials }}' - } - if ('${{ matrix.type }}' -eq 'appSourceApp') { - $template = '${{ needs.Check.outputs.githubowner }}/${{ needs.SetupRepositories.outputs.appSourceAppRepo }}' - } - else { - $template = '${{ needs.Check.outputs.githubowner }}/${{ needs.SetupRepositories.outputs.perTenantExtensionRepo }}' - } - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "adminCenterApiCredentials='$adminCenterApiCredentials'" - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "template='$template'" - $reponame = [System.IO.Path]::GetFileNameWithoutExtension([System.IO.Path]::GetTempFileName()) - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "repoName='$repoName'" - Write-Host "repoName='$repoName'" - Write-Host "Repo URL: https://github.com/${{ needs.Check.outputs.githubowner }}/$repoName" + uses: ./Actions/E2ECalculateTestParams + with: + shell: pwsh + githubOwner: ${{ needs.Check.outputs.githubowner }} + matrixType: ${{ matrix.type }} + matrixStyle: ${{ matrix.style }} + matrixOs: ${{ matrix.os }} + adminCenterApiCredentialsSecret: ${{ secrets.adminCenterApiCredentials }} + appSourceAppRepo: ${{ needs.SetupRepositories.outputs.appSourceAppRepo }} + perTenantExtensionRepo: ${{ needs.SetupRepositories.outputs.perTenantExtensionRepo }} - name: Run tests - run: | - try { - . (Join-Path "." "e2eTests/Test-AL-Go.ps1") -private -github -githubOwner '${{ needs.Check.outputs.githubowner }}' -repoName ${{ steps.calculateParams.outputs.repoName }} -e2eAppId '${{ vars.E2E_APP_ID }}' -e2eAppKey '${{ secrets.E2E_PRIVATE_KEY }}' -algoauthapp '${{ Secrets.ALGOAUTHAPP }}' -template ${{ steps.calculateParams.outputs.template }} -adminCenterApiCredentials ${{ steps.calculateParams.outputs.adminCenterApiCredentials }} -multiProject:('${{ matrix.style }}' -eq 'multiProject') -appSource:('${{ matrix.type }}' -eq 'appSourceApp') -linux:('${{ matrix.os }}' -eq 'linux') -useCompilerFolder:('${{ matrix.Compiler }}' -eq 'CompilerFolder') - } - catch { - Write-Host $_.Exception.Message - Write-Host $_.ScriptStackTrace - Write-Host "::Error::$($_.Exception.Message)" - $host.SetShouldExit(1) - } + uses: ./Actions/E2ERunTest + with: + shell: pwsh + testType: test + private: true + githubOwner: ${{ needs.Check.outputs.githubowner }} + repoName: ${{ steps.calculateParams.outputs.repoName }} + e2eAppId: ${{ vars.E2E_APP_ID }} + e2eAppKey: ${{ secrets.E2E_PRIVATE_KEY }} + algoAuthApp: ${{ secrets.ALGOAUTHAPP }} + template: ${{ steps.calculateParams.outputs.template }} + adminCenterApiCredentials: ${{ steps.calculateParams.outputs.adminCenterApiCredentials }} + multiProject: ${{ matrix.style == 'multiProject' }} + appSource: ${{ matrix.type == 'appSourceApp' }} + linux: ${{ matrix.os == 'linux' }} + useCompilerFolder: ${{ matrix.Compiler == 'CompilerFolder' }} TestAlGoUpgrade: runs-on: [ ubuntu-latest ] @@ -422,31 +333,26 @@ jobs: - name: Calculate parameters id: calculateParams - run: | - $errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 - if ('${{ matrix.type }}' -eq 'appSourceApp') { - $template = '${{ needs.Check.outputs.githubowner }}/${{ needs.SetupRepositories.outputs.appSourceAppRepo }}' - $contentPath = 'appsourceapp' - } - else { - $template = '${{ needs.Check.outputs.githubowner }}/${{ needs.SetupRepositories.outputs.perTenantExtensionRepo }}' - $contentPath = 'pte' - } - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "template='$template'" - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "contentPath='$contentPath'" - $reponame = [System.IO.Path]::GetFileNameWithoutExtension([System.IO.Path]::GetTempFileName()) - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "repoName='$repoName'" - Write-Host "repoName='$repoName'" - Write-Host "Repo URL: https://github.com/${{ needs.Check.outputs.githubowner }}/$repoName" + uses: ./Actions/E2ECalculateTestParams + with: + shell: pwsh + githubOwner: ${{ needs.Check.outputs.githubowner }} + matrixType: ${{ matrix.type }} + appSourceAppRepo: ${{ needs.SetupRepositories.outputs.appSourceAppRepo }} + perTenantExtensionRepo: ${{ needs.SetupRepositories.outputs.perTenantExtensionRepo }} + contentPath: ${{ matrix.type == 'appSourceApp' && 'appsourceapp' || 'pte' }} - name: Run tests - run: | - try { - . (Join-Path "." "e2eTests/Test-AL-Go-Upgrade.ps1") -github -githubOwner '${{ needs.Check.outputs.githubowner }}' -repoName ${{ steps.calculateParams.outputs.repoName }} -e2eAppId '${{ vars.E2E_APP_ID }}' -e2eAppKey '${{ secrets.E2E_PRIVATE_KEY }}' -algoauthapp '${{ Secrets.ALGOAUTHAPP }}' -template ${{ steps.calculateParams.outputs.template }} -appSource:('${{ matrix.type }}' -eq 'appSourceApp') -release '${{ matrix.release }}' -contentPath ${{ steps.calculateParams.outputs.contentPath }} - } - catch { - Write-Host $_.Exception.Message - Write-Host $_.ScriptStackTrace - Write-Host "::Error::$($_.Exception.Message)" - $host.SetShouldExit(1) - } + uses: ./Actions/E2ERunTest + with: + shell: pwsh + testType: upgrade + githubOwner: ${{ needs.Check.outputs.githubowner }} + repoName: ${{ steps.calculateParams.outputs.repoName }} + e2eAppId: ${{ vars.E2E_APP_ID }} + e2eAppKey: ${{ secrets.E2E_PRIVATE_KEY }} + algoAuthApp: ${{ secrets.ALGOAUTHAPP }} + template: ${{ steps.calculateParams.outputs.template }} + appSource: ${{ matrix.type == 'appSourceApp' }} + release: ${{ matrix.release }} + contentPath: ${{ steps.calculateParams.outputs.contentPath }} diff --git a/Actions/E2EAnalyze/E2EAnalyze.ps1 b/Actions/E2EAnalyze/E2EAnalyze.ps1 new file mode 100644 index 000000000..4bdc9e97c --- /dev/null +++ b/Actions/E2EAnalyze/E2EAnalyze.ps1 @@ -0,0 +1,67 @@ +Param( + [Parameter(HelpMessage = "Maximum parallel jobs", Mandatory = $true)] + [int] $maxParallel, + [Parameter(HelpMessage = "Test upgrades from version", Mandatory = $false)] + [string] $testUpgradesFromVersion = 'v5.0' +) + +$errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 +$modulePath = Join-Path "." "e2eTests\e2eTestHelper.psm1" -resolve +Import-Module $modulePath -DisableNameChecking + +$publicTestruns = @{ + "max-parallel" = $maxParallel + "fail-fast" = $false + "matrix" = @{ + "include" = @() + } +} +$privateTestruns = @{ + "max-parallel" = $maxParallel + "fail-fast" = $false + "matrix" = @{ + "include" = @() + } +} +@('appSourceApp','PTE') | ForEach-Object { + $type = $_ + @('linux','windows') | ForEach-Object { + $os = $_ + @('multiProject','singleProject') | ForEach-Object { + $style = $_ + $publicTestruns.matrix.include += @{ "type" = $type; "os" = $os; "style" = $style; "Compiler" = "Container" } + $privateTestruns.matrix.include += @{ "type" = $type; "os" = $os; "style" = $style; "Compiler" = "Container" } + if ($type -eq "PTE") { + # Run end 2 end tests using CompilerFolder with Windows+Linux and single/multiproject + $publicTestruns.matrix.include += @{ "type" = $type; "os" = $os; "style" = $style; "Compiler" = "CompilerFolder" } + } + } + } +} +$publicTestrunsJson = $publicTestruns | ConvertTo-Json -depth 99 -compress +$privateTestrunsJson = $privateTestruns | ConvertTo-Json -depth 99 -compress +Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "publictestruns=$publicTestrunsJson" +Write-Host "publictestruns=$publicTestrunsJson" +Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "privatetestruns=$privateTestrunsJson" +Write-Host "privatetestruns=$privateTestrunsJson" + +$releases = @(gh release list --repo microsoft/AL-Go | ForEach-Object { $_.split("`t")[0] }) | Where-Object { [Version]($_.trimStart('v')) -ge [Version]($testUpgradesFromVersion.TrimStart('v')) } +$releasesJson = @{ + "matrix" = @{ + "include" = @($releases | ForEach-Object { @{ "Release" = $_; "type" = 'appSourceApp' }; @{ "Release" = $_; "type" = 'PTE' } } ) + }; + "max-parallel" = $maxParallel + "fail-fast" = $false +} | ConvertTo-Json -depth 99 -compress +Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "releases=$releasesJson" +Write-Host "releases=$releasesJson" + +$scenariosJson = @{ + "matrix" = @{ + "include" = @(Get-ChildItem -path (Join-Path $ENV:GITHUB_WORKSPACE "e2eTests/scenarios/*/runtest.ps1") | ForEach-Object { @{ "Scenario" = $_.Directory.Name } } ) + }; + "max-parallel" = $maxParallel + "fail-fast" = $false +} | ConvertTo-Json -depth 99 -compress +Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "scenarios=$scenariosJson" +Write-Host "scenarios=$scenariosJson" diff --git a/Actions/E2EAnalyze/action.yaml b/Actions/E2EAnalyze/action.yaml new file mode 100644 index 000000000..c19ef1100 --- /dev/null +++ b/Actions/E2EAnalyze/action.yaml @@ -0,0 +1,47 @@ +name: E2E Analyze +author: Microsoft Corporation +inputs: + shell: + description: Shell in which you want to run the action (powershell or pwsh) + required: false + default: powershell + maxParallel: + description: Maximum parallel jobs + required: true + testUpgradesFromVersion: + description: Test upgrades from version + required: false + default: 'v5.0' + token: + description: GitHub token with permissions to read releases + required: true +outputs: + publictestruns: + description: Public test runs matrix + value: ${{ steps.run.outputs.publictestruns }} + privatetestruns: + description: Private test runs matrix + value: ${{ steps.run.outputs.privatetestruns }} + releases: + description: Releases matrix + value: ${{ steps.run.outputs.releases }} + scenarios: + description: Scenarios matrix + value: ${{ steps.run.outputs.scenarios }} +runs: + using: composite + steps: + - name: run + id: run + shell: ${{ inputs.shell }} + env: + _maxParallel: ${{ inputs.maxParallel }} + _testUpgradesFromVersion: ${{ inputs.testUpgradesFromVersion }} + GH_TOKEN: ${{ inputs.token }} + run: | + ${{ github.action_path }}/../Invoke-AlGoAction.ps1 -ActionName "E2EAnalyze" -Action { + ${{ github.action_path }}/E2EAnalyze.ps1 -maxParallel ([int]$ENV:_maxParallel) -testUpgradesFromVersion $ENV:_testUpgradesFromVersion + } +branding: + icon: activity + color: blue diff --git a/Actions/E2ECalculateRepoName/E2ECalculateRepoName.ps1 b/Actions/E2ECalculateRepoName/E2ECalculateRepoName.ps1 new file mode 100644 index 000000000..14380de66 --- /dev/null +++ b/Actions/E2ECalculateRepoName/E2ECalculateRepoName.ps1 @@ -0,0 +1,12 @@ +Param( + [Parameter(HelpMessage = "GitHub owner for test repositories", Mandatory = $false)] + [string] $githubOwner = '' +) + +$errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 +$reponame = [System.IO.Path]::GetFileNameWithoutExtension([System.IO.Path]::GetTempFileName()) +Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "repoName=$repoName" +Write-Host "repoName=$repoName" +if ($githubOwner) { + Write-Host "Repo URL: https://github.com/$githubOwner/$repoName" +} diff --git a/Actions/E2ECalculateRepoName/action.yaml b/Actions/E2ECalculateRepoName/action.yaml new file mode 100644 index 000000000..904d89a62 --- /dev/null +++ b/Actions/E2ECalculateRepoName/action.yaml @@ -0,0 +1,30 @@ +name: E2E Calculate Repo Name +author: Microsoft Corporation +inputs: + shell: + description: Shell in which you want to run the action (powershell or pwsh) + required: false + default: powershell + githubOwner: + description: GitHub owner for test repositories (optional, for logging purposes) + required: false + default: '' +outputs: + repoName: + description: Generated repository name + value: ${{ steps.run.outputs.repoName }} +runs: + using: composite + steps: + - name: run + id: run + shell: ${{ inputs.shell }} + env: + _githubOwner: ${{ inputs.githubOwner }} + run: | + ${{ github.action_path }}/../Invoke-AlGoAction.ps1 -ActionName "E2ECalculateRepoName" -Action { + ${{ github.action_path }}/E2ECalculateRepoName.ps1 -githubOwner $ENV:_githubOwner + } +branding: + icon: hash + color: blue diff --git a/Actions/E2ECalculateTestParams/E2ECalculateTestParams.ps1 b/Actions/E2ECalculateTestParams/E2ECalculateTestParams.ps1 new file mode 100644 index 000000000..dd93608c2 --- /dev/null +++ b/Actions/E2ECalculateTestParams/E2ECalculateTestParams.ps1 @@ -0,0 +1,66 @@ +Param( + [Parameter(HelpMessage = "GitHub owner for test repositories", Mandatory = $true)] + [string] $githubOwner, + [Parameter(HelpMessage = "Matrix type (PTE or appSourceApp)", Mandatory = $false)] + [string] $matrixType = '', + [Parameter(HelpMessage = "Matrix style (singleProject or multiProject)", Mandatory = $false)] + [string] $matrixStyle = '', + [Parameter(HelpMessage = "Matrix OS (windows or linux)", Mandatory = $false)] + [string] $matrixOs = '', + [Parameter(HelpMessage = "Admin center API credentials secret", Mandatory = $false)] + [string] $adminCenterApiCredentialsSecret = '', + [Parameter(HelpMessage = "AppSource app repository template", Mandatory = $true)] + [string] $appSourceAppRepo, + [Parameter(HelpMessage = "Per-tenant extension repository template", Mandatory = $true)] + [string] $perTenantExtensionRepo, + [Parameter(HelpMessage = "Content path (for upgrade tests)", Mandatory = $false)] + [string] $contentPath = '' +) + +$errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 + +# Calculate adminCenterApiCredentials +$adminCenterApiCredentials = '' +if ($matrixType -eq 'PTE' -and $matrixStyle -eq 'singleProject' -and $matrixOs -eq 'windows') { + $adminCenterApiCredentials = $adminCenterApiCredentialsSecret +} + +# Calculate template +$template = '' +if ($matrixType -eq 'appSourceApp') { + $template = "$githubOwner/$appSourceAppRepo" +} +elseif ($matrixType -eq 'PTE') { + $template = "$githubOwner/$perTenantExtensionRepo" +} +elseif ($matrixType) { + # For upgrade tests or other scenarios + if ($matrixType -eq 'appSourceApp') { + $template = "$githubOwner/$appSourceAppRepo" + } + else { + $template = "$githubOwner/$perTenantExtensionRepo" + } +} + +# Add outputs +if ($adminCenterApiCredentials) { + Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "adminCenterApiCredentials='$adminCenterApiCredentials'" +} +else { + Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "adminCenterApiCredentials=''" +} + +if ($template) { + Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "template='$template'" +} + +if ($contentPath) { + Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "contentPath='$contentPath'" +} + +# Generate repo name +$reponame = [System.IO.Path]::GetFileNameWithoutExtension([System.IO.Path]::GetTempFileName()) +Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "repoName='$repoName'" +Write-Host "repoName='$repoName'" +Write-Host "Repo URL: https://github.com/$githubOwner/$repoName" diff --git a/Actions/E2ECalculateTestParams/action.yaml b/Actions/E2ECalculateTestParams/action.yaml new file mode 100644 index 000000000..c135bdcfe --- /dev/null +++ b/Actions/E2ECalculateTestParams/action.yaml @@ -0,0 +1,71 @@ +name: E2E Calculate Test Parameters +author: Microsoft Corporation +inputs: + shell: + description: Shell in which you want to run the action (powershell or pwsh) + required: false + default: powershell + githubOwner: + description: GitHub owner for test repositories + required: true + matrixType: + description: Matrix type (PTE or appSourceApp) + required: false + default: '' + matrixStyle: + description: Matrix style (singleProject or multiProject) + required: false + default: '' + matrixOs: + description: Matrix OS (windows or linux) + required: false + default: '' + adminCenterApiCredentialsSecret: + description: Admin center API credentials secret + required: false + default: '' + appSourceAppRepo: + description: AppSource app repository template + required: true + perTenantExtensionRepo: + description: Per-tenant extension repository template + required: true + contentPath: + description: Content path (for upgrade tests) + required: false + default: '' +outputs: + adminCenterApiCredentials: + description: Calculated admin center API credentials + value: ${{ steps.run.outputs.adminCenterApiCredentials }} + template: + description: Calculated template repository + value: ${{ steps.run.outputs.template }} + repoName: + description: Generated repository name + value: ${{ steps.run.outputs.repoName }} + contentPath: + description: Content path (for upgrade tests) + value: ${{ steps.run.outputs.contentPath }} +runs: + using: composite + steps: + - name: run + id: run + shell: ${{ inputs.shell }} + env: + _githubOwner: ${{ inputs.githubOwner }} + _matrixType: ${{ inputs.matrixType }} + _matrixStyle: ${{ inputs.matrixStyle }} + _matrixOs: ${{ inputs.matrixOs }} + _adminCenterApiCredentialsSecret: ${{ inputs.adminCenterApiCredentialsSecret }} + _appSourceAppRepo: ${{ inputs.appSourceAppRepo }} + _perTenantExtensionRepo: ${{ inputs.perTenantExtensionRepo }} + _contentPath: ${{ inputs.contentPath }} + run: | + ${{ github.action_path }}/../Invoke-AlGoAction.ps1 -ActionName "E2ECalculateTestParams" -Action { + ${{ github.action_path }}/E2ECalculateTestParams.ps1 -githubOwner $ENV:_githubOwner -matrixType $ENV:_matrixType -matrixStyle $ENV:_matrixStyle -matrixOs $ENV:_matrixOs -adminCenterApiCredentialsSecret $ENV:_adminCenterApiCredentialsSecret -appSourceAppRepo $ENV:_appSourceAppRepo -perTenantExtensionRepo $ENV:_perTenantExtensionRepo -contentPath $ENV:_contentPath + } +branding: + icon: settings + color: blue diff --git a/Actions/E2ECheckSecrets/E2ECheckSecrets.ps1 b/Actions/E2ECheckSecrets/E2ECheckSecrets.ps1 new file mode 100644 index 000000000..acaa96c03 --- /dev/null +++ b/Actions/E2ECheckSecrets/E2ECheckSecrets.ps1 @@ -0,0 +1,56 @@ +Param( + [Parameter(HelpMessage = "GitHub owner (defaults to current repository owner)", Mandatory = $false)] + [string] $githubOwner = '', + [Parameter(HelpMessage = "E2E_APP_ID variable value", Mandatory = $false)] + [string] $e2eAppId = '', + [Parameter(HelpMessage = "E2E_PRIVATE_KEY secret value", Mandatory = $false)] + [string] $e2ePrivateKey = '', + [Parameter(HelpMessage = "ALGOAUTHAPP secret value", Mandatory = $false)] + [string] $algoAuthApp = '', + [Parameter(HelpMessage = "adminCenterApiCredentials secret value", Mandatory = $false)] + [string] $adminCenterApiCredentials = '', + [Parameter(HelpMessage = "E2E_GHPackagesPAT secret value", Mandatory = $false)] + [string] $e2eGHPackagesPAT = '', + [Parameter(HelpMessage = "E2EAZURECREDENTIALS secret value", Mandatory = $false)] + [string] $e2eAzureCredentials = '' +) + +$err = $false +if (($e2eAppId -eq '') -or ($e2ePrivateKey -eq '')){ + Write-Host "::Error::In order to run end to end tests, you need a Secret called E2E_PRIVATE_KEY and a variable called E2E_APP_ID." + $err = $true +} +if ($algoAuthApp -eq '') { + Write-Host "::Error::In order to run end to end tests, you need a Secret called ALGOAUTHAPP" + $err = $true +} +if ($adminCenterApiCredentials -eq '') { + Write-Host "::Error::In order to run end to end tests, you need a Secret called adminCenterApiCredentials" + $err = $true +} +if ($e2eGHPackagesPAT -eq '') { + Write-Host "::Error::In order to run end to end tests, you need a secret called E2E_GHPackagesPAT" + $err = $true +} +if ($e2eAzureCredentials -eq '') { + Write-Host "::Error::In order to run end to end tests, you need a secret called E2EAZURECREDENTIALS" + $err = $true +} +if ($err) { + exit 1 +} +$maxParallel = 99 +if (!($githubOwner)) { + $githubOwner = "$ENV:GITHUB_REPOSITORY_OWNER" +} +$orgmap = Get-Content -path (Join-Path "." "e2eTests\orgmap.json") -encoding UTF8 -raw | ConvertFrom-Json +if ($orgmap.PSObject.Properties.Name -eq $githubOwner) { + $githubOwner = $orgmap."$githubOwner" +} +if ($githubOwner -eq $ENV:GITHUB_REPOSITORY_OWNER) { + $maxParallel = 8 +} +Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "maxParallel=$maxParallel" +Write-Host "maxParallel=$maxParallel" +Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "githubOwner=$githubOwner" +Write-Host "githubOwner=$githubOwner" diff --git a/Actions/E2ECheckSecrets/action.yaml b/Actions/E2ECheckSecrets/action.yaml new file mode 100644 index 000000000..c92439dda --- /dev/null +++ b/Actions/E2ECheckSecrets/action.yaml @@ -0,0 +1,63 @@ +name: E2E Check Secrets +author: Microsoft Corporation +inputs: + shell: + description: Shell in which you want to run the action (powershell or pwsh) + required: false + default: powershell + githubOwner: + description: GitHub owner (defaults to current repository owner) + required: false + default: '' + e2eAppId: + description: E2E_APP_ID variable value + required: false + default: '' + e2ePrivateKey: + description: E2E_PRIVATE_KEY secret value + required: false + default: '' + algoAuthApp: + description: ALGOAUTHAPP secret value + required: false + default: '' + adminCenterApiCredentials: + description: adminCenterApiCredentials secret value + required: false + default: '' + e2eGHPackagesPAT: + description: E2E_GHPackagesPAT secret value + required: false + default: '' + e2eAzureCredentials: + description: E2EAZURECREDENTIALS secret value + required: false + default: '' +outputs: + maxParallel: + description: Maximum number of parallel jobs + value: ${{ steps.run.outputs.maxParallel }} + githubOwner: + description: GitHub owner for test repositories + value: ${{ steps.run.outputs.githubOwner }} +runs: + using: composite + steps: + - name: run + id: run + shell: ${{ inputs.shell }} + env: + _githubOwner: ${{ inputs.githubOwner }} + _e2eAppId: ${{ inputs.e2eAppId }} + _e2ePrivateKey: ${{ inputs.e2ePrivateKey }} + _algoAuthApp: ${{ inputs.algoAuthApp }} + _adminCenterApiCredentials: ${{ inputs.adminCenterApiCredentials }} + _e2eGHPackagesPAT: ${{ inputs.e2eGHPackagesPAT }} + _e2eAzureCredentials: ${{ inputs.e2eAzureCredentials }} + run: | + ${{ github.action_path }}/../Invoke-AlGoAction.ps1 -ActionName "E2ECheckSecrets" -Action { + ${{ github.action_path }}/E2ECheckSecrets.ps1 -githubOwner $ENV:_githubOwner -e2eAppId $ENV:_e2eAppId -e2ePrivateKey $ENV:_e2ePrivateKey -algoAuthApp $ENV:_algoAuthApp -adminCenterApiCredentials $ENV:_adminCenterApiCredentials -e2eGHPackagesPAT $ENV:_e2eGHPackagesPAT -e2eAzureCredentials $ENV:_e2eAzureCredentials + } +branding: + icon: check-circle + color: blue diff --git a/Actions/E2ERunScenario/E2ERunScenario.ps1 b/Actions/E2ERunScenario/E2ERunScenario.ps1 new file mode 100644 index 000000000..67192bb81 --- /dev/null +++ b/Actions/E2ERunScenario/E2ERunScenario.ps1 @@ -0,0 +1,54 @@ +Param( + [Parameter(HelpMessage = "Scenario name", Mandatory = $true)] + [string] $scenario, + [Parameter(HelpMessage = "Run on Linux", Mandatory = $false)] + [bool] $linux = $false, + [Parameter(HelpMessage = "GitHub owner", Mandatory = $true)] + [string] $githubOwner, + [Parameter(HelpMessage = "Repository name", Mandatory = $true)] + [string] $repoName, + [Parameter(HelpMessage = "E2E App ID", Mandatory = $true)] + [string] $e2eAppId, + [Parameter(HelpMessage = "E2E App Key", Mandatory = $true)] + [string] $e2eAppKey, + [Parameter(HelpMessage = "ALGO Auth App", Mandatory = $true)] + [string] $algoAuthApp, + [Parameter(HelpMessage = "PTE template", Mandatory = $true)] + [string] $pteTemplate, + [Parameter(HelpMessage = "AppSource template", Mandatory = $true)] + [string] $appSourceTemplate, + [Parameter(HelpMessage = "Admin center API credentials", Mandatory = $true)] + [string] $adminCenterApiCredentials, + [Parameter(HelpMessage = "Azure credentials", Mandatory = $true)] + [string] $azureCredentials, + [Parameter(HelpMessage = "GitHub packages token", Mandatory = $true)] + [string] $githubPackagesToken +) + +try { + $params = @{ + 'github' = $true + 'githubOwner' = $githubOwner + 'repoName' = $repoName + 'e2eAppId' = $e2eAppId + 'e2eAppKey' = $e2eAppKey + 'algoauthapp' = $algoAuthApp + 'pteTemplate' = $pteTemplate + 'appSourceTemplate' = $appSourceTemplate + 'adminCenterApiCredentials' = $adminCenterApiCredentials + 'azureCredentials' = $azureCredentials + 'githubPackagesToken' = $githubPackagesToken + } + + if ($linux) { + $params['linux'] = $true + } + + . (Join-Path "." "e2eTests/scenarios/$scenario/runtest.ps1") @params +} +catch { + Write-Host $_.Exception.Message + Write-Host $_.ScriptStackTrace + Write-Host "::Error::$($_.Exception.Message)" + $host.SetShouldExit(1) +} diff --git a/Actions/E2ERunScenario/action.yaml b/Actions/E2ERunScenario/action.yaml new file mode 100644 index 000000000..d6dc0aad3 --- /dev/null +++ b/Actions/E2ERunScenario/action.yaml @@ -0,0 +1,70 @@ +name: E2E Run Scenario +author: Microsoft Corporation +inputs: + shell: + description: Shell in which you want to run the action (powershell or pwsh) + required: false + default: powershell + scenario: + description: Scenario name + required: true + linux: + description: Run on Linux + required: false + default: 'false' + githubOwner: + description: GitHub owner + required: true + repoName: + description: Repository name + required: true + e2eAppId: + description: E2E App ID + required: true + e2eAppKey: + description: E2E App Key + required: true + algoAuthApp: + description: ALGO Auth App + required: true + pteTemplate: + description: PTE template + required: true + appSourceTemplate: + description: AppSource template + required: true + adminCenterApiCredentials: + description: Admin center API credentials + required: true + azureCredentials: + description: Azure credentials + required: true + githubPackagesToken: + description: GitHub packages token + required: true +runs: + using: composite + steps: + - name: run + id: run + shell: ${{ inputs.shell }} + env: + _scenario: ${{ inputs.scenario }} + _linux: ${{ inputs.linux }} + _githubOwner: ${{ inputs.githubOwner }} + _repoName: ${{ inputs.repoName }} + _e2eAppId: ${{ inputs.e2eAppId }} + _e2eAppKey: ${{ inputs.e2eAppKey }} + _algoAuthApp: ${{ inputs.algoAuthApp }} + _pteTemplate: ${{ inputs.pteTemplate }} + _appSourceTemplate: ${{ inputs.appSourceTemplate }} + _adminCenterApiCredentials: ${{ inputs.adminCenterApiCredentials }} + _azureCredentials: ${{ inputs.azureCredentials }} + _githubPackagesToken: ${{ inputs.githubPackagesToken }} + run: | + ${{ github.action_path }}/../Invoke-AlGoAction.ps1 -ActionName "E2ERunScenario" -Action { + ${{ github.action_path }}/E2ERunScenario.ps1 -scenario $ENV:_scenario -linux ($ENV:_linux -eq 'true') -githubOwner $ENV:_githubOwner -repoName $ENV:_repoName -e2eAppId $ENV:_e2eAppId -e2eAppKey $ENV:_e2eAppKey -algoAuthApp $ENV:_algoAuthApp -pteTemplate $ENV:_pteTemplate -appSourceTemplate $ENV:_appSourceTemplate -adminCenterApiCredentials $ENV:_adminCenterApiCredentials -azureCredentials $ENV:_azureCredentials -githubPackagesToken $ENV:_githubPackagesToken + } +branding: + icon: play + color: blue diff --git a/Actions/E2ERunTest/E2ERunTest.ps1 b/Actions/E2ERunTest/E2ERunTest.ps1 new file mode 100644 index 000000000..2e834ec34 --- /dev/null +++ b/Actions/E2ERunTest/E2ERunTest.ps1 @@ -0,0 +1,80 @@ +Param( + [Parameter(HelpMessage = "Test type (test or upgrade)", Mandatory = $false)] + [ValidateSet('test', 'upgrade')] + [string] $testType = 'test', + [Parameter(HelpMessage = "Private repository", Mandatory = $false)] + [bool] $private = $false, + [Parameter(HelpMessage = "GitHub owner", Mandatory = $true)] + [string] $githubOwner, + [Parameter(HelpMessage = "Repository name", Mandatory = $true)] + [string] $repoName, + [Parameter(HelpMessage = "E2E App ID", Mandatory = $true)] + [string] $e2eAppId, + [Parameter(HelpMessage = "E2E App Key", Mandatory = $true)] + [string] $e2eAppKey, + [Parameter(HelpMessage = "ALGO Auth App", Mandatory = $true)] + [string] $algoAuthApp, + [Parameter(HelpMessage = "Template", Mandatory = $true)] + [string] $template, + [Parameter(HelpMessage = "Admin center API credentials", Mandatory = $false)] + [string] $adminCenterApiCredentials = '', + [Parameter(HelpMessage = "Multi-project", Mandatory = $false)] + [bool] $multiProject = $false, + [Parameter(HelpMessage = "AppSource app", Mandatory = $false)] + [bool] $appSource = $false, + [Parameter(HelpMessage = "Linux", Mandatory = $false)] + [bool] $linux = $false, + [Parameter(HelpMessage = "Use compiler folder", Mandatory = $false)] + [bool] $useCompilerFolder = $false, + [Parameter(HelpMessage = "Release (for upgrade tests)", Mandatory = $false)] + [string] $release = '', + [Parameter(HelpMessage = "Content path (for upgrade tests)", Mandatory = $false)] + [string] $contentPath = '' +) + +try { + if ($testType -eq 'upgrade') { + $params = @{ + 'github' = $true + 'githubOwner' = $githubOwner + 'repoName' = $repoName + 'e2eAppId' = $e2eAppId + 'e2eAppKey' = $e2eAppKey + 'algoauthapp' = $algoAuthApp + 'template' = $template + 'appSource' = $appSource + 'release' = $release + 'contentPath' = $contentPath + } + + . (Join-Path "." "e2eTests/Test-AL-Go-Upgrade.ps1") @params + } + else { + $params = @{ + 'github' = $true + 'githubOwner' = $githubOwner + 'repoName' = $repoName + 'e2eAppId' = $e2eAppId + 'e2eAppKey' = $e2eAppKey + 'algoauthapp' = $algoAuthApp + 'template' = $template + 'adminCenterApiCredentials' = $adminCenterApiCredentials + 'multiProject' = $multiProject + 'appSource' = $appSource + 'linux' = $linux + 'useCompilerFolder' = $useCompilerFolder + } + + if ($private) { + $params['private'] = $true + } + + . (Join-Path "." "e2eTests/Test-AL-Go.ps1") @params + } +} +catch { + Write-Host $_.Exception.Message + Write-Host $_.ScriptStackTrace + Write-Host "::Error::$($_.Exception.Message)" + $host.SetShouldExit(1) +} diff --git a/Actions/E2ERunTest/action.yaml b/Actions/E2ERunTest/action.yaml new file mode 100644 index 000000000..ac6b096e3 --- /dev/null +++ b/Actions/E2ERunTest/action.yaml @@ -0,0 +1,90 @@ +name: E2E Run Test +author: Microsoft Corporation +inputs: + shell: + description: Shell in which you want to run the action (powershell or pwsh) + required: false + default: powershell + testType: + description: Test type (test or upgrade) + required: false + default: 'test' + private: + description: Private repository + required: false + default: 'false' + githubOwner: + description: GitHub owner + required: true + repoName: + description: Repository name + required: true + e2eAppId: + description: E2E App ID + required: true + e2eAppKey: + description: E2E App Key + required: true + algoAuthApp: + description: ALGO Auth App + required: true + template: + description: Template + required: true + adminCenterApiCredentials: + description: Admin center API credentials + required: false + default: '' + multiProject: + description: Multi-project + required: false + default: 'false' + appSource: + description: AppSource app + required: false + default: 'false' + linux: + description: Linux + required: false + default: 'false' + useCompilerFolder: + description: Use compiler folder + required: false + default: 'false' + release: + description: Release (for upgrade tests) + required: false + default: '' + contentPath: + description: Content path (for upgrade tests) + required: false + default: '' +runs: + using: composite + steps: + - name: run + id: run + shell: ${{ inputs.shell }} + env: + _testType: ${{ inputs.testType }} + _private: ${{ inputs.private }} + _githubOwner: ${{ inputs.githubOwner }} + _repoName: ${{ inputs.repoName }} + _e2eAppId: ${{ inputs.e2eAppId }} + _e2eAppKey: ${{ inputs.e2eAppKey }} + _algoAuthApp: ${{ inputs.algoAuthApp }} + _template: ${{ inputs.template }} + _adminCenterApiCredentials: ${{ inputs.adminCenterApiCredentials }} + _multiProject: ${{ inputs.multiProject }} + _appSource: ${{ inputs.appSource }} + _linux: ${{ inputs.linux }} + _useCompilerFolder: ${{ inputs.useCompilerFolder }} + _release: ${{ inputs.release }} + _contentPath: ${{ inputs.contentPath }} + run: | + ${{ github.action_path }}/../Invoke-AlGoAction.ps1 -ActionName "E2ERunTest" -Action { + ${{ github.action_path }}/E2ERunTest.ps1 -testType $ENV:_testType -private ($ENV:_private -eq 'true') -githubOwner $ENV:_githubOwner -repoName $ENV:_repoName -e2eAppId $ENV:_e2eAppId -e2eAppKey $ENV:_e2eAppKey -algoAuthApp $ENV:_algoAuthApp -template $ENV:_template -adminCenterApiCredentials $ENV:_adminCenterApiCredentials -multiProject ($ENV:_multiProject -eq 'true') -appSource ($ENV:_appSource -eq 'true') -linux ($ENV:_linux -eq 'true') -useCompilerFolder ($ENV:_useCompilerFolder -eq 'true') -release $ENV:_release -contentPath $ENV:_contentPath + } +branding: + icon: check-square + color: blue diff --git a/Actions/E2ESetupRepositories/E2ESetupRepositories.ps1 b/Actions/E2ESetupRepositories/E2ESetupRepositories.ps1 new file mode 100644 index 000000000..6fae79689 --- /dev/null +++ b/Actions/E2ESetupRepositories/E2ESetupRepositories.ps1 @@ -0,0 +1,9 @@ +Param( + [Parameter(HelpMessage = "GitHub owner for test repositories", Mandatory = $true)] + [string] $githubOwner, + [Parameter(HelpMessage = "BcContainerHelper version", Mandatory = $false)] + [string] $bcContainerHelperVersion = '' +) + +$errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 +. (Join-Path "." "e2eTests/SetupRepositories.ps1") -githubOwner $githubOwner -bcContainerHelperVersion $bcContainerHelperVersion diff --git a/Actions/E2ESetupRepositories/action.yaml b/Actions/E2ESetupRepositories/action.yaml new file mode 100644 index 000000000..e10df4c2f --- /dev/null +++ b/Actions/E2ESetupRepositories/action.yaml @@ -0,0 +1,44 @@ +name: E2E Setup Repositories +author: Microsoft Corporation +inputs: + shell: + description: Shell in which you want to run the action (powershell or pwsh) + required: false + default: powershell + githubOwner: + description: GitHub owner for test repositories + required: true + bcContainerHelperVersion: + description: BcContainerHelper version + required: false + default: '' + token: + description: GitHub token with permissions to create repositories + required: true +outputs: + actionsRepo: + description: Actions repository name + value: ${{ steps.run.outputs.actionsRepo }} + perTenantExtensionRepo: + description: Per-tenant extension repository name + value: ${{ steps.run.outputs.perTenantExtensionRepo }} + appSourceAppRepo: + description: AppSource app repository name + value: ${{ steps.run.outputs.appSourceAppRepo }} +runs: + using: composite + steps: + - name: run + id: run + shell: ${{ inputs.shell }} + env: + _githubOwner: ${{ inputs.githubOwner }} + _bcContainerHelperVersion: ${{ inputs.bcContainerHelperVersion }} + GH_TOKEN: ${{ inputs.token }} + run: | + ${{ github.action_path }}/../Invoke-AlGoAction.ps1 -ActionName "E2ESetupRepositories" -Action { + ${{ github.action_path }}/E2ESetupRepositories.ps1 -githubOwner $ENV:_githubOwner -bcContainerHelperVersion $ENV:_bcContainerHelperVersion + } +branding: + icon: git-branch + color: blue From e97149e292e15ff887b8a081841139780508c284 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 18 Nov 2025 14:24:40 +0000 Subject: [PATCH 03/16] Add README documentation for new E2E actions Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com> --- Actions/E2EAnalyze/README.md | 16 ++++++++++++++++ Actions/E2ECalculateRepoName/README.md | 11 +++++++++++ Actions/E2ECalculateTestParams/README.md | 21 +++++++++++++++++++++ Actions/E2ECheckSecrets/README.md | 18 ++++++++++++++++++ Actions/E2ERunScenario/README.md | 18 ++++++++++++++++++ Actions/E2ERunTest/README.md | 21 +++++++++++++++++++++ Actions/E2ESetupRepositories/README.md | 15 +++++++++++++++ 7 files changed, 120 insertions(+) create mode 100644 Actions/E2EAnalyze/README.md create mode 100644 Actions/E2ECalculateRepoName/README.md create mode 100644 Actions/E2ECalculateTestParams/README.md create mode 100644 Actions/E2ECheckSecrets/README.md create mode 100644 Actions/E2ERunScenario/README.md create mode 100644 Actions/E2ERunTest/README.md create mode 100644 Actions/E2ESetupRepositories/README.md diff --git a/Actions/E2EAnalyze/README.md b/Actions/E2EAnalyze/README.md new file mode 100644 index 000000000..5061596d9 --- /dev/null +++ b/Actions/E2EAnalyze/README.md @@ -0,0 +1,16 @@ +# E2E Analyze + +Analyzes and generates test matrices for E2E testing including public/private test runs, releases, and scenarios. + +## Inputs + +- `maxParallel`: Maximum parallel jobs +- `testUpgradesFromVersion`: Test upgrades from version (default: 'v5.0') +- `token`: GitHub token with permissions to read releases + +## Outputs + +- `publictestruns`: Public test runs matrix +- `privatetestruns`: Private test runs matrix +- `releases`: Releases matrix +- `scenarios`: Scenarios matrix diff --git a/Actions/E2ECalculateRepoName/README.md b/Actions/E2ECalculateRepoName/README.md new file mode 100644 index 000000000..28be7d270 --- /dev/null +++ b/Actions/E2ECalculateRepoName/README.md @@ -0,0 +1,11 @@ +# E2E Calculate Repo Name + +Generates a random repository name for E2E testing. + +## Inputs + +- `githubOwner`: GitHub owner for test repositories (optional, for logging purposes) + +## Outputs + +- `repoName`: Generated repository name diff --git a/Actions/E2ECalculateTestParams/README.md b/Actions/E2ECalculateTestParams/README.md new file mode 100644 index 000000000..e9a5aadf3 --- /dev/null +++ b/Actions/E2ECalculateTestParams/README.md @@ -0,0 +1,21 @@ +# E2E Calculate Test Parameters + +Calculates test parameters including template repository, admin center credentials, and repository name based on matrix configuration. + +## Inputs + +- `githubOwner`: GitHub owner for test repositories +- `matrixType`: Matrix type (PTE or appSourceApp) +- `matrixStyle`: Matrix style (singleProject or multiProject) +- `matrixOs`: Matrix OS (windows or linux) +- `adminCenterApiCredentialsSecret`: Admin center API credentials secret +- `appSourceAppRepo`: AppSource app repository template +- `perTenantExtensionRepo`: Per-tenant extension repository template +- `contentPath`: Content path (for upgrade tests) + +## Outputs + +- `adminCenterApiCredentials`: Calculated admin center API credentials +- `template`: Calculated template repository +- `repoName`: Generated repository name +- `contentPath`: Content path (for upgrade tests) diff --git a/Actions/E2ECheckSecrets/README.md b/Actions/E2ECheckSecrets/README.md new file mode 100644 index 000000000..23111251c --- /dev/null +++ b/Actions/E2ECheckSecrets/README.md @@ -0,0 +1,18 @@ +# E2E Check Secrets + +Validates that all required secrets and variables are configured for E2E testing. + +## Inputs + +- `githubOwner`: GitHub owner (defaults to current repository owner) +- `e2eAppId`: E2E_APP_ID variable value +- `e2ePrivateKey`: E2E_PRIVATE_KEY secret value +- `algoAuthApp`: ALGOAUTHAPP secret value +- `adminCenterApiCredentials`: adminCenterApiCredentials secret value +- `e2eGHPackagesPAT`: E2E_GHPackagesPAT secret value +- `e2eAzureCredentials`: E2EAZURECREDENTIALS secret value + +## Outputs + +- `maxParallel`: Maximum number of parallel jobs +- `githubOwner`: GitHub owner for test repositories diff --git a/Actions/E2ERunScenario/README.md b/Actions/E2ERunScenario/README.md new file mode 100644 index 000000000..16b474c43 --- /dev/null +++ b/Actions/E2ERunScenario/README.md @@ -0,0 +1,18 @@ +# E2E Run Scenario + +Runs E2E scenario tests by executing scenario-specific test scripts. + +## Inputs + +- `scenario`: Scenario name +- `linux`: Run on Linux (default: false) +- `githubOwner`: GitHub owner +- `repoName`: Repository name +- `e2eAppId`: E2E App ID +- `e2eAppKey`: E2E App Key +- `algoAuthApp`: ALGO Auth App +- `pteTemplate`: PTE template +- `appSourceTemplate`: AppSource template +- `adminCenterApiCredentials`: Admin center API credentials +- `azureCredentials`: Azure credentials +- `githubPackagesToken`: GitHub packages token diff --git a/Actions/E2ERunTest/README.md b/Actions/E2ERunTest/README.md new file mode 100644 index 000000000..6fe298599 --- /dev/null +++ b/Actions/E2ERunTest/README.md @@ -0,0 +1,21 @@ +# E2E Run Test + +Runs E2E tests by executing Test-AL-Go.ps1 or Test-AL-Go-Upgrade.ps1 scripts. + +## Inputs + +- `testType`: Test type (test or upgrade, default: test) +- `private`: Private repository (default: false) +- `githubOwner`: GitHub owner +- `repoName`: Repository name +- `e2eAppId`: E2E App ID +- `e2eAppKey`: E2E App Key +- `algoAuthApp`: ALGO Auth App +- `template`: Template +- `adminCenterApiCredentials`: Admin center API credentials +- `multiProject`: Multi-project (default: false) +- `appSource`: AppSource app (default: false) +- `linux`: Linux (default: false) +- `useCompilerFolder`: Use compiler folder (default: false) +- `release`: Release (for upgrade tests) +- `contentPath`: Content path (for upgrade tests) diff --git a/Actions/E2ESetupRepositories/README.md b/Actions/E2ESetupRepositories/README.md new file mode 100644 index 000000000..9cc433495 --- /dev/null +++ b/Actions/E2ESetupRepositories/README.md @@ -0,0 +1,15 @@ +# E2E Setup Repositories + +Sets up test repositories for E2E testing by calling the SetupRepositories.ps1 script. + +## Inputs + +- `githubOwner`: GitHub owner for test repositories +- `bcContainerHelperVersion`: BcContainerHelper version +- `token`: GitHub token with permissions to create repositories + +## Outputs + +- `actionsRepo`: Actions repository name +- `perTenantExtensionRepo`: Per-tenant extension repository name +- `appSourceAppRepo`: AppSource app repository name From 0d2f4047714a64e50c6ab9d22171bdfcb6f34357 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 19 Nov 2025 07:24:04 +0000 Subject: [PATCH 04/16] Move E2E actions from Actions/ to .github/actions/ Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com> --- .../actions}/E2EAnalyze/E2EAnalyze.ps1 | 0 .../actions}/E2EAnalyze/README.md | 0 .../actions}/E2EAnalyze/action.yaml | 2 +- .../E2ECalculateRepoName.ps1 | 0 .../actions}/E2ECalculateRepoName/README.md | 0 .../actions}/E2ECalculateRepoName/action.yaml | 2 +- .../E2ECalculateTestParams.ps1 | 0 .../actions}/E2ECalculateTestParams/README.md | 0 .../E2ECalculateTestParams/action.yaml | 2 +- .../E2ECheckSecrets/E2ECheckSecrets.ps1 | 0 .../actions}/E2ECheckSecrets/README.md | 0 .../actions}/E2ECheckSecrets/action.yaml | 2 +- .../E2ERunScenario/E2ERunScenario.ps1 | 0 .../actions}/E2ERunScenario/README.md | 0 .../actions}/E2ERunScenario/action.yaml | 2 +- .../actions}/E2ERunTest/E2ERunTest.ps1 | 0 .../actions}/E2ERunTest/README.md | 0 .../actions}/E2ERunTest/action.yaml | 2 +- .../E2ESetupRepositories.ps1 | 0 .../actions}/E2ESetupRepositories/README.md | 0 .../actions}/E2ESetupRepositories/action.yaml | 2 +- .github/workflows/E2E.yaml | 26 +++++++++---------- 22 files changed, 20 insertions(+), 20 deletions(-) rename {Actions => .github/actions}/E2EAnalyze/E2EAnalyze.ps1 (100%) rename {Actions => .github/actions}/E2EAnalyze/README.md (100%) rename {Actions => .github/actions}/E2EAnalyze/action.yaml (92%) rename {Actions => .github/actions}/E2ECalculateRepoName/E2ECalculateRepoName.ps1 (100%) rename {Actions => .github/actions}/E2ECalculateRepoName/README.md (100%) rename {Actions => .github/actions}/E2ECalculateRepoName/action.yaml (86%) rename {Actions => .github/actions}/E2ECalculateTestParams/E2ECalculateTestParams.ps1 (100%) rename {Actions => .github/actions}/E2ECalculateTestParams/README.md (100%) rename {Actions => .github/actions}/E2ECalculateTestParams/action.yaml (95%) rename {Actions => .github/actions}/E2ECheckSecrets/E2ECheckSecrets.ps1 (100%) rename {Actions => .github/actions}/E2ECheckSecrets/README.md (100%) rename {Actions => .github/actions}/E2ECheckSecrets/action.yaml (94%) rename {Actions => .github/actions}/E2ERunScenario/E2ERunScenario.ps1 (100%) rename {Actions => .github/actions}/E2ERunScenario/README.md (100%) rename {Actions => .github/actions}/E2ERunScenario/action.yaml (95%) rename {Actions => .github/actions}/E2ERunTest/E2ERunTest.ps1 (100%) rename {Actions => .github/actions}/E2ERunTest/README.md (100%) rename {Actions => .github/actions}/E2ERunTest/action.yaml (96%) rename {Actions => .github/actions}/E2ESetupRepositories/E2ESetupRepositories.ps1 (100%) rename {Actions => .github/actions}/E2ESetupRepositories/README.md (100%) rename {Actions => .github/actions}/E2ESetupRepositories/action.yaml (91%) diff --git a/Actions/E2EAnalyze/E2EAnalyze.ps1 b/.github/actions/E2EAnalyze/E2EAnalyze.ps1 similarity index 100% rename from Actions/E2EAnalyze/E2EAnalyze.ps1 rename to .github/actions/E2EAnalyze/E2EAnalyze.ps1 diff --git a/Actions/E2EAnalyze/README.md b/.github/actions/E2EAnalyze/README.md similarity index 100% rename from Actions/E2EAnalyze/README.md rename to .github/actions/E2EAnalyze/README.md diff --git a/Actions/E2EAnalyze/action.yaml b/.github/actions/E2EAnalyze/action.yaml similarity index 92% rename from Actions/E2EAnalyze/action.yaml rename to .github/actions/E2EAnalyze/action.yaml index c19ef1100..e7d1603f6 100644 --- a/Actions/E2EAnalyze/action.yaml +++ b/.github/actions/E2EAnalyze/action.yaml @@ -39,7 +39,7 @@ runs: _testUpgradesFromVersion: ${{ inputs.testUpgradesFromVersion }} GH_TOKEN: ${{ inputs.token }} run: | - ${{ github.action_path }}/../Invoke-AlGoAction.ps1 -ActionName "E2EAnalyze" -Action { + ${{ github.action_path }}/../../../Actions/Invoke-AlGoAction.ps1 -ActionName "E2EAnalyze" -Action { ${{ github.action_path }}/E2EAnalyze.ps1 -maxParallel ([int]$ENV:_maxParallel) -testUpgradesFromVersion $ENV:_testUpgradesFromVersion } branding: diff --git a/Actions/E2ECalculateRepoName/E2ECalculateRepoName.ps1 b/.github/actions/E2ECalculateRepoName/E2ECalculateRepoName.ps1 similarity index 100% rename from Actions/E2ECalculateRepoName/E2ECalculateRepoName.ps1 rename to .github/actions/E2ECalculateRepoName/E2ECalculateRepoName.ps1 diff --git a/Actions/E2ECalculateRepoName/README.md b/.github/actions/E2ECalculateRepoName/README.md similarity index 100% rename from Actions/E2ECalculateRepoName/README.md rename to .github/actions/E2ECalculateRepoName/README.md diff --git a/Actions/E2ECalculateRepoName/action.yaml b/.github/actions/E2ECalculateRepoName/action.yaml similarity index 86% rename from Actions/E2ECalculateRepoName/action.yaml rename to .github/actions/E2ECalculateRepoName/action.yaml index 904d89a62..2547285cc 100644 --- a/Actions/E2ECalculateRepoName/action.yaml +++ b/.github/actions/E2ECalculateRepoName/action.yaml @@ -22,7 +22,7 @@ runs: env: _githubOwner: ${{ inputs.githubOwner }} run: | - ${{ github.action_path }}/../Invoke-AlGoAction.ps1 -ActionName "E2ECalculateRepoName" -Action { + ${{ github.action_path }}/../../../Actions/Invoke-AlGoAction.ps1 -ActionName "E2ECalculateRepoName" -Action { ${{ github.action_path }}/E2ECalculateRepoName.ps1 -githubOwner $ENV:_githubOwner } branding: diff --git a/Actions/E2ECalculateTestParams/E2ECalculateTestParams.ps1 b/.github/actions/E2ECalculateTestParams/E2ECalculateTestParams.ps1 similarity index 100% rename from Actions/E2ECalculateTestParams/E2ECalculateTestParams.ps1 rename to .github/actions/E2ECalculateTestParams/E2ECalculateTestParams.ps1 diff --git a/Actions/E2ECalculateTestParams/README.md b/.github/actions/E2ECalculateTestParams/README.md similarity index 100% rename from Actions/E2ECalculateTestParams/README.md rename to .github/actions/E2ECalculateTestParams/README.md diff --git a/Actions/E2ECalculateTestParams/action.yaml b/.github/actions/E2ECalculateTestParams/action.yaml similarity index 95% rename from Actions/E2ECalculateTestParams/action.yaml rename to .github/actions/E2ECalculateTestParams/action.yaml index c135bdcfe..66d2cc080 100644 --- a/Actions/E2ECalculateTestParams/action.yaml +++ b/.github/actions/E2ECalculateTestParams/action.yaml @@ -63,7 +63,7 @@ runs: _perTenantExtensionRepo: ${{ inputs.perTenantExtensionRepo }} _contentPath: ${{ inputs.contentPath }} run: | - ${{ github.action_path }}/../Invoke-AlGoAction.ps1 -ActionName "E2ECalculateTestParams" -Action { + ${{ github.action_path }}/../../../Actions/Invoke-AlGoAction.ps1 -ActionName "E2ECalculateTestParams" -Action { ${{ github.action_path }}/E2ECalculateTestParams.ps1 -githubOwner $ENV:_githubOwner -matrixType $ENV:_matrixType -matrixStyle $ENV:_matrixStyle -matrixOs $ENV:_matrixOs -adminCenterApiCredentialsSecret $ENV:_adminCenterApiCredentialsSecret -appSourceAppRepo $ENV:_appSourceAppRepo -perTenantExtensionRepo $ENV:_perTenantExtensionRepo -contentPath $ENV:_contentPath } branding: diff --git a/Actions/E2ECheckSecrets/E2ECheckSecrets.ps1 b/.github/actions/E2ECheckSecrets/E2ECheckSecrets.ps1 similarity index 100% rename from Actions/E2ECheckSecrets/E2ECheckSecrets.ps1 rename to .github/actions/E2ECheckSecrets/E2ECheckSecrets.ps1 diff --git a/Actions/E2ECheckSecrets/README.md b/.github/actions/E2ECheckSecrets/README.md similarity index 100% rename from Actions/E2ECheckSecrets/README.md rename to .github/actions/E2ECheckSecrets/README.md diff --git a/Actions/E2ECheckSecrets/action.yaml b/.github/actions/E2ECheckSecrets/action.yaml similarity index 94% rename from Actions/E2ECheckSecrets/action.yaml rename to .github/actions/E2ECheckSecrets/action.yaml index c92439dda..928356d83 100644 --- a/Actions/E2ECheckSecrets/action.yaml +++ b/.github/actions/E2ECheckSecrets/action.yaml @@ -55,7 +55,7 @@ runs: _e2eGHPackagesPAT: ${{ inputs.e2eGHPackagesPAT }} _e2eAzureCredentials: ${{ inputs.e2eAzureCredentials }} run: | - ${{ github.action_path }}/../Invoke-AlGoAction.ps1 -ActionName "E2ECheckSecrets" -Action { + ${{ github.action_path }}/../../../Actions/Invoke-AlGoAction.ps1 -ActionName "E2ECheckSecrets" -Action { ${{ github.action_path }}/E2ECheckSecrets.ps1 -githubOwner $ENV:_githubOwner -e2eAppId $ENV:_e2eAppId -e2ePrivateKey $ENV:_e2ePrivateKey -algoAuthApp $ENV:_algoAuthApp -adminCenterApiCredentials $ENV:_adminCenterApiCredentials -e2eGHPackagesPAT $ENV:_e2eGHPackagesPAT -e2eAzureCredentials $ENV:_e2eAzureCredentials } branding: diff --git a/Actions/E2ERunScenario/E2ERunScenario.ps1 b/.github/actions/E2ERunScenario/E2ERunScenario.ps1 similarity index 100% rename from Actions/E2ERunScenario/E2ERunScenario.ps1 rename to .github/actions/E2ERunScenario/E2ERunScenario.ps1 diff --git a/Actions/E2ERunScenario/README.md b/.github/actions/E2ERunScenario/README.md similarity index 100% rename from Actions/E2ERunScenario/README.md rename to .github/actions/E2ERunScenario/README.md diff --git a/Actions/E2ERunScenario/action.yaml b/.github/actions/E2ERunScenario/action.yaml similarity index 95% rename from Actions/E2ERunScenario/action.yaml rename to .github/actions/E2ERunScenario/action.yaml index d6dc0aad3..7ad17f313 100644 --- a/Actions/E2ERunScenario/action.yaml +++ b/.github/actions/E2ERunScenario/action.yaml @@ -62,7 +62,7 @@ runs: _azureCredentials: ${{ inputs.azureCredentials }} _githubPackagesToken: ${{ inputs.githubPackagesToken }} run: | - ${{ github.action_path }}/../Invoke-AlGoAction.ps1 -ActionName "E2ERunScenario" -Action { + ${{ github.action_path }}/../../../Actions/Invoke-AlGoAction.ps1 -ActionName "E2ERunScenario" -Action { ${{ github.action_path }}/E2ERunScenario.ps1 -scenario $ENV:_scenario -linux ($ENV:_linux -eq 'true') -githubOwner $ENV:_githubOwner -repoName $ENV:_repoName -e2eAppId $ENV:_e2eAppId -e2eAppKey $ENV:_e2eAppKey -algoAuthApp $ENV:_algoAuthApp -pteTemplate $ENV:_pteTemplate -appSourceTemplate $ENV:_appSourceTemplate -adminCenterApiCredentials $ENV:_adminCenterApiCredentials -azureCredentials $ENV:_azureCredentials -githubPackagesToken $ENV:_githubPackagesToken } branding: diff --git a/Actions/E2ERunTest/E2ERunTest.ps1 b/.github/actions/E2ERunTest/E2ERunTest.ps1 similarity index 100% rename from Actions/E2ERunTest/E2ERunTest.ps1 rename to .github/actions/E2ERunTest/E2ERunTest.ps1 diff --git a/Actions/E2ERunTest/README.md b/.github/actions/E2ERunTest/README.md similarity index 100% rename from Actions/E2ERunTest/README.md rename to .github/actions/E2ERunTest/README.md diff --git a/Actions/E2ERunTest/action.yaml b/.github/actions/E2ERunTest/action.yaml similarity index 96% rename from Actions/E2ERunTest/action.yaml rename to .github/actions/E2ERunTest/action.yaml index ac6b096e3..57e613c42 100644 --- a/Actions/E2ERunTest/action.yaml +++ b/.github/actions/E2ERunTest/action.yaml @@ -82,7 +82,7 @@ runs: _release: ${{ inputs.release }} _contentPath: ${{ inputs.contentPath }} run: | - ${{ github.action_path }}/../Invoke-AlGoAction.ps1 -ActionName "E2ERunTest" -Action { + ${{ github.action_path }}/../../../Actions/Invoke-AlGoAction.ps1 -ActionName "E2ERunTest" -Action { ${{ github.action_path }}/E2ERunTest.ps1 -testType $ENV:_testType -private ($ENV:_private -eq 'true') -githubOwner $ENV:_githubOwner -repoName $ENV:_repoName -e2eAppId $ENV:_e2eAppId -e2eAppKey $ENV:_e2eAppKey -algoAuthApp $ENV:_algoAuthApp -template $ENV:_template -adminCenterApiCredentials $ENV:_adminCenterApiCredentials -multiProject ($ENV:_multiProject -eq 'true') -appSource ($ENV:_appSource -eq 'true') -linux ($ENV:_linux -eq 'true') -useCompilerFolder ($ENV:_useCompilerFolder -eq 'true') -release $ENV:_release -contentPath $ENV:_contentPath } branding: diff --git a/Actions/E2ESetupRepositories/E2ESetupRepositories.ps1 b/.github/actions/E2ESetupRepositories/E2ESetupRepositories.ps1 similarity index 100% rename from Actions/E2ESetupRepositories/E2ESetupRepositories.ps1 rename to .github/actions/E2ESetupRepositories/E2ESetupRepositories.ps1 diff --git a/Actions/E2ESetupRepositories/README.md b/.github/actions/E2ESetupRepositories/README.md similarity index 100% rename from Actions/E2ESetupRepositories/README.md rename to .github/actions/E2ESetupRepositories/README.md diff --git a/Actions/E2ESetupRepositories/action.yaml b/.github/actions/E2ESetupRepositories/action.yaml similarity index 91% rename from Actions/E2ESetupRepositories/action.yaml rename to .github/actions/E2ESetupRepositories/action.yaml index e10df4c2f..974f50ffa 100644 --- a/Actions/E2ESetupRepositories/action.yaml +++ b/.github/actions/E2ESetupRepositories/action.yaml @@ -36,7 +36,7 @@ runs: _bcContainerHelperVersion: ${{ inputs.bcContainerHelperVersion }} GH_TOKEN: ${{ inputs.token }} run: | - ${{ github.action_path }}/../Invoke-AlGoAction.ps1 -ActionName "E2ESetupRepositories" -Action { + ${{ github.action_path }}/../../../Actions/Invoke-AlGoAction.ps1 -ActionName "E2ESetupRepositories" -Action { ${{ github.action_path }}/E2ESetupRepositories.ps1 -githubOwner $ENV:_githubOwner -bcContainerHelperVersion $ENV:_bcContainerHelperVersion } branding: diff --git a/.github/workflows/E2E.yaml b/.github/workflows/E2E.yaml index a8a308959..2f62da71b 100644 --- a/.github/workflows/E2E.yaml +++ b/.github/workflows/E2E.yaml @@ -61,7 +61,7 @@ jobs: - name: Check secrets id: check - uses: ./Actions/E2ECheckSecrets + uses: ./.github/actions/E2ECheckSecrets with: shell: pwsh githubOwner: ${{ github.event.inputs.githubOwner }} @@ -99,7 +99,7 @@ jobs: - name: Setup Repositories id: setup - uses: ./Actions/E2ESetupRepositories + uses: ./.github/actions/E2ESetupRepositories with: shell: pwsh githubOwner: ${{ needs.Check.outputs.githubowner }} @@ -134,7 +134,7 @@ jobs: - name: Analyze id: Analyze - uses: ./Actions/E2EAnalyze + uses: ./.github/actions/E2EAnalyze with: shell: pwsh maxParallel: ${{ needs.Check.outputs.maxParallel }} @@ -159,13 +159,13 @@ jobs: - name: Calculate parameters id: calculateParams - uses: ./Actions/E2ECalculateRepoName + uses: ./.github/actions/E2ECalculateRepoName with: shell: pwsh githubOwner: ${{ needs.Check.outputs.githubowner }} - name: Run test on Windows - uses: ./Actions/E2ERunScenario + uses: ./.github/actions/E2ERunScenario with: shell: pwsh scenario: ${{ matrix.scenario }} @@ -199,13 +199,13 @@ jobs: - name: Calculate parameters id: calculateParams - uses: ./Actions/E2ECalculateRepoName + uses: ./.github/actions/E2ECalculateRepoName with: shell: pwsh githubOwner: ${{ needs.Check.outputs.githubowner }} - name: Run tests - uses: ./Actions/E2ERunScenario + uses: ./.github/actions/E2ERunScenario with: shell: pwsh scenario: ${{ matrix.scenario }} @@ -239,7 +239,7 @@ jobs: - name: Calculate parameters id: calculateParams - uses: ./Actions/E2ECalculateTestParams + uses: ./.github/actions/E2ECalculateTestParams with: shell: pwsh githubOwner: ${{ needs.Check.outputs.githubowner }} @@ -251,7 +251,7 @@ jobs: perTenantExtensionRepo: ${{ needs.SetupRepositories.outputs.perTenantExtensionRepo }} - name: Run tests - uses: ./Actions/E2ERunTest + uses: ./.github/actions/E2ERunTest with: shell: pwsh testType: test @@ -286,7 +286,7 @@ jobs: - name: Calculate parameters id: calculateParams - uses: ./Actions/E2ECalculateTestParams + uses: ./.github/actions/E2ECalculateTestParams with: shell: pwsh githubOwner: ${{ needs.Check.outputs.githubowner }} @@ -298,7 +298,7 @@ jobs: perTenantExtensionRepo: ${{ needs.SetupRepositories.outputs.perTenantExtensionRepo }} - name: Run tests - uses: ./Actions/E2ERunTest + uses: ./.github/actions/E2ERunTest with: shell: pwsh testType: test @@ -333,7 +333,7 @@ jobs: - name: Calculate parameters id: calculateParams - uses: ./Actions/E2ECalculateTestParams + uses: ./.github/actions/E2ECalculateTestParams with: shell: pwsh githubOwner: ${{ needs.Check.outputs.githubowner }} @@ -343,7 +343,7 @@ jobs: contentPath: ${{ matrix.type == 'appSourceApp' && 'appsourceapp' || 'pte' }} - name: Run tests - uses: ./Actions/E2ERunTest + uses: ./.github/actions/E2ERunTest with: shell: pwsh testType: upgrade From 7cbba2e3a1d1b588e2fd8c1707f2c30e1e570199 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 19 Nov 2025 09:29:58 +0000 Subject: [PATCH 05/16] Remove Invoke-AlGoAction.ps1 wrapper and call scripts directly Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com> --- .github/actions/E2EAnalyze/action.yaml | 4 +--- .github/actions/E2ECalculateRepoName/action.yaml | 4 +--- .github/actions/E2ECalculateTestParams/action.yaml | 4 +--- .github/actions/E2ECheckSecrets/action.yaml | 4 +--- .github/actions/E2ERunScenario/action.yaml | 4 +--- .github/actions/E2ERunTest/action.yaml | 4 +--- .github/actions/E2ESetupRepositories/action.yaml | 4 +--- 7 files changed, 7 insertions(+), 21 deletions(-) diff --git a/.github/actions/E2EAnalyze/action.yaml b/.github/actions/E2EAnalyze/action.yaml index e7d1603f6..24c17b412 100644 --- a/.github/actions/E2EAnalyze/action.yaml +++ b/.github/actions/E2EAnalyze/action.yaml @@ -39,9 +39,7 @@ runs: _testUpgradesFromVersion: ${{ inputs.testUpgradesFromVersion }} GH_TOKEN: ${{ inputs.token }} run: | - ${{ github.action_path }}/../../../Actions/Invoke-AlGoAction.ps1 -ActionName "E2EAnalyze" -Action { - ${{ github.action_path }}/E2EAnalyze.ps1 -maxParallel ([int]$ENV:_maxParallel) -testUpgradesFromVersion $ENV:_testUpgradesFromVersion - } + ${{ github.action_path }}/E2EAnalyze.ps1 -maxParallel ([int]$ENV:_maxParallel) -testUpgradesFromVersion $ENV:_testUpgradesFromVersion branding: icon: activity color: blue diff --git a/.github/actions/E2ECalculateRepoName/action.yaml b/.github/actions/E2ECalculateRepoName/action.yaml index 2547285cc..392ec651f 100644 --- a/.github/actions/E2ECalculateRepoName/action.yaml +++ b/.github/actions/E2ECalculateRepoName/action.yaml @@ -22,9 +22,7 @@ runs: env: _githubOwner: ${{ inputs.githubOwner }} run: | - ${{ github.action_path }}/../../../Actions/Invoke-AlGoAction.ps1 -ActionName "E2ECalculateRepoName" -Action { - ${{ github.action_path }}/E2ECalculateRepoName.ps1 -githubOwner $ENV:_githubOwner - } + ${{ github.action_path }}/E2ECalculateRepoName.ps1 -githubOwner $ENV:_githubOwner branding: icon: hash color: blue diff --git a/.github/actions/E2ECalculateTestParams/action.yaml b/.github/actions/E2ECalculateTestParams/action.yaml index 66d2cc080..1805ab1e4 100644 --- a/.github/actions/E2ECalculateTestParams/action.yaml +++ b/.github/actions/E2ECalculateTestParams/action.yaml @@ -63,9 +63,7 @@ runs: _perTenantExtensionRepo: ${{ inputs.perTenantExtensionRepo }} _contentPath: ${{ inputs.contentPath }} run: | - ${{ github.action_path }}/../../../Actions/Invoke-AlGoAction.ps1 -ActionName "E2ECalculateTestParams" -Action { - ${{ github.action_path }}/E2ECalculateTestParams.ps1 -githubOwner $ENV:_githubOwner -matrixType $ENV:_matrixType -matrixStyle $ENV:_matrixStyle -matrixOs $ENV:_matrixOs -adminCenterApiCredentialsSecret $ENV:_adminCenterApiCredentialsSecret -appSourceAppRepo $ENV:_appSourceAppRepo -perTenantExtensionRepo $ENV:_perTenantExtensionRepo -contentPath $ENV:_contentPath - } + ${{ github.action_path }}/E2ECalculateTestParams.ps1 -githubOwner $ENV:_githubOwner -matrixType $ENV:_matrixType -matrixStyle $ENV:_matrixStyle -matrixOs $ENV:_matrixOs -adminCenterApiCredentialsSecret $ENV:_adminCenterApiCredentialsSecret -appSourceAppRepo $ENV:_appSourceAppRepo -perTenantExtensionRepo $ENV:_perTenantExtensionRepo -contentPath $ENV:_contentPath branding: icon: settings color: blue diff --git a/.github/actions/E2ECheckSecrets/action.yaml b/.github/actions/E2ECheckSecrets/action.yaml index 928356d83..5a127e483 100644 --- a/.github/actions/E2ECheckSecrets/action.yaml +++ b/.github/actions/E2ECheckSecrets/action.yaml @@ -55,9 +55,7 @@ runs: _e2eGHPackagesPAT: ${{ inputs.e2eGHPackagesPAT }} _e2eAzureCredentials: ${{ inputs.e2eAzureCredentials }} run: | - ${{ github.action_path }}/../../../Actions/Invoke-AlGoAction.ps1 -ActionName "E2ECheckSecrets" -Action { - ${{ github.action_path }}/E2ECheckSecrets.ps1 -githubOwner $ENV:_githubOwner -e2eAppId $ENV:_e2eAppId -e2ePrivateKey $ENV:_e2ePrivateKey -algoAuthApp $ENV:_algoAuthApp -adminCenterApiCredentials $ENV:_adminCenterApiCredentials -e2eGHPackagesPAT $ENV:_e2eGHPackagesPAT -e2eAzureCredentials $ENV:_e2eAzureCredentials - } + ${{ github.action_path }}/E2ECheckSecrets.ps1 -githubOwner $ENV:_githubOwner -e2eAppId $ENV:_e2eAppId -e2ePrivateKey $ENV:_e2ePrivateKey -algoAuthApp $ENV:_algoAuthApp -adminCenterApiCredentials $ENV:_adminCenterApiCredentials -e2eGHPackagesPAT $ENV:_e2eGHPackagesPAT -e2eAzureCredentials $ENV:_e2eAzureCredentials branding: icon: check-circle color: blue diff --git a/.github/actions/E2ERunScenario/action.yaml b/.github/actions/E2ERunScenario/action.yaml index 7ad17f313..be1fca27a 100644 --- a/.github/actions/E2ERunScenario/action.yaml +++ b/.github/actions/E2ERunScenario/action.yaml @@ -62,9 +62,7 @@ runs: _azureCredentials: ${{ inputs.azureCredentials }} _githubPackagesToken: ${{ inputs.githubPackagesToken }} run: | - ${{ github.action_path }}/../../../Actions/Invoke-AlGoAction.ps1 -ActionName "E2ERunScenario" -Action { - ${{ github.action_path }}/E2ERunScenario.ps1 -scenario $ENV:_scenario -linux ($ENV:_linux -eq 'true') -githubOwner $ENV:_githubOwner -repoName $ENV:_repoName -e2eAppId $ENV:_e2eAppId -e2eAppKey $ENV:_e2eAppKey -algoAuthApp $ENV:_algoAuthApp -pteTemplate $ENV:_pteTemplate -appSourceTemplate $ENV:_appSourceTemplate -adminCenterApiCredentials $ENV:_adminCenterApiCredentials -azureCredentials $ENV:_azureCredentials -githubPackagesToken $ENV:_githubPackagesToken - } + ${{ github.action_path }}/E2ERunScenario.ps1 -scenario $ENV:_scenario -linux ($ENV:_linux -eq 'true') -githubOwner $ENV:_githubOwner -repoName $ENV:_repoName -e2eAppId $ENV:_e2eAppId -e2eAppKey $ENV:_e2eAppKey -algoAuthApp $ENV:_algoAuthApp -pteTemplate $ENV:_pteTemplate -appSourceTemplate $ENV:_appSourceTemplate -adminCenterApiCredentials $ENV:_adminCenterApiCredentials -azureCredentials $ENV:_azureCredentials -githubPackagesToken $ENV:_githubPackagesToken branding: icon: play color: blue diff --git a/.github/actions/E2ERunTest/action.yaml b/.github/actions/E2ERunTest/action.yaml index 57e613c42..fb3c1800a 100644 --- a/.github/actions/E2ERunTest/action.yaml +++ b/.github/actions/E2ERunTest/action.yaml @@ -82,9 +82,7 @@ runs: _release: ${{ inputs.release }} _contentPath: ${{ inputs.contentPath }} run: | - ${{ github.action_path }}/../../../Actions/Invoke-AlGoAction.ps1 -ActionName "E2ERunTest" -Action { - ${{ github.action_path }}/E2ERunTest.ps1 -testType $ENV:_testType -private ($ENV:_private -eq 'true') -githubOwner $ENV:_githubOwner -repoName $ENV:_repoName -e2eAppId $ENV:_e2eAppId -e2eAppKey $ENV:_e2eAppKey -algoAuthApp $ENV:_algoAuthApp -template $ENV:_template -adminCenterApiCredentials $ENV:_adminCenterApiCredentials -multiProject ($ENV:_multiProject -eq 'true') -appSource ($ENV:_appSource -eq 'true') -linux ($ENV:_linux -eq 'true') -useCompilerFolder ($ENV:_useCompilerFolder -eq 'true') -release $ENV:_release -contentPath $ENV:_contentPath - } + ${{ github.action_path }}/E2ERunTest.ps1 -testType $ENV:_testType -private ($ENV:_private -eq 'true') -githubOwner $ENV:_githubOwner -repoName $ENV:_repoName -e2eAppId $ENV:_e2eAppId -e2eAppKey $ENV:_e2eAppKey -algoAuthApp $ENV:_algoAuthApp -template $ENV:_template -adminCenterApiCredentials $ENV:_adminCenterApiCredentials -multiProject ($ENV:_multiProject -eq 'true') -appSource ($ENV:_appSource -eq 'true') -linux ($ENV:_linux -eq 'true') -useCompilerFolder ($ENV:_useCompilerFolder -eq 'true') -release $ENV:_release -contentPath $ENV:_contentPath branding: icon: check-square color: blue diff --git a/.github/actions/E2ESetupRepositories/action.yaml b/.github/actions/E2ESetupRepositories/action.yaml index 974f50ffa..88110a092 100644 --- a/.github/actions/E2ESetupRepositories/action.yaml +++ b/.github/actions/E2ESetupRepositories/action.yaml @@ -36,9 +36,7 @@ runs: _bcContainerHelperVersion: ${{ inputs.bcContainerHelperVersion }} GH_TOKEN: ${{ inputs.token }} run: | - ${{ github.action_path }}/../../../Actions/Invoke-AlGoAction.ps1 -ActionName "E2ESetupRepositories" -Action { - ${{ github.action_path }}/E2ESetupRepositories.ps1 -githubOwner $ENV:_githubOwner -bcContainerHelperVersion $ENV:_bcContainerHelperVersion - } + ${{ github.action_path }}/E2ESetupRepositories.ps1 -githubOwner $ENV:_githubOwner -bcContainerHelperVersion $ENV:_bcContainerHelperVersion branding: icon: git-branch color: blue From e6a2b0d3ba938c6176ebc6c223bba5165e80552d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 19 Nov 2025 11:44:32 +0000 Subject: [PATCH 06/16] Fix code scanning and pre-commit issues in E2E actions Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com> --- .github/actions/E2EAnalyze/E2EAnalyze.ps1 | 4 ++-- .../actions/E2ECalculateRepoName/E2ECalculateRepoName.ps1 | 2 +- .../E2ECalculateTestParams/E2ECalculateTestParams.ps1 | 2 +- .github/actions/E2ECheckSecrets/E2ECheckSecrets.ps1 | 6 ++++-- .github/actions/E2ERunScenario/E2ERunScenario.ps1 | 6 ++++-- .github/actions/E2ERunTest/E2ERunTest.ps1 | 8 +++++--- .../actions/E2ESetupRepositories/E2ESetupRepositories.ps1 | 2 +- 7 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/actions/E2EAnalyze/E2EAnalyze.ps1 b/.github/actions/E2EAnalyze/E2EAnalyze.ps1 index 4bdc9e97c..3174c659b 100644 --- a/.github/actions/E2EAnalyze/E2EAnalyze.ps1 +++ b/.github/actions/E2EAnalyze/E2EAnalyze.ps1 @@ -5,8 +5,8 @@ Param( [string] $testUpgradesFromVersion = 'v5.0' ) -$errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 -$modulePath = Join-Path "." "e2eTests\e2eTestHelper.psm1" -resolve +$ErrorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 +$modulePath = Join-Path "." "e2eTests/e2eTestHelper.psm1" -resolve Import-Module $modulePath -DisableNameChecking $publicTestruns = @{ diff --git a/.github/actions/E2ECalculateRepoName/E2ECalculateRepoName.ps1 b/.github/actions/E2ECalculateRepoName/E2ECalculateRepoName.ps1 index 14380de66..9c5c7bfa8 100644 --- a/.github/actions/E2ECalculateRepoName/E2ECalculateRepoName.ps1 +++ b/.github/actions/E2ECalculateRepoName/E2ECalculateRepoName.ps1 @@ -3,7 +3,7 @@ Param( [string] $githubOwner = '' ) -$errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 +$ErrorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 $reponame = [System.IO.Path]::GetFileNameWithoutExtension([System.IO.Path]::GetTempFileName()) Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "repoName=$repoName" Write-Host "repoName=$repoName" diff --git a/.github/actions/E2ECalculateTestParams/E2ECalculateTestParams.ps1 b/.github/actions/E2ECalculateTestParams/E2ECalculateTestParams.ps1 index dd93608c2..2f8d18f83 100644 --- a/.github/actions/E2ECalculateTestParams/E2ECalculateTestParams.ps1 +++ b/.github/actions/E2ECalculateTestParams/E2ECalculateTestParams.ps1 @@ -17,7 +17,7 @@ Param( [string] $contentPath = '' ) -$errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 +$ErrorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 # Calculate adminCenterApiCredentials $adminCenterApiCredentials = '' diff --git a/.github/actions/E2ECheckSecrets/E2ECheckSecrets.ps1 b/.github/actions/E2ECheckSecrets/E2ECheckSecrets.ps1 index acaa96c03..73fb0a44c 100644 --- a/.github/actions/E2ECheckSecrets/E2ECheckSecrets.ps1 +++ b/.github/actions/E2ECheckSecrets/E2ECheckSecrets.ps1 @@ -15,6 +15,8 @@ Param( [string] $e2eAzureCredentials = '' ) +$ErrorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 + $err = $false if (($e2eAppId -eq '') -or ($e2ePrivateKey -eq '')){ Write-Host "::Error::In order to run end to end tests, you need a Secret called E2E_PRIVATE_KEY and a variable called E2E_APP_ID." @@ -41,9 +43,9 @@ if ($err) { } $maxParallel = 99 if (!($githubOwner)) { - $githubOwner = "$ENV:GITHUB_REPOSITORY_OWNER" + $githubOwner = $ENV:GITHUB_REPOSITORY_OWNER } -$orgmap = Get-Content -path (Join-Path "." "e2eTests\orgmap.json") -encoding UTF8 -raw | ConvertFrom-Json +$orgmap = Get-Content -path (Join-Path "." "e2eTests/orgmap.json") -encoding UTF8 -raw | ConvertFrom-Json if ($orgmap.PSObject.Properties.Name -eq $githubOwner) { $githubOwner = $orgmap."$githubOwner" } diff --git a/.github/actions/E2ERunScenario/E2ERunScenario.ps1 b/.github/actions/E2ERunScenario/E2ERunScenario.ps1 index 67192bb81..77bd92bea 100644 --- a/.github/actions/E2ERunScenario/E2ERunScenario.ps1 +++ b/.github/actions/E2ERunScenario/E2ERunScenario.ps1 @@ -25,6 +25,8 @@ Param( [string] $githubPackagesToken ) +$ErrorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 + try { $params = @{ 'github' = $true @@ -39,11 +41,11 @@ try { 'azureCredentials' = $azureCredentials 'githubPackagesToken' = $githubPackagesToken } - + if ($linux) { $params['linux'] = $true } - + . (Join-Path "." "e2eTests/scenarios/$scenario/runtest.ps1") @params } catch { diff --git a/.github/actions/E2ERunTest/E2ERunTest.ps1 b/.github/actions/E2ERunTest/E2ERunTest.ps1 index 2e834ec34..ded44499e 100644 --- a/.github/actions/E2ERunTest/E2ERunTest.ps1 +++ b/.github/actions/E2ERunTest/E2ERunTest.ps1 @@ -32,6 +32,8 @@ Param( [string] $contentPath = '' ) +$ErrorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 + try { if ($testType -eq 'upgrade') { $params = @{ @@ -46,7 +48,7 @@ try { 'release' = $release 'contentPath' = $contentPath } - + . (Join-Path "." "e2eTests/Test-AL-Go-Upgrade.ps1") @params } else { @@ -64,11 +66,11 @@ try { 'linux' = $linux 'useCompilerFolder' = $useCompilerFolder } - + if ($private) { $params['private'] = $true } - + . (Join-Path "." "e2eTests/Test-AL-Go.ps1") @params } } diff --git a/.github/actions/E2ESetupRepositories/E2ESetupRepositories.ps1 b/.github/actions/E2ESetupRepositories/E2ESetupRepositories.ps1 index 6fae79689..9ccdd5b49 100644 --- a/.github/actions/E2ESetupRepositories/E2ESetupRepositories.ps1 +++ b/.github/actions/E2ESetupRepositories/E2ESetupRepositories.ps1 @@ -5,5 +5,5 @@ Param( [string] $bcContainerHelperVersion = '' ) -$errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 +$ErrorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 . (Join-Path "." "e2eTests/SetupRepositories.ps1") -githubOwner $githubOwner -bcContainerHelperVersion $bcContainerHelperVersion From 32499d0e330c267578a82ad4b12f2c1ed7268f3d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 19 Nov 2025 15:03:06 +0000 Subject: [PATCH 07/16] Remove invalid shell inputs and fix duplicate contentPath logic Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com> --- .../E2ECalculateTestParams.ps1 | 9 +++++---- .github/workflows/E2E.yaml | 14 -------------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/.github/actions/E2ECalculateTestParams/E2ECalculateTestParams.ps1 b/.github/actions/E2ECalculateTestParams/E2ECalculateTestParams.ps1 index 2f8d18f83..f468ad773 100644 --- a/.github/actions/E2ECalculateTestParams/E2ECalculateTestParams.ps1 +++ b/.github/actions/E2ECalculateTestParams/E2ECalculateTestParams.ps1 @@ -33,13 +33,14 @@ if ($matrixType -eq 'appSourceApp') { elseif ($matrixType -eq 'PTE') { $template = "$githubOwner/$perTenantExtensionRepo" } -elseif ($matrixType) { - # For upgrade tests or other scenarios + +# Calculate contentPath if not provided +if (-not $contentPath -and $matrixType) { if ($matrixType -eq 'appSourceApp') { - $template = "$githubOwner/$appSourceAppRepo" + $contentPath = 'appsourceapp' } else { - $template = "$githubOwner/$perTenantExtensionRepo" + $contentPath = 'pte' } } diff --git a/.github/workflows/E2E.yaml b/.github/workflows/E2E.yaml index 2f62da71b..1e3e9b6e0 100644 --- a/.github/workflows/E2E.yaml +++ b/.github/workflows/E2E.yaml @@ -63,7 +63,6 @@ jobs: id: check uses: ./.github/actions/E2ECheckSecrets with: - shell: pwsh githubOwner: ${{ github.event.inputs.githubOwner }} e2eAppId: ${{ vars.E2E_APP_ID }} e2ePrivateKey: ${{ secrets.E2E_PRIVATE_KEY }} @@ -101,7 +100,6 @@ jobs: id: setup uses: ./.github/actions/E2ESetupRepositories with: - shell: pwsh githubOwner: ${{ needs.Check.outputs.githubowner }} bcContainerHelperVersion: ${{ github.event.inputs.bcContainerHelperVersion }} token: ${{ steps.app-token.outputs.token }} @@ -136,7 +134,6 @@ jobs: id: Analyze uses: ./.github/actions/E2EAnalyze with: - shell: pwsh maxParallel: ${{ needs.Check.outputs.maxParallel }} testUpgradesFromVersion: ${{ env.TestUpgradesFromVersion }} token: ${{ steps.app-token.outputs.token }} @@ -161,13 +158,11 @@ jobs: id: calculateParams uses: ./.github/actions/E2ECalculateRepoName with: - shell: pwsh githubOwner: ${{ needs.Check.outputs.githubowner }} - name: Run test on Windows uses: ./.github/actions/E2ERunScenario with: - shell: pwsh scenario: ${{ matrix.scenario }} linux: false githubOwner: ${{ needs.Check.outputs.githubowner }} @@ -201,13 +196,11 @@ jobs: id: calculateParams uses: ./.github/actions/E2ECalculateRepoName with: - shell: pwsh githubOwner: ${{ needs.Check.outputs.githubowner }} - name: Run tests uses: ./.github/actions/E2ERunScenario with: - shell: pwsh scenario: ${{ matrix.scenario }} linux: true githubOwner: ${{ needs.Check.outputs.githubowner }} @@ -241,7 +234,6 @@ jobs: id: calculateParams uses: ./.github/actions/E2ECalculateTestParams with: - shell: pwsh githubOwner: ${{ needs.Check.outputs.githubowner }} matrixType: ${{ matrix.type }} matrixStyle: ${{ matrix.style }} @@ -253,7 +245,6 @@ jobs: - name: Run tests uses: ./.github/actions/E2ERunTest with: - shell: pwsh testType: test private: false githubOwner: ${{ needs.Check.outputs.githubowner }} @@ -288,7 +279,6 @@ jobs: id: calculateParams uses: ./.github/actions/E2ECalculateTestParams with: - shell: pwsh githubOwner: ${{ needs.Check.outputs.githubowner }} matrixType: ${{ matrix.type }} matrixStyle: ${{ matrix.style }} @@ -300,7 +290,6 @@ jobs: - name: Run tests uses: ./.github/actions/E2ERunTest with: - shell: pwsh testType: test private: true githubOwner: ${{ needs.Check.outputs.githubowner }} @@ -335,17 +324,14 @@ jobs: id: calculateParams uses: ./.github/actions/E2ECalculateTestParams with: - shell: pwsh githubOwner: ${{ needs.Check.outputs.githubowner }} matrixType: ${{ matrix.type }} appSourceAppRepo: ${{ needs.SetupRepositories.outputs.appSourceAppRepo }} perTenantExtensionRepo: ${{ needs.SetupRepositories.outputs.perTenantExtensionRepo }} - contentPath: ${{ matrix.type == 'appSourceApp' && 'appsourceapp' || 'pte' }} - name: Run tests uses: ./.github/actions/E2ERunTest with: - shell: pwsh testType: upgrade githubOwner: ${{ needs.Check.outputs.githubowner }} repoName: ${{ steps.calculateParams.outputs.repoName }} From da92269392f13cbec33aa44b52d38b60f7b1e720 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 25 Nov 2025 09:40:32 +0000 Subject: [PATCH 08/16] Fix E2E failure: change default shell from 'powershell' to 'pwsh' for Linux compatibility Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com> --- .github/actions/E2EAnalyze/action.yaml | 2 +- .github/actions/E2ECalculateRepoName/action.yaml | 2 +- .github/actions/E2ECalculateTestParams/action.yaml | 2 +- .github/actions/E2ECheckSecrets/action.yaml | 2 +- .github/actions/E2ERunScenario/action.yaml | 2 +- .github/actions/E2ERunTest/action.yaml | 2 +- .github/actions/E2ESetupRepositories/action.yaml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/actions/E2EAnalyze/action.yaml b/.github/actions/E2EAnalyze/action.yaml index 24c17b412..d504cca0a 100644 --- a/.github/actions/E2EAnalyze/action.yaml +++ b/.github/actions/E2EAnalyze/action.yaml @@ -4,7 +4,7 @@ inputs: shell: description: Shell in which you want to run the action (powershell or pwsh) required: false - default: powershell + default: pwsh maxParallel: description: Maximum parallel jobs required: true diff --git a/.github/actions/E2ECalculateRepoName/action.yaml b/.github/actions/E2ECalculateRepoName/action.yaml index 392ec651f..fd94339b8 100644 --- a/.github/actions/E2ECalculateRepoName/action.yaml +++ b/.github/actions/E2ECalculateRepoName/action.yaml @@ -4,7 +4,7 @@ inputs: shell: description: Shell in which you want to run the action (powershell or pwsh) required: false - default: powershell + default: pwsh githubOwner: description: GitHub owner for test repositories (optional, for logging purposes) required: false diff --git a/.github/actions/E2ECalculateTestParams/action.yaml b/.github/actions/E2ECalculateTestParams/action.yaml index 1805ab1e4..9305f7b49 100644 --- a/.github/actions/E2ECalculateTestParams/action.yaml +++ b/.github/actions/E2ECalculateTestParams/action.yaml @@ -4,7 +4,7 @@ inputs: shell: description: Shell in which you want to run the action (powershell or pwsh) required: false - default: powershell + default: pwsh githubOwner: description: GitHub owner for test repositories required: true diff --git a/.github/actions/E2ECheckSecrets/action.yaml b/.github/actions/E2ECheckSecrets/action.yaml index 5a127e483..806a1da55 100644 --- a/.github/actions/E2ECheckSecrets/action.yaml +++ b/.github/actions/E2ECheckSecrets/action.yaml @@ -4,7 +4,7 @@ inputs: shell: description: Shell in which you want to run the action (powershell or pwsh) required: false - default: powershell + default: pwsh githubOwner: description: GitHub owner (defaults to current repository owner) required: false diff --git a/.github/actions/E2ERunScenario/action.yaml b/.github/actions/E2ERunScenario/action.yaml index be1fca27a..ffe937c90 100644 --- a/.github/actions/E2ERunScenario/action.yaml +++ b/.github/actions/E2ERunScenario/action.yaml @@ -4,7 +4,7 @@ inputs: shell: description: Shell in which you want to run the action (powershell or pwsh) required: false - default: powershell + default: pwsh scenario: description: Scenario name required: true diff --git a/.github/actions/E2ERunTest/action.yaml b/.github/actions/E2ERunTest/action.yaml index fb3c1800a..99aa277cc 100644 --- a/.github/actions/E2ERunTest/action.yaml +++ b/.github/actions/E2ERunTest/action.yaml @@ -4,7 +4,7 @@ inputs: shell: description: Shell in which you want to run the action (powershell or pwsh) required: false - default: powershell + default: pwsh testType: description: Test type (test or upgrade) required: false diff --git a/.github/actions/E2ESetupRepositories/action.yaml b/.github/actions/E2ESetupRepositories/action.yaml index 88110a092..d0e8f601d 100644 --- a/.github/actions/E2ESetupRepositories/action.yaml +++ b/.github/actions/E2ESetupRepositories/action.yaml @@ -4,7 +4,7 @@ inputs: shell: description: Shell in which you want to run the action (powershell or pwsh) required: false - default: powershell + default: pwsh githubOwner: description: GitHub owner for test repositories required: true From 5a002419525946a3d2b94bdfda311f852580e89d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 28 Nov 2025 14:39:17 +0000 Subject: [PATCH 09/16] Add scenariosFilter parameter support to E2EAnalyze action Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com> --- .github/actions/E2EAnalyze/E2EAnalyze.ps1 | 10 ++++++++-- .github/actions/E2EAnalyze/action.yaml | 7 ++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/actions/E2EAnalyze/E2EAnalyze.ps1 b/.github/actions/E2EAnalyze/E2EAnalyze.ps1 index 3174c659b..a2d32fc2f 100644 --- a/.github/actions/E2EAnalyze/E2EAnalyze.ps1 +++ b/.github/actions/E2EAnalyze/E2EAnalyze.ps1 @@ -2,7 +2,9 @@ Param( [Parameter(HelpMessage = "Maximum parallel jobs", Mandatory = $true)] [int] $maxParallel, [Parameter(HelpMessage = "Test upgrades from version", Mandatory = $false)] - [string] $testUpgradesFromVersion = 'v5.0' + [string] $testUpgradesFromVersion = 'v5.0', + [Parameter(HelpMessage = "Filter to run specific scenarios (separated by comma, supports wildcards)", Mandatory = $false)] + [string] $scenariosFilter = '*' ) $ErrorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 @@ -56,9 +58,13 @@ $releasesJson = @{ Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "releases=$releasesJson" Write-Host "releases=$releasesJson" +$scenariosFilterArr = $scenariosFilter -split ',' | ForEach-Object { $_.Trim() } | Where-Object { $_ -ne '' } +$allScenarios = @(Get-ChildItem -Path (Join-Path $ENV:GITHUB_WORKSPACE "e2eTests/scenarios/*/runtest.ps1") | ForEach-Object { $_.Directory.Name }) +$filteredScenarios = $allScenarios | Where-Object { $scenario = $_; $scenariosFilterArr | ForEach-Object { $scenario -like $_ } } + $scenariosJson = @{ "matrix" = @{ - "include" = @(Get-ChildItem -path (Join-Path $ENV:GITHUB_WORKSPACE "e2eTests/scenarios/*/runtest.ps1") | ForEach-Object { @{ "Scenario" = $_.Directory.Name } } ) + "include" = @($filteredScenarios | ForEach-Object { @{ "Scenario" = $_ } }) }; "max-parallel" = $maxParallel "fail-fast" = $false diff --git a/.github/actions/E2EAnalyze/action.yaml b/.github/actions/E2EAnalyze/action.yaml index d504cca0a..f05bd6da6 100644 --- a/.github/actions/E2EAnalyze/action.yaml +++ b/.github/actions/E2EAnalyze/action.yaml @@ -12,6 +12,10 @@ inputs: description: Test upgrades from version required: false default: 'v5.0' + scenariosFilter: + description: Filter to run specific scenarios (separated by comma, supports wildcards) + required: false + default: '*' token: description: GitHub token with permissions to read releases required: true @@ -37,9 +41,10 @@ runs: env: _maxParallel: ${{ inputs.maxParallel }} _testUpgradesFromVersion: ${{ inputs.testUpgradesFromVersion }} + _scenariosFilter: ${{ inputs.scenariosFilter }} GH_TOKEN: ${{ inputs.token }} run: | - ${{ github.action_path }}/E2EAnalyze.ps1 -maxParallel ([int]$ENV:_maxParallel) -testUpgradesFromVersion $ENV:_testUpgradesFromVersion + ${{ github.action_path }}/E2EAnalyze.ps1 -maxParallel ([int]$ENV:_maxParallel) -testUpgradesFromVersion $ENV:_testUpgradesFromVersion -scenariosFilter $ENV:_scenariosFilter branding: icon: activity color: blue From 26a871625c8878a233debe3cf29f08a749c36e23 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Dec 2025 07:33:34 +0000 Subject: [PATCH 10/16] Pass scenariosFilter input to E2EAnalyze action Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com> --- .github/workflows/E2E.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/E2E.yaml b/.github/workflows/E2E.yaml index 798b752e7..ceb612e84 100644 --- a/.github/workflows/E2E.yaml +++ b/.github/workflows/E2E.yaml @@ -141,6 +141,7 @@ jobs: with: maxParallel: ${{ needs.Check.outputs.maxParallel }} testUpgradesFromVersion: ${{ env.TestUpgradesFromVersion }} + scenariosFilter: ${{ github.event.inputs.scenariosFilter }} token: ${{ steps.app-token.outputs.token }} ScenariosOnWindows: From fac0f5233513ce731b9464fe909a9be943693f86 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 16 Dec 2025 07:52:07 +0000 Subject: [PATCH 11/16] Add PSScriptAnalyzer suppressions for credential parameters in E2E actions Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com> --- .github/actions/E2ECheckSecrets/E2ECheckSecrets.ps1 | 10 +++++----- .github/actions/E2ERunScenario/E2ERunScenario.ps1 | 10 +++++----- .github/actions/E2ERunTest/E2ERunTest.ps1 | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/actions/E2ECheckSecrets/E2ECheckSecrets.ps1 b/.github/actions/E2ECheckSecrets/E2ECheckSecrets.ps1 index 73fb0a44c..b5c18e98f 100644 --- a/.github/actions/E2ECheckSecrets/E2ECheckSecrets.ps1 +++ b/.github/actions/E2ECheckSecrets/E2ECheckSecrets.ps1 @@ -4,15 +4,15 @@ Param( [Parameter(HelpMessage = "E2E_APP_ID variable value", Mandatory = $false)] [string] $e2eAppId = '', [Parameter(HelpMessage = "E2E_PRIVATE_KEY secret value", Mandatory = $false)] - [string] $e2ePrivateKey = '', + [string] $e2ePrivateKey = '', # [SuppressMessage('PSAvoidUsingPlainTextForPassword', '', Justification='GitHub Actions secrets are already masked in logs')] [Parameter(HelpMessage = "ALGOAUTHAPP secret value", Mandatory = $false)] - [string] $algoAuthApp = '', + [string] $algoAuthApp = '', # [SuppressMessage('PSAvoidUsingPlainTextForPassword', '', Justification='GitHub Actions secrets are already masked in logs')] [Parameter(HelpMessage = "adminCenterApiCredentials secret value", Mandatory = $false)] - [string] $adminCenterApiCredentials = '', + [string] $adminCenterApiCredentials = '', # [SuppressMessage('PSAvoidUsingPlainTextForPassword', '', Justification='GitHub Actions secrets are already masked in logs')] [Parameter(HelpMessage = "E2E_GHPackagesPAT secret value", Mandatory = $false)] - [string] $e2eGHPackagesPAT = '', + [string] $e2eGHPackagesPAT = '', # [SuppressMessage('PSAvoidUsingPlainTextForPassword', '', Justification='GitHub Actions secrets are already masked in logs')] [Parameter(HelpMessage = "E2EAZURECREDENTIALS secret value", Mandatory = $false)] - [string] $e2eAzureCredentials = '' + [string] $e2eAzureCredentials = '' # [SuppressMessage('PSAvoidUsingPlainTextForPassword', '', Justification='GitHub Actions secrets are already masked in logs')] ) $ErrorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 diff --git a/.github/actions/E2ERunScenario/E2ERunScenario.ps1 b/.github/actions/E2ERunScenario/E2ERunScenario.ps1 index 77bd92bea..0565dcb54 100644 --- a/.github/actions/E2ERunScenario/E2ERunScenario.ps1 +++ b/.github/actions/E2ERunScenario/E2ERunScenario.ps1 @@ -10,19 +10,19 @@ Param( [Parameter(HelpMessage = "E2E App ID", Mandatory = $true)] [string] $e2eAppId, [Parameter(HelpMessage = "E2E App Key", Mandatory = $true)] - [string] $e2eAppKey, + [string] $e2eAppKey, # [SuppressMessage('PSAvoidUsingPlainTextForPassword', '', Justification='GitHub Actions secrets are already masked in logs')] [Parameter(HelpMessage = "ALGO Auth App", Mandatory = $true)] - [string] $algoAuthApp, + [string] $algoAuthApp, # [SuppressMessage('PSAvoidUsingPlainTextForPassword', '', Justification='GitHub Actions secrets are already masked in logs')] [Parameter(HelpMessage = "PTE template", Mandatory = $true)] [string] $pteTemplate, [Parameter(HelpMessage = "AppSource template", Mandatory = $true)] [string] $appSourceTemplate, [Parameter(HelpMessage = "Admin center API credentials", Mandatory = $true)] - [string] $adminCenterApiCredentials, + [string] $adminCenterApiCredentials, # [SuppressMessage('PSAvoidUsingPlainTextForPassword', '', Justification='GitHub Actions secrets are already masked in logs')] [Parameter(HelpMessage = "Azure credentials", Mandatory = $true)] - [string] $azureCredentials, + [string] $azureCredentials, # [SuppressMessage('PSAvoidUsingPlainTextForPassword', '', Justification='GitHub Actions secrets are already masked in logs')] [Parameter(HelpMessage = "GitHub packages token", Mandatory = $true)] - [string] $githubPackagesToken + [string] $githubPackagesToken # [SuppressMessage('PSAvoidUsingPlainTextForPassword', '', Justification='GitHub Actions secrets are already masked in logs')] ) $ErrorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0 diff --git a/.github/actions/E2ERunTest/E2ERunTest.ps1 b/.github/actions/E2ERunTest/E2ERunTest.ps1 index ded44499e..fe8c08aeb 100644 --- a/.github/actions/E2ERunTest/E2ERunTest.ps1 +++ b/.github/actions/E2ERunTest/E2ERunTest.ps1 @@ -11,13 +11,13 @@ Param( [Parameter(HelpMessage = "E2E App ID", Mandatory = $true)] [string] $e2eAppId, [Parameter(HelpMessage = "E2E App Key", Mandatory = $true)] - [string] $e2eAppKey, + [string] $e2eAppKey, # [SuppressMessage('PSAvoidUsingPlainTextForPassword', '', Justification='GitHub Actions secrets are already masked in logs')] [Parameter(HelpMessage = "ALGO Auth App", Mandatory = $true)] - [string] $algoAuthApp, + [string] $algoAuthApp, # [SuppressMessage('PSAvoidUsingPlainTextForPassword', '', Justification='GitHub Actions secrets are already masked in logs')] [Parameter(HelpMessage = "Template", Mandatory = $true)] [string] $template, [Parameter(HelpMessage = "Admin center API credentials", Mandatory = $false)] - [string] $adminCenterApiCredentials = '', + [string] $adminCenterApiCredentials = '', # [SuppressMessage('PSAvoidUsingPlainTextForPassword', '', Justification='GitHub Actions secrets are already masked in logs')] [Parameter(HelpMessage = "Multi-project", Mandatory = $false)] [bool] $multiProject = $false, [Parameter(HelpMessage = "AppSource app", Mandatory = $false)] From d8bd92a9175236c2703ab138ba19f1f8607ab688 Mon Sep 17 00:00:00 2001 From: Maria Zhelezova <43066499+mazhelez@users.noreply.github.com> Date: Tue, 6 Jan 2026 13:30:22 +0100 Subject: [PATCH 12/16] Initialize github variable in e2eTestHelper.psm1 for consistent state management --- e2eTests/e2eTestHelper.psm1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/e2eTests/e2eTestHelper.psm1 b/e2eTests/e2eTestHelper.psm1 index e3bdaefe7..b24cfcb27 100644 --- a/e2eTests/e2eTestHelper.psm1 +++ b/e2eTests/e2eTestHelper.psm1 @@ -5,6 +5,7 @@ $defaultApplication = "22.0.0.0" $defaultRuntime = "10.0" $defaultPublisher = "MS Test" $lastTokenRefresh = 0 +$github = $false Import-Module (Join-Path $PSScriptRoot "..\Actions\Github-Helper.psm1" -Resolve) -DisableNameChecking -Global . (Join-Path $PSScriptRoot "..\Actions\AL-Go-Helper.ps1" -Resolve) @@ -25,6 +26,7 @@ function SetTokenAndRepository { $script:githubOwner = $githubOwner $script:defaultRepository = $repository + $script:github = $github if ($github) { invoke-git config --global user.email "$githubOwner@users.noreply.github.com" From b9cf0c7ddd31fac33c22eb47396fdef331072cbd Mon Sep 17 00:00:00 2001 From: Maria Zhelezova <43066499+mazhelez@users.noreply.github.com> Date: Tue, 6 Jan 2026 16:10:21 +0100 Subject: [PATCH 13/16] Set default repository in CancelAllWorkflows, WaitAllWorkflows, and Test-LogContainsFromRun functions --- e2eTests/e2eTestHelper.psm1 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/e2eTests/e2eTestHelper.psm1 b/e2eTests/e2eTestHelper.psm1 index b24cfcb27..c9a97a2dd 100644 --- a/e2eTests/e2eTestHelper.psm1 +++ b/e2eTests/e2eTestHelper.psm1 @@ -242,6 +242,11 @@ function CancelAllWorkflows { if (-not $noDelay.IsPresent) { Start-Sleep -Seconds 60 } + + if (!$repository) { + $repository = $defaultRepository + } + $runs = invoke-gh api /repos/$repository/actions/runs -silent -returnValue | ConvertFrom-Json foreach($run in $runs.workflow_runs) { Write-Host $run.name @@ -262,6 +267,11 @@ function WaitAllWorkflows { if (-not $noDelay.IsPresent) { Start-Sleep -Seconds 60 } + + if (!$repository) { + $repository = $defaultRepository + } + $runs = invoke-gh api /repos/$repository/actions/runs -silent -returnValue | ConvertFrom-Json $workflowRuns = $runs.workflow_runs | Select-Object -First $top foreach($run in $workflowRuns) { @@ -691,6 +701,10 @@ function Test-LogContainsFromRun { [switch] $isRegEx ) + if (!$repository) { + $repository = $defaultRepository + } + DownloadWorkflowLog -repository $repository -runid $runid -path 'logs' try { # Log format changes are rolling out on GitHub Actions, we have to support both From d374ea9f15536c5c019095ccc1c7c3e18fb379a0 Mon Sep 17 00:00:00 2001 From: Maria Zhelezova <43066499+mazhelez@users.noreply.github.com> Date: Tue, 6 Jan 2026 16:43:44 +0100 Subject: [PATCH 14/16] Set default repository in CommitAndPush function --- e2eTests/e2eTestHelper.psm1 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/e2eTests/e2eTestHelper.psm1 b/e2eTests/e2eTestHelper.psm1 index c9a97a2dd..0a45b2412 100644 --- a/e2eTests/e2eTestHelper.psm1 +++ b/e2eTests/e2eTestHelper.psm1 @@ -560,9 +560,7 @@ function CommitAndPush { [switch] $wait ) - if (!$repository) { - $repository = $defaultRepository - } + $repository = $defaultRepository RefreshToken -repository $repository From e3fc5f3e2b482221568558b24a24df4a3c1c54a8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 14:24:06 +0000 Subject: [PATCH 15/16] Fix E2E test failure: quote repository names in gh repo create calls Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com> --- Internal/Deploy.ps1 | 2 +- e2eTests/e2eTestHelper.psm1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Internal/Deploy.ps1 b/Internal/Deploy.ps1 index 84ca0b8f8..cc89d3df7 100644 --- a/Internal/Deploy.ps1 +++ b/Internal/Deploy.ps1 @@ -172,7 +172,7 @@ try { catch { Write-Host "gh repo create $($config.githubOwner)/$repo --public --clone" $ownerRepo = "$($config.githubOwner)/$repo" - invoke-gh repo create $ownerRepo --public --clone + invoke-gh repo create "$ownerRepo" --public --clone Start-Sleep -Seconds 10 Set-Location $repo invoke-git checkout -b $branch diff --git a/e2eTests/e2eTestHelper.psm1 b/e2eTests/e2eTestHelper.psm1 index 0a45b2412..12d4454d5 100644 --- a/e2eTests/e2eTestHelper.psm1 +++ b/e2eTests/e2eTestHelper.psm1 @@ -434,11 +434,11 @@ function CreateAlGoRepository { } if ($private) { Write-Host -ForegroundColor Yellow "`nCreating private repository $repository (based on $template)" - invoke-gh repo create $repository --private --clone + invoke-gh repo create "$repository" --private --clone } else { Write-Host -ForegroundColor Yellow "`nCreating public repository $repository (based on $template)" - invoke-gh repo create $repository --public --clone + invoke-gh repo create "$repository" --public --clone } Start-Sleep -seconds 10 Set-Location '*' From b3b0575e5d52962223044af27ad01fca5cf9fc88 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 16 Jan 2026 11:18:31 +0000 Subject: [PATCH 16/16] Remove incorrect quotes from GitHub Actions outputs in E2ECalculateTestParams Co-authored-by: mazhelez <43066499+mazhelez@users.noreply.github.com> --- .../E2ECalculateTestParams.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/E2ECalculateTestParams/E2ECalculateTestParams.ps1 b/.github/actions/E2ECalculateTestParams/E2ECalculateTestParams.ps1 index f468ad773..179249914 100644 --- a/.github/actions/E2ECalculateTestParams/E2ECalculateTestParams.ps1 +++ b/.github/actions/E2ECalculateTestParams/E2ECalculateTestParams.ps1 @@ -46,22 +46,22 @@ if (-not $contentPath -and $matrixType) { # Add outputs if ($adminCenterApiCredentials) { - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "adminCenterApiCredentials='$adminCenterApiCredentials'" + Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "adminCenterApiCredentials=$adminCenterApiCredentials" } else { - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "adminCenterApiCredentials=''" + Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "adminCenterApiCredentials=" } if ($template) { - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "template='$template'" + Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "template=$template" } if ($contentPath) { - Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "contentPath='$contentPath'" + Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "contentPath=$contentPath" } # Generate repo name $reponame = [System.IO.Path]::GetFileNameWithoutExtension([System.IO.Path]::GetTempFileName()) -Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "repoName='$repoName'" -Write-Host "repoName='$repoName'" +Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "repoName=$repoName" +Write-Host "repoName=$repoName" Write-Host "Repo URL: https://github.com/$githubOwner/$repoName"