Skip to content

Commit 25407e9

Browse files
Add tool version tracking to Build Notes PDF (#29)
* Initial plan * Add VersionMark tool and configuration for capturing tool versions Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> * Add generated files to .gitignore Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> * Address code review feedback: make regex case-insensitive and remove hardcoded versions Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> * Fix regex patterns for .NET SDK and add case-insensitive matching for git, node Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> * Add versionmark to tool capture lists in all jobs and make build-docs explicit Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> * Fix integration-test job: move checkout before package download Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
1 parent d482b9e commit 25407e9

File tree

5 files changed

+177
-0
lines changed

5 files changed

+177
-0
lines changed

.config/dotnet-tools.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@
4343
"commands": [
4444
"buildmark"
4545
]
46+
},
47+
"demaconsulting.versionmark": {
48+
"version": "0.1.0",
49+
"commands": [
50+
"versionmark"
51+
]
4652
}
4753
}
4854
}

.github/workflows/build.yaml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,28 @@ jobs:
2121
- name: Checkout
2222
uses: actions/checkout@v6
2323

24+
- name: Setup dotnet
25+
uses: actions/setup-dotnet@v5
26+
with:
27+
dotnet-version: 10.x
28+
29+
- name: Restore Tools
30+
run: >
31+
dotnet tool restore
32+
33+
- name: Capture tool versions
34+
shell: bash
35+
run: |
36+
echo "Capturing tool versions..."
37+
dotnet versionmark --capture --job-id "quality" -- dotnet git versionmark
38+
echo "✓ Tool versions captured"
39+
40+
- name: Upload version capture
41+
uses: actions/upload-artifact@v6
42+
with:
43+
name: version-capture-quality
44+
path: versionmark-quality.json
45+
2446
- name: Run markdown linter
2547
uses: DavidAnson/markdownlint-cli2-action@v22
2648
with:
@@ -121,6 +143,23 @@ jobs:
121143
--no-restore
122144
--property:PackageVersion=${{ inputs.version }}
123145
146+
- name: Capture tool versions
147+
shell: bash
148+
run: |
149+
echo "Capturing tool versions..."
150+
# Create short job ID: build-win, build-ubuntu
151+
OS_SHORT=$(echo "${{ matrix.os }}" | sed 's/windows-latest/win/;s/ubuntu-latest/ubuntu/')
152+
JOB_ID="build-${OS_SHORT}"
153+
dotnet versionmark --capture --job-id "${JOB_ID}" -- \
154+
dotnet git dotnet-sonarscanner versionmark
155+
echo "✓ Tool versions captured"
156+
157+
- name: Upload version capture
158+
uses: actions/upload-artifact@v6
159+
with:
160+
name: version-capture-${{ matrix.os }}
161+
path: versionmark-build-*.json
162+
124163
- name: Upload Test Results
125164
uses: actions/upload-artifact@v6
126165
with:
@@ -211,6 +250,13 @@ jobs:
211250
dotnet-version: ['8.x', '9.x', '10.x']
212251

213252
steps:
253+
- name: Checkout
254+
uses: actions/checkout@v6
255+
with:
256+
sparse-checkout: |
257+
.versionmark.yaml
258+
.config/dotnet-tools.json
259+
214260
- name: Download package
215261
uses: actions/download-artifact@v7
216262
with:
@@ -222,6 +268,10 @@ jobs:
222268
with:
223269
dotnet-version: ${{ matrix.dotnet-version }}
224270

271+
- name: Restore Tools
272+
run: >
273+
dotnet tool restore
274+
225275
- name: Install tool from package
226276
shell: bash
227277
run: |
@@ -253,6 +303,23 @@ jobs:
253303
|| { echo "✗ Self-validation failed"; exit 1; }
254304
echo "✓ Self-validation succeeded"
255305
306+
- name: Capture tool versions
307+
shell: bash
308+
run: |
309+
echo "Capturing tool versions..."
310+
# Create short job ID: int-win-8, int-win-9, int-ubuntu-8, etc.
311+
OS_SHORT=$(echo "${{ matrix.os }}" | sed 's/windows-latest/win/;s/ubuntu-latest/ubuntu/')
312+
DOTNET_SHORT=$(echo "${{ matrix.dotnet-version }}" | sed 's/\.x$//')
313+
JOB_ID="int-${OS_SHORT}-${DOTNET_SHORT}"
314+
dotnet versionmark --capture --job-id "${JOB_ID}" -- dotnet git versionmark
315+
echo "✓ Tool versions captured"
316+
317+
- name: Upload version capture
318+
uses: actions/upload-artifact@v6
319+
with:
320+
name: version-capture-${{ matrix.os }}-dotnet${{ matrix.dotnet-version }}
321+
path: versionmark-int-*.json
322+
256323
- name: Upload validation test results
257324
if: always()
258325
uses: actions/upload-artifact@v6
@@ -297,6 +364,13 @@ jobs:
297364
name: codeql-sarif
298365
path: codeql-results
299366

367+
- name: Download all version captures
368+
uses: actions/download-artifact@v7
369+
with:
370+
path: version-captures
371+
pattern: 'version-capture-*'
372+
continue-on-error: true
373+
300374
- name: Setup dotnet
301375
uses: actions/setup-dotnet@v5
302376
with:
@@ -317,6 +391,14 @@ jobs:
317391
- name: Restore Tools
318392
run: dotnet tool restore
319393

394+
- name: Capture tool versions for build-docs
395+
shell: bash
396+
run: |
397+
echo "Capturing tool versions..."
398+
dotnet versionmark --capture --job-id "build-docs" -- \
399+
dotnet git node npm pandoc weasyprint sarifmark sonarmark reqstream buildmark versionmark
400+
echo "✓ Tool versions captured"
401+
320402
- name: Generate Requirements Report, Justifications, and Trace Matrix
321403
run: >
322404
dotnet reqstream
@@ -370,6 +452,20 @@ jobs:
370452
--report docs/buildnotes.md
371453
--report-depth 1
372454
455+
- name: Publish Tool Versions
456+
shell: bash
457+
run: |
458+
echo "Publishing tool versions..."
459+
dotnet versionmark --publish --report docs/buildnotes/versions.md --report-depth 1 \
460+
-- "versionmark-*.json" "version-captures/**/versionmark-*.json"
461+
echo "✓ Tool versions published"
462+
463+
- name: Display Tool Versions Report
464+
shell: bash
465+
run: |
466+
echo "=== Tool Versions Report ==="
467+
cat docs/buildnotes/versions.md
468+
373469
- name: Generate Build Notes HTML with Pandoc
374470
shell: bash
375471
run: >

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,23 @@ __pycache__/
8989
docs/**/*.html
9090
docs/**/*.pdf
9191
!docs/template/**
92+
docs/requirements/requirements.md
93+
docs/justifications/justifications.md
94+
docs/tracematrix/tracematrix.md
95+
docs/quality/codeql-quality.md
96+
docs/quality/sonar-quality.md
97+
docs/buildnotes.md
98+
docs/buildnotes/versions.md
9299

93100
# Test results
94101
TestResults/
95102
*.trx
96103
*.xml
97104
coverage.opencover.xml
98105

106+
# VersionMark captures (generated during CI/CD)
107+
versionmark-*.json
108+
99109
# Temporary files
100110
*.tmp
101111
*.temp

.versionmark.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
# VersionMark Configuration File
3+
# This file defines which tools to capture and how to extract their version information.
4+
5+
tools:
6+
# .NET SDK
7+
dotnet:
8+
command: dotnet --version
9+
regex: '(?<version>\d+\.\d+\.\d+(?:\.\d+)?)'
10+
11+
# Git
12+
git:
13+
command: git --version
14+
regex: '(?i)git version (?<version>\d+\.\d+\.\d+)'
15+
16+
# Node.js
17+
node:
18+
command: node --version
19+
regex: '(?i)v(?<version>\d+\.\d+\.\d+)'
20+
21+
# npm
22+
npm:
23+
command: npm --version
24+
regex: '(?<version>\d+\.\d+\.\d+)'
25+
26+
# SonarScanner for .NET (from dotnet tool list)
27+
dotnet-sonarscanner:
28+
command: dotnet tool list
29+
regex: '(?i)dotnet-sonarscanner\s+(?<version>\d+\.\d+\.\d+)'
30+
31+
# Pandoc (DemaConsulting.PandocTool from dotnet tool list)
32+
pandoc:
33+
command: dotnet tool list
34+
regex: '(?i)demaconsulting\.pandoctool\s+(?<version>\d+\.\d+\.\d+)'
35+
36+
# WeasyPrint (DemaConsulting.WeasyPrintTool from dotnet tool list)
37+
weasyprint:
38+
command: dotnet tool list
39+
regex: '(?i)demaconsulting\.weasyprinttool\s+(?<version>\d+\.\d+\.\d+)'
40+
41+
# SarifMark (DemaConsulting.SarifMark from dotnet tool list)
42+
sarifmark:
43+
command: dotnet tool list
44+
regex: '(?i)demaconsulting\.sarifmark\s+(?<version>\d+\.\d+\.\d+)'
45+
46+
# SonarMark (DemaConsulting.SonarMark from dotnet tool list)
47+
sonarmark:
48+
command: dotnet tool list
49+
regex: '(?i)demaconsulting\.sonarmark\s+(?<version>\d+\.\d+\.\d+)'
50+
51+
# ReqStream (DemaConsulting.ReqStream from dotnet tool list)
52+
reqstream:
53+
command: dotnet tool list
54+
regex: '(?i)demaconsulting\.reqstream\s+(?<version>\d+\.\d+\.\d+)'
55+
56+
# BuildMark (DemaConsulting.BuildMark from dotnet tool list)
57+
buildmark:
58+
command: dotnet tool list
59+
regex: '(?i)demaconsulting\.buildmark\s+(?<version>\d+\.\d+\.\d+)'
60+
61+
# VersionMark (DemaConsulting.VersionMark from dotnet tool list)
62+
versionmark:
63+
command: dotnet tool list
64+
regex: '(?i)demaconsulting\.versionmark\s+(?<version>\d+\.\d+\.\d+)'

docs/buildnotes/definition.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ input-files:
66
- docs/buildnotes/title.txt
77
- docs/buildnotes/introduction.md
88
- docs/buildnotes.md
9+
- docs/buildnotes/versions.md
910
template: template.html
1011
table-of-contents: true
1112
number-sections: true

0 commit comments

Comments
 (0)