Skip to content

[bug] miners API: getPullRequestsByRepo joins miss review_summary for mixed-case repos #183

Description

@kiannidev

Description

POST /api/v1/miners/:githubId/pulls (getPullRequestsByRepo) windows repos case-insensitively via LOWER(p.repo_full_name), but joins pr_review_summary and repos using exact-case PK equality. When pull_requests.repo_full_name casing differs from the joined tables (legacy rows, pre-normalization backfills), review_summary and default_branch come back empty/zero despite data existing under the canonical casing.

Steps to Reproduce

  1. Store a PR under PK Org/MyRepo#42 with matching pr_review_summary row keyed as Org/MyRepo.
  2. Call POST /api/v1/miners/{id}/pulls with since_by_repo: { "org/myrepo": "<since>" }.
  3. The PR is returned (window join uses LOWER), but review_summary counts are all zero and default_branch is null.

Expected Behavior

Joins should match repo names case-insensitively, consistent with the windows join and /repos/:owner/:repo/maintainers.

Actual Behavior

LEFT JOIN pr_review_summary rs
  ON rs.repo_full_name = p.repo_full_name   -- exact case
LEFT JOIN repos r
  ON r.repo_full_name = p.repo_full_name   -- exact case

Environment

  • OS: Linux
  • Runtime/Node version: Node 20

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions