Skip to content

Conversation

@feO2x
Copy link
Owner

@feO2x feO2x commented Jul 6, 2025

This pull request introduces several changes to enhance the Light.TemporaryStreams project by adding support for Microsoft.Extensions.DependencyInjection and Logging, improving project structure, and refining test coverage. The most important changes include adding new extension methods for dependency injection and logging, restructuring project files, and updating test configurations.

Dependency Injection and Logging Integration:

Project Structure Updates:

  • src/Directory.Build.props and tests/Directory.Build.props: Added shared MSBuild properties for the src and tests directories to centralize configurations. [1] [2]
  • Light.TemporaryStreams.sln: Updated the solution file to include new projects and their configurations. [1] [2] [3]

Test Enhancements:

Package Updates:

These changes collectively improve the project's extensibility, maintainability, and testing capabilities.

feO2x added 8 commits July 6, 2025 17:57
…c OS X

Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
… cannot be deleted

Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
@feO2x feO2x self-assigned this Jul 6, 2025
@feO2x feO2x added the enhancement New feature or request label Jul 6, 2025
@feO2x feO2x requested a review from Copilot July 6, 2025 21:23
Copy link
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

Enhances Light.TemporaryStreams with Microsoft DI and logging support, reorganizes project files, and refines test configuration and coverage.

  • Introduce AddTemporaryStreamService DI extension and ILogger error‐logging helpers.
  • Centralize MSBuild settings via shared Directory.Build.props in src and tests.
  • Update and add tests for service registration, logging integration, and hashing.

Reviewed Changes

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

Show a summary per file
File Description
src/Light.TemporaryStreams/ServiceCollectionExtensions.cs Register TemporaryStreamService and error handler in DI
src/Light.TemporaryStreams/MicrosoftLoggingExtensions.cs Add LoggerMessage extensions for stream deletion errors
src/Directory.Build.props Shared build props (documentation, AOT, namespace)
tests/Directory.Build.props Shared test build props (test SDK, xunit, FluentAssertions)
tests/Light.TemporaryStreams.Tests/ServiceCollectionExtensionsTests.cs Tests for DI registration and logging behavior
tests/Light.TemporaryStreams.Core.Tests/Light.TemporaryStreams.Core.Tests.csproj Simplify csproj; now relies on centralized props
src/Light.TemporaryStreams.Core/Hashing/HashingPlugin.cs Add cancellation check before wrapping streams
tests/Light.TemporaryStreams.Core.Tests/Hashing/CopyToHashCalculatorTests.cs Change hash algorithm in test
Comments suppressed due to low confidence (4)

tests/Light.TemporaryStreams.Tests/ServiceCollectionExtensionsTests.cs:37

  • [nitpick] The test method name ends with 'When()' but doesn't specify the condition. Consider renaming to reflect the scenario, e.g., 'WhenLoggingDisabled'.
    public async Task AddTemporaryStreamService_ShouldNotIncorporateMicrosoftLogging_When()

tests/Light.TemporaryStreams.Core.Tests/Light.TemporaryStreams.Core.Tests.csproj:3

  • The test project no longer includes package references for test SDK and frameworks (e.g., Microsoft.NET.Test.Sdk, xunit), so tests won’t build or run. Re-add these PackageReferences or ensure they're imported via the shared props.
  <ItemGroup>

src/Light.TemporaryStreams.Core/Hashing/HashingPlugin.cs:82

  • This declaration shadows the earlier Stream currentStream and leaves it unused. Remove the initial declaration or reuse the same variable to avoid shadowing.
        var currentStream = innerStream;

tests/Light.TemporaryStreams.Core.Tests/Hashing/CopyToHashCalculatorTests.cs:38

  • [nitpick] The test now uses SHA1.Create() but originally targeted SHA3-512. Verify that SHA1 is the intended algorithm for this test or revert to the original to maintain test accuracy.
        await using CopyToHashCalculator calculator = SHA1.Create();

…softLogging_WhenCorrespondingArgumentIsFalse

Signed-off-by: Kenny Pflug <kenny.pflug@live.de>
@feO2x feO2x merged commit 5ec3f4f into main Jul 6, 2025
1 check passed
@feO2x feO2x deleted the composition-root-project branch July 6, 2025 21:29
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.

2 participants