diff --git a/internal/api/types.go b/internal/api/types.go index ae99c3b..bac2bd8 100644 --- a/internal/api/types.go +++ b/internal/api/types.go @@ -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"` } diff --git a/internal/handler/ingest.go b/internal/handler/ingest.go index 2992fc3..385e8ab 100644 --- a/internal/handler/ingest.go +++ b/internal/handler/ingest.go @@ -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) diff --git a/internal/models/crash_group.go b/internal/models/crash_group.go index f1d685b..ce34531 100644 --- a/internal/models/crash_group.go +++ b/internal/models/crash_group.go @@ -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 } diff --git a/web/static/css/cairn.css b/web/static/css/cairn.css index 7dd2d23..fca4937 100644 --- a/web/static/css/cairn.css +++ b/web/static/css/cairn.css @@ -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); diff --git a/web/templates/pages/crashgroups.html b/web/templates/pages/crashgroups.html index da67c9a..b0c17f7 100644 --- a/web/templates/pages/crashgroups.html +++ b/web/templates/pages/crashgroups.html @@ -19,18 +19,34 @@
{{range .CrashGroups}} -No crash groups yet. Crash groups are created automatically when artifacts with stack traces are uploaded.
{{end}}