Skip to content

feat: implement ISupportDryRun on FixedWidthLoader (#197) - #215

Merged
Chris-Wolfgang merged 1 commit into
vNextfrom
feat/issue-197-dry-run
Jul 15, 2026
Merged

feat: implement ISupportDryRun on FixedWidthLoader (#197)#215
Chris-Wolfgang merged 1 commit into
vNextfrom
feat/issue-197-dry-run

Conversation

@Chris-Wolfgang

Copy link
Copy Markdown
Owner

Implements ISupportDryRun on FixedWidthLoader<TRecord> — part of the fleet-wide dry-run rollout (Abstractions 0.15.0, already referenced).

Behavior

When IsDryRun is true, the loader runs the full pipeline — enumerate the source, evaluate SkipItemCount / MaximumItemCount, increment progress counters, fire the progress-timer callback, log, and validate field widths — but writes nothing to the output stream. Defaults to false.

Implementation

  • Formatting is routed through TextWriter.Null in dry-run, so field-width validation still runs (a dry run surfaces FieldOverflowException exactly like a real run) while the real writer is left untouched.
  • The owned-writer flush is skipped in dry-run — otherwise the StreamWriter emits its UTF-8 BOM on .NET Framework even with no content, which the contract treats as a side effect (the same quirk ETL-Json ci(docfx): sync docfx.yaml to canonical #200 hit). Caught locally by the full-matrix gate before pushing.

Tests / surface

  • New FixedWidthLoaderDryRunContractTests : SupportsDryRunContractTests<FixedWidthLoader<PersonRecord>> (TestKit.Xunit 0.10.0, already referenced).
  • IsDryRun added to PublicAPI.Unshipped.txt; CHANGELOG [Unreleased] entry. Additive surface → MINOR (version bump deferred to release prep, per the vNext flow).

Local verification (full pr.yaml gate via dotnet)

  • Release build: 0 warnings, all TFMs
  • Full 13-TFM test matrix: 294/294 pass (net462→net10.0)
  • Coverage: 95.2% assembly / 93.7% loader (above the 90% gate)

Closes #197

FixedWidthLoader<TRecord> now implements ISupportDryRun (Abstractions
0.15.0). When IsDryRun is true the loader runs the full pipeline —
enumerate, evaluate SkipItemCount/MaximumItemCount, increment progress
counters, fire the progress-timer callback, log, and validate field
widths — but writes nothing to the output stream.

Implementation routes formatting through TextWriter.Null in dry-run so
field-width validation still runs while the real writer is untouched, and
skips the owned-writer flush (which would otherwise emit the StreamWriter
UTF-8 BOM on .NET Framework and register as a side effect).

- Add SupportsDryRunContractTests-derived FixedWidthLoaderDryRunContractTests.
- Add IsDryRun to PublicAPI.Unshipped.txt and a CHANGELOG [Unreleased] entry.

Verified locally: full 13-TFM matrix 294/294 green, 95.2% coverage.

Closes #197

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 15, 2026 00:25

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

}

if (_ownsWriter)
await FlushIfOwnedAsync(token).ConfigureAwait(false);

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@claude add {}

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