Skip to content

test: add XML-doc example-rot detection (#130) - #224

Merged
Chris-Wolfgang merged 4 commits into
vNextfrom
ci/doc-example-rot
Jul 24, 2026
Merged

test: add XML-doc example-rot detection (#130)#224
Chris-Wolfgang merged 4 commits into
vNextfrom
ci/doc-example-rot

Conversation

@Chris-Wolfgang

Copy link
Copy Markdown
Owner

Adds tests/Wolfgang.Etl.TestKit.Tests.DocExamples — a Roslyn meta-test that extracts every <example><code> block across both shipped projects (39 blocks) and compiles each against the current public API, failing if a snippet references a symbol the library no longer owns.

Harness (adapted from ETL-Transformers, made shape-aware)

TestKit's examples come in three shapes: statement snippets, full contract-test subclass declarations, and bare member overrides. The Transformers harness only wraps statements in a method body, which would falsely fail every declaration example. This version compiles each snippet in three contexts (top-level / class-member / async-method-body) and accepts it if any compiles cleanly — tolerating undefined illustrative placeholders (MyExtractor, sourceData) and member-extraction artifacts (override-nothing, duplicate-var).

One source doc edit (flagged for review)

src/Wolfgang.Etl.TestKit.Xunit/ManualProgressTimer.cs had an example that mixed a member declaration with usage statements in a single block — not rot, but un-hostable by any single wrapping. Converted the redundant protected override CreateSutWithTimer fragment (documented in ExtractorBaseContractTests) to a prose comment, keeping the valuable usage demo machine-checked. No API/behavior change.

Verified

Locally: all 39 examples compile (Passed: 1, the meta-test). Project is net10.0-only, IsPackable=false, added to ETL-Test-Kit.slnx.

Closes #130 when the vNext cycle merges to main.

🤖 Generated with Claude Code

Adds tests/Wolfgang.Etl.TestKit.Tests.DocExamples — a meta-test that extracts
every <example><code> block across both shipped projects (39 blocks) and
compiles each against the current public API via Roslyn, failing if a snippet
references a symbol the library no longer owns.

TestKit's examples come in three shapes (statements, full contract-test
subclasses, bare member overrides), so the harness compiles each snippet in
three contexts (top-level / class-member / async-method-body) and accepts it if
any context compiles cleanly, tolerating undefined illustrative placeholders and
member-extraction artifacts.

One example (ManualProgressTimer.cs) mixed a member declaration with usage
statements in a single block, which no single wrapping can host; converted the
redundant member fragment to prose (documented elsewhere) so the valuable usage
demo stays machine-checked. All 39 examples now compile.

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

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.

Chris-Wolfgang and others added 3 commits July 22, 2026 15:00
The actions-audit (#143) was failing every open PR on findings that aren't
actionable:

- actionlint tripped on info-level shellcheck nits (SC2012 'use find not ls',
  SC2035 'use ./*glob*') in the canonical pr.yaml. Set SHELLCHECK_OPTS to
  --severity=warning so it gates on warning+ (real issues), not style nits.
- zizmor flagged error[dangerous-triggers] on pr.yaml's pull_request_target.
  That is the intentional *gated* pattern (runs from trusted main, checks out PR
  refs, re-fetches config from main). Added a documented dangerous-triggers
  ignore for pr.yaml to .zizmor.yml and wired --config .zizmor.yml into the
  zizmor step (it is not auto-discovered).
- Enabling the config also activates the existing unpinned-uses:hash-pin policy,
  which then flagged pr.yaml's three remaining tag-pinned actions
  (checkout@v7, setup-dotnet@v5, upload-sarif@v4). SHA-pinned them to the repo
  canonical commits (also fixing a real SHA-pin-convention gap).

Verified locally: zizmor --config at high severity reports no findings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Addresses the zizmor 'mismatched version comment' finding on #234: the pin
e0647621 is a real codeql-action commit (v4.37.2) but not the one the v4 tag
points to, so the hash-pin comment-match check flags it. Re-pin every
codeql-action reference (init / analyze / upload-sarif across pr, codeql,
actions-audit, scorecard, semgrep) to e4fba868 — the actual commit v4 resolves
to (verified via the GitHub tags API) — so each # v4 comment now matches.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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