Adds a per-app webhook event history page at /apps/{id}/webhooks showing received webhook events with match/no-match status.
Changes
New templatewebhook_events.html — displays webhook events in a table with time, event type, branch, commit SHA (linked when URL available), and match status badges
New handlerHandleAppWebhookEvents() in webhook_events.go — fetches app and its webhook events (limit 100)
New routeGET /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.
## 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)
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
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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.