Skip to content

Add PowerKit (prerelease), update PolyShim and CSharpier, remove duplicate utilities#72

Merged
Tyrrrz merged 3 commits intoprimefrom
copilot/add-powerkit-remove-utilities
Apr 16, 2026
Merged

Add PowerKit (prerelease), update PolyShim and CSharpier, remove duplicate utilities#72
Tyrrrz merged 3 commits intoprimefrom
copilot/add-powerkit-remove-utilities

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 16, 2026

Replaces several locally-implemented utility/extension classes with their equivalents from PowerKit 0.0.0-a.4, a source package providing the same primitives. Also bumps PolyShim to 2.9.0 and CSharpier.MsBuild to 1.2.6, then reformats.

Removed (now provided by PowerKit)

Main project:

  • Utils/Extensions/AssemblyExtensions.csPowerKit.Extensions.AssemblyExtensions
  • Utils/Extensions/StringExtensions.csPowerKit.Extensions.StringExtensions + StringBuilderExtensions
  • Utils/Extensions/GenericExtensions.csPowerKit.Extensions.FunctionalExtensions
  • Utils/Extensions/ParsingExtensions.csPowerKit.Extensions.IntExtensions

Test project:

  • Tests/Utils/TempFile.csPowerKit.TempFile
  • Tests/Utils/TempDir.csPowerKit.TempDirectory
  • Tests/Utils/Extensions/FileExtensions.csPowerKit.Extensions.FileExtensions

Kept (not covered by PowerKit): TimeSpanExtensions (ToHumanString), ExceptionExtensions (ReplaceStackTrace), MtpExtensions, VsTestExtensions, ContentionTolerantWriteFileStream, StackFrame.

Package changes

Package Before After
PowerKit 0.0.0-a.4
PolyShim 2.7.0 2.9.0
CSharpier.MsBuild 1.2.1 1.2.6

Namespace updates

Call sites that used the deleted extension classes now import PowerKit.Extensions instead of (or alongside) GitHubActionsTestLogger.Utils.Extensions. Test files now import PowerKit for TempFile and TempDirectory, and PowerKit.Extensions for file utilities.

@Tyrrrz Tyrrrz added the enhancement New feature or request label Apr 16, 2026
@Tyrrrz Tyrrrz marked this pull request as ready for review April 16, 2026 13:07
Copilot AI review requested due to automatic review settings April 16, 2026 13:07
@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Apr 16, 2026

@copilot why are TempFile/TempDir not replaced?

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.22%. Comparing base (b47a22f) to head (b512953).
⚠️ Report is 1 commits behind head on prime.

Additional details and impacted files
@@            Coverage Diff             @@
##            prime      #72      +/-   ##
==========================================
+ Coverage   84.56%   85.22%   +0.65%     
==========================================
  Files          23       19       -4     
  Lines         784      758      -26     
  Branches       92       85       -7     
==========================================
- Hits          663      646      -17     
+ Misses         63       59       -4     
+ Partials       58       53       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR replaces several in-repo utility/extension implementations with equivalents provided by the new PowerKit source package, updates a couple of tooling/runtime dependencies, and applies reformatting.

Changes:

  • Add PowerKit (0.0.0-a.4) and migrate call sites to PowerKit.Extensions.
  • Update PolyShim to 2.9.0 and CSharpier.MsBuild to 1.2.6 (via central package management).
  • Remove now-duplicated extension utility files and reformat affected files.

Reviewed changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
GitHubActionsTestLogger/VsTestLogger.cs Import PowerKit.Extensions for extension method usage.
GitHubActionsTestLogger/Utils/StackFrame.cs Switch extension-method dependency to PowerKit.Extensions (e.g., parsing helpers).
GitHubActionsTestLogger/Utils/Extensions/VsTestExtensions.cs Import PowerKit.Extensions for string helpers used in VSTest extensions.
GitHubActionsTestLogger/Utils/Extensions/MtpExtensions.cs Import PowerKit.Extensions for shared helpers used by MTP extensions.
GitHubActionsTestLogger/Utils/Extensions/StringExtensions.cs Removed (replaced by PowerKit string/StringBuilder extensions).
GitHubActionsTestLogger/Utils/Extensions/ParsingExtensions.cs Removed (replaced by PowerKit int parsing extensions).
GitHubActionsTestLogger/Utils/Extensions/GenericExtensions.cs Removed (replaced by PowerKit functional extensions such as Pipe).
GitHubActionsTestLogger/Utils/Extensions/AssemblyExtensions.cs Removed (replaced by PowerKit assembly extensions).
GitHubActionsTestLogger/Reporting/TestSummaryTemplate.cshtml Add @using PowerKit.Extensions for extension methods used in the template.
GitHubActionsTestLogger/Reporting/TestReportingContext.cs Import PowerKit.Extensions for StringBuilder extension usage.
GitHubActionsTestLogger/MtpLoggerOptionsProvider.cs Import PowerKit.Extensions for migrated extension methods.
GitHubActionsTestLogger/MtpLogger.cs Import PowerKit.Extensions for migrated extension methods.
GitHubActionsTestLogger/GitHubActionsTestLogger.csproj Add PowerKit package reference.
GitHubActionsTestLogger/GitHub/GitHubWorkflow.cs Use PowerKit.Extensions and formatting adjustments.
GitHubActionsTestLogger/GitHub/GitHubEnvironment.cs Use PowerKit.Extensions for helper chaining.
GitHubActionsTestLogger.Tests/Utils/TempFile.cs Formatting-only change.
GitHubActionsTestLogger.Tests/Utils/TempDir.cs Formatting-only change.
Directory.Packages.props Central version updates for CSharpier/PolyShim and add PowerKit version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 16, 2026

@copilot why are TempFile/TempDir not replaced?

Good catch — they were overlooked. Fixed in dffa28e: deleted Tests/Utils/TempFile.cs and Tests/Utils/TempDir.cs, added PowerKit to the test project, and updated all usages to PowerKit.TempFile / PowerKit.TempDirectory.

Copilot AI requested a review from Tyrrrz April 16, 2026 13:13
@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Apr 16, 2026

@copilot look for more utilities that can be removed in all projects

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 16, 2026

@copilot look for more utilities that can be removed in all projects

Audited all remaining local utilities across both projects against PowerKit's content files. One more removal was possible:

  • Tests/Utils/Extensions/FileExtensions.csPowerKit.Extensions.FileExtensions (provides WriteAllZeroes and ReadAllBytes with compatible signatures) — done in b512953

Kept (no PowerKit equivalent):

  • Utils/Extensions/TimeSpanExtensions.csToHumanString (PowerKit only has ParseOrNull)
  • Tests/Utils/Extensions/ExceptionExtensions.csReplaceStackTrace (PowerKit has unrelated GetSelfAndDescendants)
  • Utils/Extensions/MtpExtensions.cs, VsTestExtensions.cs — project-specific
  • Utils/ContentionTolerantWriteFileStream.cs, Utils/StackFrame.cs — project-specific

Copilot AI requested a review from Tyrrrz April 16, 2026 13:20
@Tyrrrz Tyrrrz merged commit e4e5017 into prime Apr 16, 2026
7 checks passed
@Tyrrrz Tyrrrz deleted the copilot/add-powerkit-remove-utilities branch April 16, 2026 13:26
This was referenced May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants