From 498ea144a7fd347f749052b35f912f2d9024f893 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Dec 2025 17:20:08 +0000 Subject: [PATCH 1/3] Initial plan From bc093c4c07470a9c872cba375b35e3dc266241f8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Dec 2025 17:33:33 +0000 Subject: [PATCH 2/3] Add log file folder location to audit command overview section Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/release.lock.yml | 4 ++-- pkg/cli/audit_report.go | 4 ++++ pkg/cli/audit_test.go | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.lock.yml b/.github/workflows/release.lock.yml index ff08e762e0e..326a7745951 100644 --- a/.github/workflows/release.lock.yml +++ b/.github/workflows/release.lock.yml @@ -6276,13 +6276,13 @@ jobs: - name: Download Go modules run: go mod download - name: Generate SBOM (SPDX format) - uses: anchore/sbom-action@fbfd9c6c189226748411491745178e0c2017392d # v0 + uses: anchore/sbom-action@fbfd9c6c189226748411491745178e0c2017392d # v0.20.10 with: artifact-name: sbom.spdx.json format: spdx-json output-file: sbom.spdx.json - name: Generate SBOM (CycloneDX format) - uses: anchore/sbom-action@fbfd9c6c189226748411491745178e0c2017392d # v0 + uses: anchore/sbom-action@fbfd9c6c189226748411491745178e0c2017392d # v0.20.10 with: artifact-name: sbom.cdx.json format: cyclonedx-json diff --git a/pkg/cli/audit_report.go b/pkg/cli/audit_report.go index bbb4aedaf63..98adeb2db30 100644 --- a/pkg/cli/audit_report.go +++ b/pkg/cli/audit_report.go @@ -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 @@ -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 @@ -154,6 +156,7 @@ func buildAuditData(processedRun ProcessedRun, metrics LogMetrics) AuditData { Event: run.Event, Branch: run.HeadBranch, URL: run.URL, + LogsPath: run.LogsPath, } if run.Duration > 0 { overview.Duration = timeutil.FormatDuration(run.Duration) @@ -562,6 +565,7 @@ func renderOverview(overview OverviewData) { Event: overview.Event, Branch: overview.Branch, URL: overview.URL, + Files: overview.LogsPath, } fmt.Print(console.RenderStruct(display)) diff --git a/pkg/cli/audit_test.go b/pkg/cli/audit_test.go index 1cca9a7c0d5..e15cfe370db 100644 --- a/pkg/cli/audit_test.go +++ b/pkg/cli/audit_test.go @@ -707,6 +707,9 @@ func TestBuildAuditData(t *testing.T) { if auditData.Overview.Status != "completed" { t.Errorf("Expected status 'completed', got %s", auditData.Overview.Status) } + if auditData.Overview.LogsPath != run.LogsPath { + t.Errorf("Expected logs path '%s', got '%s'", run.LogsPath, auditData.Overview.LogsPath) + } // Verify metrics if auditData.Metrics.TokenUsage != 1500 { From 644979efe6a3e74c5d1aaf3932421cbcb1b348a7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Dec 2025 17:48:13 +0000 Subject: [PATCH 3/3] Make log file path relative to workspace in audit overview Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/cli/audit_report.go | 13 ++++++++++++- pkg/cli/audit_test.go | 9 +++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/pkg/cli/audit_report.go b/pkg/cli/audit_report.go index 98adeb2db30..169a410144d 100644 --- a/pkg/cli/audit_report.go +++ b/pkg/cli/audit_report.go @@ -156,8 +156,19 @@ func buildAuditData(processedRun ProcessedRun, metrics LogMetrics) AuditData { Event: run.Event, Branch: run.HeadBranch, URL: run.URL, - LogsPath: run.LogsPath, } + + // 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) } diff --git a/pkg/cli/audit_test.go b/pkg/cli/audit_test.go index e15cfe370db..51bcf15d9cf 100644 --- a/pkg/cli/audit_test.go +++ b/pkg/cli/audit_test.go @@ -707,8 +707,13 @@ func TestBuildAuditData(t *testing.T) { if auditData.Overview.Status != "completed" { t.Errorf("Expected status 'completed', got %s", auditData.Overview.Status) } - if auditData.Overview.LogsPath != run.LogsPath { - t.Errorf("Expected logs path '%s', got '%s'", run.LogsPath, auditData.Overview.LogsPath) + // 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