Skip to content

feat(webhooks): parse out commenter relevant fields when receiving a github webhook#931

Open
knechtionscoding wants to merge 1 commit intokelos-dev:mainfrom
datagravity-ai:feat/parse-comments-github-webhooks
Open

feat(webhooks): parse out commenter relevant fields when receiving a github webhook#931
knechtionscoding wants to merge 1 commit intokelos-dev:mainfrom
datagravity-ai:feat/parse-comments-github-webhooks

Conversation

@knechtionscoding
Copy link
Copy Markdown
Contributor

@knechtionscoding knechtionscoding commented Apr 8, 2026

…webhook

What type of PR is this?

/kind feature

What this PR does / why we need it:

Extracts comment-specific fields (CommentAuthor, CommentBody, CommentURL) from GitHub webhook payloads for issue_comment, pull_request_review, and pull_request_review_comment events and exposes them as template variables for TaskSpawner prompt templates.

Previously, these fields were never parsed or included in the template variables map, causing prompt template execution to fail with map has no entry for key "CommentAuthor" when a spawner referenced {{.CommentAuthor}}.

Which issue(s) this PR is related to:

N/A

Special notes for your reviewer:

The Sender field (which was already populated) represents the user who triggered the webhook event, which is typically the same as the comment author. However, CommentAuthor is explicitly extracted from the comment/review object for clarity, and CommentBody/CommentURL provide access to the comment content rather than the parent issue/PR body.

Does this PR introduce a user-facing change?

Add CommentAuthor, CommentBody, and CommentURL template variables for GitHub comment webhook events (issue_comment, pull_request_review, pull_request_review_comment).

Summary by cubic

Expose comment-specific template variables from GitHub webhooks so TaskSpawner prompts can use CommentAuthor, CommentBody, and CommentURL without missing-key errors. Supports issue_comment, pull_request_review, and pull_request_review_comment events.

  • New Features
    • Parse commenter, body, and URL from the three comment/review events.
    • Add CommentAuthor, CommentBody, CommentURL to event data and export via ExtractGitHubWorkItem.
    • Add tests covering extraction and absence on non-comment events.

Written for commit 8d2c292. Summary will update on new commits.

@knechtionscoding knechtionscoding changed the title feat(webhooks): parse out commenter relevant fields when receiving a … feat(webhooks): parse out commenter relevant fields when receiving a github webhook Apr 8, 2026
@knechtionscoding knechtionscoding marked this pull request as ready for review April 8, 2026 15:42
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@knechtionscoding
Copy link
Copy Markdown
Contributor Author

@gjkim42 I think this is ready for review

@github-actions github-actions bot added needs-triage needs-kind Indicates an issue or PR lacks a kind/* label needs-priority needs-actor labels Apr 15, 2026
@gjkim42 gjkim42 self-requested a review April 15, 2026 12:13
@gjkim42 gjkim42 self-assigned this Apr 15, 2026
@gjkim42 gjkim42 added the kind/api Categorizes issue or PR as related to API changes label Apr 15, 2026
@github-actions github-actions bot added release-note and removed needs-kind Indicates an issue or PR lacks a kind/* label labels Apr 15, 2026
@knechtionscoding
Copy link
Copy Markdown
Contributor Author

bump @gjkim42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/api Categorizes issue or PR as related to API changes needs-actor needs-priority needs-triage release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants