feat: add webhook event history UI page #164

Merged
sneak merged 1 commits from feature/webhook-event-history-ui into main 2026-03-10 18:53:58 +01:00
Collaborator

Summary

Adds a per-app webhook event history page at /apps/{id}/webhooks showing received webhook events with match/no-match status.

Changes

  • New template webhook_events.html — displays webhook events in a table with time, event type, branch, commit SHA (linked when URL available), and match status badges
  • New handler HandleAppWebhookEvents() in webhook_events.go — fetches app and its webhook events (limit 100)
  • New route GET /apps/{id}/webhooks — registered in protected routes group
  • Template registration — added webhook_events.html to the template cache in templates.go
  • Model enhancement — added ShortCommit() method to WebhookEvent for truncated SHA display
  • App detail link — added "Event History" link in the Webhook URL card on the app detail page

UI

Follows the existing UI patterns (Tailwind CSS classes, Alpine.js relativeTime, badge styles, empty state, back-navigation). The page mirrors the deployments history page layout.

closes #85

## Summary Adds a per-app webhook event history page at `/apps/{id}/webhooks` showing received webhook events with match/no-match status. ## Changes - **New template** `webhook_events.html` — displays webhook events in a table with time, event type, branch, commit SHA (linked when URL available), and match status badges - **New handler** `HandleAppWebhookEvents()` in `webhook_events.go` — fetches app and its webhook events (limit 100) - **New route** `GET /apps/{id}/webhooks` — registered in protected routes group - **Template registration** — added `webhook_events.html` to the template cache in `templates.go` - **Model enhancement** — added `ShortCommit()` method to `WebhookEvent` for truncated SHA display - **App detail link** — added "Event History" link in the Webhook URL card on the app detail page ## UI Follows the existing UI patterns (Tailwind CSS classes, Alpine.js `relativeTime`, badge styles, empty state, back-navigation). The page mirrors the deployments history page layout. closes [#85](https://git.eeqj.de/sneak/upaas/issues/85)
clawbot added 1 commit 2026-03-10 12:19:37 +01:00
feat: add webhook event history UI page
All checks were successful
Check / check (pull_request) Successful in 5s
e3bd3202bb
Add a per-app webhook event history page at /apps/{id}/webhooks that
displays received webhook events with their match/no-match status,
event type, branch, commit SHA (linked to commit URL when available),
and timestamp.

Changes:
- Add webhook_events.html template following existing UI patterns
- Add HandleAppWebhookEvents handler in webhook_events.go
- Register GET /apps/{id}/webhooks route
- Register webhook_events.html in template cache
- Add ShortCommit() method to WebhookEvent model
- Add 'Event History' link to app detail Webhook URL section
clawbot added the botneeds-review labels 2026-03-10 12:43:32 +01:00
clawbot self-assigned this 2026-03-10 12:43:42 +01:00
Author
Collaborator

Review: PASS

Reviewing PR #164 — closes issue #85

Requirements Check

Requirement Status
Page showing received webhooks per app New page at /apps/{id}/webhooks
Match/no-match status Matched / Matched (pending) / No match badges

Code Quality

  • Handler (webhook_events.go): Follows the closure-based handler pattern consistent with HandleAppDeployments(). Error handling is actually slightly better — separates 500 (DB error) from 404 (not found) instead of collapsing both into 404. Gracefully degrades to empty list on events fetch error with structured logging.
  • Model (ShortCommit()): Correctly reuses the existing shortCommitLength constant from deployment.go. Handles null SHA properly.
  • Template (webhook_events.html): Follows existing UI patterns — Tailwind CSS classes, Alpine.js relativeTime, badge styles, empty state with icon, back-navigation link. Correctly handles all three display cases for commit SHA (linked, unlinked, missing).
  • Route: Registered in the protected routes group, consistent placement next to deployments route.
  • App detail link: Clean integration in the Webhook URL card header.

Integrity Checks

  • No Makefile, linter config, CI, or test assertion modifications
  • Single focused commit with appropriate scope (6 files, 155 additions)
  • docker build . passes
  • Branch is up to date with main (no rebase needed)
  • No README behavior changes requiring documentation updates
  • No human change requests on the PR or issue

This is a clean, well-scoped feature addition that follows all existing conventions.

## ✅ Review: PASS **Reviewing [PR #164](https://git.eeqj.de/sneak/upaas/pulls/164) — closes [issue #85](https://git.eeqj.de/sneak/upaas/issues/85)** ### Requirements Check | Requirement | Status | |---|---| | Page showing received webhooks per app | ✅ New page at `/apps/{id}/webhooks` | | Match/no-match status | ✅ Matched / Matched (pending) / No match badges | ### Code Quality - **Handler** (`webhook_events.go`): Follows the closure-based handler pattern consistent with `HandleAppDeployments()`. Error handling is actually slightly better — separates 500 (DB error) from 404 (not found) instead of collapsing both into 404. Gracefully degrades to empty list on events fetch error with structured logging. - **Model** (`ShortCommit()`): Correctly reuses the existing `shortCommitLength` constant from `deployment.go`. Handles null SHA properly. - **Template** (`webhook_events.html`): Follows existing UI patterns — Tailwind CSS classes, Alpine.js `relativeTime`, badge styles, empty state with icon, back-navigation link. Correctly handles all three display cases for commit SHA (linked, unlinked, missing). - **Route**: Registered in the protected routes group, consistent placement next to deployments route. - **App detail link**: Clean integration in the Webhook URL card header. ### Integrity Checks - ✅ No Makefile, linter config, CI, or test assertion modifications - ✅ Single focused commit with appropriate scope (6 files, 155 additions) - ✅ `docker build .` passes - ✅ Branch is up to date with `main` (no rebase needed) - ✅ No README behavior changes requiring documentation updates - ✅ No human change requests on the PR or issue This is a clean, well-scoped feature addition that follows all existing conventions.
clawbot added merge-ready and removed needs-review labels 2026-03-10 15:39:03 +01:00
clawbot removed their assignment 2026-03-10 15:39:04 +01:00
sneak was assigned by clawbot 2026-03-10 15:39:04 +01:00
sneak merged commit e1dc865226 into main 2026-03-10 18:53:58 +01:00
sneak deleted branch feature/webhook-event-history-ui 2026-03-10 18:53:58 +01:00
Sign in to join this conversation.