feat: add webhook event history UI page #164
Reference in New Issue
Block a user
Delete Branch "feature/webhook-event-history-ui"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds a per-app webhook event history page at
/apps/{id}/webhooksshowing received webhook events with match/no-match status.Changes
webhook_events.html— displays webhook events in a table with time, event type, branch, commit SHA (linked when URL available), and match status badgesHandleAppWebhookEvents()inwebhook_events.go— fetches app and its webhook events (limit 100)GET /apps/{id}/webhooks— registered in protected routes groupwebhook_events.htmlto the template cache intemplates.goShortCommit()method toWebhookEventfor truncated SHA displayUI
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
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✅ Review: PASS
Reviewing PR #164 — closes issue #85
Requirements Check
/apps/{id}/webhooksCode Quality
webhook_events.go): Follows the closure-based handler pattern consistent withHandleAppDeployments(). 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.ShortCommit()): Correctly reuses the existingshortCommitLengthconstant fromdeployment.go. Handles null SHA properly.webhook_events.html): Follows existing UI patterns — Tailwind CSS classes, Alpine.jsrelativeTime, badge styles, empty state with icon, back-navigation link. Correctly handles all three display cases for commit SHA (linked, unlinked, missing).Integrity Checks
docker build .passesmain(no rebase needed)This is a clean, well-scoped feature addition that follows all existing conventions.