Skip to content

Apply TemplateDotNetTool template updates: staged pipelines, artifact consolidation, semantic requirement IDs, and OTS Software requirements#120

Merged
Malcolmnixon merged 5 commits intomainfrom
copilot/update-template-project-changes
Mar 4, 2026
Merged

Apply TemplateDotNetTool template updates: staged pipelines, artifact consolidation, semantic requirement IDs, and OTS Software requirements#120
Malcolmnixon merged 5 commits intomainfrom
copilot/update-template-project-changes

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

Pull Request

Description

Ports all recent improvements from the TemplateDotNetTool template into ReqStream, covering CI workflow restructuring, artifact naming conventions, OTS Software requirements, semantic requirement IDs, stderr error output, csproj packaging organisation, and minor documentation accuracy fixes. Also fixes a Windows-specific file lock bug introduced by the AutoFlush log writer change.

.github/workflows/build.yaml (Template PR #52)

All jobs now follow four consistent sections with # === SECTION === comments:

  • quality-checks: version capture writes to artifacts/; VersionMark self-validation added; upload renamed to artifacts-quality
  • build: version capture moved before build/test; test results written to artifacts/ via LogFilePrefix + --results-directory; VersionMark self-validation added; uploads split into artifacts-build-${{ matrix.os }} (all build outputs) and packages-${{ matrix.os }} (NuGet only)
  • codeql: CodeQL SARIF output routed directly to artifacts/; uploaded as artifacts-codeql
  • integration-test: version capture moved before tests; self-validation TRX written to artifacts/; two separate uploads consolidated into single artifacts-validation-${{ matrix.os }}-dotnet${{ matrix.dotnet-version }}
  • build-docs: four separate artifact downloads collapsed into one with pattern: 'artifacts-*' + merge-multiple: true; packages-ubuntu-latest downloaded separately to packages/; adds five OTS self-validation steps (ReqStream, BuildMark, VersionMark, SarifMark, SonarMark); all paths updated to artifacts/

requirements.yaml — Semantic requirement IDs (Template PR #50)

All 38 requirement IDs renamed from opaque numeric format (CLI-001, REQ-001, PLT-001…) to self-documenting semantic format (ReqStream-Cmd-Cli, ReqStream-Req-YamlProcessing, ReqStream-Plt-Windows…) following the ReqStream-[Section]-[Description] convention with short 3-4 character section names.

Three new CLI requirements added (Template PR #48): ReqStream-Cmd-ErrorOutput, ReqStream-Cmd-InvalidArgs, and ReqStream-Cmd-ExitCode.

New OTS Software section with six ots-tagged requirements — ReqStream-OTS-MSTest, ReqStream-OTS-ReqStream, ReqStream-OTS-BuildMark, ReqStream-OTS-VersionMark, ReqStream-OTS-SarifMark, ReqStream-OTS-SonarMark — each linked to self-validation TRX evidence.

Context.cs / Program.cs — stderr for errors (Template PR #48)

  • Context.WriteError() now writes to Console.Error instead of Console.Out
  • Program.Main catch blocks now write to Console.Error
  • Log StreamWriter opened with AutoFlush = true
  • Existing Context_WriteError_* tests updated to capture Console.Error; Program_Run_WithEnforcementAndUnsatisfiedRequirements_Fails updated to use an explicit using block so the context (and log StreamWriter) is disposed before reading the log file, fixing a Windows file-lock IOException

DemaConsulting.ReqStream.csproj — package grouping (Template PR #47)

Reorganised into three labeled ItemGroups: Runtime Dependencies, Build Tool Dependencies, and Code Analysis Dependencies. Polyfill moved to Build Tool Dependencies with simplified PrivateAssets="All" inline form.

DemaConsulting.ReqStream.Tests.csproj — LangVersion (Template PR #41)

LangVersion updated from 12 to latest (missed in the previous sync).

Documentation fixes (Template PRs #39, #50)

  • README.md: CLA sentence added to License section
  • AGENTS.md: encoding description corrected from UTF-8+BOMUTF-8
  • CONTRIBUTING.md: encoding description corrected from UTF-8 with BOMUTF-8

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code quality improvement

Related Issues

Pre-Submission Checklist

Before submitting this pull request, ensure you have completed the following:

Build and Test

  • Code builds successfully: dotnet build --configuration Release
  • All unit tests pass: dotnet test --configuration Release
  • Self-validation tests pass:
    dotnet run --project src/DemaConsulting.ReqStream --configuration Release --framework net10.0
    --no-build -- --validate
  • Code produces zero warnings

Code Quality

  • Code formatting is correct: dotnet format --verify-no-changes
  • New code has appropriate XML documentation comments
  • Static analyzer warnings have been addressed

Quality Checks

Please run the following checks before submitting:

  • Spell checker passes: cspell "**/*.{md,cs}"
  • Markdown linter passes: markdownlint "**/*.md"
  • YAML linter passes: yamllint .

Testing

  • Added unit tests for new functionality
  • Updated existing tests if behavior changed
  • All tests follow the AAA (Arrange, Act, Assert) pattern
  • Test coverage is maintained or improved

Documentation

  • Updated README.md (if applicable)
  • Updated ARCHITECTURE.md (if applicable)
  • Added code examples for new features (if applicable)
  • Updated requirements.yaml (if applicable)

Additional Notes

The artifacts/ folder convention ensures every CI job writes all outputs to a single local directory without intermediate copy steps, keeping download/publish steps simple and consistent. The build-docs job downloads packages-ubuntu-latest to a separate packages/ folder and installs ReqStream via --add-source packages, consistent with the integration-test job pattern. Requirement ID changes in requirements.yaml do not affect test result matching — only the requirement IDs change, not the linked test names. The Windows file-lock fix ensures Program_Run_WithEnforcementAndUnsatisfiedRequirements_Fails disposes the Context (closing the log StreamWriter) before calling File.ReadAllText — this was silently succeeding on Linux but failing with IOException on Windows. All 132 unit tests pass with 0 build warnings and 0 CodeQL alerts.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…tion, artifact-naming, OTS requirements

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot AI changed the title [WIP] Update repository with recent template project changes Apply TemplateDotNetTool PR #52: staged pipelines, artifact consolidation, and OTS Software requirements Mar 4, 2026
Copy link
Contributor

@Malcolmnixon Malcolmnixon left a comment

Choose a reason for hiding this comment

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

I think you may have missed numerous template changes - please review the recent template PRs and apply them all - that includes things like updating the requirement IDs from numeric to semantic - but I believe there are numerous other changes that weren't applied.

…j grouping, encoding fixes, CLA

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 4, 2026

I think you may have missed numerous template changes - please review the recent template PRs and apply them all - that includes things like updating the requirement IDs from numeric to semantic - but...

Applied all missed template changes in commit 5d3c462:

Template PR #50 – Semantic requirement IDs & encoding fixes

  • All 38 requirement IDs renamed from numeric format (CLI-001, REQ-001, PLT-001…) to semantic format (ReqStream-Cmd-Cli, ReqStream-Req-YamlProcessing, ReqStream-Platform-Windows…)
  • AGENTS.md: UTF-8+BOMUTF-8
  • CONTRIBUTING.md: UTF-8 with BOMUTF-8

Template PR #48 – stderr for errors + AutoFlush

  • Context.WriteError(): Console.WriteLineConsole.Error.WriteLine
  • Program.Main catch blocks: Console.WriteLineConsole.Error.WriteLine
  • StreamWriter log file: added AutoFlush = true
  • Tests updated to capture stderr; Program_Run_WithEnforcementAndUnsatisfiedRequirements_Fails uses --log for reliable capture
  • Three new requirements added: ReqStream-Cmd-ErrorOutput, ReqStream-Cmd-InvalidArgs, ReqStream-Cmd-ExitCode

Template PR #47 – csproj package grouping

  • Source csproj reorganized into three labeled ItemGroups: Runtime Dependencies, Build Tool Dependencies, Code Analysis Dependencies
  • Polyfill simplified to inline PrivateAssets="All" form in Build Tool Dependencies

Template PR #41 (missed from PR #113) – LangVersion

  • Test csproj: LangVersion 12latest

Template PR #39 – CLA sentence

  • README.md License section: added CLA sentence

All 132 unit tests pass, 0 build warnings, 0 CodeQL alerts.

Copilot AI changed the title Apply TemplateDotNetTool PR #52: staged pipelines, artifact consolidation, and OTS Software requirements Apply TemplateDotNetTool template updates: staged pipelines, artifact consolidation, semantic requirement IDs, and OTS Software requirements Mar 4, 2026
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
@Malcolmnixon
Copy link
Contributor

@copilot Something happened to the Windows build - it's failing 100% of the time on Net 8/9/10:

Failed!  - Failed:     1, Passed:   131, Skipped:     0, Total:   132, Duration: 1 s - DemaConsulting.ReqStream.Tests.dll (net10.0)
  Failed Program_Run_WithEnforcementAndUnsatisfiedRequirements_Fails [88 ms]
  Error Message:
   Test method DemaConsulting.ReqStream.Tests.ProgramTests.Program_Run_WithEnforcementAndUnsatisfiedRequirements_Fails threw exception:
System.IO.IOException: The process cannot access the file 'C:\Users\runneradmin\AppData\Local\Temp\reqstream_test_dc8d2afc-7ee1-4dcc-bb07-8c75067c9194\enforcement-test.log' because it is being used by another process.
  Stack Trace:
     at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
   at System.IO.File.ReadAllText(String path, Encoding encoding)
   at DemaConsulting.ReqStream.Tests.ProgramTests.Program_Run_WithEnforcementAndUnsatisfiedRequirements_Fails() in D:\a\ReqStream\ReqStream\test\DemaConsulting.ReqStream.Tests\ProgramTests.cs:line 510
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

It's not a collision with the tests running on the other multitarget executions, because they do have different GUIDs - it's like this thing is failing to release a file resource.

…s_Fails on Windows

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 4, 2026

@copilot Something happened to the Windows build - it's failing 100% of the time on Net 8/9/10:

...

Fixed in commit 28c47a0. The using var context was still in scope (keeping the StreamWriter open) when File.ReadAllText(logFile) was called. Changed to an explicit using (...) { } block so context is disposed (closing the log file) before the file is read. All three target frameworks now pass the test locally.

Copy link
Contributor

@Malcolmnixon Malcolmnixon left a comment

Choose a reason for hiding this comment

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

Something happened to the Windows

@Malcolmnixon Malcolmnixon marked this pull request as ready for review March 4, 2026 20:51
@Malcolmnixon Malcolmnixon merged commit 04b72b9 into main Mar 4, 2026
11 checks passed
@Malcolmnixon Malcolmnixon deleted the copilot/update-template-project-changes branch March 4, 2026 20:51
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