plane: accept past-tense action verbs from real Plane webhooks#11
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-tensecreate/update/delete, so every real Plane webhook hitErrUnsupportedEvent→ 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 defaultlog_level=info; operators saw nothing.The fix
Three changes:
internal/plane/parse.go—workItemKindandcommentKindnow accept both past-tense and present-tense verbs. New constantsactionCreated/actionUpdated/actionDeletedalongside the existing present-tense ones; the present-tense aliases stay so hand-rolled clients / older Plane code paths that emit them keep working.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.internal/server/server.go— split theErrUnsupportedEventbranch inrespondVerifyParseErr. 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_RealPlaneActionVerbsAcceptedinparse_test.gotable-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
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