Skip to content

Commit ecaf0b4

Browse files
committed
Print the revision within the markdown reports
Closes #207
1 parent 1ed28ea commit ecaf0b4

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

cmd/eval-dev-quality/cmd/evaluate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ func (command *Evaluate) evaluateLocal(evaluationContext *evaluate.Context) (err
419419
if err := (report.Markdown{
420420
DateTime: command.timestamp,
421421
Version: evaluate.Version,
422+
Revision: evaluate.Revision,
422423

423424
CSVPath: "./evaluation.csv",
424425
LogPath: "./evaluation.log",

evaluate/report/markdown.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ type Markdown struct {
2525
DateTime time.Time
2626
// Version holds the version of the evaluation tool.
2727
Version string
28+
// Revision holds the Git revision of the evaluation tool.
29+
Revision string
2830

2931
// CSVPath holds the path of detailed CSV results.
3032
CSVPath string
@@ -71,7 +73,7 @@ var markdownTemplate = template.Must(template.New("template-report").Parse(bytes
7173
7274
![Bar chart that categorizes all evaluated models.]({{.SVGPath}})
7375
74-
This report was generated by [DevQualityEval benchmark](https://github.com/symflower/eval-dev-quality) in ` + "`" + `version {{.Version}}` + "`" + `.
76+
This report was generated by [DevQualityEval benchmark](https://github.com/symflower/eval-dev-quality) in ` + "`" + `version {{.Version}}` + "`" + ` - ` + "`" + `revision {{.Revision}}` + "`" + `.
7577
7678
## Results
7779

evaluate/report/markdown_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func TestMarkdownWriteToFile(t *testing.T) {
6262
Markdown: Markdown{
6363
DateTime: testTime,
6464
Version: "1234",
65+
Revision: "abcd",
6566

6667
CSVPath: "./file.csv",
6768
LogPath: "./file.log",
@@ -74,7 +75,7 @@ func TestMarkdownWriteToFile(t *testing.T) {
7475
7576
![Bar chart that categorizes all evaluated models.](./file.svg)
7677
77-
This report was generated by [DevQualityEval benchmark](https://github.com/symflower/eval-dev-quality) in ` + "`" + `version 1234` + "`" + `.
78+
This report was generated by [DevQualityEval benchmark](https://github.com/symflower/eval-dev-quality) in ` + "`" + `version 1234` + "`" + ` - ` + "`" + `revision abcd` + "`" + `.
7879
7980
## Results
8081
@@ -101,6 +102,7 @@ func TestMarkdownWriteToFile(t *testing.T) {
101102
Markdown: Markdown{
102103
DateTime: testTime,
103104
Version: "1234",
105+
Revision: "abcd",
104106

105107
CSVPath: "./file.csv",
106108
LogPath: "./file.log",
@@ -121,7 +123,7 @@ func TestMarkdownWriteToFile(t *testing.T) {
121123
122124
![Bar chart that categorizes all evaluated models.](./file.svg)
123125
124-
This report was generated by [DevQualityEval benchmark](https://github.com/symflower/eval-dev-quality) in ` + "`" + `version 1234` + "`" + `.
126+
This report was generated by [DevQualityEval benchmark](https://github.com/symflower/eval-dev-quality) in ` + "`" + `version 1234` + "`" + ` - ` + "`" + `revision abcd` + "`" + `.
125127
126128
## Results
127129

0 commit comments

Comments
 (0)