Skip to content

Phase 4: Test coverage, build hygiene, and CI/CD hardening - #368

Merged
kzu merged 5 commits into
mainfrom
chore/phase-4-testing-ci
Nov 29, 2026
Merged

kzu merged 5 commits into
mainfrom
chore/phase-4-testing-ci

Conversation

@kzu

@kzu kzu commented Nov 29, 2026

Copy link
Copy Markdown
Member

Summary

Phase 4 of the Stunts codebase audit: strengthens test coverage and determinism, cleans up build/solution/repo hygiene, and hardens GitHub Actions workflows.

Test Coverage & Reliability

  • Added Phase4CoverageTests covering ST007 (GeneratorAttributeNotFound), analyzer-path ST013 (UnsupportedRuntimeSignature, including compile-time vs run-time constructor gating), MSBuild diagnostics (ST011, ST014, ST024), and in-process VB compilation of Stunt.vb and Stunt.DynamicFactory.vb under Option Strict On.
  • Added StuntCacheTests for compilation-option invalidation (LanguageVersion, NullableContextOptions, AllowUnsafe), stale entry / temp file / old version folder pruning, and concurrent reads/writes.
  • Removed blanket Retry + Thread.Sleep(500) from .Scenarios.cs and replaced Thread.Sleep(50) in StuntFactoryTests and BehaviorPipelineTests with deterministic Barrier synchronization.

Build, Solution & Repo Hygiene

  • Deleted dead src/Directory.targets (moving ResXFileCodeGenerator directly onto Resources.resx in Stunts.CodeAnalysis.csproj) and legacy Jekyll files (_config.yml, assets/css/style.scss).
  • Centralized RoslynVersion, RoslynToolsVersion, NuGetizerVersion, and PolySharpVersion in src/Directory.props and referenced them from Directory.Packages.props, Stunts.CodeAnalysis.csproj, Stunts.CodeFixes.csproj, and Stunts.CompiledProxy.targets.
  • Removed dead net48 conditions from Stunts.UnitTests.csproj and Samples.csproj and removed the missing wait-status.ps1 entry from Stunts.slnx.

CI/CD Hardening

  • Hardened .github/workflows/build.yml with workflow-level permissions: contents: read, SHA-pinned actions, env:-passed secrets, windows-latest in the native-aot matrix, and a dedicated samples job running samples/Samples.slnx.
  • Gated .github/workflows/publish.yml on native-aot and acceptance, pinned actions, added least-privilege permissions, and passed NUGET_API_KEY via env:.
  • Added PR dry-run Lunet build to .github/workflows/site.yml with pages: write / id-token: write scoped strictly to the non-PR deploy job.
  • Added github-actions weekly update checks to .github/dependabot.yml.

Verification

  • dotnet format whitespace --verify-no-changes and dotnet format style --verify-no-changes
  • Full dotnet build, dnx --yes retest, dotnet pack, and samples/Samples.slnx (13/13 passed)

This pull request was created by CodeAlta.

- Add tests for ST007, analyzer-path ST013, MSBuild diagnostics (ST011, ST014, ST024),
  automated in-process VB compilation of Stunt.vb and Stunt.DynamicFactory.vb, and
  StuntCache compilation-option invalidation, pruning, and concurrency.
- Remove blanket Retry/Thread.Sleep(500) from scenario tests and replace Thread.Sleep(50)
  in concurrency tests with deterministic Barrier synchronization.
- Delete dead src/Directory.targets and legacy Jekyll files (_config.yml, assets/css/style.scss);
  remove dead net48 conditions from Stunts.UnitTests.csproj and Samples.csproj; remove stale
  wait-status.ps1 entry from Stunts.slnx.
- Centralize RoslynVersion, RoslynToolsVersion, NuGetizerVersion, and PolySharpVersion in
  src/Directory.props.
- Harden GitHub Actions workflows (least-privilege permissions, SHA-pinned actions, env-passed
  secrets, windows-latest native-aot, samples job, publish gated on native-aot and acceptance,
  PR dry-run Lunet site build, and github-actions Dependabot updates).

Co-authored-by: CodeAlta <noreply@codealta.io>
@kzu kzu added the techdebt Technical debt label Nov 29, 2026
@kzu
kzu enabled auto-merge (rebase) November 29, 2026 20:48
kzu and others added 4 commits November 29, 2026 17:57
Declare nuget.org explicitly with <clear /> in samples/nuget.config and
remove the project-level RestoreSources override from Samples.csproj so
third-party packages resolve from nuget.org while Stunts* packages
resolve from the local bin feed.

Co-authored-by: CodeAlta <noreply@codealta.io>
WorkspaceHelper.Emit used a 10s CancellationTokenSource (and Scenarios,
ManualStunts, and AssertCode used 1s-5s timeouts) which could fire under
parallel test CPU contention on CI runners. Increase those timeouts to
60s (30s for syntax root) and dispose the CancellationTokenSource.

Co-authored-by: CodeAlta <noreply@codealta.io>
SynchronizedBehavior scenario waits and ambient Barrier waits used 2s-5s
timeouts, which could time out when Roslyn compilation tests running in
parallel starved the thread pool on CI runners. Use 30s timeouts.

Co-authored-by: CodeAlta <noreply@codealta.io>
Keep Ubuntu Native AOT job names as native-aot-net8.0 and
native-aot-net10.0 so the main branch ruleset required check
(native-aot-net10.0) continues to match while Windows runs as
native-aot-windows-net8.0 and native-aot-windows-net10.0.

Co-authored-by: CodeAlta <noreply@codealta.io>
@kzu
kzu merged commit 82b6baf into main Nov 29, 2026
12 checks passed
@kzu
kzu deleted the chore/phase-4-testing-ci branch November 29, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

techdebt Technical debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant