v1.4.1: read X-*-Event-Type header (fixes dropped package/action_run events) #4

Merged
eric merged 1 commit from fix-event-type-header into main 2026-06-09 20:18:50 -07:00
Owner

Forgejo and Gitea set two event headers with different values
(services/webhook/shared/payloader.go: AddDefaultHeaders):

X--Event = HookEventType.Event() -> a derived value, written
identically to the Gitea/Forgejo/Gogs/GitHub -Event
headers; observed EMPTY for some events (e.g. package)
X-
-Event-Type = string(HookEventType) -> raw type, matches FORMATTERS keys

We only read X--Event, so package and action_run deliveries arrived with
an empty event header and were rejected with HTTP 400 "Missing event
header", dropping the notification. Read X-
-Event-Type first, fall back
to X--Event. conftest signed_headers now emits both headers like the
real forges; add a regression test for the empty-X-
-Event case.

Also fix the package formatter showing "[unknown]" for user-scoped
packages (top-level repository and organization both null) by falling
back to package.repository then package.owner.

100 tests pass.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

Forgejo and Gitea set two event headers with different values (services/webhook/shared/payloader.go: AddDefaultHeaders): X-*-Event = HookEventType.Event() -> a derived value, written identically to the Gitea/Forgejo/Gogs/GitHub -Event headers; observed EMPTY for some events (e.g. package) X-*-Event-Type = string(HookEventType) -> raw type, matches FORMATTERS keys We only read X-*-Event, so package and action_run deliveries arrived with an empty event header and were rejected with HTTP 400 "Missing event header", dropping the notification. Read X-*-Event-Type first, fall back to X-*-Event. conftest signed_headers now emits both headers like the real forges; add a regression test for the empty-X-*-Event case. Also fix the package formatter showing "[unknown]" for user-scoped packages (top-level repository and organization both null) by falling back to package.repository then package.owner. 100 tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Forgejo and Gitea set two event headers with different values
(services/webhook/shared/payloader.go: AddDefaultHeaders):

  X-*-Event      = HookEventType.Event()  -> a derived value, written
                   identically to the Gitea/Forgejo/Gogs/GitHub -Event
                   headers; observed EMPTY for some events (e.g. package)
  X-*-Event-Type = string(HookEventType)  -> raw type, matches FORMATTERS keys

We only read X-*-Event, so package and action_run deliveries arrived with
an empty event header and were rejected with HTTP 400 "Missing event
header", dropping the notification. Read X-*-Event-Type first, fall back
to X-*-Event. conftest signed_headers now emits both headers like the
real forges; add a regression test for the empty-X-*-Event case.

Also fix the package formatter showing "[unknown]" for user-scoped
packages (top-level repository and organization both null) by falling
back to package.repository then package.owner.

100 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
eric merged commit 9b8ba5bdde into main 2026-06-09 20:18:50 -07:00
eric deleted branch fix-event-type-header 2026-06-09 20:18:50 -07:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
eric/apprise-forge-notifications!4
No description provided.