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
5 changes: 2 additions & 3 deletions pkg/cli/audit_comparison.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,7 @@ func collectMCPFailureServers(failures []MCPFailureReport) []string {
return servers
}

func findPreviousSuccessfulWorkflowRuns(ctx context.Context, current WorkflowRun, owner, repo, hostname string, verbose bool) ([]WorkflowRun, error) {
_ = verbose
func findPreviousSuccessfulWorkflowRuns(ctx context.Context, current WorkflowRun, owner, repo, hostname string) ([]WorkflowRun, error) {
workflowID := filepath.Base(current.WorkflowPath)
if workflowID == "." || workflowID == "" {
return nil, fmt.Errorf("workflow path unavailable for run %d", current.DatabaseID)
Expand Down Expand Up @@ -508,7 +507,7 @@ func findPreviousSuccessfulWorkflowRuns(ctx context.Context, current WorkflowRun
}

func buildAuditComparisonForRun(ctx context.Context, currentRun ProcessedRun, currentSnapshot auditComparisonSnapshot, outputDir string, owner, repo, hostname string, verbose bool) *AuditComparisonData {
baselineRuns, err := findPreviousSuccessfulWorkflowRuns(ctx, currentRun.Run, owner, repo, hostname, verbose)
baselineRuns, err := findPreviousSuccessfulWorkflowRuns(ctx, currentRun.Run, owner, repo, hostname)
if err != nil {
auditLog.Printf("Skipping audit comparison: failed to find baseline: %v", err)
return &AuditComparisonData{BaselineFound: false}
Expand Down
4 changes: 2 additions & 2 deletions pkg/cli/commands_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ More content.

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result, err := findIncludesInContent(tt.content, "", false)
result, err := findIncludesInContent(tt.content)
if err != nil {
t.Errorf("Unexpected error: %v", err)
return
Expand Down Expand Up @@ -320,7 +320,7 @@ More content here.
Final content.`

for b.Loop() {
_, _ = findIncludesInContent(content, "", false)
_, _ = findIncludesInContent(content)
}
}

Expand Down
8 changes: 3 additions & 5 deletions pkg/cli/remove_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func cleanupOrphanedIncludes(verbose bool) error {
}

// Find includes used by this workflow
includes, err := findIncludesInContent(string(content), filepath.Dir(mdFile), verbose)
includes, err := findIncludesInContent(string(content))
if err != nil {
if verbose {
fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("Could not analyze includes in %s: %v", mdFile, err)))
Expand Down Expand Up @@ -297,7 +297,7 @@ func previewOrphanedIncludes(filesToRemove []string, verbose bool) ([]string, er
}

// Find includes used by this workflow
includes, err := findIncludesInContent(string(content), filepath.Dir(mdFile), verbose)
includes, err := findIncludesInContent(string(content))
if err != nil {
if verbose {
fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("Could not analyze includes in %s: %v", mdFile, err)))
Expand Down Expand Up @@ -414,9 +414,7 @@ func hasDirectiveMarker(content string) bool {
}

// findIncludesInContent finds all import references in content
func findIncludesInContent(content, baseDir string, verbose bool) ([]string, error) {
_ = baseDir // unused parameter for now, keeping for potential future use
_ = verbose // unused parameter for now, keeping for potential future use
func findIncludesInContent(content string) ([]string, error) {

// Fast path: skip the line scan entirely when no directive markers are present.
if !hasDirectiveMarker(content) {
Expand Down