Opus finding
Webhook 'install_created' uses welcomes[0]?.installationId for logging — undefined when array is empty but log still fires
lowmaintainabilityhigh
- apps/web/app/api/github/webhook/route.ts:201-214
If installCreatedTargets() returns [] (e.g., malformed payload, missing installation id, or no repositories), the log records installationId: null and repoCount: 0 with no indication of why. Operators looking at logs cannot distinguish 'install with no repos selected' from 'payload validation failed'. This impedes debugging install issues.
Recommendation
Differentiate the two cases — when typeof installation.id !== 'number', emit a logWarn('webhook.install_payload_invalid', …); reserve the success log for successful parses.