Skip to content

test: cover ghost member commits and issue reclose mapping (CM-1473) - #4779

Merged
mbani01 merged 2 commits into
mainfrom
test/shadow-connector-fixes
Sep 25, 2026
Merged

mbani01 merged 2 commits into
mainfrom
test/shadow-connector-fixes

Conversation

@mbani01

@mbani01 mbani01 commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

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 activity

Validation

  • npx vitest run on both files against main: 6/6 pass
  • oxfmt --check + oxlint --deny-warnings: clean

🤖 Generated with Claude Code

Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Copilot AI balanced review requested due to automatic review settings September 25, 2026 16:32
@cursor

cursor Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Test-only changes that document existing behavior; no runtime or deployment impact.

Overview
Adds Vitest coverage that was missing after earlier GitHub connector fixes (CM-1473), with no production code changes.

Introduces mappers/issue.test.ts to lock in toIssueActivities behavior: a closed issue with a timeline close event gets an issue-closed activity with the latest timestamp and closedBy; an open issue does not emit a close activity.

Extends pullRequestCommits.test.ts so the sync harness records emitted activities and can simulate commits with author.user = null, plus a new case asserting those commits map to the ghost member identity.

Reviewed by Cursor Bugbot for commit 7f0a5a6. Bugbot is set up for automated code reviews on this repo. Configure here.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 Medium severity · 1 Low severity

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.

Comment on lines +37 to +41
timelineItems: {
nodes: [
{
__typename: 'ClosedEvent',
createdAt: '2026-09-24T10:00:00Z',
Comment on lines +33 to +34
// PR numbers whose commits have no resolvable GitHub user (author.user = null)
ghostAuthorPrs?: number[]
@mbani01 mbani01 self-assigned this Sep 25, 2026
Copilot AI review requested due to automatic review settings September 25, 2026 16:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 Medium severity · 2 Low severity

Open (3)

expect(requests).toHaveLength(3)
})

it('emits commits whose author has no github account as the ghost member', async () => {
@mbani01
mbani01 merged commit 11da619 into main Sep 25, 2026
14 checks passed
@mbani01
mbani01 deleted the test/shadow-connector-fixes branch September 25, 2026 16:43
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.

3 participants