Merge pull request 'Update crash group title, add stack trace drop down' (#21) from fuzz-titles into main

Reviewed-on: https://git.ts.mattnite.net/mattnite/cairn/pulls/21
This commit is contained in:
Matthew Knight 2026-03-07 05:28:38 +00:00
commit ee58658648
5 changed files with 34 additions and 2 deletions

View File

@ -111,5 +111,6 @@ type CrashGroup struct {
RepoName string `json:"repo_name,omitempty"`
Fingerprint string `json:"fingerprint,omitempty"`
OccurrenceCount uint `json:"occurrence_count,omitempty"`
SampleTrace *string `json:"sample_trace,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) != "" {
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)
if groupErr == nil && h.ForgejoSync != nil {
_ = 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.Fingerprint = sig.Fingerprint
group.OccurrenceCount = sig.OccurrenceCount
group.SampleTrace = sig.SampleTrace
return &group, nil
}

View File

@ -445,6 +445,12 @@ code {
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 ======= */
.crashgroup-title {
font-family: var(--font-heading);

View File

@ -19,18 +19,34 @@
</thead>
<tbody>
{{range .CrashGroups}}
<tr>
<tr class="crashgroup-row" onclick="toggleTrace(this)">
<td><span class="badge badge-status-{{.Status}}">{{.Status}}</span></td>
<td>{{.Title}}</td>
<td>{{.RepoName}}</td>
<td>{{.OccurrenceCount}}</td>
<td>{{timeAgo .FirstSeenAt}}</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>
{{if .SampleTrace}}
<tr class="trace-row" style="display: none;">
<td colspan="7">
<div class="code-block">{{.SampleTrace}}</div>
</td>
</tr>
{{end}}
{{end}}
</tbody>
</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}}
<p class="empty-state">No crash groups yet. Crash groups are created automatically when artifacts with stack traces are uploaded.</p>
{{end}}