Skip to content

plane: accept past-tense action verbs from real Plane webhooks#11

Merged
hstern merged 1 commit into
mainfrom
fix/plane-past-tense-actions
May 24, 2026
Merged

plane: accept past-tense action verbs from real Plane webhooks#11
hstern merged 1 commit into
mainfrom
fix/plane-past-tense-actions

Conversation

@hstern

@hstern hstern commented May 24, 2026

Copy link
Copy Markdown
Owner

Fixes #10. Closes PFB-22.

The bug

Real Plane (verified against v1.3.1's bgtasks/webhook_task.py) sends past-tense action verbs in the body envelope — created/updated/deleted — matching the GitHub/GitLab webhook convention. The bridge's parser only accepted present-tense create/update/delete, so every real Plane webhook hit ErrUnsupportedEvent → 204 No Content + log at DEBUG. plane→forge was broken on every deployment of v0.1.0. The silent 204 made Plane think the delivery succeeded; the DEBUG log was suppressed at the default log_level=info; operators saw nothing.

The fix

Three changes:

  1. internal/plane/parse.goworkItemKind and commentKind now accept both past-tense and present-tense verbs. New constants actionCreated/actionUpdated/actionDeleted alongside the existing present-tense ones; the present-tense aliases stay so hand-rolled clients / older Plane code paths that emit them keep working.

  2. internal/plane/testdata/*.json — updated to past-tense (the wire reality). The 5 existing parse-fixture tests now exercise the real-Plane spelling instead of codifying the wrong shape — which is what masked the bug in CI.

  3. internal/server/server.go — split the ErrUnsupportedEvent branch in respondVerifyParseErr. Forge stays at DEBUG (forges legitimately fan out events the operator didn't subscribe to). Plane is promoted to INFO with a distinct log message — Plane only sends event types the operator subscribed to, so any unsupported event there is a contract mismatch that should be visible at the default log level. This would have caught GH#10 in seconds.

Regression test

TestParse_RealPlaneActionVerbsAccepted in parse_test.go table-pins both spellings for both event types (issue, issue_comment) so nobody can tighten the parser back to present-tense only without a failing test.

Test plan

  • lint
  • build-image
  • e2e-docker (forgejo)
  • e2e-docker (gitea)

Suggest cutting v0.1.1 after this merges

This is the kind of bug that warrants a patch release rather than waiting on the next feature batch — anyone running v0.1.0 against real Plane has zero plane→forge traffic landing.

🤖 Generated with Claude Code

Fixes GH#10. Closes PFB-22.

Real Plane (verified against v1.3.1's bgtasks/webhook_task.py) sends
past-tense action verbs in the body envelope —
"created"/"updated"/"deleted" — matching the GitHub/GitLab webhook
convention. The bridge's parser only accepted present-tense
"create"/"update"/"delete", so every real Plane webhook hit
ErrUnsupportedEvent in respondVerifyParseErr → 204 No Content + log
at DEBUG. plane→forge was broken on every deployment of v0.1.0; the
silent 204 made Plane think the delivery succeeded, the DEBUG log
was suppressed at the default log_level=info, and operators saw
nothing.

Three fixes:

1. internal/plane/parse.go workItemKind + commentKind now accept
   both past-tense and present-tense verbs. New constants
   actionCreated/actionUpdated/actionDeleted alongside the existing
   actionCreate/Update/Delete. The present-tense aliases stay so
   hand-rolled clients / older Plane code paths that emit them
   continue to work.

2. internal/plane/testdata/*.json updated to past-tense — the wire
   reality. The 5 existing parse-fixture tests now exercise the
   real-Plane spelling instead of codifying the wrong shape.

3. internal/server/server.go: split the ErrUnsupportedEvent branch
   in respondVerifyParseErr. Forge stays at DEBUG (forges legitimately
   fan out events the operator didn't subscribe to). Plane is promoted
   to INFO with a distinct log message — Plane only sends event types
   the operator subscribed to, so an unsupported event there is a
   contract mismatch that should be visible at the default log level.
   This is what would have caught GH#10 in seconds instead of an hour.

Regression test TestParse_RealPlaneActionVerbsAccepted in parse_test.go
table-pins both spellings for both event types (issue, issue_comment)
to guard against anyone tightening the parser back to present-tense
only.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hstern hstern merged commit 87f7b37 into main May 24, 2026
5 checks passed
@hstern hstern deleted the fix/plane-past-tense-actions branch May 24, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plane → bridge: every real Plane webhook silently dropped (action verb tense mismatch)

1 participant