Add comment write endpoint for Helper#4331
Conversation
… keys, add tests - Extract Comment.normalize_content as a public class method, replacing fragile .send(:trim_extra_newlines) on throwaway Comment.new instances - Standardize create_comment 400 error responses to use error_message key (matching 409/422 responses and other helper endpoints) - Add test for normalization-equivalent idempotency (content differing only by extra newlines) - Add test for RecordNotUnique race condition rescue path Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
👋 @gianfrancopiana — This PR has been open for 46h with no reviewers assigned. Consider requesting a review from a teammate to keep things moving. This is an automated review-cycle reminder. |
|
👋 @gianfrancopiana — This PR has been open for 71h with no reviewers assigned. Consider requesting a review from a teammate to keep things moving. This is an automated review-cycle reminder. |
|
👋 @gianfrancopiana — This PR has been open for 77h with no reviewers assigned. Consider requesting a review from a teammate to keep things moving. This is an automated review-cycle reminder. |
|
👋 @gianfrancopiana — This PR has been open for 82h with no reviewers assigned. Consider requesting a review from a teammate to keep things moving. This is an automated review-cycle reminder. |
Ref https://github.com/antiwork/gumroad-private/issues/280
Depends on #4317.
What
Adds
POST /api/internal/helper/users/create_comment— lets Helper and Gumclaw createnote-type comments on Gumroad users.email,content, andidempotency_keyparametersGUMROAD_ADMIN_IDas author — bypasses adult-keyword validation, provides audit attribution(commentable_type, commentable_id, idempotency_key). Handles concurrent retries viaRecordNotUniquerescue.OpenapiControllerfor Gumclaw discoveryHelperUserInfoService.serialize_commentas a shared class method (used by both the read and write paths)Why
Step 2 of the structured comments plan. Helper's internal notes were removed (antiwork/helper#1116) and Gumroad is now the single source of truth for comments. This endpoint gives Helper's sidebar and Gumclaw the ability to write comments back to Gumroad, completing the read-write loop started in #4317.
This PR was implemented with AI assistance using Claude Opus 4.6 and gpt‑5.4 xhigh