Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions pkg/cli/audit_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ type OverviewData struct {
Event string `json:"event" console:"header:Event"`
Branch string `json:"branch" console:"header:Branch"`
URL string `json:"url" console:"header:URL"`
LogsPath string `json:"logs_path,omitempty" console:"header:Files,omitempty"`
}

// MetricsData contains execution metrics
Expand Down Expand Up @@ -135,6 +136,7 @@ type OverviewDisplay struct {
Event string `console:"header:Event"`
Branch string `console:"header:Branch"`
URL string `console:"header:URL"`
Files string `console:"header:Files,omitempty"`
}

// buildAuditData creates structured audit data from workflow run information
Expand All @@ -155,6 +157,18 @@ func buildAuditData(processedRun ProcessedRun, metrics LogMetrics) AuditData {
Branch: run.HeadBranch,
URL: run.URL,
}

// Convert LogsPath to relative path from workspace root
if run.LogsPath != "" {
logsPathDisplay := run.LogsPath
if cwd, err := os.Getwd(); err == nil {
if relPath, err := filepath.Rel(cwd, run.LogsPath); err == nil {
logsPathDisplay = relPath
}
}
overview.LogsPath = logsPathDisplay
}

if run.Duration > 0 {
overview.Duration = timeutil.FormatDuration(run.Duration)
}
Expand Down Expand Up @@ -562,6 +576,7 @@ func renderOverview(overview OverviewData) {
Event: overview.Event,
Branch: overview.Branch,
URL: overview.URL,
Files: overview.LogsPath,
}

fmt.Print(console.RenderStruct(display))
Expand Down
8 changes: 8 additions & 0 deletions pkg/cli/audit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,14 @@ func TestBuildAuditData(t *testing.T) {
if auditData.Overview.Status != "completed" {
t.Errorf("Expected status 'completed', got %s", auditData.Overview.Status)
}
// LogsPath should be converted to relative path
if auditData.Overview.LogsPath == "" {
t.Error("Expected logs path to be set")
}
// Verify that LogsPath is relative (doesn't start with /)
if filepath.IsAbs(auditData.Overview.LogsPath) && auditData.Overview.LogsPath != run.LogsPath {
t.Errorf("Expected logs path to be relative or match original, got '%s'", auditData.Overview.LogsPath)
}

// Verify metrics
if auditData.Metrics.TokenUsage != 1500 {
Expand Down