kredits-github: fix webhook path and restart on unit changes #688

Merged
raucao merged 1 commits from fix/kredits-github-webhook-path into master 2026-10-29 15:13:43 +00:00
Owner

Problem

After the Probot 14 upgrade (6821b4f), kredits-github stopped processing GitHub events entirely. Probot 14 changed its default webhook path from / (Probot 7) to /api/github/webhooks, but the GitHub App is still configured to POST to https://kredits-github.kosmos.org/. Every delivery returned 404 (seen with sockethub/sockethub#1347), so pull_request labels were never picked up and no Kredits check run was ever created.

A second, latent bug masked the fix: Chef's systemd_unit :create action only runs daemon-reload and never restarts a running unit, so writing WEBHOOK_PATH=/ into the unit file alone did not affect the running process.

Changes

  • kredits-github: serve / again via WEBHOOK_PATH=/.
  • kredits-github and the kosmos-hubot bot resource: manage the unit with :create/:enable and restart it from a service resource subscribed to unit changes, so unit/env changes take effect without a repo change or reboot.

Verification

Converged nodejs-5 and restarted the service:

  • POST https://kredits-github.kosmos.org/ returns 400 (signature required), was 404.
  • Re-delivered a previously failed pull_request labeled delivery via the GitHub API: GitHub now reports OK, and a Kredits check run was created and completed successfully.
## Problem After the Probot 14 upgrade (6821b4f), kredits-github stopped processing GitHub events entirely. Probot 14 changed its default webhook path from `/` (Probot 7) to `/api/github/webhooks`, but the GitHub App is still configured to POST to `https://kredits-github.kosmos.org/`. Every delivery returned 404 (seen with sockethub/sockethub#1347), so `pull_request` labels were never picked up and no `Kredits` check run was ever created. A second, latent bug masked the fix: Chef's `systemd_unit` `:create` action only runs `daemon-reload` and never restarts a running unit, so writing `WEBHOOK_PATH=/` into the unit file alone did not affect the running process. ## Changes - `kredits-github`: serve `/` again via `WEBHOOK_PATH=/`. - `kredits-github` and the `kosmos-hubot` bot resource: manage the unit with `:create`/`:enable` and restart it from a `service` resource subscribed to unit changes, so unit/env changes take effect without a repo change or reboot. ## Verification Converged `nodejs-5` and restarted the service: - `POST https://kredits-github.kosmos.org/` returns `400` (signature required), was `404`. - Re-delivered a previously failed `pull_request labeled` delivery via the GitHub API: GitHub now reports `OK`, and a `Kredits` check run was created and completed successfully.
raucao added 1 commit 2026-10-29 14:53:52 +00:00
Probot 14 changed its default webhook path from "/" (Probot 7) to
"/api/github/webhooks", but the GitHub App still POSTs to
https://kredits-github.kosmos.org/. Every delivery returned 404, so the
app never processed pull_request events and never created the Kredits
check run. Serve "/" again via WEBHOOK_PATH.

Chef's systemd_unit :create only runs daemon-reload and never restarts a
running unit, so the env change above would not have taken effect until
the next repo change or reboot. Manage the unit with :create/:enable and
restart it from a service resource that subscribes to unit changes.
Apply the same fix to the kosmos-hubot bot resource.
raucao added the kredits-1bug labels 2026-10-29 15:13:38 +00:00
raucao merged commit b0bc630551 into master 2026-10-29 15:13:43 +00:00
raucao deleted branch fix/kredits-github-webhook-path 2026-10-29 15:13:44 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kosmos/chef#688