Skip to content

fix(logging): show the log path for job warnings and errors - #5286

Open
dani3lsamir wants to merge 1 commit into
ChrisTitusTech:mainfrom
dani3lsamir:codex/show-job-log-path
Open

dani3lsamir wants to merge 1 commit into
ChrisTitusTech:mainfrom
dani3lsamir:codex/show-job-log-path

Conversation

@dani3lsamir

Copy link
Copy Markdown

Description

When a job finishes with warnings or errors, its console banner now prints the active session log path on a separate line. This gives people the exact file to open when there are several WinUtil logs. The banner only prints a path after the log writer has opened the file.

Related issue

Related to #5280. This adds the path to the terminal output. #5281 covers where logs are stored in the docs.

Testing

  • Compiled WinUtil and parsed the generated PowerShell script.
  • Ran pester/logging.Tests.ps1 and pester/job-layer.Tests.ps1 with Pester 5.8.0. All 116 tests passed. The sandbox required disabling Pester's TestRegistry provider for this run.
  • The two new banner cases failed before the fix and pass with it. The tests cover warning and error banners, normal completion, and a log that could not be opened.

PR human checks

  • The change addresses a specific report and was tested before and after the fix.
  • The contributing guidelines were reviewed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T12:04:19.960459Z e579fae PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the bug Something isn't working label Nov 25, 2026
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Job banners now show the session log location for warnings and errors when available, without the previous “see the log” wording.
    • Routine informational banners continue to omit the log location.

Warning and error job banners now display the open session-log path when available. Warning banners use the WARN level, and both warning and error messages omit “see the log.” Tests cover path display and omission conditions.

Changes: Job Banner Log Paths

Layer / File(s) Summary
Banner levels and session-log output
functions/private/Write-WinUtilJobBanner.ps1, functions/private/Start-WinUtilJob.ps1, pester/logging.Tests.ps1
Write-WinUtilJobBanner accepts WARN and prints the session-log path for non-INFO levels when LogWriterPath is set. Job warning and error banners use the updated levels and messages. Tests cover path display and omission conditions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Merge Risk: Minimal · up to e579f

Warning and error job banners now show the open session-log path when one is available. The change is low risk and easy to revert.

Architecture risk: Low · up to e579f

The change affects 2 systems.

Changed systems: functions, pester

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — functions (service) was modified; 2 changed files map to changed impact.
  • observed — pester (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in functions/private/Start-WinUtilJob.ps1: The error banner retains the error count and ERROR level but drops “see the log.” The warning banner now explicitly uses WARN level and drops “see the log”; the warning status update remains unchanged.
  • observed — Modified behavior in functions/private/Write-WinUtilJobBanner.ps1: The Level documentation now says WARN and ERROR also show the open session log when available, and the validation set adds WARN to the accepted levels.
  • observed — Modified behavior in functions/private/Write-WinUtilJobBanner.ps1: After the banner, the function writes the session-log path when $Level is not INFO and $sync.LogWriterPath is set.
  • observed — Modified behavior in pester/logging.Tests.ps1: Adds tests asserting that warning and error job banners display the open session log path as a separate host line; routine banners do not display a path; and a configured logPath is omitted when LogWriterPath is null.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the console banner for job warnings and errors now shows the session log path. It uses the conventional commit prefix and is specific enough for a teammate scanning hi…
Description check Passed The description states the change: the job banner prints the active session log path on a separate line when a job finishes with warnings or errors. It also lists the test run and links related issues…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the console banner for job warnings and errors now shows the session log path. It uses the conventional commit prefix and is specific enough for a teammate scanning history. The raw summary confirms the banner change in Write-WinUtilJobBanner and Start-WinUtilJob, and the tests cover the new behavior.

Full details: Description check

Explanation

The description states the change: the job banner prints the active session log path on a separate line when a job finishes with warnings or errors. It also lists the test run and links related issues. It matches the changeset, which adds WARN support and log-path output in the banner plus new Pester tests.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a83fdcae-1da8-4ef2-9033-80388f30debf
Commits

Reviewing files that changed from the base of the PR and between 70c23c8 and e579fae.

Files selected for processing: 3

  • functions/private/Start-WinUtilJob.ps1
  • functions/private/Write-WinUtilJobBanner.ps1
  • pester/logging.Tests.ps1

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e579fae8f6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

}
Write-WinUtilHost $border -ForegroundColor $colour
if ($Level -ne "INFO" -and $sync.LogWriterPath) {
Write-WinUtilHost "Session log: $($sync.LogWriterPath)"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add guide documentation for the new log-path output

Write-WinUtilJobBanner now changes user-facing terminal output whenever a warning or error banner has an open log, but this commit leaves docs/src/content/docs/guides/ unchanged, so the documented user flow does not explain when this path appears or how to use it. Add the behavior to the relevant guide in the same change; the repository explicitly requires guide updates for user-facing behavior changes.

AGENTS.md reference: AGENTS.md:L140-L140

Useful? React with 👍 / 👎.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant