Skip to content

Commit 7357883

Browse files
Integrate VersionMark for tool version tracking in Build Notes PDF (#72)
* Initial plan * Add VersionMark tool and configuration for capturing tool versions - Add .versionmark.yaml configuration file defining all tools to capture - Add DemaConsulting.VersionMark v0.1.0 to .config/dotnet-tools.json - Add version capture steps to all workflow jobs: - quality-checks: captures dotnet, git, versionmark - build: captures dotnet, git, dotnet-sonarscanner, versionmark - integration-test: captures dotnet, git, versionmark - build-docs: captures all tools used in documentation generation - Add version publishing step in build-docs job to generate versions.md - Add docs/buildnotes/versions.md to buildnotes definition.yaml - Update .gitignore to exclude versionmark-*.json capture files - Add 'versionmark' to .cspell.json dictionary This enables tracking and publishing of tool versions used in each CI/CD job to the Build Notes PDF documentation, providing complete build environment transparency. * Fix versionmark command formatting for consistency and line length - Remove line continuation in build job versionmark capture (line 148) - Split build-docs versionmark capture into multiple lines to meet 120 char limit - Split versionmark publish command into multiple lines for better readability - Maintain consistent formatting across all versionmark commands in the workflow * Fix YAML formatting: simplify single-command run statements - Change 'run: >' to simple 'run:' for single-line dotnet tool restore commands - Improves consistency with other single-command steps in the workflow - Addresses code review feedback on YAML style inconsistencies * Add clarifying comments for version capture patterns - Document that .NET SDK versions include up to 4 components - Explain why versionmark captures its own version (complete tool transparency) - Addresses code review feedback on regex patterns and self-capture rationale * Fix BuildMark version capture to use --global flag Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com> * Remove BuildMark from integration-test version capture 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 f40d51d commit 7357883

File tree

6 files changed

+175
-0
lines changed

6 files changed

+175
-0
lines changed

.config/dotnet-tools.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@
4949
"commands": [
5050
"sarifmark"
5151
]
52+
},
53+
"demaconsulting.versionmark": {
54+
"version": "0.1.0",
55+
"commands": [
56+
"versionmark"
57+
]
5258
}
5359
}
5460
}

.cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"snupkg",
3737
"tracematrix",
3838
"trx",
39+
"versionmark",
3940
"Weasyprint",
4041
"yamllint"
4142
],

.github/workflows/build.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,28 @@ jobs:
1919
- name: Checkout
2020
uses: actions/checkout@v6
2121

22+
- name: Setup dotnet
23+
uses: actions/setup-dotnet@v5
24+
with:
25+
dotnet-version: 10.x
26+
27+
- name: Restore Tools
28+
run: dotnet tool restore
29+
30+
- name: Capture tool versions
31+
shell: bash
32+
run: |
33+
echo "Capturing tool versions..."
34+
# Capture versionmark itself for complete tool transparency
35+
dotnet versionmark --capture --job-id "quality" -- dotnet git versionmark
36+
echo "✓ Tool versions captured"
37+
38+
- name: Upload version capture
39+
uses: actions/upload-artifact@v6
40+
with:
41+
name: version-capture-quality
42+
path: versionmark-quality.json
43+
2244
- name: Run markdown linter
2345
uses: DavidAnson/markdownlint-cli2-action@v22
2446
with:
@@ -116,6 +138,22 @@ jobs:
116138
--no-restore
117139
--property:PackageVersion=${{ inputs.version }}
118140
141+
- name: Capture tool versions
142+
shell: bash
143+
run: |
144+
echo "Capturing tool versions..."
145+
# Create short job ID: build-win, build-ubuntu
146+
OS_SHORT=$(echo "${{ matrix.os }}" | sed 's/windows-latest/win/;s/ubuntu-latest/ubuntu/')
147+
JOB_ID="build-${OS_SHORT}"
148+
dotnet versionmark --capture --job-id "${JOB_ID}" -- dotnet git dotnet-sonarscanner versionmark
149+
echo "✓ Tool versions captured"
150+
151+
- name: Upload version capture
152+
uses: actions/upload-artifact@v6
153+
with:
154+
name: version-capture-${{ matrix.os }}
155+
path: versionmark-build-*.json
156+
119157
- name: Upload Test Results
120158
uses: actions/upload-artifact@v6
121159
with:
@@ -201,6 +239,13 @@ jobs:
201239
dotnet-version: ['8.x', '9.x', '10.x']
202240

203241
steps:
242+
- name: Checkout
243+
uses: actions/checkout@v6
244+
with:
245+
sparse-checkout: |
246+
.versionmark.yaml
247+
.config/dotnet-tools.json
248+
204249
- name: Download package
205250
uses: actions/download-artifact@v7
206251
with:
@@ -212,6 +257,9 @@ jobs:
212257
with:
213258
dotnet-version: ${{ matrix.dotnet-version }}
214259

260+
- name: Restore Tools
261+
run: dotnet tool restore
262+
215263
- name: Install tool from package
216264
shell: bash
217265
run: |
@@ -243,6 +291,23 @@ jobs:
243291
|| { echo "✗ Self-validation failed"; exit 1; }
244292
echo "✓ Self-validation succeeded"
245293
294+
- name: Capture tool versions
295+
shell: bash
296+
run: |
297+
echo "Capturing tool versions..."
298+
# Create short job ID: int-win-8, int-win-9, int-ubuntu-8, etc.
299+
OS_SHORT=$(echo "${{ matrix.os }}" | sed 's/windows-latest/win/;s/ubuntu-latest/ubuntu/')
300+
DOTNET_SHORT=$(echo "${{ matrix.dotnet-version }}" | sed 's/\.x$//')
301+
JOB_ID="int-${OS_SHORT}-${DOTNET_SHORT}"
302+
dotnet versionmark --capture --job-id "${JOB_ID}" -- dotnet git versionmark
303+
echo "✓ Tool versions captured"
304+
305+
- name: Upload version capture
306+
uses: actions/upload-artifact@v6
307+
with:
308+
name: version-capture-${{ matrix.os }}-dotnet${{ matrix.dotnet-version }}
309+
path: versionmark-int-*.json
310+
246311
- name: Upload validation test results
247312
if: always()
248313
uses: actions/upload-artifact@v6
@@ -307,6 +372,13 @@ jobs:
307372
name: codeql-sarif
308373
path: codeql-results
309374

375+
- name: Download all version captures
376+
uses: actions/download-artifact@v7
377+
with:
378+
path: version-captures
379+
pattern: 'version-capture-*'
380+
continue-on-error: true
381+
310382
- name: Generate Requirements Report and Trace Matrix
311383
run: >
312384
dotnet reqstream
@@ -359,6 +431,31 @@ jobs:
359431
--report docs/buildnotes.md
360432
--report-depth 1
361433
434+
- name: Capture tool versions for build-docs
435+
shell: bash
436+
run: |
437+
echo "Capturing tool versions..."
438+
dotnet versionmark --capture --job-id "build-docs" -- \
439+
dotnet git node npm pandoc weasyprint \
440+
sarifmark sonarmark reqstream buildmark versionmark
441+
echo "✓ Tool versions captured"
442+
443+
- name: Publish Tool Versions
444+
shell: bash
445+
run: |
446+
echo "Publishing tool versions..."
447+
dotnet versionmark --publish \
448+
--report docs/buildnotes/versions.md \
449+
--report-depth 1 \
450+
-- "versionmark-*.json" "version-captures/**/versionmark-*.json"
451+
echo "✓ Tool versions published"
452+
453+
- name: Display Tool Versions Report
454+
shell: bash
455+
run: |
456+
echo "=== Tool Versions Report ==="
457+
cat docs/buildnotes/versions.md
458+
362459
- name: Display Build Notes Report
363460
shell: bash
364461
run: |

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ docs/quality/sonar-quality.md
3838
docs/quality/codeql-quality.md
3939
docs/quality/*.html
4040
docs/buildnotes.md
41+
docs/buildnotes/versions.md
4142
docs/buildnotes/*.html
4243

44+
# VersionMark captures (generated during CI/CD)
45+
versionmark-*.json
46+
4347
# Agent report files
4448
AGENT_REPORT_*.md

.versionmark.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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+
# Note: .NET SDK versions include up to 4 components (e.g., 10.0.102, 8.0.404)
8+
dotnet:
9+
command: dotnet --version
10+
regex: '(?<version>\d+\.\d+\.\d+(?:\.\d+)?)'
11+
12+
# Git
13+
git:
14+
command: git --version
15+
regex: '(?i)git version (?<version>\d+\.\d+\.\d+)'
16+
17+
# Node.js
18+
node:
19+
command: node --version
20+
regex: '(?i)v(?<version>\d+\.\d+\.\d+)'
21+
22+
# npm
23+
npm:
24+
command: npm --version
25+
regex: '(?<version>\d+\.\d+\.\d+)'
26+
27+
# SonarScanner for .NET (from dotnet tool list)
28+
dotnet-sonarscanner:
29+
command: dotnet tool list
30+
regex: '(?i)dotnet-sonarscanner\s+(?<version>\d+\.\d+\.\d+)'
31+
32+
# Pandoc (DemaConsulting.PandocTool from dotnet tool list)
33+
pandoc:
34+
command: dotnet tool list
35+
regex: '(?i)demaconsulting\.pandoctool\s+(?<version>\d+\.\d+\.\d+)'
36+
37+
# WeasyPrint (DemaConsulting.WeasyPrintTool from dotnet tool list)
38+
weasyprint:
39+
command: dotnet tool list
40+
regex: '(?i)demaconsulting\.weasyprinttool\s+(?<version>\d+\.\d+\.\d+)'
41+
42+
# SarifMark (DemaConsulting.SarifMark from dotnet tool list)
43+
sarifmark:
44+
command: dotnet tool list
45+
regex: '(?i)demaconsulting\.sarifmark\s+(?<version>\d+\.\d+\.\d+)'
46+
47+
# SonarMark (DemaConsulting.SonarMark from dotnet tool list)
48+
sonarmark:
49+
command: dotnet tool list
50+
regex: '(?i)demaconsulting\.sonarmark\s+(?<version>\d+\.\d+\.\d+)'
51+
52+
# ReqStream (DemaConsulting.ReqStream from dotnet tool list)
53+
reqstream:
54+
command: dotnet tool list
55+
regex: '(?i)demaconsulting\.reqstream\s+(?<version>\d+\.\d+\.\d+)'
56+
57+
# BuildMark (DemaConsulting.BuildMark from dotnet tool list --global)
58+
# Note: BuildMark is installed globally in integration-test and build-docs jobs
59+
buildmark:
60+
command: dotnet tool list --global
61+
regex: '(?i)demaconsulting\.buildmark\s+(?<version>\d+\.\d+\.\d+)'
62+
63+
# VersionMark (DemaConsulting.VersionMark from dotnet tool list)
64+
versionmark:
65+
command: dotnet tool list
66+
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
@@ -7,6 +7,7 @@ input-files:
77
- docs/buildnotes/title.txt
88
- docs/buildnotes/introduction.md
99
- docs/buildnotes.md
10+
- docs/buildnotes/versions.md
1011

1112
template: template.html
1213

0 commit comments

Comments
 (0)