Add log grouping to build.psm1 for collapsible GitHub Actions logs#26326
Add log grouping to build.psm1 for collapsible GitHub Actions logs#26326TravisEz13 merged 10 commits intomasterfrom
Conversation
…og formatting Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Per review feedback, individual project restore groups are excessive since each only logs one line. Keep the outer grouping from parent function call. Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
- Removed outer "Bootstrap PowerShell Build Dependencies" group (groups cannot nest) - Removed small ResGen and TypeGen groups (too small, only 2-3 lines each) - Keep sub-groups like "Install Native Dependencies", "Install .NET SDK", etc. Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Document best practices learned from code review: - Groups cannot be nested - Groups should be substantial (5+ lines) - Avoid groups in loops or for small operations - Each group should be an independent operation Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
|
In github workflows, find where we do Also, builds and tests are not being triggered when buildModuleChanged is coming from the path-filters action and it should, for linux-ci, windows-ci and macos-ci |
- Created Show-Environment function in tools/ci.psm1 to wrap environment variable logging with log group (avoids code repetition) - Replaced all instances of Get-ChildItem -Path env: | Out-String with Show-Environment call in workflows and actions - Added buildModuleChanged to outputs in linux-ci, windows-ci, macos-ci - Updated all job conditions to include buildModuleChanged so builds and tests trigger when build.psm1 is modified Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Done in 04b2833:
|
|
📣 Hey @@Copilot, how did we do? We would love to hear your feedback with the link below! 🗣️ 🔗 https://aka.ms/PSRepoFeedback |
…owerShell#26326) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com> Co-authored-by: Travis Plunk <travis.plunk@microsoft.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…owerShell#26326) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com> Co-authored-by: Travis Plunk <travis.plunk@microsoft.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…owerShell#26326) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com> Co-authored-by: Travis Plunk <travis.plunk@microsoft.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
GitHub Actions logs for PowerShell builds are difficult to navigate due to verbose, flat output. This wraps major build operations with
Write-LogGroupStart/Write-LogGroupEndto create collapsible sections.Changes
Modified Functions:
Start-PSBuild: Grouped restore, build, module restore, and config generationStart-PSBootstrap: Grouped native dependencies, .NET SDK, Windows dependencies, and global tools installationInstall-Dotnet: Wrapped entire SDK installationShow-Environment(new): Created function intools/ci.psm1to display environment variables in a log groupDocumentation Added:
.github/instructions/log-grouping-guidelines.instructions.mdwith best practices for using log groups:Workflow Fixes:
Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -VerbosewithShow-Environmentfunction call (6 locations in workflows and actions)buildModuleChangedto outputs in linux-ci.yml, windows-ci.yml, and macos-ci.ymlbuildModuleChanged == 'true'so builds and tests are triggered when build.psm1 is modifiedGuidelines Applied
Based on review feedback, the implementation follows these principles:
Example
Before:
After:
Renders as collapsible sections in GitHub Actions UI.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.