test: cover ghost member commits and issue reclose mapping (CM-1473) - #4779
Conversation
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
PR SummaryLow Risk Overview Introduces Extends Reviewed by Cursor Bugbot for commit 7f0a5a6. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The issue fixtures do not exercise the query regression or the open-state guard they claim to protect.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Adds missing regression tests for GitHub connector behavior around ghost commit authors and issue closure events.
Changes:
- Captures emitted commit activities and verifies ghost-member mapping.
- Adds issue close-event mapper scenarios.
| File | Description |
|---|---|
syncs/pullRequestCommits.test.ts |
Tests commits without resolvable GitHub users. |
mappers/issue.test.ts |
Tests closed and currently open issue mapping. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| timelineItems: { | ||
| nodes: [ | ||
| { | ||
| __typename: 'ClosedEvent', | ||
| createdAt: '2026-09-24T10:00:00Z', |
| // PR numbers whose commits have no resolvable GitHub user (author.user = null) | ||
| ghostAuthorPrs?: number[] |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The issue test does not exercise the query behavior responsible for selecting the latest close event.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
| expect(requests).toHaveLength(3) | ||
| }) | ||
|
|
||
| it('emits commits whose author has no github account as the ghost member', async () => { |


Problem
The fixes merged in #4776 (ghost-author PR commits) and #4777 (latest issue close event) shipped without their unit tests committed.
Change
Adds the Vitest coverage written alongside those fixes:
pullRequestCommits.test.ts: a commit whose author has no GitHub account is emitted as the ghost member (plus harness support for capturing emits)mappers/issue.test.ts: a reopened-then-reclosed issue emits the latest close event's timestamp; an open issue emits no close activityValidation
npx vitest runon both files against main: 6/6 passoxfmt --check+oxlint --deny-warnings: clean🤖 Generated with Claude Code