Skip to content

Commit f0bccc1

Browse files
jacobm-splunkdaveshanley
authored andcommitted
OPENAPI: added commit information to flat report
1 parent 33f30d0 commit f0bccc1

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

cmd/flatten_report.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ func FlattenReport(report *model.Report) *model.FlatReport {
1818
changes = append(changes, change)
1919
}
2020
flatReport.Changes = changes
21+
22+
// Copy the Commit information from the report to the flatReport and then delete the changes
23+
flatReport.Commit = &model.Commit{}
24+
*flatReport.Commit = *report.Commit
25+
flatReport.Commit.Changes = nil
26+
2127
return flatReport
2228
}
2329

model/report.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ type Report struct {
2020
type FlatReport struct {
2121
Summary map[string]*reports.Changed `json:"reportSummary"`
2222
Changes []*model.Change `json:"changes"`
23+
Commit *Commit `gorm:"foreignKey:ID" json:"commitDetails"`
2324
}
2425

2526
type FlatHistoricalReport struct {

0 commit comments

Comments
 (0)