Update crash group title, add stack trace drop down

This commit is contained in:
Matthew Knight 2026-03-06 21:17:40 -08:00
parent aa0c47d9e7
commit bbecd40ce9
No known key found for this signature in database
5 changed files with 34 additions and 2 deletions

View File

@ -111,5 +111,6 @@ type CrashGroup struct {
RepoName string `json:"repo_name,omitempty"` RepoName string `json:"repo_name,omitempty"`
Fingerprint string `json:"fingerprint,omitempty"` Fingerprint string `json:"fingerprint,omitempty"`
OccurrenceCount uint `json:"occurrence_count,omitempty"` OccurrenceCount uint `json:"occurrence_count,omitempty"`
SampleTrace *string `json:"sample_trace,omitempty"`
ForgejoIssueURL *string `json:"forgejo_issue_url,omitempty"` ForgejoIssueURL *string `json:"forgejo_issue_url,omitempty"`
} }

View File

@ -123,6 +123,14 @@ func (h *IngestHandler) Create(c *gin.Context) {
if len(result.Frames) > 0 && strings.TrimSpace(result.Frames[0].Function) != "" { if len(result.Frames) > 0 && strings.TrimSpace(result.Frames[0].Function) != "" {
title = req.Type + ": " + result.Frames[0].Function title = req.Type + ": " + result.Frames[0].Function
} }
shortFP := result.Fingerprint
if len(shortFP) > 8 {
shortFP = shortFP[:8]
}
if req.CrashMessage != "" {
title += " — " + req.CrashMessage
}
title += " [" + shortFP + "]"
group, groupErr := models.CreateCrashGroup(ctx, h.DB, sig.ID, repo.ID, title) group, groupErr := models.CreateCrashGroup(ctx, h.DB, sig.ID, repo.ID, title)
if groupErr == nil && h.ForgejoSync != nil { if groupErr == nil && h.ForgejoSync != nil {
_ = h.ForgejoSync.CreateIssueForCrashGroup(ctx, group, req.StackTrace) _ = h.ForgejoSync.CreateIssueForCrashGroup(ctx, group, req.StackTrace)

View File

@ -117,6 +117,7 @@ func enrichCrashGroup(ctx context.Context, db *gorm.DB, model CrashGroup) (*cair
group.RepoName = repo.Name group.RepoName = repo.Name
group.Fingerprint = sig.Fingerprint group.Fingerprint = sig.Fingerprint
group.OccurrenceCount = sig.OccurrenceCount group.OccurrenceCount = sig.OccurrenceCount
group.SampleTrace = sig.SampleTrace
return &group, nil return &group, nil
} }

View File

@ -445,6 +445,12 @@ code {
box-shadow: 0 0 10px var(--accent-glow-soft); box-shadow: 0 0 10px var(--accent-glow-soft);
} }
/* ======= CRASH GROUP LIST ======= */
.crashgroup-row { cursor: pointer; }
.trace-row td { padding: 0 !important; border-bottom: 1px solid var(--border); }
.trace-row .code-block { margin: 0.5rem 0.75rem; max-height: 300px; overflow-y: auto; }
.trace-row:hover td { background: none; box-shadow: none; }
/* ======= CRASH GROUP DETAIL ======= */ /* ======= CRASH GROUP DETAIL ======= */
.crashgroup-title { .crashgroup-title {
font-family: var(--font-heading); font-family: var(--font-heading);

View File

@ -19,18 +19,34 @@
</thead> </thead>
<tbody> <tbody>
{{range .CrashGroups}} {{range .CrashGroups}}
<tr> <tr class="crashgroup-row" onclick="toggleTrace(this)">
<td><span class="badge badge-status-{{.Status}}">{{.Status}}</span></td> <td><span class="badge badge-status-{{.Status}}">{{.Status}}</span></td>
<td>{{.Title}}</td> <td>{{.Title}}</td>
<td>{{.RepoName}}</td> <td>{{.RepoName}}</td>
<td>{{.OccurrenceCount}}</td> <td>{{.OccurrenceCount}}</td>
<td>{{timeAgo .FirstSeenAt}}</td> <td>{{timeAgo .FirstSeenAt}}</td>
<td>{{timeAgo .LastSeenAt}}</td> <td>{{timeAgo .LastSeenAt}}</td>
<td><a href="/crashgroups/{{.ID}}" class="btn btn-sm">View</a></td> <td><a href="/crashgroups/{{.ID}}" class="btn btn-sm" onclick="event.stopPropagation()">View</a></td>
</tr> </tr>
{{if .SampleTrace}}
<tr class="trace-row" style="display: none;">
<td colspan="7">
<div class="code-block">{{.SampleTrace}}</div>
</td>
</tr>
{{end}}
{{end}} {{end}}
</tbody> </tbody>
</table> </table>
<script>
function toggleTrace(row) {
var traceRow = row.nextElementSibling;
if (traceRow && traceRow.classList.contains('trace-row')) {
traceRow.style.display = traceRow.style.display === 'none' ? '' : 'none';
}
}
</script>
{{else}} {{else}}
<p class="empty-state">No crash groups yet. Crash groups are created automatically when artifacts with stack traces are uploaded.</p> <p class="empty-state">No crash groups yet. Crash groups are created automatically when artifacts with stack traces are uploaded.</p>
{{end}} {{end}}