Skip to content

Fix style verification failures and add CI checks - #625

Open
nmummau wants to merge 6 commits into
Eventuous:devfrom
nmummau:fix/624
Open

nmummau wants to merge 6 commits into
Eventuous:devfrom
nmummau:fix/624

Conversation

@nmummau

@nmummau nmummau commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #624
Fixes #626

  • dotnet format style --verify-no-changes passes without errors
  • mongo tests run on CI

Run dotnet format style checks on pull requests and pushes to dev.
Fail verification when required project references cannot be loaded,
and require code style checks to pass before preview publishing.

Document local verification and formatting commands for contributors

issue Eventuous#624
Rename static fields and the StreamReadPosition constructor parameter
to match the repository's naming conventions.

issue Eventuous#624
Exclude Analyzed.cs from project compilation while preserving its
explicit imports for standalone Roslyn analysis.

Reference required assemblies explicitly and fail tests on compiler
errors or unexpected analyzer diagnostics. Allow compiler errors
only in the intentional missing-assembly test.

issue Eventuous#624
@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Fix code-style violations and enforce style checks in CI

🐞 Bug fix 🧪 Tests ⚙️ Configuration changes 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Resolve naming and unnecessary-import violations so solution-wide style verification passes.
• Compile analyzer input as test data and reject compiler errors or unexpected diagnostics.
• Add reusable CI style checks, gate preview publishing, and document local commands.
Diagram

graph TD
  PR["PR checks"] --> Style["Style workflow"] --> Restore["Solution restore"] --> Format["Format verify"]
  Dev["Dev preview"] --> Style
  Dev --> Tests["Test suite"] --> Publish["NuGet publish"]
  Format -->|required| Publish
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Inline style checks in each caller
  • ➕ Each workflow would contain its complete verification steps.
  • ➖ Duplicated restore and verification logic could drift between PR and preview checks.

Recommendation: Keep the reusable workflow: both CI callers need the same verification, and a single implementation preserves consistent failure handling. Inlining offers little benefit for these two callers.

Files changed (14) +97 / -36

Bug fix (8) +14 / -19
EventuousDiagnostics.csRename the static diagnostics listener field +4/-4

Rename the static diagnostics listener field

• Renames the private static field and its uses to satisfy the configured naming rule without changing listener behavior.

src/Core/src/Eventuous.Diagnostics/EventuousDiagnostics.cs

ExpectedStreamVersion.csRename the stream-position constructor parameter +3/-3

Rename the stream-position constructor parameter

• Changes the parameter from 'Value' to 'value' while retaining the public 'Value' property. Named constructor arguments must now use 'value:'.

src/Core/src/Eventuous.Persistence/ExpectedStreamVersion.cs

EventSerializer.csRename the default serializer backing field +4/-4

Rename the default serializer backing field

• Renames the private static field across default-serializer access and assignment paths to satisfy naming rules.

src/Core/src/Eventuous.Serialization/EventSerializer.cs

TypeMap.csRename the type-map index field +3/-4

Rename the type-map index field

• Renames the private static index field and its references, and removes its obsolete naming suppression.

src/Core/src/Eventuous.Shared/TypeMap/TypeMap.cs

GapAgeReleaseWhileRunningTest.csRemove an unused subscription-test import +0/-1

Remove an unused subscription-test import

• Removes an unnecessary persistence-fixtures using directive to satisfy style verification.

src/Postgres/test/Eventuous.Tests.Postgres/Subscriptions/GapAgeReleaseWhileRunningTest.cs

GapRemediationBeforeSkipTest.csRemove an unused subscription-test import +0/-1

Remove an unused subscription-test import

• Removes an unnecessary persistence-fixtures using directive to satisfy style verification.

src/Postgres/test/Eventuous.Tests.Postgres/Subscriptions/GapRemediationBeforeSkipTest.cs

GapSkipTimeoutTest.csRemove an unused subscription-test import +0/-1

Remove an unused subscription-test import

• Removes an unnecessary persistence-fixtures using directive to satisfy style verification.

src/Postgres/test/Eventuous.Tests.Postgres/Subscriptions/GapSkipTimeoutTest.cs

MetricsFixture.csRemove an unused metrics-fixture import +0/-1

Remove an unused metrics-fixture import

• Removes an unnecessary logging using directive to satisfy style verification.

src/Sqlite/test/Eventuous.Tests.Sqlite/Metrics/MetricsFixture.cs

Tests (2) +19 / -16
Analyzer_Ev001_Tests.csStrengthen standalone analyzer-test compilation +14/-16

Strengthen standalone analyzer-test compilation

• Adds explicit assembly references and rejects compiler errors and unexpected analyzer diagnostics. The intentional missing-assembly test alone permits compiler errors.

src/Core/test/Eventuous.Tests.Shared.Analyzers/Analyzer_Ev001_Tests.cs

Eventuous.Tests.Shared.Analyzers.csprojTreat analyzer input as test data +5/-0

Treat analyzer input as test data

• Excludes 'Analyzed.cs' from normal project compilation while keeping it available for the analyzer tests' standalone compilation.

src/Core/test/Eventuous.Tests.Shared.Analyzers/Eventuous.Tests.Shared.Analyzers.csproj

Documentation (1) +18 / -0
CONTRIBUTING.mdDocument local code-style commands +18/-0

Document local code-style commands

• Explains how to verify and apply available style fixes locally, and notes CI's unloaded-reference check.

CONTRIBUTING.md

Other (3) +46 / -1
code-style.ymlAdd reusable solution-wide style verification +37/-0

Add reusable solution-wide style verification

• Restores the solution and verifies warning- and error-level code-style rules. Fails if formatter output reports unloaded required references, while preserving formatter failures.

.github/workflows/code-style.yml

preview.ymlGate preview publishing on code style +5/-1

Gate preview publishing on code style

• Calls the reusable style workflow and requires it, alongside tests, before the NuGet publishing job runs.

.github/workflows/preview.yml

pull-request.ymlRun code-style verification in PR CI +4/-0

Run code-style verification in PR CI

• Adds the reusable style workflow to pull-request checks.

.github/workflows/pull-request.yml

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Named-argument callers fail to compile 🐞 Bug ≡ Correctness
Description
StreamReadPosition renames its public constructor parameter from Value to value, so Value:
is no longer a valid named argument. Consumers using the previous spelling must change their source
code when they update the package; negative-value exceptions also change their ParamName from
Value to value.
Code

src/Core/src/Eventuous.Persistence/ExpectedStreamVersion.cs[R14-15]

+    public StreamReadPosition(long value) {
+        if (value < 0) throw new ArgumentOutOfRangeException(nameof(value), "StreamReadPosition cannot be negative.");
Evidence
The changed constructor declaration shows that its accepted named-argument spelling is now value;
the changed nameof expression likewise changes the exception parameter name. The preceding
spelling is visible on the removed lines of the same diff.

src/Core/src/Eventuous.Persistence/ExpectedStreamVersion.cs[13-17]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Renaming the public constructor parameter breaks consumers that call it with `Value:` and changes the exception parameter name.
## Fix Focus Areas
- src/Core/src/Eventuous.Persistence/ExpectedStreamVersion.cs[14-17]
## Recommended Fix
Retain `Value` as the constructor parameter and its exception parameter name. Apply a narrowly scoped naming-rule suppression for this existing public API so style verification can pass without changing callers' source contract.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can open the rule or relationship behind a finding in one click

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Test Results

   48 files  ±0     48 suites  ±0   15m 1s ⏱️ -38s
  617 tests ±0    617 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 234 runs  ±0  1 234 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 32d2467. ± Comparison against base commit 60a7643.

♻️ This comment has been updated with latest results.

Use a per-suite runner override to avoid MongoDB startup failures
on Ubuntu 26.04 kernels. Document the upstream compatibility issue.

Fixes Eventuous#626
MongoDB 8 exits on affected Linux 6.19+ kernels, including the runner used after pinning Ubuntu 24.04. Use the unaffected MongoDB 7.0 test image and remove the ineffective runner override.

Validation: all nine MongoDB integration tests passed on net10.0 in Debug CI; targeted style verification and workflow YAML validation passed.
@nmummau

nmummau commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

@alexeyzimarev this can be reviewed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant