Fix release title to match tag name and improve build output#82
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Improves release packaging to preserve the module’s top-level folder structure, aligns GitHub Release titles with tag names, and adds a regression test to validate build output layout.
Changes:
- Update build packaging to copy top-level folders as folders (no flattening).
- Force GitHub release title to match the tag name in the release workflow.
- Add a Pester test to verify expected top-level directories exist in the packaged output; bump module version and changelog entry.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
DevOps/Build/build.ps1 |
Copies source directories into the module output preserving folder structure. |
.github/workflows/create-release.yml |
Ensures gh release create sets the release title to the tag name. |
Tests/HaloAPI.Meta.Tests.ps1 |
Adds a build output layout regression test around packaged folder structure. |
HaloAPI.psd1 |
Bumps module version and updates ReleaseNotes URL. |
CHANGELOG.md |
Adds a 1.23.3 entry describing the packaging/test changes. |
| $Script:BuildScriptPath = Join-Path -Path $ModulePath -ChildPath 'DevOps\Build\build.ps1' | ||
| $Script:BuiltModulePath = Join-Path -Path $ModulePath -ChildPath 'Output\HaloAPI' |
There was a problem hiding this comment.
Using Windows-style backslashes inside -ChildPath makes these paths incorrect on non-Windows PowerShell (backslash is treated as a literal character, so the file/folder won’t be found). Use OS-agnostic path construction (e.g., Join-Path with multiple segments, [IO.Path]::Combine, or forward slashes) so the test passes on Linux/macOS runners.
| $expectedDirectories = @('Public', 'Private', 'Classes', 'Data') | ||
| foreach ($expectedDirectory in $expectedDirectories) { | ||
| $expectedPath = Join-Path -Path $Script:BuiltModulePath -ChildPath $expectedDirectory | ||
| Test-Path -Path $expectedPath -PathType Container | Should -BeTrue | ||
| } |
There was a problem hiding this comment.
This assertion only checks that the directories exist; it could still pass if the build accidentally flattens files into the module root while also creating empty (or unrelated) directories. To better guard against the original regression, also assert that expected content is nested (e.g., each directory contains at least one file) and/or that the module root does not contain files that should live under Public/Private/Classes/Data.
|
|
||
| It 'preserves wrapped top-level folders in packaged output' { | ||
| { | ||
| & $Script:BuildScriptPath -TaskNames @('clean', 'build') |
There was a problem hiding this comment.
Invoking the real build from the meta test can be slow and can leave artifacts (e.g., Output/) behind after tests run locally, which may cause flaky runs or dirty working trees. Consider adding an AfterAll cleanup for the output directory (or running the build into a temporary output path if the build script supports it) to keep the test suite isolated and repeatable.
This pull request focuses on improving the release packaging process to ensure the module output preserves its intended folder structure. It also adds automated test coverage to prevent regressions in the build output layout. Additionally, versioning and release metadata have been updated to reflect these changes.
Release Packaging Improvements
Buildfunction inDevOps/Build/build.ps1to copy each top-level source folder (Public,Private,Classes,Data) as a folder, preserving the module's layout in the release output..github/workflows/create-release.ymlto always set the release title to the tag name when creating a release.Test Coverage
Tests/HaloAPI.Meta.Tests.ps1to verify that the packaged output retains the expected top-level directories, guarding against future regressions in build packaging.Versioning and Metadata
1.23.3inHaloAPI.psd1and updated theReleaseNoteslink accordingly. [1] [2]1.23.3describing the packaging fix and new test coverage.