Skip to content

connector-github polling issue_comment events do not include PR author / PR status #184

Description

@odink-kindo

Summary

@orgloop/connector-github polling supports issue_comment, but pollIssueComments() normalizes comments with only { number, title: '' } for the issue/PR object. That means PR issue-comment events are emitted with:

  • provenance.pr_author = "unknown"
  • payload.is_pull_request = false
  • no PR title/context

This makes it impossible to safely route top-level PR comments only for PRs authored by a target agent/bot. Routes like:

filter:
  provenance.platform_event: issue_comment
  provenance.pr_author: "odink-kindo[bot]"

will never match.

Why this matters

Many GitHub PR comments are issue_comment events, not pull_request_review_comment or pull_request.review_submitted. Examples include normal PR timeline comments and bot summary comments. Odin K's OrgLoop config only routed review events, so top-level PR comments were missed. Adding issue_comment to the event list is not enough because the connector does not enrich the comment with the PR author.

Minimal code pointer

In @orgloop/connector-github/dist/source.js / source equivalent:

async pollIssueComments(since) {
  this.pollBudget.apiCalls++;
  const comments = await this.octokit.paginate(this.octokit.issues.listCommentsForRepo, ...);
  const repoData = { full_name: `${this.owner}/${this.repo}` };
  return comments
    .filter((c) => c.updated_at > since)
    .map((comment) => {
      const issueNumber = comment.issue_url?.split('/').pop();
      return normalizeIssueComment(this.sourceId, comment, { number: Number(issueNumber), title: '' }, repoData);
    });
}

normalizeIssueComment() expects an issue-like object with user and pull_request fields, but pollIssueComments() supplies neither.

Expected behavior

For issue comments on PRs, the connector should fetch/enrich the backing issue or PR (or otherwise include enough fields from the GitHub API) so emitted events include:

  • payload.is_pull_request = true
  • provenance.pr_author = <PR author login>
  • provenance.pr_number = <PR number>
  • PR/issue title in payload

Then agent-specific routes can safely filter by provenance.pr_author without waking on every repo issue comment.

Workaround

Use webhook payloads with full issue/PR context, or add a custom polling/enrichment route outside the stock connector.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions