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
2 changes: 0 additions & 2 deletions pkg/cli/compile_batch_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ func purgeOrphanedLockFiles(workflowsDir string, expectedLockFiles []string, ver
if verbose {
fmt.Fprintln(os.Stderr, console.FormatSuccessMessage(fmt.Sprintf("Purged %d orphaned .lock.yml files", len(orphanedFiles))))
}
} else if verbose {
fmt.Fprintln(os.Stderr, console.FormatInfoMessage("No orphaned .lock.yml files found to purge"))
}

compileBatchOperationsLog.Printf("Purged %d orphaned lock files", len(orphanedFiles))
Expand Down
4 changes: 2 additions & 2 deletions pkg/cli/compile_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ func collectWorkflowStats(lockFilePath string) (*WorkflowStats, error) {

// displayStatsTable displays workflow statistics in a sorted table
func displayStatsTable(statsList []*WorkflowStats) {
compileStatsLog.Printf("Displaying stats table: workflow_count=%d", len(statsList))
if len(statsList) == 0 {
fmt.Fprintln(os.Stderr, console.FormatWarningMessage("No workflow statistics to display"))
return
}
Comment on lines 95 to 98
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

displayStatsTable now returns with no user-facing output when statsList is empty, but it still emits a debug log line to stderr before the empty check (compileStatsLog.Printf(...)). Because logger enablement is determined at init time from DEBUG/ACTIONS_RUNNER_DEBUG, this can cause unexpected stderr output (and will break the updated empty-output test) when debug logging is enabled. Consider moving the compileStatsLog.Printf after the len(statsList) == 0 early return, or otherwise avoid writing to stderr for the empty case.

See below for a potential fix:

	if len(statsList) == 0 {
		return
	}

	compileStatsLog.Printf("Displaying stats table: workflow_count=%d", len(statsList))

Copilot uses AI. Check for mistakes.

compileStatsLog.Printf("Displaying stats table: workflow_count=%d", len(statsList))

// Sort by file size (descending)
sort.Slice(statsList, func(i, j int) bool {
return statsList[i].FileSize > statsList[j].FileSize
Expand Down
4 changes: 2 additions & 2 deletions pkg/cli/compile_stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ func TestDisplayStatsTable_Empty(t *testing.T) {
buf.ReadFrom(r)
output := buf.String()

if !strings.Contains(output, "No workflow statistics to display") {
t.Errorf("Expected warning message for empty stats list, got: %s", output)
if output != "" {
t.Errorf("Expected no output for empty stats list, got: %s", output)
}
}

Expand Down