-
Notifications
You must be signed in to change notification settings - Fork 195
Workspace Compilation Follow-up - Add support for BCPT and Upgrade Tests #2186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aholstrup1
wants to merge
25
commits into
main
Choose a base branch
from
aholstrup/workspace_compilation_part2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
1c19278
Add support for BCPT and previous apps
aholstrup1 56dbc17
update docs
aholstrup1 c888ef6
Review findings
aholstrup1 ccd0e60
Review
aholstrup1 56703bd
Update previousApps
aholstrup1 1894eb1
Suggestions
aholstrup1 072dcfd
Suggestions
aholstrup1 470d6fa
Address review: use app ID for baseline matching and baselinePackageC…
aholstrup1 d445b8c
Remove redundant dependency JSON write-back in Compile.ps1
aholstrup1 572a86b
Separate BCPT test app files into own variable for telemetry
aholstrup1 88f0d55
Fix DownloadRelease project matching for root-level projects
aholstrup1 28e3175
Fix baselinePackageCachePath to use packageCachePath with all depende…
aholstrup1 35f76ce
Address code review findings
aholstrup1 d0e8a53
Update README docs for DownloadPreviousRelease and CompileApps
aholstrup1 1c9e178
Respect local appsourcecop files
aholstrup1 14b9f45
Update RELEASENOTES for workspace compilation follow-up
aholstrup1 9a76a6d
Address round 3 review: version casing, test gaps, whitespace fix
aholstrup1 dcdc0be
Rename PreviousApps to BaselineApps, add branch info to release messages
aholstrup1 2e6add6
Merge branch 'main' into aholstrup/workspace_compilation_part2
aholstrup1 ce48982
Address round 4 review findings
aholstrup1 cd33e7d
Apply AppSourceCop affix/obsoleteTag config even when skipUpgrade is …
aholstrup1 5e0c152
Fix mdformat: add blank line after H3 heading in RELEASENOTES.md
aholstrup1 13c7885
fix: add UTF-8 BOM to CompileFromWorkspace.Test.ps1
aholstrup1 1e202e1
Merge remote-tracking branch 'origin/main' into pr-2186
aholstrup1 190d5d7
Merge branch 'main' into aholstrup/workspace_compilation_part2
mazhelez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
Actions/DownloadPreviousRelease/DownloadPreviousRelease.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| Param( | ||
| [Parameter(HelpMessage = "The GitHub token running the action", Mandatory = $false)] | ||
| [string] $token, | ||
| [Parameter(HelpMessage = "Project folder", Mandatory = $false)] | ||
| [string] $project = "" | ||
| ) | ||
|
|
||
| . (Join-Path -Path $PSScriptRoot -ChildPath "..\AL-Go-Helper.ps1" -Resolve) | ||
|
|
||
| $baseFolder = (Get-BasePath) | ||
| $projectFolder = Join-Path $baseFolder $project | ||
| $previousAppsPath = Join-Path $projectFolder ".previousRelease" | ||
| New-Item $previousAppsPath -ItemType Directory -Force | Out-Null | ||
|
aholstrup1 marked this conversation as resolved.
|
||
|
|
||
| OutputGroupStart -Message "Locating previous release" | ||
| try { | ||
| $branchForRelease = if ($ENV:GITHUB_BASE_REF) { $ENV:GITHUB_BASE_REF } else { $ENV:GITHUB_REF_NAME } | ||
| $latestRelease = GetLatestRelease -token $token -api_url $ENV:GITHUB_API_URL -repository $ENV:GITHUB_REPOSITORY -ref $branchForRelease | ||
| if ($latestRelease) { | ||
| Write-Host "Using $($latestRelease.name) (tag $($latestRelease.tag_name)) as previous release for branch '$branchForRelease'" | ||
| # Use the project name for asset matching; for root projects (".") use wildcard to match repo-named assets | ||
| $releaseProject = if ($project -eq '.' -or $project -eq '') { '*' } else { $project } | ||
| DownloadRelease -token $token -projects $releaseProject -api_url $ENV:GITHUB_API_URL -repository $ENV:GITHUB_REPOSITORY -release $latestRelease -path $previousAppsPath -mask "Apps" -unpack | ||
| $previousApps = @(Get-ChildItem -Path $previousAppsPath -Recurse -Filter "*.app" | ForEach-Object { $_.FullName }) | ||
| Write-Host "Downloaded $($previousApps.Count) previous release app(s)" | ||
| } | ||
| else { | ||
| OutputWarning -message "No previous release found for branch '$branchForRelease'" | ||
| } | ||
|
aholstrup1 marked this conversation as resolved.
|
||
| } | ||
| catch { | ||
| OutputError -message "Error trying to locate previous release. Error was $($_.Exception.Message)" | ||
| throw | ||
| } | ||
| finally { | ||
| OutputGroupEnd | ||
| } | ||
|
|
||
| # Output variable with path to previous apps for use in subsequent steps | ||
| Add-Content -Encoding UTF8 -Path $env:GITHUB_OUTPUT -Value "PreviousAppsPath=$previousAppsPath" | ||
|
aholstrup1 marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Download Previous Release | ||
|
aholstrup1 marked this conversation as resolved.
|
||
|
|
||
| Downloads the latest release apps for the current branch, for use as a baseline in AppSourceCop validation and upgrade testing. | ||
| The release is determined based on the target branch (for pull requests) or the current branch (for pushes). | ||
|
|
||
| ## INPUT | ||
|
|
||
| ### ENV variables | ||
|
|
||
| | Name | Description | | ||
| | :-- | :-- | | ||
| | Settings | env.Settings must be set by a prior call to the ReadSettings Action | | ||
|
|
||
| ### Parameters | ||
|
|
||
| | Name | Required | Description | Default value | | ||
| | :-- | :-: | :-- | :-- | | ||
| | shell | | The shell (powershell or pwsh) in which the PowerShell script in this action should run | powershell | | ||
| | token | | The GitHub token running the action | github.token | | ||
| | project | | The AL-Go project for which to download previous release apps | '.' | | ||
|
|
||
| ## OUTPUT | ||
|
|
||
| ### OUTPUT variables | ||
|
|
||
| | Name | Description | | ||
| | :-- | :-- | | ||
| | PreviousAppsPath | Path to the folder containing the downloaded previous release apps. | | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Download Previous Release | ||
| author: Microsoft Corporation | ||
| inputs: | ||
| shell: | ||
| description: Shell in which you want to run the action (powershell or pwsh) | ||
| required: false | ||
| default: powershell | ||
| token: | ||
| description: The GitHub token running the action | ||
| required: false | ||
| default: ${{ github.token }} | ||
| project: | ||
| description: Project folder | ||
| required: false | ||
| default: '.' | ||
| outputs: | ||
| PreviousAppsPath: | ||
| description: Path to the folder containing the downloaded previous release apps. | ||
| value: ${{ steps.DownloadPreviousRelease.outputs.PreviousAppsPath }} | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: run | ||
| shell: ${{ inputs.shell }} | ||
| id: DownloadPreviousRelease | ||
| env: | ||
| _token: ${{ inputs.token }} | ||
| _project: ${{ inputs.project }} | ||
| run: | | ||
| ${{ github.action_path }}/../Invoke-AlGoAction.ps1 -ActionName "DownloadPreviousRelease" -Action { | ||
| ${{ github.action_path }}/DownloadPreviousRelease.ps1 -token $ENV:_token -project $ENV:_project | ||
| } | ||
| branding: | ||
| icon: terminal | ||
| color: blue |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.