Skip to content

Stop PowerShell from truncating Scoop listing output - #5434

Merged
Gabriel Dufresne (GabrielDuf) merged 5 commits into
mainfrom
fix/scoop-table-truncation
Sep 23, 2026
Merged

Gabriel Dufresne (GabrielDuf) merged 5 commits into
mainfrom
fix/scoop-table-truncation

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

This pull request improves the reliability and accuracy of parsing tabular output from the Scoop package manager, especially when dealing with long package names or versions that can cause table columns to overflow the default console width. The changes ensure that all relevant packages are correctly identified and parsed, even in edge cases, and enhance test coverage for these scenarios.

Parsing improvements and robustness:

  • Added a PowerShell argument (UntruncatedTableOutput) to force table output to use a wide width, preventing column truncation and overflow issues in commands that list buckets, installed packages, and available updates (ScoopSourceHelper.cs, Scoop.cs). [1] [2] [3] [4]
  • Rewrote the parsing logic for tabular Scoop output to dynamically detect column positions, strip ANSI sequences, and robustly extract package information even when column alignment is affected by long values (Scoop.cs). [1] [2]

Testing enhancements:

  • Added new test fixtures with realistic Scoop output, including cases with no outdated packages and with long package names/versions (list-output-not-outdated.txt, status-output-not-outdated.txt). [1] [2]
  • Introduced unit tests to verify that packages are skipped when there is no newer version and that rows with overflowing columns are correctly parsed (ScoopManagerTests.cs). [1] [2]

Test infrastructure updates:

  • Added helper methods and constants to facilitate testing of long package names and dynamic PowerShell table generation in tests (ScoopManagerTests.cs). [1] [2]

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.

Copilot review overview

🟡 Changes recommended

Bucket paths containing spaces can be dropped, and the regex is not NativeAOT-safe.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Improves Scoop output parsing by preventing PowerShell truncation and handling long or non-outdated package entries.

Changes:

  • Adds wide PowerShell table formatting.
  • Dynamically parses columns and strips ANSI sequences.
  • Adds regression tests and fixtures for edge cases.
File Review
src/​UniGetUI.PackageEngine.Tests/​ScoopManagerTests.cs Adds parsing regression tests and helpers.
src/​UniGetUI.PackageEngine.Tests/​Fixtures/​Scoop/​status-output-not-outdated.txt Adds mixed update-status fixture.
src/​UniGetUI.PackageEngine.Tests/​Fixtures/​Scoop/​list-output-not-outdated.txt Adds installed-package fixture.
src/​UniGetUI.PackageEngine.Managers.Scoop/​Scoop.cs Improves update parsing; the compiled regex should be made NativeAOT-safe.
src/​UniGetUI.PackageEngine.Managers.Scoop/​Helpers/​ScoopSourceHelper.cs Adds wide bucket output, but whitespace tokenization breaks local paths containing spaces.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

Copilot review overview

🟡 Changes recommended

The unresolved critical path-handling defect and moderate NativeAOT regex issue must be addressed.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity

Open (2)
Resolved since last review (1)

Comment thread src/UniGetUI.PackageEngine.Managers.Scoop/Helpers/ScoopSourceHelper.cs Outdated
Comment thread src/UniGetUI.PackageEngine.Managers.Scoop/Helpers/ScoopTable.cs Outdated

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.

Copilot review overview

🔵 Needs a closer look

The legacy three-column scoop list parsing regression must be fixed before approval.

Review effort: Balanced
Findings: None

Resolved since last review (2)

@randy-but-a-ro randy-but-a-ro 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.

🤖 Pull request was approved automatically: the AI review is complete and all its review threads are resolved. 🎉

Integration Details
{
	"deliveryId": "c4968f50-b6c5-11f1-87f3-b0ad5919b481",
	"headSha": "00c04164242f82239975b5685fcbcba14531a5bb",
	"reviewer": "copilot-pull-request-reviewer[bot]"
}

@GabrielDuf
Gabriel Dufresne (GabrielDuf) merged commit 9f55ba5 into main Sep 23, 2026
9 of 10 checks passed
@GabrielDuf
Gabriel Dufresne (GabrielDuf) deleted the fix/scoop-table-truncation branch September 23, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Lack of updatable scoop packages

2 participants