[BUG]: list_contribution_summaries() splits contributor metrics across username casing variations

Open
#239 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 4 days

@ydvvdinesh is already working on this.

Since Nov 26, 2026.

  • #241 by @ydvvdinesh — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python, sqlite
Domain
database

Research direction

Start in src/ghdcbot/adapters/storage/sqlite.py, especially list_contribution_summaries() at lines 296-335. Read how contribution rows are grouped and check any related storage tests for summary aggregation. Done means case variants of one GitHub username produce one combined ContributionSummary; issue #241 already has an open pull request.

Written by the indexing model from the issue text.

Description

bug
Bug Description

In src/ghdcbot/adapters/storage/sqlite.py:296-335, list_contribution_summaries(start_utc, end_utc) groups contribution events from the contributions table using the raw dictionary key user = row["github_user"].

Because GitHub usernames are case-insensitive (e.g. Octocat and octocat refer to the same user), any difference in casing between event ingestion records causes list_contribution_summaries to create separate buckets for the same contributor. This splits their metrics (issues opened, PRs opened, comments, scores) across multiple records instead of aggregating them into a single unified ContributionSummary.

Steps to Reproduce
  1. Record contribution events in SQLite for user "OctoCat" (e.g., 2 PRs opened).
  2. Record contribution events for user "octocat" (e.g., 3 comments).
  3. Call storage.list_contribution_summaries(start_utc, end_utc).
  4. Observe that two separate ContributionSummary objects are returned instead of one combined summary with 2 PRs and 3 comments.
Logs and Screenshots
# src/ghdcbot/adapters/storage/sqlite.py:296-302
summaries: dict[str, dict[str, int]] = {}
for row in rows:
    user = row["github_user"]  # Raw casing used as dict key!
    event_type = row["event_type"]
    bucket = summaries.setdefault(
        user,
        { ... }
    )
Environment Details
  • OS: Independent (Windows / Linux / macOS)
  • Python: 3.11+
  • Package: ghdcbot
Impact

Medium - Feature works but has issues

Code of Conduct
  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates
Dominant language
Python
Stars
30
Forks
58
Avg merge
6d 6h
Merged PRs (30d)
14

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AOSSIE-Org/Gitcord-GithubDiscordBot

All issues in AOSSIE-Org/Gitcord-GithubDiscordBot

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.