Skip to content

[Bug] Admin repoFullName matching is case-sensitive, causing register/backfill failures for valid repos #91

@aliworksx08

Description

@aliworksx08

Description

Admin endpoints treat repoFullName as case-sensitive even though GitHub repository identity is case-insensitive.

registerRepo currently does an exact-case update match:

await this.repoRepo.update({ repoFullName }, { registered: true });

If the stored row casing differs from the request casing, registration can fail with "Repo not found" even for the same real GitHub repository. The same mismatch can also break downstream flows that rely on exact repoFullName lookup (for example token resolution/backfill paths).

Steps to Reproduce

  1. Ensure the repos table has a row like entrius/das-github-mirror.
  2. Call POST /api/v1/admin/repos/register with:
    • repoFullName: "Entrius/das-github-mirror" (different case).
  3. Observe registration fails because exact-case row match is not found.

Expected Behavior

Admin repo matching should be case-insensitive (or inputs normalized consistently), so equivalent casing variants of the same repo resolve to the same row.

Actual Behavior

Exact-case matching is used, causing valid repos to fail registration/backfill when request casing differs from stored casing.

Environment

  • OS: Any
  • Runtime/Node version: Node 20
  • Browser (if applicable): N/A

Additional Context

Relevant paths:

  • packages/das/src/api/admin.controller.ts
  • packages/das/src/webhook/github-fetcher.service.ts

Potential fix direction:

  • normalize incoming repoFullName (e.g. lowercase) before persistence/lookups, and/or
  • use case-insensitive DB predicates (LOWER(repo_full_name) = LOWER($1)) for admin lookup/update paths.

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