Skip to content

V10.1.4/service update#32

Merged
gimlichael merged 15 commits into
mainfrom
v10.1.4/service-update
Jun 5, 2026
Merged

V10.1.4/service update#32
gimlichael merged 15 commits into
mainfrom
v10.1.4/service-update

Conversation

@gimlichael

Copy link
Copy Markdown
Member

This pull request delivers a patch release (v10.1.4) focused on improving code quality, CI/CD infrastructure, and documentation for both developers and AI agents. It introduces official AI agent guidance, expands the CI pipeline with macOS test support and stricter quality gating, upgrades dependencies, and fixes several bugs in JSON extension logic. Notably, it also prohibits code coverage exclusions to ensure more reliable test metrics.

Documentation and AI Agent Guidance

  • Added AGENTS.md with official instructions for AI agents, detailing project overview, standards, test conventions, CI practices, and safeguards for git operations. Also clarified the purpose and handling of the .bot/ folder for confidential agent ideation material. (AGENTS.md, .bot/README.md) [1] [2]
  • Updated CHANGELOG.md to document these changes and linked new release notes. [1] [2]

Testing and Code Coverage Improvements

  • Added comprehensive new unit test files to increase code coverage (e.g., DynamicContractResolverTest, ExceptionConverterTest, etc.).
  • Expanded test coverage in existing test classes (e.g., MvcBuilderExtensionsTests, NewtonsoftJsonFormatterTest, etc.).
  • Explicitly prohibited the use of ExcludeFromCodeCoverage attributes in Copilot instructions, emphasizing refactoring over coverage exclusion. (.github/copilot-instructions.md)

CI/CD Pipeline Enhancements

  • CI pipeline now supports an optional macOS test matrix (X64 and ARM64), configurable via workflow dispatch input. (.github/workflows/ci-pipeline.yml) [1] [2] [3] [4]
  • Introduced a test_qualitygate job to coordinate test result validation, ensuring all required test suites pass before proceeding to quality and deployment jobs.
  • Corrected the Codecov repository reference and improved job dependencies for downstream quality and deployment jobs.

Dependency and Package Management

  • Upgraded all dependencies to the latest compatible versions for supported target frameworks, including bumping Microsoft.NET.Test.Sdk from 18.5.1 to 18.6.0. (Directory.Packages.props, .nuget/Codebelt.Extensions.*.Json/PackageReleaseNotes.txt) [1] [2] [3] [4] [5]

Bug Fixes

  • TransientFaultExceptionConverter now gracefully handles null evidence by providing a default instance, preventing null reference exceptions. (src/Codebelt.Extensions.Newtonsoft.Json/Converters/TransientFaultExceptionConverter.cs)
  • JDataResultExtensions validates PropertyName before path comparison to avoid null reference errors. (src/Codebelt.Extensions.Newtonsoft.Json/JDataResultExtensions.cs)

codebelt-aicia Bot and others added 9 commits June 5, 2026 11:21
Introduce AGENTS.md as official repository guidance for AI agents working in this codebase, including project overview, coding standards, test conventions, build & CI practices, and git operation safeguards. Expand copilot-instructions.md with explicit guidelines prohibiting ExcludeFromCodeCoverage attributes across all code paths, emphasizing code refactoring over metrics exclusion.
Add workflow_dispatch input to optionally run macOS test matrix (X64 and ARM64 variants) despite increased cost and runtime. Introduce test_qualitygate job to orchestrate test result validation, ensuring all required test suites complete successfully before downstream quality and deployment jobs. Fix codecov repository reference from 'codebeltnet/newtonsoft' to 'codebeltnet/newtonsoft-json'. Update job dependencies throughout pipeline to reference test_qualitygate rather than individual test jobs.
Add .bot/ folder to gitignore with allowance for .bot/README.md. The .bot/ directory contains local-only AI agent ideation material including product requirement documents, design proposals, and agentic loop state that should never be committed to the repository.
Update Microsoft.NET.Test.SDK from 18.5.1 to 18.6.0, the latest stable patch version. This brings bug fixes and improvements to the test infrastructure without breaking changes.
TransientFaultExceptionConverter now handles null evidence by creating a default TransientFaultEvidence instance. JDataResultExtensions validates PropertyName is not null or empty before attempting wildcard matching to prevent null reference exceptions.
Adds 11 new test files covering DynamicContractResolver, ExceptionConverter, StringFlagsEnumConverter, TransientFaultExceptionConverter, JDataResult, JDataResultExtensions, JsonConverterFactory, JsonSerializerSettingsExtensions, and JsonWriterExtensions. Expands test coverage with additional test methods in MvcBuilderExtensionsTests, NewtonsoftJsonFormatterTest, ContractResolverExtensionsTest, and ValidatorExtensionsTest.
Adds detailed release notes to PackageReleaseNotes.txt and comprehensive changelog to CHANGELOG.md documenting all additions, changes, and bug fixes for version 10.1.4. Includes sections on test coverage expansion, CI/CD enhancements, AI agent guidance, and defensive null-checking improvements.
@gimlichael gimlichael self-assigned this Jun 5, 2026
@greptile-apps

greptile-apps Bot commented Jun 5, 2026

Copy link
Copy Markdown

Greptile Summary

This patch release (v10.1.4) delivers targeted bug fixes, a reworked CI pipeline with macOS support and a quality-gate fan-in job, significantly expanded test coverage, and new AI-agent guidance documentation.

  • Bug fixes: TransientFaultExceptionConverter now creates a default TransientFaultEvidence when the JSON payload lacks an evidence section, preventing a null reference exception on deserialization; both ExtractObjectValues and ExtractArrayValues in JDataResultExtensions now guard against null PropertyName before adding entries to the accumulator list, eliminating the null-key Dictionary exception that would follow.
  • DynamicContractResolver refactor: DynamicCamelCasePropertyNamesContractResolver overrides ResolveContract with an instance-local cache so handler-backed resolvers are never served contracts from CamelCasePropertyNamesContractResolver's shared static cache, fixing a subtle contract-contamination bug.
  • CI pipeline: A new test_qualitygate fan-in job gates all downstream analysis and deployment jobs; sonarcloud/codecov/codeql now run only when the quality gate passes; the Codecov repository slug was corrected from codebeltnet/newtonsoft to codebeltnet/newtonsoft-json.

Confidence Score: 5/5

Safe to merge — all three source-level changes are minimal, targeted fixes with direct test coverage, and the CI restructuring correctly handles optional jobs.

The bug fixes in TransientFaultExceptionConverter and JDataResultExtensions are straightforward null-guards, each backed by new unit tests. The DynamicContractResolver change is well-motivated and the new test specifically validates the shared-cache scenario that motivated it. The CI quality-gate logic correctly distinguishes between skipped and failed for the optional macOS matrix. The two issues flagged in previous reviews have both been addressed in this PR.

No files require special attention.

Important Files Changed

Filename Overview
src/Codebelt.Extensions.Newtonsoft.Json/Converters/TransientFaultExceptionConverter.cs Added null-guard for evidence after deserialization, creating a default TransientFaultEvidence instance to prevent NRE when evidence is absent from the JSON payload.
src/Codebelt.Extensions.Newtonsoft.Json/JDataResultExtensions.cs Added !string.IsNullOrEmpty(jr.PropertyName) guard to both ExtractObjectValues and ExtractArrayValues, preventing null-key Dictionary exceptions when PropertyName is null.
src/Codebelt.Extensions.Newtonsoft.Json/DynamicContractResolver.cs Introduced per-instance contract cache for DynamicCamelCasePropertyNamesContractResolver to avoid handler-contamination from the static shared cache; correct and well-motivated fix.
.github/workflows/ci-pipeline.yml Added optional macOS test matrix, a test_qualitygate fan-in job with correct skipped/success handling, and fixed Codecov repository reference.
test/Codebelt.Extensions.Newtonsoft.Json.Tests/Converters/TransientFaultExceptionConverterTest.cs New test file covering CanConvert, WriteJson, and ReadJson including proper round-trip with evidence field validation.
test/Codebelt.Extensions.Newtonsoft.Json.Tests/JDataResultExtensionsTest.cs New test file with comprehensive coverage of Flatten, ExtractObjectValues, and ExtractArrayValues including null-source and asterisk-pattern scenarios.
test/Codebelt.Extensions.Newtonsoft.Json.Tests/DynamicContractResolverTest.cs New test file validating handler invocation, naming conventions, and the shared-cache scenario.
AGENTS.md New file documenting AI-agent guidance including project overview, coding standards, test conventions, CI practices, and git safeguards.

Reviews (5): Last reviewed commit: "🐛 fix condition for macOS in test proje..." | Re-trigger Greptile

aicia-bot added 3 commits June 5, 2026 23:44
Add null-safety check for PropertyName before accessing names list. Prevents null reference exceptions when jr.PropertyName is not set during filtering operations.
…nverter test

Expand test to verify full deserialization behavior and validate that evidence is correctly preserved during serialization and deserialization cycles. Removes redundant comments and adds comprehensive assertions on message, inner exception, and evidence properties.
Implement thread-safe caching of resolved contracts in DynamicCamelCasePropertyNamesContractResolver using a lock-protected dictionary. Reduces repeated contract resolution overhead and improves performance for repeated serialization operations. Adds test coverage for caching behavior including edge case where multiple resolver instances interact with the contract cache.
@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.24%. Comparing base (fadaad2) to head (ac6ff5c).
⚠️ Report is 21 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #32       +/-   ##
===========================================
+ Coverage   78.01%   99.24%   +21.23%     
===========================================
  Files          24       25        +1     
  Lines         905      929       +24     
  Branches      111      116        +5     
===========================================
+ Hits          706      922      +216     
+ Misses        197        7      -190     
+ Partials        2        0        -2     

☔ View full report in Codecov by Harness.
📢 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.

@gimlichael gimlichael merged commit be365db into main Jun 5, 2026
24 checks passed
@gimlichael gimlichael deleted the v10.1.4/service-update branch June 5, 2026 23:24
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.

2 participants