-
Notifications
You must be signed in to change notification settings - Fork 495
refactor(logs): extract AggregatedSummaryBase from near-duplicate summary structs #42552
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
76eee44
f0707bb
c18403c
36663d8
108c60a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -149,15 +149,22 @@ type MCPFailureReport struct { | |
| ReportProvenance | ||
| } | ||
|
|
||
| // MissingToolSummary aggregates missing tool reports across runs | ||
| type MissingToolSummary struct { | ||
| Tool string `json:"tool" console:"header:Tool"` | ||
| // AggregatedSummaryBase holds the shared tail fields that appear byte-for-byte identically | ||
| // in MissingToolSummary and MissingDataSummary (and as a subset in MCPFailureSummary). | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The parenthetical Suggested wording: // AggregatedSummaryBase holds the shared tail fields that appear byte-for-byte identically
// in MissingToolSummary and MissingDataSummary. MCPFailureSummary is intentionally excluded:
// its Count (header:Failures) and WorkflowsDisplay (maxlen:60) carry different console: tags.
// Embedding this struct removes copy-paste drift risk across the aggregated-report types.@copilot please address this.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [/codebase-design] The doc comment says 💡 Suggested rewording// AggregatedSummaryBase holds the shared tail fields that appear byte-for-byte identically
// in MissingToolSummary and MissingDataSummary. MCPFailureSummary carries overlapping fields
// but with different console: tag values (header:Failures, maxlen:60), so it does not embed
// this type.Being explicit about why @copilot please address this. |
||
| // Embedding this struct removes copy-paste drift risk across the aggregated-report types. | ||
| type AggregatedSummaryBase struct { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [/codebase-design] The 💡 Naming alternativesConsider a name that describes the data these fields represent:
@copilot please address this. |
||
| Count int `json:"count" console:"header:Occurrences"` | ||
| Workflows []string `json:"workflows" console:"-"` // List of workflow names that reported this tool | ||
| Workflows []string `json:"workflows" console:"-"` // List of workflow names | ||
| WorkflowsDisplay string `json:"-" console:"header:Workflows,maxlen:40"` // Formatted display of workflows | ||
| FirstReason string `json:"first_reason" console:"-"` // Reason from the first occurrence | ||
| FirstReasonDisplay string `json:"-" console:"header:First Reason,maxlen:50"` // Formatted display of first reason | ||
| RunIDs []int64 `json:"run_ids" console:"-"` // List of run IDs where this tool was reported | ||
| RunIDs []int64 `json:"run_ids" console:"-"` // List of run IDs | ||
| } | ||
|
|
||
| // MissingToolSummary aggregates missing tool reports across runs | ||
| type MissingToolSummary struct { | ||
| Tool string `json:"tool" console:"header:Tool"` | ||
| AggregatedSummaryBase | ||
| } | ||
|
Comment on lines
+164
to
168
|
||
|
|
||
| // MCPFailureSummary aggregates MCP server failure reports across runs | ||
|
|
@@ -171,13 +178,8 @@ type MCPFailureSummary struct { | |
|
|
||
| // MissingDataSummary aggregates missing data reports across runs | ||
| type MissingDataSummary struct { | ||
| DataType string `json:"data_type" console:"header:Data Type"` | ||
| Count int `json:"count" console:"header:Occurrences"` | ||
| Workflows []string `json:"workflows" console:"-"` // List of workflow names that reported this data | ||
| WorkflowsDisplay string `json:"-" console:"header:Workflows,maxlen:40"` // Formatted display of workflows | ||
| FirstReason string `json:"first_reason" console:"-"` // Reason from the first occurrence | ||
| FirstReasonDisplay string `json:"-" console:"header:First Reason,maxlen:50"` // Formatted display of first reason | ||
| RunIDs []int64 `json:"run_ids" console:"-"` // List of run IDs where this data was reported | ||
| DataType string `json:"data_type" console:"header:Data Type"` | ||
| AggregatedSummaryBase | ||
| } | ||
|
Comment on lines
179
to
183
|
||
|
|
||
| // MCPToolUsageSummary aggregates MCP tool usage across all runs | ||
|
|
||
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.
[/tdd]
TestMissingToolSummaryDisplayFieldsexists, and there is a symmetricTestMCPFailureSummaryDisplayFields, but noTestMissingDataSummaryDisplayFields. SinceMissingDataSummarynow embedsAggregatedSummaryBase, a parallel test would confirm thatconsole.RenderStructpromotes the embedded headers (Occurrences,Workflows,First Reason) correctly forMissingDataSummarytoo.💡 Suggested test skeleton
@copilot please address this.