Skip to content

Fix log packaging fallback logic - #42192

Merged
Feng Wang (chemwolf6922) merged 1 commit into
masterfrom
user/chemwolf6922/fix-log-packaging-fallback-logic
Nov 9, 2026
Merged

Feng Wang (chemwolf6922) merged 1 commit into
masterfrom
user/chemwolf6922/fix-log-packaging-fallback-logic

Conversation

@chemwolf6922

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Issue: Missing tar.exe left $LASTEXITCODE unchanged, so a previous zero could cause unarchived logs to be deleted and success falsely reported.

Fix: Catch tar failures and fall back to ZIP, treat ZIP errors as failures, and verify archive creation before deleting logs. Preserve the logs if both methods fail.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

@chemwolf6922
Feng Wang (chemwolf6922) requested a review from a team as a code owner November 6, 2026 05:42
Copilot AI balanced review requested due to automatic review settings November 6, 2026 05:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The diagnostic log packaging changes have no active review issues.

No open issues 🎉

What changed in this PR

This PR hardens diagnostic log packaging so a missing or failing tar.exe does not cause unarchived logs to be deleted or success to be falsely reported.

Changes:

  • Catches tar failures and falls back to ZIP compression.
  • Treats ZIP errors as failures and checks that the archive exists before deleting source logs.
  • Preserves the collected logs when both compression methods fail.
File Description
diagnostics/​collect-wsl-logs.ps1 Adds guarded compression fallback and centralizes success reporting and cleanup.

Review effort: Balanced

@chemwolf6922
Feng Wang (chemwolf6922) merged commit d555f4f into master Nov 9, 2026
17 checks passed
@chemwolf6922
Feng Wang (chemwolf6922) deleted the user/chemwolf6922/fix-log-packaging-fallback-logic branch November 9, 2026 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants