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
10 changes: 10 additions & 0 deletions pkg/parser/schemas/main_workflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6378,6 +6378,16 @@
"description": "Custom message template for detection job failure. Available placeholders: {workflow_name}, {run_url}. Default: '\u26a0\ufe0f Security scanning failed for [{workflow_name}]({run_url}). Review the logs for details.'",
"examples": ["\u26a0\ufe0f Security scanning failed for [{workflow_name}]({run_url}). Review the logs for details.", "\u26a0\ufe0f Detection job failed in [{workflow_name}]({run_url})."]
},
"agent-failure-issue": {
"type": "string",
"description": "Custom footer template for agent failure tracking issues. Available placeholders: {workflow_name}, {run_url}. Default: '> Agent failure tracked by [{workflow_name}]({run_url})'",
"examples": ["> Agent failure tracked by [{workflow_name}]({run_url})", "> Failure report from [{workflow_name}]({run_url})"]
},
"agent-failure-comment": {
"type": "string",
"description": "Custom footer template for comments on agent failure tracking issues. Available placeholders: {workflow_name}, {run_url}. Default: '> Agent failure update from [{workflow_name}]({run_url})'",
"examples": ["> Agent failure update from [{workflow_name}]({run_url})", "> Update from [{workflow_name}]({run_url})"]
},
"append-only-comments": {
"type": "boolean",
"description": "When enabled, workflow completion notifier creates a new comment instead of editing the activation comment. Creates an append-only timeline of workflow runs. Default: false",
Expand Down
9 changes: 9 additions & 0 deletions pkg/workflow/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,15 @@ func mergeMessagesConfig(result, imported *SafeOutputMessagesConfig) *SafeOutput
if result.RunFailure == "" && imported.RunFailure != "" {
result.RunFailure = imported.RunFailure
}
if result.DetectionFailure == "" && imported.DetectionFailure != "" {
result.DetectionFailure = imported.DetectionFailure
}
if result.AgentFailureIssue == "" && imported.AgentFailureIssue != "" {
result.AgentFailureIssue = imported.AgentFailureIssue
}
if result.AgentFailureComment == "" && imported.AgentFailureComment != "" {
result.AgentFailureComment = imported.AgentFailureComment
}
Comment on lines +686 to +694
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The merge logic for the three new message fields follows the established pattern correctly. However, the existing tests in pkg/workflow/safe_outputs_import_test.go (specifically TestMergeSafeOutputsMessagesUnit) don't verify these new fields. The test assertions at lines 610-617 should be extended to also check DetectionFailure, AgentFailureIssue, and AgentFailureComment to ensure they are merged correctly during imports.

Copilot uses AI. Check for mistakes.
if !result.AppendOnlyComments && imported.AppendOnlyComments {
result.AppendOnlyComments = imported.AppendOnlyComments
}
Expand Down
18 changes: 18 additions & 0 deletions pkg/workflow/safe_outputs_config_messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,24 @@ func parseMessagesConfig(messagesMap map[string]any) *SafeOutputMessagesConfig {
}
}

if detectionFailure, exists := messagesMap["detection-failure"]; exists {
if detectionFailureStr, ok := detectionFailure.(string); ok {
config.DetectionFailure = detectionFailureStr
}
}

if agentFailureIssue, exists := messagesMap["agent-failure-issue"]; exists {
if agentFailureIssueStr, ok := agentFailureIssue.(string); ok {
config.AgentFailureIssue = agentFailureIssueStr
}
}

if agentFailureComment, exists := messagesMap["agent-failure-comment"]; exists {
if agentFailureCommentStr, ok := agentFailureComment.(string); ok {
config.AgentFailureComment = agentFailureCommentStr
}
}

Comment on lines +82 to +99
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The new message parsing logic for detection-failure, agent-failure-issue, and agent-failure-comment follows the established pattern correctly. However, the existing tests in pkg/workflow/safe_outputs_test.go (specifically TestParseMessagesConfig) don't verify these three new fields. Consider adding test cases that include these fields to ensure they are parsed correctly, similar to the existing test case "all fields" at lines 344-366 in safe_outputs_test.go.

Copilot uses AI. Check for mistakes.
return config
}

Expand Down
Loading