Skip to content

.NET 10 upgrade - #25

Merged
bitai-cs merged 2 commits into
mainfrom
upgrade/20260604-net10
Jun 5, 2026
Merged

.NET 10 upgrade#25
bitai-cs merged 2 commits into
mainfrom
upgrade/20260604-net10

Conversation

@bitai-cs

@bitai-cs bitai-cs commented Jun 5, 2026

Copy link
Copy Markdown
Owner

.NET 10 and Component upgrades.

Additional some library messages fixes.

Summary by Sourcery

.NET 10 upgrade and project housekeeping across solution, build, and messaging.

Enhancements:

  • Standardize terminology from "user account" to "username" across LDAP operations and error messages for clearer semantics.
  • Rename the main solution file to Bitai.Ldap.Helper.sln and update project metadata and repository configuration accordingly.
  • Add an .editorconfig file to enforce consistent code style across the repository.

CI:

  • Introduce a GitHub Actions CI workflow that restores, builds, and tests the solution using .NET 10 with dependency caching.

Documentation:

  • Update README to remove the hard-coded .NET 8.0 reference, describe authentication using domain username terminology, and require .NET 10 SDK or higher.

Tests:

  • Adjust unit tests to align with updated operation messages and terminology around account creation and authentication results.

Chores:

  • Normalize BOM/encoding in several source and test files and perform minor wording refinements in user-facing messages.

@sourcery-ai

sourcery-ai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

.NET SDK and solution have been upgraded to target .NET 10, CI has been introduced via GitHub Actions, and several library messages and documentation strings were updated to consistently use "username" terminology instead of "user account" while keeping functional behavior the same.

File-Level Changes

Change Details Files
.NET SDK, project configuration, and solution naming updated for .NET 10 and new solution file.
  • Renamed the solution file from LDAP Helper Libraries.sln to Bitai.Ldap.Helper.sln and updated references in CI and commands.
  • Updated project configuration files (main library, DTOs, tests, demo, and mocks) to align with .NET 10 SDK usage.
  • Adjusted repository metadata (e.g., README) to remove the explicit .NET 8 reference and instead state .NET 10 SDK as requirement.
Bitai.Ldap.Helper.sln
demo/Bitai.LDAPHelper.Demo/Bitai.LDAPHelper.Demo.csproj
src/Bitai.LDAPHelper.DTO/Bitai.LDAPHelper.DTO.csproj
src/Bitai.LDAPHelper/Bitai.LDAPHelper.csproj
tests/Bitai.LDAPHelper.Tests.Mocks/Bitai.LDAPHelper.Tests.Mocks.csproj
tests/Bitai.LDAPHelper.Tests/Bitai.LDAPHelper.Tests.csproj
README.md
User-facing strings and XML documentation updated to use consistent "username" terminology and clearer authentication messages without changing runtime behavior.
  • Reworded XML documentation and comments in AccountManager to replace "user account" with "username" and to clarify behavior of create, password set, disable, and delete operations.
  • Updated operation messages and exception messages to reflect the new "username" terminology and more explicit DN wording.
  • Adjusted Authenticator messages for both domain-account and DN-based authentication to consistently refer to "username", clarify failure reasons, and improve wording for not-found and wrong-password cases.
src/Bitai.LDAPHelper/AccountManager.cs
src/Bitai.LDAPHelper/Authenticator.cs
Tests updated to reflect new operation messages; one assertion may contain a typo that will fail with the current implementation.
  • Adjusted AccountManagerAdapterTests.CreateUserAccountForMsAD_ReturnsSuccess assertion to expect the new operation message wording.
  • The new expectation uses the substring "account nameX created at" (with an extra x), which does not match the production message "Account name created at..." and will likely cause this test to fail, so this should be double‑checked during review.
tests/Bitai.LDAPHelper.Tests/AccountManagerAdapterTests.cs
Continuous Integration added via GitHub Actions targeting .NET 10 with restore, build, and test stages.
  • Introduced a CI workflow that runs on push, pull_request, merge_group, and manual dispatch.
  • Configured actions/setup-dotnet to install .NET 10 (10.0.x) and enable caching based on project and NuGet configuration files.
  • Runs dotnet restore, dotnet build (Release), and dotnet test against Bitai.Ldap.Helper.sln with no rebuild/restore in test step.
.github/workflows/ci.yml
Repository-level configuration introduced via EditorConfig (details not shown in diff).
  • Added a new .editorconfig file to standardize code style and formatting across the repository (specific rules are not visible in the provided diff).
.editorconfig

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot 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.

Hey - I've found 2 issues, and left some high level feedback:

  • In AccountManagerAdapterTests.CreateUserAccountForMsAD_ReturnsSuccess, the assertion now expects "account nameX created at" but the production message is "Account name created at ...", so the extra X will cause this test to fail and should be removed.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `AccountManagerAdapterTests.CreateUserAccountForMsAD_ReturnsSuccess`, the assertion now expects `"account nameX created at"` but the production message is `"Account name created at ..."`, so the extra `X` will cause this test to fail and should be removed.

## Individual Comments

### Comment 1
<location path="tests/Bitai.LDAPHelper.Tests/AccountManagerAdapterTests.cs" line_range="38" />
<code_context>
             // Assert
             Assert.True(result.IsSuccessfulOperation);
-            Assert.Contains("user account created at", result.OperationMessage.ToLower());
+            Assert.Contains("account nameX created at", result.OperationMessage.ToLower());
         }

</code_context>
<issue_to_address>
**issue (testing):** The assertion string appears to have a typo and no longer matches the updated operation message format.

This test now checks for `"account nameX created at"` while the implementation emits `"Account name created at {DN} with sAMAccountName: {SAM}"`, so the assertion is inconsistent and fragile. Please update the expected substring to match the new format and, ideally, assert that both the DN and `sAMAccountName` appear in `OperationMessage` so the test validates the key data rather than just a human‑readable phrase.
</issue_to_address>

### Comment 2
<location path="README.md" line_range="23" />
<code_context>
+- **Disable Accounts** (`DisableUserAccountForMsAD`): Securely disables accounts by updating the `userAccountControl` attribute with the `ACCOUNTDISABLE` flag, dynamically preserving all other existing account name flags to prevent unintended configuration loss.
</code_context>
<issue_to_address>
**issue (typo):** Consider removing "name" in "account name flags" for clarity.

This looks like a leftover from the previous "account flags" wording; since `userAccountControl` is a set of account flags, consider reverting to that phrase (or similar) to avoid confusion.

```suggestion
- **Disable Accounts** (`DisableUserAccountForMsAD`): Securely disables accounts by updating the `userAccountControl` attribute with the `ACCOUNTDISABLE` flag, dynamically preserving all other existing account flags to prevent unintended configuration loss.
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread tests/Bitai.LDAPHelper.Tests/AccountManagerAdapterTests.cs Outdated
Comment thread README.md Outdated
@bitai-cs
bitai-cs merged commit a75052e into main Jun 5, 2026
3 checks passed
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.

1 participant