Skip to content

fix: pass sender login as scmLogin in github-bot session creation#498

Merged
ColeMurray merged 1 commit intomainfrom
fix/github-bot-scm-login
Apr 18, 2026
Merged

fix: pass sender login as scmLogin in github-bot session creation#498
ColeMurray merged 1 commit intomainfrom
fix/github-bot-scm-login

Conversation

@ColeMurray
Copy link
Copy Markdown
Owner

@ColeMurray ColeMurray commented Apr 18, 2026

Summary

  • GitHub bot sessions were created without scmLogin, causing them to appear as "unknown" in the analytics dashboard
  • All four webhook handlers (handleReviewRequested, handlePullRequestOpened, handleIssueComment, handleReviewComment) now pass sender.login from the webhook payload as scmLogin when creating sessions via the control plane
  • The control plane already accepts scmLogin as an optional field on POST /sessions — no backend changes needed

Test plan

  • All 100 github-bot tests pass, including new scmLogin assertions on all four handler happy paths
  • TypeScript typecheck passes
  • After deploy, verify new github-bot sessions show the sender's GitHub login in analytics instead of "unknown"

Summary by CodeRabbit

  • Chores

    • Updated internal session creation to include GitHub sender identification.
  • Tests

    • Added validation that GitHub sender login data is properly included in session payloads across all webhook handlers.

GitHub bot sessions were created without scmLogin, causing them to
appear as "unknown" in the analytics dashboard. Pass sender.login
from the webhook payload to the control plane on all four handlers.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0b4b80fe-c148-4304-b8dc-1036acb667de

📥 Commits

Reviewing files that changed from the base of the PR and between 196a74a and 39e49d9.

📒 Files selected for processing (2)
  • packages/github-bot/src/handlers.ts
  • packages/github-bot/test/handlers.test.ts

📝 Walkthrough

Walkthrough

The createSession helper function in the GitHub bot handlers is enhanced to accept and forward a scmLogin parameter containing the GitHub sender's login to the session endpoint. Four event handlers now pass the sender's login during session creation, with corresponding test assertions validating this behavior.

Changes

Cohort / File(s) Summary
Handler Implementation
packages/github-bot/src/handlers.ts
Added scmLogin: string parameter to createSession and updated four handlers (handlePullRequestOpened, handleReviewRequested, handleIssueComment, handleReviewComment) to pass scmLogin: sender.login when initiating sessions.
Test Assertions
packages/github-bot/test/handlers.test.ts
Added test assertions validating that session payloads include the scmLogin field with correct GitHub sender logins for each handler path.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A hop and a login, tracked down the line,
Each sender's name now shines so fine,
Four handlers dance with GitHub's grace,
SCM logins find their rightful place! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: adding scmLogin parameter to session creation in the github-bot handlers.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/github-bot-scm-login

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

Terraform Validation Results

Step Status
Format
Init
Validate

Note: Terraform plan was skipped because secrets are not configured. This is expected for external contributors. See docs/GETTING_STARTED.md for setup instructions.

Pushed by: @ColeMurray, Action: pull_request

Copy link
Copy Markdown
Contributor

@open-inspect open-inspect Bot left a comment

Choose a reason for hiding this comment

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

Summary

This PR updates all four github-bot webhook handlers to forward sender.login as scmLogin when creating sessions, and adds focused assertions to verify that payload on each happy path. I reviewed the changed handlers and tests, verified the control-plane session creation path already accepts scmLogin as an optional field, and did not find any correctness, security, performance, or maintainability issues.

  • PR Title and number: fix: pass sender login as scmLogin in github-bot session creation (#498)
  • Author: @ColeMurray
  • Files changed count, additions/deletions: 2 files, +15/-0

Critical Issues

  • None.

Suggestions

  • None.

Nitpicks

  • None.

Positive Feedback

  • This change is minimal and threads the new field through every github-bot session creation path consistently.
  • The tests assert the new request payload directly, which keeps the regression coverage targeted and easy to understand.
  • The implementation matches the existing control-plane contract, so the fix stays scoped to the caller that was omitting the field.

Questions

  • None.

Verdict

Approve: Ready to merge, no blocking issues

@ColeMurray ColeMurray merged commit 357931d into main Apr 18, 2026
18 checks passed
@ColeMurray ColeMurray deleted the fix/github-bot-scm-login branch April 18, 2026 20:46
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.

1 participant