Skip to content

Commit fbfcab4

Browse files
Add debug logging to artifact manager, update command, and MCP config utils (#20261)
1 parent 44d2f5d commit fbfcab4

5 files changed

Lines changed: 20 additions & 1 deletion

File tree

pkg/cli/logs_utils.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ func getAgenticWorkflowNames(verbose bool) ([]string, error) {
3838
return nil, fmt.Errorf("failed to glob .lock.yml files: %w", err)
3939
}
4040

41+
logsUtilsLog.Printf("Found %d .lock.yml file(s) in %s", len(files), workflowsDir)
42+
4143
for _, file := range files {
4244
if verbose {
4345
fmt.Fprintln(os.Stderr, console.FormatInfoMessage("Reading workflow file: "+file))
@@ -64,6 +66,7 @@ func getAgenticWorkflowNames(verbose bool) ([]string, error) {
6466
name = strings.Trim(name, `"'`)
6567
if name != "" {
6668
workflowNames = append(workflowNames, name)
69+
logsUtilsLog.Printf("Discovered workflow name: %s (from %s)", name, file)
6770
if verbose {
6871
fmt.Fprintln(os.Stderr, console.FormatInfoMessage("Found agentic workflow: "+name))
6972
}

pkg/cli/update_command.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,20 @@ func RunUpdateWorkflows(workflowNames []string, allowMajor, force, verbose bool,
121121
// Update GitHub Actions versions in actions-lock.json.
122122
// By default all actions are updated to the latest major version.
123123
// Pass --disable-release-bump to revert to only forcing updates for core (actions/*) actions.
124+
updateLog.Printf("Updating GitHub Actions versions in actions-lock.json: allowMajor=%v, disableReleaseBump=%v", allowMajor, disableReleaseBump)
124125
if err := UpdateActions(allowMajor, verbose, disableReleaseBump); err != nil {
125126
// Non-fatal: warn but don't fail the update
126127
fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("Warning: Failed to update actions-lock.json: %v", err)))
127128
}
128129

129130
// Update action references in user-provided steps within workflow .md files.
130131
// By default all org/repo@version references are updated to the latest major version.
132+
updateLog.Print("Updating action references in workflow .md files")
131133
if err := UpdateActionsInWorkflowFiles(workflowsDir, engineOverride, verbose, disableReleaseBump, noCompile); err != nil {
132134
// Non-fatal: warn but don't fail the update
133135
fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("Warning: Failed to update action references in workflow files: %v", err)))
134136
}
135137

138+
updateLog.Printf("Update process complete: had_error=%v", firstErr != nil)
136139
return firstErr
137140
}

pkg/workflow/artifact_manager.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ type ArtifactFile struct {
8787

8888
// NewArtifactManager creates a new artifact manager
8989
func NewArtifactManager() *ArtifactManager {
90+
artifactManagerLog.Print("Creating new artifact manager")
9091
return &ArtifactManager{
9192
uploads: make(map[string][]*ArtifactUpload),
9293
downloads: make(map[string][]*ArtifactDownload),

pkg/workflow/create_code_scanning_alert.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,32 @@ func (c *Compiler) parseCodeScanningAlertsConfig(outputMap map[string]any) *Crea
2929
if driver, exists := configMap["driver"]; exists {
3030
if driverStr, ok := driver.(string); ok {
3131
securityReportsConfig.Driver = driverStr
32+
createCodeScanningAlertLog.Printf("Using custom SARIF driver name: %s", driverStr)
3233
}
3334
}
3435

3536
// Parse target-repo
3637
securityReportsConfig.TargetRepoSlug = parseTargetRepoFromConfig(configMap)
38+
if securityReportsConfig.TargetRepoSlug != "" {
39+
createCodeScanningAlertLog.Printf("Target repo for code scanning alerts: %s", securityReportsConfig.TargetRepoSlug)
40+
}
3741

3842
// Parse allowed-repos
3943
securityReportsConfig.AllowedRepos = parseAllowedReposFromConfig(configMap)
44+
if len(securityReportsConfig.AllowedRepos) > 0 {
45+
createCodeScanningAlertLog.Printf("Allowed repos for cross-repo alerts: %d configured", len(securityReportsConfig.AllowedRepos))
46+
}
4047

4148
// Parse common base fields with default max of 0 (unlimited)
4249
c.parseBaseSafeOutputConfig(configMap, &securityReportsConfig.BaseSafeOutputConfig, 0)
4350
} else {
4451
// If configData is nil or not a map (e.g., "create-code-scanning-alert:" with no value),
4552
// still set the default max (nil = unlimited)
53+
createCodeScanningAlertLog.Print("No config map provided, using defaults (unlimited max)")
4654
securityReportsConfig.Max = nil
4755
}
4856

57+
createCodeScanningAlertLog.Printf("Parsed create-code-scanning-alert config: driver=%q, target-repo=%q, allowed-repos=%d",
58+
securityReportsConfig.Driver, securityReportsConfig.TargetRepoSlug, len(securityReportsConfig.AllowedRepos))
4959
return securityReportsConfig
5060
}

pkg/workflow/mcp_config_utils.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,11 @@ func rewriteLocalhostToDockerHost(url string) string {
8282
// running on the host. Rewriting is enabled whenever the agent sandbox is active
8383
// (i.e. sandbox.agent is not explicitly disabled).
8484
func shouldRewriteLocalhostToDocker(workflowData *WorkflowData) bool {
85-
return workflowData != nil && (workflowData.SandboxConfig == nil ||
85+
result := workflowData != nil && (workflowData.SandboxConfig == nil ||
8686
workflowData.SandboxConfig.Agent == nil ||
8787
!workflowData.SandboxConfig.Agent.Disabled)
88+
mcpUtilsLog.Printf("shouldRewriteLocalhostToDocker: %v (agent sandbox active)", result)
89+
return result
8890
}
8991

9092
// noOpCacheMemoryRenderer is a no-op MCPToolRenderers.RenderCacheMemory function for engines

0 commit comments

Comments
 (0)