-
Notifications
You must be signed in to change notification settings - Fork 300
Fix safe-outputs message parsing and schema gaps for detection-failure and agent-failure-* #17207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
|
||
| return config | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
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(specificallyTestMergeSafeOutputsMessagesUnit) 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.