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:
commit
ee58658648
|
|
@ -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"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -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}}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue